forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/marvell/mwifiex/util.c
....@@ -1,10 +1,10 @@
11 /*
2
- * Marvell Wireless LAN device driver: utility functions
2
+ * NXP Wireless LAN device driver: utility functions
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.,
....@@ -488,11 +488,7 @@
488488 (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE))
489489 skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE);
490490
491
- if (in_interrupt())
492
- netif_rx(skb);
493
- else
494
- netif_rx_ni(skb);
495
-
491
+ netif_rx_any_context(skb);
496492 return 0;
497493 }
498494
....@@ -607,12 +603,11 @@
607603 mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac)
608604 {
609605 struct mwifiex_sta_node *node;
610
- unsigned long flags;
611606
612607 if (!mac)
613608 return NULL;
614609
615
- spin_lock_irqsave(&priv->sta_list_spinlock, flags);
610
+ spin_lock_bh(&priv->sta_list_spinlock);
616611 node = mwifiex_get_sta_entry(priv, mac);
617612 if (node)
618613 goto done;
....@@ -625,7 +620,7 @@
625620 list_add_tail(&node->list, &priv->sta_list);
626621
627622 done:
628
- spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
623
+ spin_unlock_bh(&priv->sta_list_spinlock);
629624 return node;
630625 }
631626
....@@ -662,9 +657,8 @@
662657 void mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac)
663658 {
664659 struct mwifiex_sta_node *node;
665
- unsigned long flags;
666660
667
- spin_lock_irqsave(&priv->sta_list_spinlock, flags);
661
+ spin_lock_bh(&priv->sta_list_spinlock);
668662
669663 node = mwifiex_get_sta_entry(priv, mac);
670664 if (node) {
....@@ -672,7 +666,7 @@
672666 kfree(node);
673667 }
674668
675
- spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
669
+ spin_unlock_bh(&priv->sta_list_spinlock);
676670 return;
677671 }
678672
....@@ -680,9 +674,8 @@
680674 void mwifiex_del_all_sta_list(struct mwifiex_private *priv)
681675 {
682676 struct mwifiex_sta_node *node, *tmp;
683
- unsigned long flags;
684677
685
- spin_lock_irqsave(&priv->sta_list_spinlock, flags);
678
+ spin_lock_bh(&priv->sta_list_spinlock);
686679
687680 list_for_each_entry_safe(node, tmp, &priv->sta_list, list) {
688681 list_del(&node->list);
....@@ -690,7 +683,7 @@
690683 }
691684
692685 INIT_LIST_HEAD(&priv->sta_list);
693
- spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
686
+ spin_unlock_bh(&priv->sta_list_spinlock);
694687 return;
695688 }
696689