summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/main.c3
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rx.c2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/ops.c3
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rx.c2
-rw-r--r--include/net/mac80211.h37
-rw-r--r--net/mac80211/ieee80211_i.h6
-rw-r--r--net/mac80211/main.c12
-rw-r--r--net/mac80211/rx.c18
10 files changed, 44 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index 3811878ab9cd..074977ede343 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -669,6 +669,8 @@ struct iwl_priv {
669 /* ieee device used by generic ieee processing code */ 669 /* ieee device used by generic ieee processing code */
670 struct ieee80211_hw *hw; 670 struct ieee80211_hw *hw;
671 671
672 struct napi_struct *napi;
673
672 struct list_head calib_results; 674 struct list_head calib_results;
673 675
674 struct workqueue_struct *workqueue; 676 struct workqueue_struct *workqueue;
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 234e30f498b2..644819563cf0 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -2037,7 +2037,8 @@ static void iwl_napi_add(struct iwl_op_mode *op_mode,
2037{ 2037{
2038 struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); 2038 struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
2039 2039
2040 ieee80211_napi_add(priv->hw, napi, napi_dev, poll, weight); 2040 netif_napi_add(napi_dev, napi, poll, weight);
2041 priv->napi = napi;
2041} 2042}
2042 2043
2043static const struct iwl_op_mode_ops iwl_dvm_ops = { 2044static const struct iwl_op_mode_ops iwl_dvm_ops = {
diff --git a/drivers/net/wireless/iwlwifi/dvm/rx.c b/drivers/net/wireless/iwlwifi/dvm/rx.c
index debec963c610..5a91f5d6b1dc 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rx.c
@@ -786,7 +786,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
786 786
787 memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats)); 787 memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats));
788 788
789 ieee80211_rx(priv->hw, skb); 789 ieee80211_rx_napi(priv->hw, skb, priv->napi);
790} 790}
791 791
792static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in) 792static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 2d4bad5fe825..605f57a2c6be 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -559,6 +559,7 @@ struct iwl_mvm {
559 const struct iwl_cfg *cfg; 559 const struct iwl_cfg *cfg;
560 struct iwl_phy_db *phy_db; 560 struct iwl_phy_db *phy_db;
561 struct ieee80211_hw *hw; 561 struct ieee80211_hw *hw;
562 struct napi_struct *napi;
562 563
563 /* for protecting access to iwl_mvm */ 564 /* for protecting access to iwl_mvm */
564 struct mutex mutex; 565 struct mutex mutex;
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index e4fa50075ffd..3967df63e0f3 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -1316,7 +1316,8 @@ static void iwl_mvm_napi_add(struct iwl_op_mode *op_mode,
1316{ 1316{
1317 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); 1317 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
1318 1318
1319 ieee80211_napi_add(mvm->hw, napi, napi_dev, poll, weight); 1319 netif_napi_add(napi_dev, napi, poll, weight);
1320 mvm->napi = napi;
1320} 1321}
1321 1322
1322static const struct iwl_op_mode_ops iwl_mvm_ops = { 1323static const struct iwl_op_mode_ops iwl_mvm_ops = {
diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c
index 8f1d93b7a13a..9ff0b4321df3 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rx.c
@@ -129,7 +129,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
129 fraglen, rxb->truesize); 129 fraglen, rxb->truesize);
130 } 130 }
131 131
132 ieee80211_rx(mvm->hw, skb); 132 ieee80211_rx_napi(mvm->hw, skb, mvm->napi);
133} 133}
134 134
135/* 135/*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 43dbddfa06c0..ff68b8c4ab35 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3694,20 +3694,28 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
3694void ieee80211_restart_hw(struct ieee80211_hw *hw); 3694void ieee80211_restart_hw(struct ieee80211_hw *hw);
3695 3695
3696/** 3696/**
3697 * ieee80211_napi_add - initialize mac80211 NAPI context 3697 * ieee80211_rx_napi - receive frame from NAPI context
3698 * @hw: the hardware to initialize the NAPI context on
3699 * @napi: the NAPI context to initialize
3700 * @napi_dev: dummy NAPI netdevice, here to not waste the space if the
3701 * driver doesn't use NAPI
3702 * @poll: poll function
3703 * @weight: default weight
3704 * 3698 *
3705 * See also netif_napi_add(). 3699 * Use this function to hand received frames to mac80211. The receive
3700 * buffer in @skb must start with an IEEE 802.11 header. In case of a
3701 * paged @skb is used, the driver is recommended to put the ieee80211
3702 * header of the frame on the linear part of the @skb to avoid memory
3703 * allocation and/or memcpy by the stack.
3704 *
3705 * This function may not be called in IRQ context. Calls to this function
3706 * for a single hardware must be synchronized against each other. Calls to
3707 * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be
3708 * mixed for a single hardware. Must not run concurrently with
3709 * ieee80211_tx_status() or ieee80211_tx_status_ni().
3710 *
3711 * This function must be called with BHs disabled.
3712 *
3713 * @hw: the hardware this frame came in on
3714 * @skb: the buffer to receive, owned by mac80211 after this call
3715 * @napi: the NAPI context
3706 */ 3716 */
3707void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi, 3717void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
3708 struct net_device *napi_dev, 3718 struct napi_struct *napi);
3709 int (*poll)(struct napi_struct *, int),
3710 int weight);
3711 3719
3712/** 3720/**
3713 * ieee80211_rx - receive frame 3721 * ieee80211_rx - receive frame
@@ -3729,7 +3737,10 @@ void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
3729 * @hw: the hardware this frame came in on 3737 * @hw: the hardware this frame came in on
3730 * @skb: the buffer to receive, owned by mac80211 after this call 3738 * @skb: the buffer to receive, owned by mac80211 after this call
3731 */ 3739 */
3732void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); 3740static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3741{
3742 ieee80211_rx_napi(hw, skb, NULL);
3743}
3733 3744
3734/** 3745/**
3735 * ieee80211_rx_irqsafe - receive frame 3746 * ieee80211_rx_irqsafe - receive frame
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 361bb3ca335c..7d75f93bac7d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -202,8 +202,6 @@ enum ieee80211_packet_rx_flags {
202 * @IEEE80211_RX_CMNTR: received on cooked monitor already 202 * @IEEE80211_RX_CMNTR: received on cooked monitor already
203 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported 203 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
204 * to cfg80211_report_obss_beacon(). 204 * to cfg80211_report_obss_beacon().
205 * @IEEE80211_RX_REORDER_TIMER: this frame is released by the
206 * reorder buffer timeout timer, not the normal RX path
207 * 205 *
208 * These flags are used across handling multiple interfaces 206 * These flags are used across handling multiple interfaces
209 * for a single frame. 207 * for a single frame.
@@ -211,10 +209,10 @@ enum ieee80211_packet_rx_flags {
211enum ieee80211_rx_flags { 209enum ieee80211_rx_flags {
212 IEEE80211_RX_CMNTR = BIT(0), 210 IEEE80211_RX_CMNTR = BIT(0),
213 IEEE80211_RX_BEACON_REPORTED = BIT(1), 211 IEEE80211_RX_BEACON_REPORTED = BIT(1),
214 IEEE80211_RX_REORDER_TIMER = BIT(2),
215}; 212};
216 213
217struct ieee80211_rx_data { 214struct ieee80211_rx_data {
215 struct napi_struct *napi;
218 struct sk_buff *skb; 216 struct sk_buff *skb;
219 struct ieee80211_local *local; 217 struct ieee80211_local *local;
220 struct ieee80211_sub_if_data *sdata; 218 struct ieee80211_sub_if_data *sdata;
@@ -1347,8 +1345,6 @@ struct ieee80211_local {
1347 1345
1348 struct ieee80211_sub_if_data __rcu *p2p_sdata; 1346 struct ieee80211_sub_if_data __rcu *p2p_sdata;
1349 1347
1350 struct napi_struct *napi;
1351
1352 /* virtual monitor interface */ 1348 /* virtual monitor interface */
1353 struct ieee80211_sub_if_data __rcu *monitor_sdata; 1349 struct ieee80211_sub_if_data __rcu *monitor_sdata;
1354 struct cfg80211_chan_def monitor_chandef; 1350 struct cfg80211_chan_def monitor_chandef;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 3c63468b4dfb..dba0a86dee18 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1132,18 +1132,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1132} 1132}
1133EXPORT_SYMBOL(ieee80211_register_hw); 1133EXPORT_SYMBOL(ieee80211_register_hw);
1134 1134
1135void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
1136 struct net_device *napi_dev,
1137 int (*poll)(struct napi_struct *, int),
1138 int weight)
1139{
1140 struct ieee80211_local *local = hw_to_local(hw);
1141
1142 netif_napi_add(napi_dev, napi, poll, weight);
1143 local->napi = napi;
1144}
1145EXPORT_SYMBOL_GPL(ieee80211_napi_add);
1146
1147void ieee80211_unregister_hw(struct ieee80211_hw *hw) 1135void ieee80211_unregister_hw(struct ieee80211_hw *hw)
1148{ 1136{
1149 struct ieee80211_local *local = hw_to_local(hw); 1137 struct ieee80211_local *local = hw_to_local(hw);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index dd6bb2a54d45..817bf22dad5a 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2148,9 +2148,8 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
2148 /* deliver to local stack */ 2148 /* deliver to local stack */
2149 skb->protocol = eth_type_trans(skb, dev); 2149 skb->protocol = eth_type_trans(skb, dev);
2150 memset(skb->cb, 0, sizeof(skb->cb)); 2150 memset(skb->cb, 0, sizeof(skb->cb));
2151 if (!(rx->flags & IEEE80211_RX_REORDER_TIMER) && 2151 if (rx->napi)
2152 rx->local->napi) 2152 napi_gro_receive(rx->napi, skb);
2153 napi_gro_receive(rx->local->napi, skb);
2154 else 2153 else
2155 netif_receive_skb(skb); 2154 netif_receive_skb(skb);
2156 } 2155 }
@@ -3256,7 +3255,7 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
3256 /* This is OK -- must be QoS data frame */ 3255 /* This is OK -- must be QoS data frame */
3257 .security_idx = tid, 3256 .security_idx = tid,
3258 .seqno_idx = tid, 3257 .seqno_idx = tid,
3259 .flags = IEEE80211_RX_REORDER_TIMER, 3258 .napi = NULL, /* must be NULL to not have races */
3260 }; 3259 };
3261 struct tid_ampdu_rx *tid_agg_rx; 3260 struct tid_ampdu_rx *tid_agg_rx;
3262 3261
@@ -3433,7 +3432,8 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
3433 * be called with rcu_read_lock protection. 3432 * be called with rcu_read_lock protection.
3434 */ 3433 */
3435static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, 3434static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3436 struct sk_buff *skb) 3435 struct sk_buff *skb,
3436 struct napi_struct *napi)
3437{ 3437{
3438 struct ieee80211_local *local = hw_to_local(hw); 3438 struct ieee80211_local *local = hw_to_local(hw);
3439 struct ieee80211_sub_if_data *sdata; 3439 struct ieee80211_sub_if_data *sdata;
@@ -3449,6 +3449,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3449 memset(&rx, 0, sizeof(rx)); 3449 memset(&rx, 0, sizeof(rx));
3450 rx.skb = skb; 3450 rx.skb = skb;
3451 rx.local = local; 3451 rx.local = local;
3452 rx.napi = napi;
3452 3453
3453 if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc)) 3454 if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc))
3454 I802_DEBUG_INC(local->dot11ReceivedFragmentCount); 3455 I802_DEBUG_INC(local->dot11ReceivedFragmentCount);
@@ -3550,7 +3551,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3550 * This is the receive path handler. It is called by a low level driver when an 3551 * This is the receive path handler. It is called by a low level driver when an
3551 * 802.11 MPDU is received from the hardware. 3552 * 802.11 MPDU is received from the hardware.
3552 */ 3553 */
3553void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) 3554void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
3555 struct napi_struct *napi)
3554{ 3556{
3555 struct ieee80211_local *local = hw_to_local(hw); 3557 struct ieee80211_local *local = hw_to_local(hw);
3556 struct ieee80211_rate *rate = NULL; 3558 struct ieee80211_rate *rate = NULL;
@@ -3649,7 +3651,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3649 ieee80211_tpt_led_trig_rx(local, 3651 ieee80211_tpt_led_trig_rx(local,
3650 ((struct ieee80211_hdr *)skb->data)->frame_control, 3652 ((struct ieee80211_hdr *)skb->data)->frame_control,
3651 skb->len); 3653 skb->len);
3652 __ieee80211_rx_handle_packet(hw, skb); 3654 __ieee80211_rx_handle_packet(hw, skb, napi);
3653 3655
3654 rcu_read_unlock(); 3656 rcu_read_unlock();
3655 3657
@@ -3657,7 +3659,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3657 drop: 3659 drop:
3658 kfree_skb(skb); 3660 kfree_skb(skb);
3659} 3661}
3660EXPORT_SYMBOL(ieee80211_rx); 3662EXPORT_SYMBOL(ieee80211_rx_napi);
3661 3663
3662/* This is a version of the rx handler that can be called from hard irq 3664/* This is a version of the rx handler that can be called from hard irq
3663 * context. Post the skb on the queue and schedule the tasklet */ 3665 * context. Post the skb on the queue and schedule the tasklet */