aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-02-04 14:51:09 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-12 15:37:27 -0500
commit06d181a8fd58031db9c114d920b40d8820380a6e (patch)
tree4b1fd3bdb5c9568f127970ff8bc9630c5b9e6c80 /include/net/mac80211.h
parent9900e4843c6c95cc951a642e337478831429be88 (diff)
mac80211: add NAPI support back
NAPI was originally added to mac80211 a long time ago (by John in commit 4e6cbfd09c66 in July 2010), but then removed years later (by Stanislaw in commit 30c97120c6c7 in February 2013). No driver ever used it, so that was fine. Now I'm adding support for NAPI to our driver, so add some code to mac80211 again to support NAPI. John was originally wrapping some (but not nearly all NAPI-related functions), but that doesn't scale very well with the number of functions that are there, some of which are even only inlines. Thus, instead of doing that, let the drivers manage the NAPI struct, except for napi_add() which is needed so mac80211 knows how to call napi_gro_receive(). Also remove some no longer needed definitions that were left when NAPI support was removed. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h34
1 files changed, 13 insertions, 21 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 4005c5b4e3b4..2d4d31212eed 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1642,10 +1642,6 @@ enum ieee80211_hw_flags {
1642 * the hw can report back. 1642 * the hw can report back.
1643 * @max_rate_tries: maximum number of tries for each stage 1643 * @max_rate_tries: maximum number of tries for each stage
1644 * 1644 *
1645 * @napi_weight: weight used for NAPI polling. You must specify an
1646 * appropriate value here if a napi_poll operation is provided
1647 * by your driver.
1648 *
1649 * @max_rx_aggregation_subframes: maximum buffer size (number of 1645 * @max_rx_aggregation_subframes: maximum buffer size (number of
1650 * sub-frames) to be used for A-MPDU block ack receiver 1646 * sub-frames) to be used for A-MPDU block ack receiver
1651 * aggregation. 1647 * aggregation.
@@ -1699,7 +1695,6 @@ struct ieee80211_hw {
1699 int vif_data_size; 1695 int vif_data_size;
1700 int sta_data_size; 1696 int sta_data_size;
1701 int chanctx_data_size; 1697 int chanctx_data_size;
1702 int napi_weight;
1703 u16 queues; 1698 u16 queues;
1704 u16 max_listen_interval; 1699 u16 max_listen_interval;
1705 s8 max_signal; 1700 s8 max_signal;
@@ -2622,8 +2617,6 @@ enum ieee80211_roc_type {
2622 * callback. They must then call ieee80211_chswitch_done() to indicate 2617 * callback. They must then call ieee80211_chswitch_done() to indicate
2623 * completion of the channel switch. 2618 * completion of the channel switch.
2624 * 2619 *
2625 * @napi_poll: Poll Rx queue for incoming data frames.
2626 *
2627 * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. 2620 * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
2628 * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may 2621 * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
2629 * reject TX/RX mask combinations they cannot support by returning -EINVAL 2622 * reject TX/RX mask combinations they cannot support by returning -EINVAL
@@ -2882,7 +2875,6 @@ struct ieee80211_ops {
2882 void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop); 2875 void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop);
2883 void (*channel_switch)(struct ieee80211_hw *hw, 2876 void (*channel_switch)(struct ieee80211_hw *hw,
2884 struct ieee80211_channel_switch *ch_switch); 2877 struct ieee80211_channel_switch *ch_switch);
2885 int (*napi_poll)(struct ieee80211_hw *hw, int budget);
2886 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); 2878 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
2887 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 2879 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
2888 2880
@@ -3164,21 +3156,21 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
3164 */ 3156 */
3165void ieee80211_restart_hw(struct ieee80211_hw *hw); 3157void ieee80211_restart_hw(struct ieee80211_hw *hw);
3166 3158
3167/** ieee80211_napi_schedule - schedule NAPI poll 3159/**
3168 * 3160 * ieee80211_napi_add - initialize mac80211 NAPI context
3169 * Use this function to schedule NAPI polling on a device. 3161 * @hw: the hardware to initialize the NAPI context on
3170 * 3162 * @napi: the NAPI context to initialize
3171 * @hw: the hardware to start polling 3163 * @napi_dev: dummy NAPI netdevice, here to not waste the space if the
3172 */ 3164 * driver doesn't use NAPI
3173void ieee80211_napi_schedule(struct ieee80211_hw *hw); 3165 * @poll: poll function
3174 3166 * @weight: default weight
3175/** ieee80211_napi_complete - complete NAPI polling
3176 *
3177 * Use this function to finish NAPI polling on a device.
3178 * 3167 *
3179 * @hw: the hardware to stop polling 3168 * See also netif_napi_add().
3180 */ 3169 */
3181void ieee80211_napi_complete(struct ieee80211_hw *hw); 3170void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
3171 struct net_device *napi_dev,
3172 int (*poll)(struct napi_struct *, int),
3173 int weight);
3182 3174
3183/** 3175/**
3184 * ieee80211_rx - receive frame 3176 * ieee80211_rx - receive frame