aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h313
1 files changed, 225 insertions, 88 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ee50c5eba50c..f7eba1300d82 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -147,10 +147,12 @@ struct ieee80211_low_level_stats {
147 * enum ieee80211_chanctx_change - change flag for channel context 147 * enum ieee80211_chanctx_change - change flag for channel context
148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
150 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
150 */ 151 */
151enum ieee80211_chanctx_change { 152enum ieee80211_chanctx_change {
152 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 153 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
153 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 154 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
155 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
154}; 156};
155 157
156/** 158/**
@@ -165,6 +167,7 @@ enum ieee80211_chanctx_change {
165 * @rx_chains_dynamic: The number of RX chains that must be enabled 167 * @rx_chains_dynamic: The number of RX chains that must be enabled
166 * after RTS/CTS handshake to receive SMPS MIMO transmissions; 168 * after RTS/CTS handshake to receive SMPS MIMO transmissions;
167 * this will always be >= @rx_chains_static. 169 * this will always be >= @rx_chains_static.
170 * @radar_enabled: whether radar detection is enabled on this channel.
168 * @drv_priv: data area for driver use, will always be aligned to 171 * @drv_priv: data area for driver use, will always be aligned to
169 * sizeof(void *), size is determined in hw information. 172 * sizeof(void *), size is determined in hw information.
170 */ 173 */
@@ -173,7 +176,9 @@ struct ieee80211_chanctx_conf {
173 176
174 u8 rx_chains_static, rx_chains_dynamic; 177 u8 rx_chains_static, rx_chains_dynamic;
175 178
176 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 179 bool radar_enabled;
180
181 u8 drv_priv[0] __aligned(sizeof(void *));
177}; 182};
178 183
179/** 184/**
@@ -208,6 +213,11 @@ struct ieee80211_chanctx_conf {
208 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface 213 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
209 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) 214 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
210 * changed (currently only in P2P client mode, GO mode will be later) 215 * changed (currently only in P2P client mode, GO mode will be later)
216 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when
217 * it becomes valid, managed mode only)
218 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,
219 * note that this is only called when it changes after the channel
220 * context had been assigned.
211 */ 221 */
212enum ieee80211_bss_change { 222enum ieee80211_bss_change {
213 BSS_CHANGED_ASSOC = 1<<0, 223 BSS_CHANGED_ASSOC = 1<<0,
@@ -230,6 +240,8 @@ enum ieee80211_bss_change {
230 BSS_CHANGED_PS = 1<<17, 240 BSS_CHANGED_PS = 1<<17,
231 BSS_CHANGED_TXPOWER = 1<<18, 241 BSS_CHANGED_TXPOWER = 1<<18,
232 BSS_CHANGED_P2P_PS = 1<<19, 242 BSS_CHANGED_P2P_PS = 1<<19,
243 BSS_CHANGED_DTIM_PERIOD = 1<<20,
244 BSS_CHANGED_BANDWIDTH = 1<<21,
233 245
234 /* when adding here, make sure to change ieee80211_reconfig */ 246 /* when adding here, make sure to change ieee80211_reconfig */
235}; 247};
@@ -271,13 +283,19 @@ enum ieee80211_rssi_event {
271 * if the hardware cannot handle this it must set the 283 * if the hardware cannot handle this it must set the
272 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag 284 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
273 * @dtim_period: num of beacons before the next DTIM, for beaconing, 285 * @dtim_period: num of beacons before the next DTIM, for beaconing,
274 * valid in station mode only while @assoc is true and if also 286 * valid in station mode only if after the driver was notified
275 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf 287 * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then.
276 * @ps_dtim_period)
277 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old 288 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
278 * as it may have been received during scanning long ago) 289 * as it may have been received during scanning long ago). If the
290 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can
291 * only come from a beacon, but might not become valid until after
292 * association when a beacon is received (which is notified with the
293 * %BSS_CHANGED_DTIM flag.)
279 * @sync_device_ts: the device timestamp corresponding to the sync_tsf, 294 * @sync_device_ts: the device timestamp corresponding to the sync_tsf,
280 * the driver/device can use this to calculate synchronisation 295 * the driver/device can use this to calculate synchronisation
296 * (see @sync_tsf)
297 * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY
298 * is requested, see @sync_tsf/@sync_device_ts.
281 * @beacon_int: beacon interval 299 * @beacon_int: beacon interval
282 * @assoc_capability: capabilities taken from assoc resp 300 * @assoc_capability: capabilities taken from assoc resp
283 * @basic_rates: bitmap of basic rates, each bit stands for an 301 * @basic_rates: bitmap of basic rates, each bit stands for an
@@ -297,11 +315,9 @@ enum ieee80211_rssi_event {
297 * may filter ARP queries targeted for other addresses than listed here. 315 * may filter ARP queries targeted for other addresses than listed here.
298 * The driver must allow ARP queries targeted for all address listed here 316 * The driver must allow ARP queries targeted for all address listed here
299 * to pass through. An empty list implies no ARP queries need to pass. 317 * to pass through. An empty list implies no ARP queries need to pass.
300 * @arp_addr_cnt: Number of addresses currently on the list. 318 * @arp_addr_cnt: Number of addresses currently on the list. Note that this
301 * @arp_filter_enabled: Enable ARP filtering - if enabled, the hardware may 319 * may be larger than %IEEE80211_BSS_ARP_ADDR_LIST_LEN (the arp_addr_list
302 * filter ARP queries based on the @arp_addr_list, if disabled, the 320 * array size), it's up to the driver what to do in that case.
303 * hardware must not perform any ARP filtering. Note, that the filter will
304 * be enabled also in promiscuous mode.
305 * @qos: This is a QoS-enabled BSS. 321 * @qos: This is a QoS-enabled BSS.
306 * @idle: This interface is idle. There's also a global idle flag in the 322 * @idle: This interface is idle. There's also a global idle flag in the
307 * hardware config which may be more appropriate depending on what 323 * hardware config which may be more appropriate depending on what
@@ -331,6 +347,7 @@ struct ieee80211_bss_conf {
331 u16 assoc_capability; 347 u16 assoc_capability;
332 u64 sync_tsf; 348 u64 sync_tsf;
333 u32 sync_device_ts; 349 u32 sync_device_ts;
350 u8 sync_dtim_count;
334 u32 basic_rates; 351 u32 basic_rates;
335 int mcast_rate[IEEE80211_NUM_BANDS]; 352 int mcast_rate[IEEE80211_NUM_BANDS];
336 u16 ht_operation_mode; 353 u16 ht_operation_mode;
@@ -338,8 +355,7 @@ struct ieee80211_bss_conf {
338 u32 cqm_rssi_hyst; 355 u32 cqm_rssi_hyst;
339 struct cfg80211_chan_def chandef; 356 struct cfg80211_chan_def chandef;
340 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; 357 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
341 u8 arp_addr_cnt; 358 int arp_addr_cnt;
342 bool arp_filter_enabled;
343 bool qos; 359 bool qos;
344 bool idle; 360 bool idle;
345 bool ps; 361 bool ps;
@@ -392,6 +408,9 @@ struct ieee80211_bss_conf {
392 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be 408 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
393 * set by rate control algorithms to indicate probe rate, will 409 * set by rate control algorithms to indicate probe rate, will
394 * be cleared for fragmented frames (except on the last fragment) 410 * be cleared for fragmented frames (except on the last fragment)
411 * @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate
412 * that a frame can be transmitted while the queues are stopped for
413 * off-channel operation.
395 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, 414 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211,
396 * used to indicate that a pending frame requires TX processing before 415 * used to indicate that a pending frame requires TX processing before
397 * it can be sent out. 416 * it can be sent out.
@@ -409,6 +428,9 @@ struct ieee80211_bss_conf {
409 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted 428 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
410 * after TX status because the destination was asleep, it must not 429 * after TX status because the destination was asleep, it must not
411 * be modified again (no seqno assignment, crypto, etc.) 430 * be modified again (no seqno assignment, crypto, etc.)
431 * @IEEE80211_TX_INTFL_MLME_CONN_TX: This frame was transmitted by the MLME
432 * code for connection establishment, this indicates that its status
433 * should kick the MLME state machine.
412 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 434 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
413 * MLME command (internal to mac80211 to figure out whether to send TX 435 * MLME command (internal to mac80211 to figure out whether to send TX
414 * status to user space) 436 * status to user space)
@@ -454,13 +476,14 @@ enum mac80211_tx_control_flags {
454 IEEE80211_TX_STAT_AMPDU = BIT(10), 476 IEEE80211_TX_STAT_AMPDU = BIT(10),
455 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), 477 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
456 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), 478 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
479 IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13),
457 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 480 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
458 IEEE80211_TX_INTFL_RETRIED = BIT(15), 481 IEEE80211_TX_INTFL_RETRIED = BIT(15),
459 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 482 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
460 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), 483 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17),
461 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 484 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
462 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 485 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
463 /* hole at 20, use later */ 486 IEEE80211_TX_INTFL_MLME_CONN_TX = BIT(20),
464 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), 487 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
465 IEEE80211_TX_CTL_LDPC = BIT(22), 488 IEEE80211_TX_CTL_LDPC = BIT(22),
466 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), 489 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
@@ -953,6 +976,7 @@ enum ieee80211_smps_mode {
953 * 976 *
954 * @channel: the channel to tune to 977 * @channel: the channel to tune to
955 * @channel_type: the channel (HT) type 978 * @channel_type: the channel (HT) type
979 * @radar_enabled: whether radar detection is enabled
956 * 980 *
957 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 981 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
958 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 982 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
@@ -979,6 +1003,7 @@ struct ieee80211_conf {
979 1003
980 struct ieee80211_channel *channel; 1004 struct ieee80211_channel *channel;
981 enum nl80211_channel_type channel_type; 1005 enum nl80211_channel_type channel_type;
1006 bool radar_enabled;
982 enum ieee80211_smps_mode smps_mode; 1007 enum ieee80211_smps_mode smps_mode;
983}; 1008};
984 1009
@@ -1059,7 +1084,7 @@ struct ieee80211_vif {
1059 u32 driver_flags; 1084 u32 driver_flags;
1060 1085
1061 /* must be last */ 1086 /* must be last */
1062 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 1087 u8 drv_priv[0] __aligned(sizeof(void *));
1063}; 1088};
1064 1089
1065static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) 1090static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
@@ -1176,6 +1201,24 @@ enum ieee80211_sta_state {
1176}; 1201};
1177 1202
1178/** 1203/**
1204 * enum ieee80211_sta_rx_bandwidth - station RX bandwidth
1205 * @IEEE80211_STA_RX_BW_20: station can only receive 20 MHz
1206 * @IEEE80211_STA_RX_BW_40: station can receive up to 40 MHz
1207 * @IEEE80211_STA_RX_BW_80: station can receive up to 80 MHz
1208 * @IEEE80211_STA_RX_BW_160: station can receive up to 160 MHz
1209 * (including 80+80 MHz)
1210 *
1211 * Implementation note: 20 must be zero to be initialized
1212 * correctly, the values must be sorted.
1213 */
1214enum ieee80211_sta_rx_bandwidth {
1215 IEEE80211_STA_RX_BW_20 = 0,
1216 IEEE80211_STA_RX_BW_40,
1217 IEEE80211_STA_RX_BW_80,
1218 IEEE80211_STA_RX_BW_160,
1219};
1220
1221/**
1179 * struct ieee80211_sta - station table entry 1222 * struct ieee80211_sta - station table entry
1180 * 1223 *
1181 * A station table entry represents a station we are possibly 1224 * A station table entry represents a station we are possibly
@@ -1197,6 +1240,12 @@ enum ieee80211_sta_state {
1197 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid 1240 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
1198 * if wme is supported. 1241 * if wme is supported.
1199 * @max_sp: max Service Period. Only valid if wme is supported. 1242 * @max_sp: max Service Period. Only valid if wme is supported.
1243 * @bandwidth: current bandwidth the station can receive with
1244 * @rx_nss: in HT/VHT, the maximum number of spatial streams the
1245 * station can receive at the moment, changed by operating mode
1246 * notifications and capabilities. The value is only valid after
1247 * the station moves to associated state.
1248 * @smps_mode: current SMPS mode (off, static or dynamic)
1200 */ 1249 */
1201struct ieee80211_sta { 1250struct ieee80211_sta {
1202 u32 supp_rates[IEEE80211_NUM_BANDS]; 1251 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1207,9 +1256,12 @@ struct ieee80211_sta {
1207 bool wme; 1256 bool wme;
1208 u8 uapsd_queues; 1257 u8 uapsd_queues;
1209 u8 max_sp; 1258 u8 max_sp;
1259 u8 rx_nss;
1260 enum ieee80211_sta_rx_bandwidth bandwidth;
1261 enum ieee80211_smps_mode smps_mode;
1210 1262
1211 /* must be last */ 1263 /* must be last */
1212 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 1264 u8 drv_priv[0] __aligned(sizeof(void *));
1213}; 1265};
1214 1266
1215/** 1267/**
@@ -1331,9 +1383,9 @@ struct ieee80211_tx_control {
1331 * When this flag is set, signaling beacon-loss will cause an immediate 1383 * When this flag is set, signaling beacon-loss will cause an immediate
1332 * change to disassociated state. 1384 * change to disassociated state.
1333 * 1385 *
1334 * @IEEE80211_HW_NEED_DTIM_PERIOD: 1386 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1335 * This device needs to know the DTIM period for the BSS before 1387 * This device needs to get data from beacon before association (i.e.
1336 * associating. 1388 * dtim_period).
1337 * 1389 *
1338 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports 1390 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports
1339 * per-station GTKs as used by IBSS RSN or during fast transition. If 1391 * per-station GTKs as used by IBSS RSN or during fast transition. If
@@ -1353,10 +1405,6 @@ struct ieee80211_tx_control {
1353 * setup strictly in HW. mac80211 should not attempt to do this in 1405 * setup strictly in HW. mac80211 should not attempt to do this in
1354 * software. 1406 * software.
1355 * 1407 *
1356 * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while
1357 * being idle (i.e. mac80211 doesn't have to go idle-off during the
1358 * the scan).
1359 *
1360 * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of 1408 * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of
1361 * a virtual monitor interface when monitor interfaces are the only 1409 * a virtual monitor interface when monitor interfaces are the only
1362 * active interfaces. 1410 * active interfaces.
@@ -1370,9 +1418,8 @@ struct ieee80211_tx_control {
1370 * P2P Interface. This will be honoured even if more than one interface 1418 * P2P Interface. This will be honoured even if more than one interface
1371 * is supported. 1419 * is supported.
1372 * 1420 *
1373 * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session 1421 * @IEEE80211_HW_TIMING_BEACON_ONLY: Use sync timing from beacon frames
1374 * should be tear down once BAR frame will not be acked. 1422 * only, to allow getting TBTT of a DTIM beacon.
1375 *
1376 */ 1423 */
1377enum ieee80211_hw_flags { 1424enum ieee80211_hw_flags {
1378 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1425 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1382,7 +1429,7 @@ enum ieee80211_hw_flags {
1382 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 1429 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
1383 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, 1430 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
1384 IEEE80211_HW_SIGNAL_DBM = 1<<6, 1431 IEEE80211_HW_SIGNAL_DBM = 1<<6,
1385 IEEE80211_HW_NEED_DTIM_PERIOD = 1<<7, 1432 IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 1<<7,
1386 IEEE80211_HW_SPECTRUM_MGMT = 1<<8, 1433 IEEE80211_HW_SPECTRUM_MGMT = 1<<8,
1387 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, 1434 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9,
1388 IEEE80211_HW_SUPPORTS_PS = 1<<10, 1435 IEEE80211_HW_SUPPORTS_PS = 1<<10,
@@ -1399,9 +1446,8 @@ enum ieee80211_hw_flags {
1399 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1446 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1400 IEEE80211_HW_AP_LINK_PS = 1<<22, 1447 IEEE80211_HW_AP_LINK_PS = 1<<22,
1401 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1448 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1402 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1403 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1449 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
1404 IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26, 1450 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26,
1405}; 1451};
1406 1452
1407/** 1453/**
@@ -1522,6 +1568,8 @@ struct ieee80211_hw {
1522 * structure can then access it via hw->priv. Note that mac802111 drivers should 1568 * structure can then access it via hw->priv. Note that mac802111 drivers should
1523 * not use wiphy_priv() to try to get their private driver structure as this 1569 * not use wiphy_priv() to try to get their private driver structure as this
1524 * is already used internally by mac80211. 1570 * is already used internally by mac80211.
1571 *
1572 * Return: The mac80211 driver hw struct of @wiphy.
1525 */ 1573 */
1526struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy); 1574struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy);
1527 1575
@@ -1628,6 +1676,10 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1628 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is 1676 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is
1629 * provided by update_tkip_key only. The trigger that makes mac80211 call this 1677 * provided by update_tkip_key only. The trigger that makes mac80211 call this
1630 * handler is software decryption with wrap around of iv16. 1678 * handler is software decryption with wrap around of iv16.
1679 *
1680 * The set_default_unicast_key() call updates the default WEP key index
1681 * configured to the hardware for WEP encryption type. This is required
1682 * for devices that support offload of data packets (e.g. ARP responses).
1631 */ 1683 */
1632 1684
1633/** 1685/**
@@ -1680,15 +1732,6 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1680 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS 1732 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
1681 * enabled whenever user has enabled powersave. 1733 * enabled whenever user has enabled powersave.
1682 * 1734 *
1683 * Some hardware need to toggle a single shared antenna between WLAN and
1684 * Bluetooth to facilitate co-existence. These types of hardware set
1685 * limitations on the use of host controlled dynamic powersave whenever there
1686 * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the
1687 * driver may request temporarily going into full power save, in order to
1688 * enable toggling the antenna between BT and WLAN. If the driver requests
1689 * disabling dynamic powersave, the @dynamic_ps_timeout value will be
1690 * temporarily set to zero until the driver re-enables dynamic powersave.
1691 *
1692 * Driver informs U-APSD client support by enabling 1735 * Driver informs U-APSD client support by enabling
1693 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the 1736 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the
1694 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS 1737 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS
@@ -2033,17 +2076,29 @@ enum ieee80211_filter_flags {
2033 * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer 2076 * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer
2034 * might receive the addBA frame and send a delBA right away! 2077 * might receive the addBA frame and send a delBA right away!
2035 * 2078 *
2036 * @IEEE80211_AMPDU_RX_START: start Rx aggregation 2079 * @IEEE80211_AMPDU_RX_START: start RX aggregation
2037 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 2080 * @IEEE80211_AMPDU_RX_STOP: stop RX aggregation
2038 * @IEEE80211_AMPDU_TX_START: start Tx aggregation 2081 * @IEEE80211_AMPDU_TX_START: start TX aggregation
2039 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
2040 * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational 2082 * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational
2083 * @IEEE80211_AMPDU_TX_STOP_CONT: stop TX aggregation but continue transmitting
2084 * queued packets, now unaggregated. After all packets are transmitted the
2085 * driver has to call ieee80211_stop_tx_ba_cb_irqsafe().
2086 * @IEEE80211_AMPDU_TX_STOP_FLUSH: stop TX aggregation and flush all packets,
2087 * called when the station is removed. There's no need or reason to call
2088 * ieee80211_stop_tx_ba_cb_irqsafe() in this case as mac80211 assumes the
2089 * session is gone and removes the station.
2090 * @IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: called when TX aggregation is stopped
2091 * but the driver hasn't called ieee80211_stop_tx_ba_cb_irqsafe() yet and
2092 * now the connection is dropped and the station will be removed. Drivers
2093 * should clean up and drop remaining packets when this is called.
2041 */ 2094 */
2042enum ieee80211_ampdu_mlme_action { 2095enum ieee80211_ampdu_mlme_action {
2043 IEEE80211_AMPDU_RX_START, 2096 IEEE80211_AMPDU_RX_START,
2044 IEEE80211_AMPDU_RX_STOP, 2097 IEEE80211_AMPDU_RX_STOP,
2045 IEEE80211_AMPDU_TX_START, 2098 IEEE80211_AMPDU_TX_START,
2046 IEEE80211_AMPDU_TX_STOP, 2099 IEEE80211_AMPDU_TX_STOP_CONT,
2100 IEEE80211_AMPDU_TX_STOP_FLUSH,
2101 IEEE80211_AMPDU_TX_STOP_FLUSH_CONT,
2047 IEEE80211_AMPDU_TX_OPERATIONAL, 2102 IEEE80211_AMPDU_TX_OPERATIONAL,
2048}; 2103};
2049 2104
@@ -2062,16 +2117,21 @@ enum ieee80211_frame_release_type {
2062 * enum ieee80211_rate_control_changed - flags to indicate what changed 2117 * enum ieee80211_rate_control_changed - flags to indicate what changed
2063 * 2118 *
2064 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit 2119 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit
2065 * to this station changed. 2120 * to this station changed. The actual bandwidth is in the station
2121 * information -- for HT20/40 the IEEE80211_HT_CAP_SUP_WIDTH_20_40
2122 * flag changes, for HT and VHT the bandwidth field changes.
2066 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. 2123 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed.
2067 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer 2124 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer
2068 * changed (in IBSS mode) due to discovering more information about 2125 * changed (in IBSS mode) due to discovering more information about
2069 * the peer. 2126 * the peer.
2127 * @IEEE80211_RC_NSS_CHANGED: N_SS (number of spatial streams) was changed
2128 * by the peer
2070 */ 2129 */
2071enum ieee80211_rate_control_changed { 2130enum ieee80211_rate_control_changed {
2072 IEEE80211_RC_BW_CHANGED = BIT(0), 2131 IEEE80211_RC_BW_CHANGED = BIT(0),
2073 IEEE80211_RC_SMPS_CHANGED = BIT(1), 2132 IEEE80211_RC_SMPS_CHANGED = BIT(1),
2074 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), 2133 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2),
2134 IEEE80211_RC_NSS_CHANGED = BIT(3),
2075}; 2135};
2076 2136
2077/** 2137/**
@@ -2152,6 +2212,18 @@ enum ieee80211_rate_control_changed {
2152 * MAC address of the device going away. 2212 * MAC address of the device going away.
2153 * Hence, this callback must be implemented. It can sleep. 2213 * Hence, this callback must be implemented. It can sleep.
2154 * 2214 *
2215 * @add_interface_debugfs: Drivers can use this callback to add debugfs files
2216 * when a vif is added to mac80211. This callback and
2217 * @remove_interface_debugfs should be within a CONFIG_MAC80211_DEBUGFS
2218 * conditional. @remove_interface_debugfs must be provided for cleanup.
2219 * This callback can sleep.
2220 *
2221 * @remove_interface_debugfs: Remove the debugfs files which were added using
2222 * @add_interface_debugfs. This callback must remove all debugfs entries
2223 * that were added because mac80211 only removes interface debugfs when the
2224 * interface is destroyed, not when it is removed from the driver.
2225 * This callback can sleep.
2226 *
2155 * @config: Handler for configuration requests. IEEE 802.11 code calls this 2227 * @config: Handler for configuration requests. IEEE 802.11 code calls this
2156 * function to change hardware configuration, e.g., channel. 2228 * function to change hardware configuration, e.g., channel.
2157 * This function should never fail but returns a negative error code 2229 * This function should never fail but returns a negative error code
@@ -2194,6 +2266,10 @@ enum ieee80211_rate_control_changed {
2194 * After rekeying was done it should (for example during resume) notify 2266 * After rekeying was done it should (for example during resume) notify
2195 * userspace of the new replay counter using ieee80211_gtk_rekey_notify(). 2267 * userspace of the new replay counter using ieee80211_gtk_rekey_notify().
2196 * 2268 *
2269 * @set_default_unicast_key: Set the default (unicast) key index, useful for
2270 * WEP when the device sends data packets autonomously, e.g. for ARP
2271 * offloading. The index can be 0-3, or -1 for unsetting it.
2272 *
2197 * @hw_scan: Ask the hardware to service the scan request, no need to start 2273 * @hw_scan: Ask the hardware to service the scan request, no need to start
2198 * the scan state machine in stack. The scan must honour the channel 2274 * the scan state machine in stack. The scan must honour the channel
2199 * configuration done by the regulatory agent in the wiphy's 2275 * configuration done by the regulatory agent in the wiphy's
@@ -2474,7 +2550,13 @@ enum ieee80211_rate_control_changed {
2474 * 2550 *
2475 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the 2551 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the
2476 * reconfiguration has completed. This can help the driver implement the 2552 * reconfiguration has completed. This can help the driver implement the
2477 * reconfiguration step. This callback may sleep. 2553 * reconfiguration step. Also called when reconfiguring because the
2554 * driver's resume function returned 1, as this is just like an "inline"
2555 * hardware restart. This callback may sleep.
2556 *
2557 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2558 * Currently, this is only called for managed or P2P client interfaces.
2559 * This callback is optional; it must not sleep.
2478 */ 2560 */
2479struct ieee80211_ops { 2561struct ieee80211_ops {
2480 void (*tx)(struct ieee80211_hw *hw, 2562 void (*tx)(struct ieee80211_hw *hw,
@@ -2522,6 +2604,8 @@ struct ieee80211_ops {
2522 void (*set_rekey_data)(struct ieee80211_hw *hw, 2604 void (*set_rekey_data)(struct ieee80211_hw *hw,
2523 struct ieee80211_vif *vif, 2605 struct ieee80211_vif *vif,
2524 struct cfg80211_gtk_rekey_data *data); 2606 struct cfg80211_gtk_rekey_data *data);
2607 void (*set_default_unicast_key)(struct ieee80211_hw *hw,
2608 struct ieee80211_vif *vif, int idx);
2525 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2609 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2526 struct cfg80211_scan_request *req); 2610 struct cfg80211_scan_request *req);
2527 void (*cancel_hw_scan)(struct ieee80211_hw *hw, 2611 void (*cancel_hw_scan)(struct ieee80211_hw *hw,
@@ -2553,6 +2637,12 @@ struct ieee80211_ops {
2553 struct ieee80211_vif *vif, 2637 struct ieee80211_vif *vif,
2554 struct ieee80211_sta *sta, 2638 struct ieee80211_sta *sta,
2555 struct dentry *dir); 2639 struct dentry *dir);
2640 void (*add_interface_debugfs)(struct ieee80211_hw *hw,
2641 struct ieee80211_vif *vif,
2642 struct dentry *dir);
2643 void (*remove_interface_debugfs)(struct ieee80211_hw *hw,
2644 struct ieee80211_vif *vif,
2645 struct dentry *dir);
2556#endif 2646#endif
2557 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2647 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2558 enum sta_notify_cmd, struct ieee80211_sta *sta); 2648 enum sta_notify_cmd, struct ieee80211_sta *sta);
@@ -2606,6 +2696,7 @@ struct ieee80211_ops {
2606 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2696 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2607 const struct cfg80211_bitrate_mask *mask); 2697 const struct cfg80211_bitrate_mask *mask);
2608 void (*rssi_callback)(struct ieee80211_hw *hw, 2698 void (*rssi_callback)(struct ieee80211_hw *hw,
2699 struct ieee80211_vif *vif,
2609 enum ieee80211_rssi_event rssi_event); 2700 enum ieee80211_rssi_event rssi_event);
2610 2701
2611 void (*allow_buffered_frames)(struct ieee80211_hw *hw, 2702 void (*allow_buffered_frames)(struct ieee80211_hw *hw,
@@ -2648,6 +2739,12 @@ struct ieee80211_ops {
2648 struct ieee80211_chanctx_conf *ctx); 2739 struct ieee80211_chanctx_conf *ctx);
2649 2740
2650 void (*restart_complete)(struct ieee80211_hw *hw); 2741 void (*restart_complete)(struct ieee80211_hw *hw);
2742
2743#if IS_ENABLED(CONFIG_IPV6)
2744 void (*ipv6_addr_change)(struct ieee80211_hw *hw,
2745 struct ieee80211_vif *vif,
2746 struct inet6_dev *idev);
2747#endif
2651}; 2748};
2652 2749
2653/** 2750/**
@@ -2661,6 +2758,8 @@ struct ieee80211_ops {
2661 * 2758 *
2662 * @priv_data_len: length of private data 2759 * @priv_data_len: length of private data
2663 * @ops: callbacks for this device 2760 * @ops: callbacks for this device
2761 *
2762 * Return: A pointer to the new hardware device, or %NULL on error.
2664 */ 2763 */
2665struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 2764struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
2666 const struct ieee80211_ops *ops); 2765 const struct ieee80211_ops *ops);
@@ -2673,6 +2772,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
2673 * need to fill the contained wiphy's information. 2772 * need to fill the contained wiphy's information.
2674 * 2773 *
2675 * @hw: the device to register as returned by ieee80211_alloc_hw() 2774 * @hw: the device to register as returned by ieee80211_alloc_hw()
2775 *
2776 * Return: 0 on success. An error code otherwise.
2676 */ 2777 */
2677int ieee80211_register_hw(struct ieee80211_hw *hw); 2778int ieee80211_register_hw(struct ieee80211_hw *hw);
2678 2779
@@ -2719,6 +2820,8 @@ extern char *__ieee80211_create_tpt_led_trigger(
2719 * of the trigger so you can automatically link the LED device. 2820 * of the trigger so you can automatically link the LED device.
2720 * 2821 *
2721 * @hw: the hardware to get the LED trigger name for 2822 * @hw: the hardware to get the LED trigger name for
2823 *
2824 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2722 */ 2825 */
2723static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw) 2826static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw)
2724{ 2827{
@@ -2738,6 +2841,8 @@ static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw)
2738 * of the trigger so you can automatically link the LED device. 2841 * of the trigger so you can automatically link the LED device.
2739 * 2842 *
2740 * @hw: the hardware to get the LED trigger name for 2843 * @hw: the hardware to get the LED trigger name for
2844 *
2845 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2741 */ 2846 */
2742static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw) 2847static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
2743{ 2848{
@@ -2757,6 +2862,8 @@ static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
2757 * of the trigger so you can automatically link the LED device. 2862 * of the trigger so you can automatically link the LED device.
2758 * 2863 *
2759 * @hw: the hardware to get the LED trigger name for 2864 * @hw: the hardware to get the LED trigger name for
2865 *
2866 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2760 */ 2867 */
2761static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw) 2868static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
2762{ 2869{
@@ -2776,6 +2883,8 @@ static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
2776 * of the trigger so you can automatically link the LED device. 2883 * of the trigger so you can automatically link the LED device.
2777 * 2884 *
2778 * @hw: the hardware to get the LED trigger name for 2885 * @hw: the hardware to get the LED trigger name for
2886 *
2887 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2779 */ 2888 */
2780static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) 2889static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
2781{ 2890{
@@ -2793,9 +2902,10 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
2793 * @blink_table: the blink table -- needs to be ordered by throughput 2902 * @blink_table: the blink table -- needs to be ordered by throughput
2794 * @blink_table_len: size of the blink table 2903 * @blink_table_len: size of the blink table
2795 * 2904 *
2796 * This function returns %NULL (in case of error, or if no LED 2905 * Return: %NULL (in case of error, or if no LED triggers are
2797 * triggers are configured) or the name of the new trigger. 2906 * configured) or the name of the new trigger.
2798 * This function must be called before ieee80211_register_hw(). 2907 *
2908 * Note: This function must be called before ieee80211_register_hw().
2799 */ 2909 */
2800static inline char * 2910static inline char *
2801ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, 2911ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags,
@@ -2928,10 +3038,10 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw,
2928 * Calls to this function for a single hardware must be synchronized against 3038 * Calls to this function for a single hardware must be synchronized against
2929 * each other. 3039 * each other.
2930 * 3040 *
2931 * The function returns -EINVAL when the requested PS mode is already set.
2932 *
2933 * @sta: currently connected sta 3041 * @sta: currently connected sta
2934 * @start: start or stop PS 3042 * @start: start or stop PS
3043 *
3044 * Return: 0 on success. -EINVAL when the requested PS mode is already set.
2935 */ 3045 */
2936int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start); 3046int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
2937 3047
@@ -2945,6 +3055,8 @@ int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
2945 * 3055 *
2946 * @sta: currently connected sta 3056 * @sta: currently connected sta
2947 * @start: start or stop PS 3057 * @start: start or stop PS
3058 *
3059 * Return: Like ieee80211_sta_ps_transition().
2948 */ 3060 */
2949static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, 3061static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
2950 bool start) 3062 bool start)
@@ -3082,6 +3194,8 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);
3082 * according to the current DTIM parameters/TIM bitmap. 3194 * according to the current DTIM parameters/TIM bitmap.
3083 * 3195 *
3084 * The driver is responsible for freeing the returned skb. 3196 * The driver is responsible for freeing the returned skb.
3197 *
3198 * Return: The beacon template. %NULL on error.
3085 */ 3199 */
3086struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, 3200struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
3087 struct ieee80211_vif *vif, 3201 struct ieee80211_vif *vif,
@@ -3093,6 +3207,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
3093 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3207 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3094 * 3208 *
3095 * See ieee80211_beacon_get_tim(). 3209 * See ieee80211_beacon_get_tim().
3210 *
3211 * Return: See ieee80211_beacon_get_tim().
3096 */ 3212 */
3097static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 3213static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3098 struct ieee80211_vif *vif) 3214 struct ieee80211_vif *vif)
@@ -3109,6 +3225,8 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3109 * hardware. The destination address should be set by the caller. 3225 * hardware. The destination address should be set by the caller.
3110 * 3226 *
3111 * Can only be called in AP mode. 3227 * Can only be called in AP mode.
3228 *
3229 * Return: The Probe Response template. %NULL on error.
3112 */ 3230 */
3113struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw, 3231struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
3114 struct ieee80211_vif *vif); 3232 struct ieee80211_vif *vif);
@@ -3124,6 +3242,8 @@ struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
3124 * 3242 *
3125 * Note: Caller (or hardware) is responsible for setting the 3243 * Note: Caller (or hardware) is responsible for setting the
3126 * &IEEE80211_FCTL_PM bit. 3244 * &IEEE80211_FCTL_PM bit.
3245 *
3246 * Return: The PS Poll template. %NULL on error.
3127 */ 3247 */
3128struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, 3248struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
3129 struct ieee80211_vif *vif); 3249 struct ieee80211_vif *vif);
@@ -3139,6 +3259,8 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
3139 * 3259 *
3140 * Note: Caller (or hardware) is responsible for setting the 3260 * Note: Caller (or hardware) is responsible for setting the
3141 * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields. 3261 * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
3262 *
3263 * Return: The nullfunc template. %NULL on error.
3142 */ 3264 */
3143struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw, 3265struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
3144 struct ieee80211_vif *vif); 3266 struct ieee80211_vif *vif);
@@ -3153,6 +3275,8 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
3153 * 3275 *
3154 * Creates a Probe Request template which can, for example, be uploaded to 3276 * Creates a Probe Request template which can, for example, be uploaded to
3155 * hardware. 3277 * hardware.
3278 *
3279 * Return: The Probe Request template. %NULL on error.
3156 */ 3280 */
3157struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, 3281struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
3158 struct ieee80211_vif *vif, 3282 struct ieee80211_vif *vif,
@@ -3188,6 +3312,8 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3188 * If the RTS is generated in firmware, but the host system must provide 3312 * If the RTS is generated in firmware, but the host system must provide
3189 * the duration field, the low-level driver uses this function to receive 3313 * the duration field, the low-level driver uses this function to receive
3190 * the duration field value in little-endian byteorder. 3314 * the duration field value in little-endian byteorder.
3315 *
3316 * Return: The duration.
3191 */ 3317 */
3192__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, 3318__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
3193 struct ieee80211_vif *vif, size_t frame_len, 3319 struct ieee80211_vif *vif, size_t frame_len,
@@ -3223,6 +3349,8 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
3223 * If the CTS-to-self is generated in firmware, but the host system must provide 3349 * If the CTS-to-self is generated in firmware, but the host system must provide
3224 * the duration field, the low-level driver uses this function to receive 3350 * the duration field, the low-level driver uses this function to receive
3225 * the duration field value in little-endian byteorder. 3351 * the duration field value in little-endian byteorder.
3352 *
3353 * Return: The duration.
3226 */ 3354 */
3227__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, 3355__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
3228 struct ieee80211_vif *vif, 3356 struct ieee80211_vif *vif,
@@ -3239,6 +3367,8 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
3239 * 3367 *
3240 * Calculate the duration field of some generic frame, given its 3368 * Calculate the duration field of some generic frame, given its
3241 * length and transmission rate (in 100kbps). 3369 * length and transmission rate (in 100kbps).
3370 *
3371 * Return: The duration.
3242 */ 3372 */
3243__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, 3373__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
3244 struct ieee80211_vif *vif, 3374 struct ieee80211_vif *vif,
@@ -3255,9 +3385,10 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
3255 * hardware/firmware does not implement buffering of broadcast/multicast 3385 * hardware/firmware does not implement buffering of broadcast/multicast
3256 * frames when power saving is used, 802.11 code buffers them in the host 3386 * frames when power saving is used, 802.11 code buffers them in the host
3257 * memory. The low-level driver uses this function to fetch next buffered 3387 * memory. The low-level driver uses this function to fetch next buffered
3258 * frame. In most cases, this is used when generating beacon frame. This 3388 * frame. In most cases, this is used when generating beacon frame.
3259 * function returns a pointer to the next buffered skb or NULL if no more 3389 *
3260 * buffered frames are available. 3390 * Return: A pointer to the next buffered skb or NULL if no more buffered
3391 * frames are available.
3261 * 3392 *
3262 * Note: buffered frames are returned only after DTIM beacon frame was 3393 * Note: buffered frames are returned only after DTIM beacon frame was
3263 * generated with ieee80211_beacon_get() and the low-level driver must thus 3394 * generated with ieee80211_beacon_get() and the low-level driver must thus
@@ -3437,6 +3568,8 @@ void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
3437 * @queue: queue number (counted from zero). 3568 * @queue: queue number (counted from zero).
3438 * 3569 *
3439 * Drivers should use this function instead of netif_stop_queue. 3570 * Drivers should use this function instead of netif_stop_queue.
3571 *
3572 * Return: %true if the queue is stopped. %false otherwise.
3440 */ 3573 */
3441 3574
3442int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue); 3575int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue);
@@ -3634,7 +3767,9 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra,
3634 * @vif: virtual interface to look for station on 3767 * @vif: virtual interface to look for station on
3635 * @addr: station's address 3768 * @addr: station's address
3636 * 3769 *
3637 * This function must be called under RCU lock and the 3770 * Return: The station, if found. %NULL otherwise.
3771 *
3772 * Note: This function must be called under RCU lock and the
3638 * resulting pointer is only valid under RCU lock as well. 3773 * resulting pointer is only valid under RCU lock as well.
3639 */ 3774 */
3640struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, 3775struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
@@ -3647,7 +3782,9 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
3647 * @addr: remote station's address 3782 * @addr: remote station's address
3648 * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. 3783 * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'.
3649 * 3784 *
3650 * This function must be called under RCU lock and the 3785 * Return: The station, if found. %NULL otherwise.
3786 *
3787 * Note: This function must be called under RCU lock and the
3651 * resulting pointer is only valid under RCU lock as well. 3788 * resulting pointer is only valid under RCU lock as well.
3652 * 3789 *
3653 * NOTE: You may pass NULL for localaddr, but then you will just get 3790 * NOTE: You may pass NULL for localaddr, but then you will just get
@@ -3754,6 +3891,11 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
3754 * The iterator will not find a context that's being added (during 3891 * The iterator will not find a context that's being added (during
3755 * the driver callback to add it) but will find it while it's being 3892 * the driver callback to add it) but will find it while it's being
3756 * removed. 3893 * removed.
3894 *
3895 * Note that during hardware restart, all contexts that existed
3896 * before the restart are considered already present so will be
3897 * found while iterating, whether they've been re-added already
3898 * or not.
3757 */ 3899 */
3758void ieee80211_iter_chan_contexts_atomic( 3900void ieee80211_iter_chan_contexts_atomic(
3759 struct ieee80211_hw *hw, 3901 struct ieee80211_hw *hw,
@@ -3772,7 +3914,9 @@ void ieee80211_iter_chan_contexts_atomic(
3772 * information. This function must only be called from within the 3914 * information. This function must only be called from within the
3773 * .bss_info_changed callback function and only in managed mode. The function 3915 * .bss_info_changed callback function and only in managed mode. The function
3774 * is only useful when the interface is associated, otherwise it will return 3916 * is only useful when the interface is associated, otherwise it will return
3775 * NULL. 3917 * %NULL.
3918 *
3919 * Return: The Probe Request template. %NULL on error.
3776 */ 3920 */
3777struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, 3921struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
3778 struct ieee80211_vif *vif); 3922 struct ieee80211_vif *vif);
@@ -3796,6 +3940,8 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
3796 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and 3940 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and
3797 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver 3941 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
3798 * needs to inform if the connection to the AP has been lost. 3942 * needs to inform if the connection to the AP has been lost.
3943 * The function may also be called if the connection needs to be terminated
3944 * for some other reason, even if %IEEE80211_HW_CONNECTION_MONITOR isn't set.
3799 * 3945 *
3800 * This function will cause immediate change to disassociated state, 3946 * This function will cause immediate change to disassociated state,
3801 * without connection recovery attempts. 3947 * without connection recovery attempts.
@@ -3826,36 +3972,6 @@ void ieee80211_connection_loss(struct ieee80211_vif *vif);
3826void ieee80211_resume_disconnect(struct ieee80211_vif *vif); 3972void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
3827 3973
3828/** 3974/**
3829 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
3830 *
3831 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3832 *
3833 * Some hardware require full power save to manage simultaneous BT traffic
3834 * on the WLAN frequency. Full PSM is required periodically, whenever there are
3835 * burst of BT traffic. The hardware gets information of BT traffic via
3836 * hardware co-existence lines, and consequentially requests mac80211 to
3837 * (temporarily) enter full psm.
3838 * This function will only temporarily disable dynamic PS, not enable PSM if
3839 * it was not already enabled.
3840 * The driver must make sure to re-enable dynamic PS using
3841 * ieee80211_enable_dyn_ps() if the driver has disabled it.
3842 *
3843 */
3844void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif);
3845
3846/**
3847 * ieee80211_enable_dyn_ps - restore dynamic psm after being disabled
3848 *
3849 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3850 *
3851 * This function restores dynamic PS after being temporarily disabled via
3852 * ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must
3853 * be coupled with an eventual call to this function.
3854 *
3855 */
3856void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif);
3857
3858/**
3859 * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring 3975 * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring
3860 * rssi threshold triggered 3976 * rssi threshold triggered
3861 * 3977 *
@@ -3872,6 +3988,13 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
3872 gfp_t gfp); 3988 gfp_t gfp);
3873 3989
3874/** 3990/**
3991 * ieee80211_radar_detected - inform that a radar was detected
3992 *
3993 * @hw: pointer as obtained from ieee80211_alloc_hw()
3994 */
3995void ieee80211_radar_detected(struct ieee80211_hw *hw);
3996
3997/**
3875 * ieee80211_chswitch_done - Complete channel switch process 3998 * ieee80211_chswitch_done - Complete channel switch process
3876 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3999 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3877 * @success: make the channel switch successful or not 4000 * @success: make the channel switch successful or not
@@ -4119,13 +4242,27 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
4119void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); 4242void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
4120 4243
4121/** 4244/**
4122 * ieee80211_ave_rssi - report the average rssi for the specified interface 4245 * ieee80211_ave_rssi - report the average RSSI for the specified interface
4123 * 4246 *
4124 * @vif: the specified virtual interface 4247 * @vif: the specified virtual interface
4125 * 4248 *
4126 * This function return the average rssi value for the requested interface. 4249 * Note: This function assumes that the given vif is valid.
4127 * It assumes that the given vif is valid. 4250 *
4251 * Return: The average RSSI value for the requested interface, or 0 if not
4252 * applicable.
4128 */ 4253 */
4129int ieee80211_ave_rssi(struct ieee80211_vif *vif); 4254int ieee80211_ave_rssi(struct ieee80211_vif *vif);
4130 4255
4256/**
4257 * ieee80211_report_wowlan_wakeup - report WoWLAN wakeup
4258 * @vif: virtual interface
4259 * @wakeup: wakeup reason(s)
4260 * @gfp: allocation flags
4261 *
4262 * See cfg80211_report_wowlan_wakeup().
4263 */
4264void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif,
4265 struct cfg80211_wowlan_wakeup *wakeup,
4266 gfp_t gfp);
4267
4131#endif /* MAC80211_H */ 4268#endif /* MAC80211_H */