hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/marvell/mwifiex/init.c
....@@ -1,10 +1,10 @@
11 /*
2
- * Marvell Wireless LAN device driver: HW/FW Initialization
2
+ * NXP Wireless LAN device driver: HW/FW Initialization
33 *
4
- * Copyright (C) 2011-2014, Marvell International Ltd.
4
+ * Copyright 2011-2020 NXP
55 *
6
- * This software file (the "File") is distributed by Marvell International
7
- * Ltd. under the terms of the GNU General Public License Version 2, June 1991
6
+ * This software file (the "File") is distributed by NXP
7
+ * under the terms of the GNU General Public License Version 2, June 1991
88 * (the "License"). You may use, redistribute and/or modify this File in
99 * accordance with the terms and conditions of the License, a copy of which
1010 * is available by writing to the Free Software Foundation, Inc.,
....@@ -36,7 +36,6 @@
3636 struct mwifiex_adapter *adapter = priv->adapter;
3737 struct mwifiex_bss_prio_node *bss_prio;
3838 struct mwifiex_bss_prio_tbl *tbl = adapter->bss_prio_tbl;
39
- unsigned long flags;
4039
4140 bss_prio = kzalloc(sizeof(struct mwifiex_bss_prio_node), GFP_KERNEL);
4241 if (!bss_prio)
....@@ -45,9 +44,9 @@
4544 bss_prio->priv = priv;
4645 INIT_LIST_HEAD(&bss_prio->list);
4746
48
- spin_lock_irqsave(&tbl[priv->bss_priority].bss_prio_lock, flags);
47
+ spin_lock_bh(&tbl[priv->bss_priority].bss_prio_lock);
4948 list_add_tail(&bss_prio->list, &tbl[priv->bss_priority].bss_prio_head);
50
- spin_unlock_irqrestore(&tbl[priv->bss_priority].bss_prio_lock, flags);
49
+ spin_unlock_bh(&tbl[priv->bss_priority].bss_prio_lock);
5150
5251 return 0;
5352 }
....@@ -60,7 +59,7 @@
6059 adapter->hw_status = MWIFIEX_HW_STATUS_RESET;
6160 mwifiex_cancel_all_pending_cmd(adapter);
6261
63
- if (adapter->if_ops.card_reset && !adapter->hs_activated)
62
+ if (adapter->if_ops.card_reset)
6463 adapter->if_ops.card_reset(adapter);
6564 }
6665
....@@ -344,11 +343,9 @@
344343 void mwifiex_wake_up_net_dev_queue(struct net_device *netdev,
345344 struct mwifiex_adapter *adapter)
346345 {
347
- unsigned long dev_queue_flags;
348
-
349
- spin_lock_irqsave(&adapter->queue_lock, dev_queue_flags);
346
+ spin_lock_bh(&adapter->queue_lock);
350347 netif_tx_wake_all_queues(netdev);
351
- spin_unlock_irqrestore(&adapter->queue_lock, dev_queue_flags);
348
+ spin_unlock_bh(&adapter->queue_lock);
352349 }
353350
354351 /*
....@@ -357,11 +354,9 @@
357354 void mwifiex_stop_net_dev_queue(struct net_device *netdev,
358355 struct mwifiex_adapter *adapter)
359356 {
360
- unsigned long dev_queue_flags;
361
-
362
- spin_lock_irqsave(&adapter->queue_lock, dev_queue_flags);
357
+ spin_lock_bh(&adapter->queue_lock);
363358 netif_tx_stop_all_queues(netdev);
364
- spin_unlock_irqrestore(&adapter->queue_lock, dev_queue_flags);
359
+ spin_unlock_bh(&adapter->queue_lock);
365360 }
366361
367362 /*
....@@ -506,7 +501,6 @@
506501 struct mwifiex_private *priv;
507502 u8 i, first_sta = true;
508503 int is_cmd_pend_q_empty;
509
- unsigned long flags;
510504
511505 adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING;
512506
....@@ -547,9 +541,9 @@
547541 }
548542 }
549543
550
- spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags);
544
+ spin_lock_bh(&adapter->cmd_pending_q_lock);
551545 is_cmd_pend_q_empty = list_empty(&adapter->cmd_pending_q);
552
- spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags);
546
+ spin_unlock_bh(&adapter->cmd_pending_q_lock);
553547 if (!is_cmd_pend_q_empty) {
554548 /* Send the first command in queue and return */
555549 if (mwifiex_main_process(adapter) != -1)
....@@ -574,7 +568,6 @@
574568 struct mwifiex_bss_prio_node *bssprio_node, *tmp_node;
575569 struct list_head *head;
576570 spinlock_t *lock; /* bss priority lock */
577
- unsigned long flags;
578571
579572 for (i = 0; i < adapter->priv_num; ++i) {
580573 head = &adapter->bss_prio_tbl[i].bss_prio_head;
....@@ -586,7 +579,7 @@
586579 priv->bss_type, priv->bss_num, i, head);
587580
588581 {
589
- spin_lock_irqsave(lock, flags);
582
+ spin_lock_bh(lock);
590583 list_for_each_entry_safe(bssprio_node, tmp_node, head,
591584 list) {
592585 if (bssprio_node->priv == priv) {
....@@ -598,7 +591,7 @@
598591 kfree(bssprio_node);
599592 }
600593 }
601
- spin_unlock_irqrestore(lock, flags);
594
+ spin_unlock_bh(lock);
602595 }
603596 }
604597 }
....@@ -630,7 +623,6 @@
630623 {
631624 struct mwifiex_private *priv;
632625 s32 i;
633
- unsigned long flags;
634626 struct sk_buff *skb;
635627
636628 /* mwifiex already shutdown */
....@@ -665,7 +657,7 @@
665657 while ((skb = skb_dequeue(&adapter->tx_data_q)))
666658 mwifiex_write_data_complete(adapter, skb, 0, 0);
667659
668
- spin_lock_irqsave(&adapter->rx_proc_lock, flags);
660
+ spin_lock_bh(&adapter->rx_proc_lock);
669661
670662 while ((skb = skb_dequeue(&adapter->rx_data_q))) {
671663 struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
....@@ -678,7 +670,7 @@
678670 dev_kfree_skb_any(skb);
679671 }
680672
681
- spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
673
+ spin_unlock_bh(&adapter->rx_proc_lock);
682674
683675 mwifiex_adapter_cleanup(adapter);
684676
....@@ -703,14 +695,12 @@
703695 int ret;
704696 u32 poll_num = 1;
705697
706
- if (adapter->if_ops.check_fw_status) {
707
- /* check if firmware is already running */
708
- ret = adapter->if_ops.check_fw_status(adapter, poll_num);
709
- if (!ret) {
710
- mwifiex_dbg(adapter, MSG,
711
- "WLAN FW already running! Skip FW dnld\n");
712
- return 0;
713
- }
698
+ /* check if firmware is already running */
699
+ ret = adapter->if_ops.check_fw_status(adapter, poll_num);
700
+ if (!ret) {
701
+ mwifiex_dbg(adapter, MSG,
702
+ "WLAN FW already running! Skip FW dnld\n");
703
+ return 0;
714704 }
715705
716706 /* check if we are the winner for downloading FW */