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.h294
1 files changed, 262 insertions, 32 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9259e97864d7..dc1123aa8181 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -16,7 +16,6 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/if_ether.h> 17#include <linux/if_ether.h>
18#include <linux/skbuff.h> 18#include <linux/skbuff.h>
19#include <linux/wireless.h>
20#include <linux/device.h> 19#include <linux/device.h>
21#include <linux/ieee80211.h> 20#include <linux/ieee80211.h>
22#include <net/cfg80211.h> 21#include <net/cfg80211.h>
@@ -110,6 +109,7 @@ enum ieee80211_ac_numbers {
110 IEEE80211_AC_BE = 2, 109 IEEE80211_AC_BE = 2,
111 IEEE80211_AC_BK = 3, 110 IEEE80211_AC_BK = 3,
112}; 111};
112#define IEEE80211_NUM_ACS 4
113 113
114/** 114/**
115 * struct ieee80211_tx_queue_params - transmit queue configuration 115 * struct ieee80211_tx_queue_params - transmit queue configuration
@@ -165,13 +165,14 @@ struct ieee80211_low_level_stats {
165 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note 165 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
166 * that it is only ever disabled for station mode. 166 * that it is only ever disabled for station mode.
167 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. 167 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
168 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode)
168 */ 169 */
169enum ieee80211_bss_change { 170enum ieee80211_bss_change {
170 BSS_CHANGED_ASSOC = 1<<0, 171 BSS_CHANGED_ASSOC = 1<<0,
171 BSS_CHANGED_ERP_CTS_PROT = 1<<1, 172 BSS_CHANGED_ERP_CTS_PROT = 1<<1,
172 BSS_CHANGED_ERP_PREAMBLE = 1<<2, 173 BSS_CHANGED_ERP_PREAMBLE = 1<<2,
173 BSS_CHANGED_ERP_SLOT = 1<<3, 174 BSS_CHANGED_ERP_SLOT = 1<<3,
174 BSS_CHANGED_HT = 1<<4, 175 BSS_CHANGED_HT = 1<<4,
175 BSS_CHANGED_BASIC_RATES = 1<<5, 176 BSS_CHANGED_BASIC_RATES = 1<<5,
176 BSS_CHANGED_BEACON_INT = 1<<6, 177 BSS_CHANGED_BEACON_INT = 1<<6,
177 BSS_CHANGED_BSSID = 1<<7, 178 BSS_CHANGED_BSSID = 1<<7,
@@ -182,6 +183,7 @@ enum ieee80211_bss_change {
182 BSS_CHANGED_ARP_FILTER = 1<<12, 183 BSS_CHANGED_ARP_FILTER = 1<<12,
183 BSS_CHANGED_QOS = 1<<13, 184 BSS_CHANGED_QOS = 1<<13,
184 BSS_CHANGED_IDLE = 1<<14, 185 BSS_CHANGED_IDLE = 1<<14,
186 BSS_CHANGED_SSID = 1<<15,
185 187
186 /* when adding here, make sure to change ieee80211_reconfig */ 188 /* when adding here, make sure to change ieee80211_reconfig */
187}; 189};
@@ -255,6 +257,9 @@ enum ieee80211_rssi_event {
255 * @idle: This interface is idle. There's also a global idle flag in the 257 * @idle: This interface is idle. There's also a global idle flag in the
256 * hardware config which may be more appropriate depending on what 258 * hardware config which may be more appropriate depending on what
257 * your driver/device needs to do. 259 * your driver/device needs to do.
260 * @ssid: The SSID of the current vif. Only valid in AP-mode.
261 * @ssid_len: Length of SSID given in @ssid.
262 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
258 */ 263 */
259struct ieee80211_bss_conf { 264struct ieee80211_bss_conf {
260 const u8 *bssid; 265 const u8 *bssid;
@@ -281,6 +286,9 @@ struct ieee80211_bss_conf {
281 bool arp_filter_enabled; 286 bool arp_filter_enabled;
282 bool qos; 287 bool qos;
283 bool idle; 288 bool idle;
289 u8 ssid[IEEE80211_MAX_SSID_LEN];
290 size_t ssid_len;
291 bool hidden_ssid;
284}; 292};
285 293
286/** 294/**
@@ -331,9 +339,9 @@ struct ieee80211_bss_conf {
331 * used to indicate that a frame was already retried due to PS 339 * used to indicate that a frame was already retried due to PS
332 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, 340 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
333 * used to indicate frame should not be encrypted 341 * used to indicate frame should not be encrypted
334 * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?) 342 * @IEEE80211_TX_CTL_POLL_RESPONSE: This frame is a response to a poll
335 * This frame is a response to a PS-poll frame and should be sent 343 * frame (PS-Poll or uAPSD) and should be sent although the station
336 * although the station is in powersave mode. 344 * is in powersave mode.
337 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the 345 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
338 * transmit function after the current frame, this can be used 346 * transmit function after the current frame, this can be used
339 * by drivers to kick the DMA queue only if unset or when the 347 * by drivers to kick the DMA queue only if unset or when the
@@ -341,8 +349,6 @@ struct ieee80211_bss_conf {
341 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted 349 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
342 * after TX status because the destination was asleep, it must not 350 * after TX status because the destination was asleep, it must not
343 * be modified again (no seqno assignment, crypto, etc.) 351 * be modified again (no seqno assignment, crypto, etc.)
344 * @IEEE80211_TX_INTFL_HAS_RADIOTAP: This frame was injected and still
345 * has a radiotap header at skb->data.
346 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 352 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
347 * MLME command (internal to mac80211 to figure out whether to send TX 353 * MLME command (internal to mac80211 to figure out whether to send TX
348 * status to user space) 354 * status to user space)
@@ -356,6 +362,20 @@ struct ieee80211_bss_conf {
356 * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP 362 * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP
357 * testing. It will be sent out with incorrect Michael MIC key to allow 363 * testing. It will be sent out with incorrect Michael MIC key to allow
358 * TKIP countermeasures to be tested. 364 * TKIP countermeasures to be tested.
365 * @IEEE80211_TX_CTL_NO_CCK_RATE: This frame will be sent at non CCK rate.
366 * This flag is actually used for management frame especially for P2P
367 * frames not being sent at CCK rate in 2GHz band.
368 * @IEEE80211_TX_STATUS_EOSP: This packet marks the end of service period,
369 * when its status is reported the service period ends. For frames in
370 * an SP that mac80211 transmits, it is already set; for driver frames
371 * the driver may set this flag. It is also used to do the same for
372 * PS-Poll responses.
373 * @IEEE80211_TX_CTL_USE_MINRATE: This frame will be sent at lowest rate.
374 * This flag is used to send nullfunc frame at minimum rate when
375 * the nullfunc is used for connection monitoring purpose.
376 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
377 * would be fragmented by size (this is optional, only used for
378 * monitor injection).
359 * 379 *
360 * Note: If you have to add new flags to the enumeration, then don't 380 * Note: If you have to add new flags to the enumeration, then don't
361 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 381 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -377,15 +397,19 @@ enum mac80211_tx_control_flags {
377 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 397 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
378 IEEE80211_TX_INTFL_RETRIED = BIT(15), 398 IEEE80211_TX_INTFL_RETRIED = BIT(15),
379 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 399 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
380 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), 400 IEEE80211_TX_CTL_POLL_RESPONSE = BIT(17),
381 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 401 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
382 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 402 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
383 IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), 403 /* hole at 20, use later */
384 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), 404 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
385 IEEE80211_TX_CTL_LDPC = BIT(22), 405 IEEE80211_TX_CTL_LDPC = BIT(22),
386 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), 406 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
387 IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), 407 IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25),
388 IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), 408 IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26),
409 IEEE80211_TX_CTL_NO_CCK_RATE = BIT(27),
410 IEEE80211_TX_STATUS_EOSP = BIT(28),
411 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),
412 IEEE80211_TX_CTL_DONTFRAG = BIT(30),
389}; 413};
390 414
391#define IEEE80211_TX_CTL_STBC_SHIFT 23 415#define IEEE80211_TX_CTL_STBC_SHIFT 23
@@ -399,9 +423,9 @@ enum mac80211_tx_control_flags {
399 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ 423 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \
400 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ 424 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \
401 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ 425 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \
402 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ 426 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_POLL_RESPONSE | \
403 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ 427 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \
404 IEEE80211_TX_CTL_STBC) 428 IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP)
405 429
406/** 430/**
407 * enum mac80211_rate_control_flags - per-rate flags set by the 431 * enum mac80211_rate_control_flags - per-rate flags set by the
@@ -948,6 +972,9 @@ enum set_key_cmd {
948 * @wme: indicates whether the STA supports WME. Only valid during AP-mode. 972 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
949 * @drv_priv: data area for driver use, will always be aligned to 973 * @drv_priv: data area for driver use, will always be aligned to
950 * sizeof(void *), size is determined in hw information. 974 * sizeof(void *), size is determined in hw information.
975 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
976 * if wme is supported.
977 * @max_sp: max Service Period. Only valid if wme is supported.
951 */ 978 */
952struct ieee80211_sta { 979struct ieee80211_sta {
953 u32 supp_rates[IEEE80211_NUM_BANDS]; 980 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -955,6 +982,8 @@ struct ieee80211_sta {
955 u16 aid; 982 u16 aid;
956 struct ieee80211_sta_ht_cap ht_cap; 983 struct ieee80211_sta_ht_cap ht_cap;
957 bool wme; 984 bool wme;
985 u8 uapsd_queues;
986 u8 max_sp;
958 987
959 /* must be last */ 988 /* must be last */
960 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 989 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -1095,6 +1124,10 @@ enum sta_notify_cmd {
1095 * stations based on the PM bit of incoming frames. 1124 * stations based on the PM bit of incoming frames.
1096 * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure 1125 * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure
1097 * the PS mode of connected stations. 1126 * the PS mode of connected stations.
1127 *
1128 * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
1129 * setup strictly in HW. mac80211 should not attempt to do this in
1130 * software.
1098 */ 1131 */
1099enum ieee80211_hw_flags { 1132enum ieee80211_hw_flags {
1100 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1133 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1120,6 +1153,7 @@ enum ieee80211_hw_flags {
1120 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, 1153 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20,
1121 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1154 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1122 IEEE80211_HW_AP_LINK_PS = 1<<22, 1155 IEEE80211_HW_AP_LINK_PS = 1<<22,
1156 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1123}; 1157};
1124 1158
1125/** 1159/**
@@ -1511,6 +1545,95 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1511 */ 1545 */
1512 1546
1513/** 1547/**
1548 * DOC: AP support for powersaving clients
1549 *
1550 * In order to implement AP and P2P GO modes, mac80211 has support for
1551 * client powersaving, both "legacy" PS (PS-Poll/null data) and uAPSD.
1552 * There currently is no support for sAPSD.
1553 *
1554 * There is one assumption that mac80211 makes, namely that a client
1555 * will not poll with PS-Poll and trigger with uAPSD at the same time.
1556 * Both are supported, and both can be used by the same client, but
1557 * they can't be used concurrently by the same client. This simplifies
1558 * the driver code.
1559 *
1560 * The first thing to keep in mind is that there is a flag for complete
1561 * driver implementation: %IEEE80211_HW_AP_LINK_PS. If this flag is set,
1562 * mac80211 expects the driver to handle most of the state machine for
1563 * powersaving clients and will ignore the PM bit in incoming frames.
1564 * Drivers then use ieee80211_sta_ps_transition() to inform mac80211 of
1565 * stations' powersave transitions. In this mode, mac80211 also doesn't
1566 * handle PS-Poll/uAPSD.
1567 *
1568 * In the mode without %IEEE80211_HW_AP_LINK_PS, mac80211 will check the
1569 * PM bit in incoming frames for client powersave transitions. When a
1570 * station goes to sleep, we will stop transmitting to it. There is,
1571 * however, a race condition: a station might go to sleep while there is
1572 * data buffered on hardware queues. If the device has support for this
1573 * it will reject frames, and the driver should give the frames back to
1574 * mac80211 with the %IEEE80211_TX_STAT_TX_FILTERED flag set which will
1575 * cause mac80211 to retry the frame when the station wakes up. The
1576 * driver is also notified of powersave transitions by calling its
1577 * @sta_notify callback.
1578 *
1579 * When the station is asleep, it has three choices: it can wake up,
1580 * it can PS-Poll, or it can possibly start a uAPSD service period.
1581 * Waking up is implemented by simply transmitting all buffered (and
1582 * filtered) frames to the station. This is the easiest case. When
1583 * the station sends a PS-Poll or a uAPSD trigger frame, mac80211
1584 * will inform the driver of this with the @allow_buffered_frames
1585 * callback; this callback is optional. mac80211 will then transmit
1586 * the frames as usual and set the %IEEE80211_TX_CTL_POLL_RESPONSE
1587 * on each frame. The last frame in the service period (or the only
1588 * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to
1589 * indicate that it ends the service period; as this frame must have
1590 * TX status report it also sets %IEEE80211_TX_CTL_REQ_TX_STATUS.
1591 * When TX status is reported for this frame, the service period is
1592 * marked has having ended and a new one can be started by the peer.
1593 *
1594 * Another race condition can happen on some devices like iwlwifi
1595 * when there are frames queued for the station and it wakes up
1596 * or polls; the frames that are already queued could end up being
1597 * transmitted first instead, causing reordering and/or wrong
1598 * processing of the EOSP. The cause is that allowing frames to be
1599 * transmitted to a certain station is out-of-band communication to
1600 * the device. To allow this problem to be solved, the driver can
1601 * call ieee80211_sta_block_awake() if frames are buffered when it
1602 * is notified that the station went to sleep. When all these frames
1603 * have been filtered (see above), it must call the function again
1604 * to indicate that the station is no longer blocked.
1605 *
1606 * If the driver buffers frames in the driver for aggregation in any
1607 * way, it must use the ieee80211_sta_set_buffered() call when it is
1608 * notified of the station going to sleep to inform mac80211 of any
1609 * TIDs that have frames buffered. Note that when a station wakes up
1610 * this information is reset (hence the requirement to call it when
1611 * informed of the station going to sleep). Then, when a service
1612 * period starts for any reason, @release_buffered_frames is called
1613 * with the number of frames to be released and which TIDs they are
1614 * to come from. In this case, the driver is responsible for setting
1615 * the EOSP (for uAPSD) and MORE_DATA bits in the released frames,
1616 * to help the @more_data paramter is passed to tell the driver if
1617 * there is more data on other TIDs -- the TIDs to release frames
1618 * from are ignored since mac80211 doesn't know how many frames the
1619 * buffers for those TIDs contain.
1620 *
1621 * If the driver also implement GO mode, where absence periods may
1622 * shorten service periods (or abort PS-Poll responses), it must
1623 * filter those response frames except in the case of frames that
1624 * are buffered in the driver -- those must remain buffered to avoid
1625 * reordering. Because it is possible that no frames are released
1626 * in this case, the driver must call ieee80211_sta_eosp_irqsafe()
1627 * to indicate to mac80211 that the service period ended anyway.
1628 *
1629 * Finally, if frames from multiple TIDs are released from mac80211
1630 * but the driver might reorder them, it must clear & set the flags
1631 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP)
1632 * and also take care of the EOSP and MORE_DATA bits in the frame.
1633 * The driver may also use ieee80211_sta_eosp_irqsafe() in this case.
1634 */
1635
1636/**
1514 * enum ieee80211_filter_flags - hardware filter flags 1637 * enum ieee80211_filter_flags - hardware filter flags
1515 * 1638 *
1516 * These flags determine what the filter in hardware should be 1639 * These flags determine what the filter in hardware should be
@@ -1600,6 +1723,17 @@ enum ieee80211_tx_sync_type {
1600}; 1723};
1601 1724
1602/** 1725/**
1726 * enum ieee80211_frame_release_type - frame release reason
1727 * @IEEE80211_FRAME_RELEASE_PSPOLL: frame released for PS-Poll
1728 * @IEEE80211_FRAME_RELEASE_UAPSD: frame(s) released due to
1729 * frame received on trigger-enabled AC
1730 */
1731enum ieee80211_frame_release_type {
1732 IEEE80211_FRAME_RELEASE_PSPOLL,
1733 IEEE80211_FRAME_RELEASE_UAPSD,
1734};
1735
1736/**
1603 * struct ieee80211_ops - callbacks from mac80211 to the driver 1737 * struct ieee80211_ops - callbacks from mac80211 to the driver
1604 * 1738 *
1605 * This structure contains various callbacks that the driver may 1739 * This structure contains various callbacks that the driver may
@@ -1896,11 +2030,6 @@ enum ieee80211_tx_sync_type {
1896 * ieee80211_remain_on_channel_expired(). This callback may sleep. 2030 * ieee80211_remain_on_channel_expired(). This callback may sleep.
1897 * @cancel_remain_on_channel: Requests that an ongoing off-channel period is 2031 * @cancel_remain_on_channel: Requests that an ongoing off-channel period is
1898 * aborted before it expires. This callback may sleep. 2032 * aborted before it expires. This callback may sleep.
1899 * @offchannel_tx: Transmit frame on another channel, wait for a response
1900 * and return. Reliable TX status must be reported for the frame. If the
1901 * return value is 1, then the @remain_on_channel will be used with a
1902 * regular transmission (if supported.)
1903 * @offchannel_tx_cancel_wait: cancel wait associated with offchannel TX
1904 * 2033 *
1905 * @set_ringparam: Set tx and rx ring sizes. 2034 * @set_ringparam: Set tx and rx ring sizes.
1906 * 2035 *
@@ -1914,6 +2043,45 @@ enum ieee80211_tx_sync_type {
1914 * The callback can sleep. 2043 * The callback can sleep.
1915 * @rssi_callback: Notify driver when the average RSSI goes above/below 2044 * @rssi_callback: Notify driver when the average RSSI goes above/below
1916 * thresholds that were registered previously. The callback can sleep. 2045 * thresholds that were registered previously. The callback can sleep.
2046 *
2047 * @release_buffered_frames: Release buffered frames according to the given
2048 * parameters. In the case where the driver buffers some frames for
2049 * sleeping stations mac80211 will use this callback to tell the driver
2050 * to release some frames, either for PS-poll or uAPSD.
2051 * Note that if the @more_data paramter is %false the driver must check
2052 * if there are more frames on the given TIDs, and if there are more than
2053 * the frames being released then it must still set the more-data bit in
2054 * the frame. If the @more_data parameter is %true, then of course the
2055 * more-data bit must always be set.
2056 * The @tids parameter tells the driver which TIDs to release frames
2057 * from, for PS-poll it will always have only a single bit set.
2058 * In the case this is used for a PS-poll initiated release, the
2059 * @num_frames parameter will always be 1 so code can be shared. In
2060 * this case the driver must also set %IEEE80211_TX_STATUS_EOSP flag
2061 * on the TX status (and must report TX status) so that the PS-poll
2062 * period is properly ended. This is used to avoid sending multiple
2063 * responses for a retried PS-poll frame.
2064 * In the case this is used for uAPSD, the @num_frames parameter may be
2065 * bigger than one, but the driver may send fewer frames (it must send
2066 * at least one, however). In this case it is also responsible for
2067 * setting the EOSP flag in the QoS header of the frames. Also, when the
2068 * service period ends, the driver must set %IEEE80211_TX_STATUS_EOSP
2069 * on the last frame in the SP. Alternatively, it may call the function
2070 * ieee80211_sta_eosp_irqsafe() to inform mac80211 of the end of the SP.
2071 * This callback must be atomic.
2072 * @allow_buffered_frames: Prepare device to allow the given number of frames
2073 * to go out to the given station. The frames will be sent by mac80211
2074 * via the usual TX path after this call. The TX information for frames
2075 * released will also have the %IEEE80211_TX_CTL_POLL_RESPONSE flag set
2076 * and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case
2077 * frames from multiple TIDs are released and the driver might reorder
2078 * them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag
2079 * on the last frame and clear it on all others and also handle the EOSP
2080 * bit in the QoS header correctly. Alternatively, it can also call the
2081 * ieee80211_sta_eosp_irqsafe() function.
2082 * The @tids parameter is a bitmap and tells the driver which TIDs the
2083 * frames will be on; it will at most have two bits set.
2084 * This callback must be atomic.
1917 */ 2085 */
1918struct ieee80211_ops { 2086struct ieee80211_ops {
1919 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 2087 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1986,11 +2154,13 @@ struct ieee80211_ops {
1986 struct ieee80211_sta *sta); 2154 struct ieee80211_sta *sta);
1987 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2155 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1988 enum sta_notify_cmd, struct ieee80211_sta *sta); 2156 enum sta_notify_cmd, struct ieee80211_sta *sta);
1989 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 2157 int (*conf_tx)(struct ieee80211_hw *hw,
2158 struct ieee80211_vif *vif, u16 queue,
1990 const struct ieee80211_tx_queue_params *params); 2159 const struct ieee80211_tx_queue_params *params);
1991 u64 (*get_tsf)(struct ieee80211_hw *hw); 2160 u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1992 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); 2161 void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1993 void (*reset_tsf)(struct ieee80211_hw *hw); 2162 u64 tsf);
2163 void (*reset_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1994 int (*tx_last_beacon)(struct ieee80211_hw *hw); 2164 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1995 int (*ampdu_action)(struct ieee80211_hw *hw, 2165 int (*ampdu_action)(struct ieee80211_hw *hw,
1996 struct ieee80211_vif *vif, 2166 struct ieee80211_vif *vif,
@@ -2019,11 +2189,6 @@ struct ieee80211_ops {
2019 enum nl80211_channel_type channel_type, 2189 enum nl80211_channel_type channel_type,
2020 int duration); 2190 int duration);
2021 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); 2191 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
2022 int (*offchannel_tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
2023 struct ieee80211_channel *chan,
2024 enum nl80211_channel_type channel_type,
2025 unsigned int wait);
2026 int (*offchannel_tx_cancel_wait)(struct ieee80211_hw *hw);
2027 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); 2192 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
2028 void (*get_ringparam)(struct ieee80211_hw *hw, 2193 void (*get_ringparam)(struct ieee80211_hw *hw,
2029 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); 2194 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
@@ -2032,6 +2197,17 @@ struct ieee80211_ops {
2032 const struct cfg80211_bitrate_mask *mask); 2197 const struct cfg80211_bitrate_mask *mask);
2033 void (*rssi_callback)(struct ieee80211_hw *hw, 2198 void (*rssi_callback)(struct ieee80211_hw *hw,
2034 enum ieee80211_rssi_event rssi_event); 2199 enum ieee80211_rssi_event rssi_event);
2200
2201 void (*allow_buffered_frames)(struct ieee80211_hw *hw,
2202 struct ieee80211_sta *sta,
2203 u16 tids, int num_frames,
2204 enum ieee80211_frame_release_type reason,
2205 bool more_data);
2206 void (*release_buffered_frames)(struct ieee80211_hw *hw,
2207 struct ieee80211_sta *sta,
2208 u16 tids, int num_frames,
2209 enum ieee80211_frame_release_type reason,
2210 bool more_data);
2035}; 2211};
2036 2212
2037/** 2213/**
@@ -2346,20 +2522,38 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
2346 * The TX headroom reserved by mac80211 for its own tx_status functions. 2522 * The TX headroom reserved by mac80211 for its own tx_status functions.
2347 * This is enough for the radiotap header. 2523 * This is enough for the radiotap header.
2348 */ 2524 */
2349#define IEEE80211_TX_STATUS_HEADROOM 13 2525#define IEEE80211_TX_STATUS_HEADROOM 14
2350 2526
2351/** 2527/**
2352 * ieee80211_sta_set_tim - set the TIM bit for a sleeping station 2528 * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
2353 * @sta: &struct ieee80211_sta pointer for the sleeping station 2529 * @sta: &struct ieee80211_sta pointer for the sleeping station
2530 * @tid: the TID that has buffered frames
2531 * @buffered: indicates whether or not frames are buffered for this TID
2354 * 2532 *
2355 * If a driver buffers frames for a powersave station instead of passing 2533 * If a driver buffers frames for a powersave station instead of passing
2356 * them back to mac80211 for retransmission, the station needs to be told 2534 * them back to mac80211 for retransmission, the station may still need
2357 * to wake up using the TIM bitmap in the beacon. 2535 * to be told that there are buffered frames via the TIM bit.
2358 * 2536 *
2359 * This function sets the station's TIM bit - it will be cleared when the 2537 * This function informs mac80211 whether or not there are frames that are
2360 * station wakes up. 2538 * buffered in the driver for a given TID; mac80211 can then use this data
2539 * to set the TIM bit (NOTE: This may call back into the driver's set_tim
2540 * call! Beware of the locking!)
2541 *
2542 * If all frames are released to the station (due to PS-poll or uAPSD)
2543 * then the driver needs to inform mac80211 that there no longer are
2544 * frames buffered. However, when the station wakes up mac80211 assumes
2545 * that all buffered frames will be transmitted and clears this data,
2546 * drivers need to make sure they inform mac80211 about all buffered
2547 * frames on the sleep transition (sta_notify() with %STA_NOTIFY_SLEEP).
2548 *
2549 * Note that technically mac80211 only needs to know this per AC, not per
2550 * TID, but since driver buffering will inevitably happen per TID (since
2551 * it is related to aggregation) it is easier to make mac80211 map the
2552 * TID to the AC as required instead of keeping track in all drivers that
2553 * use this API.
2361 */ 2554 */
2362void ieee80211_sta_set_tim(struct ieee80211_sta *sta); 2555void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
2556 u8 tid, bool buffered);
2363 2557
2364/** 2558/**
2365 * ieee80211_tx_status - transmit status callback 2559 * ieee80211_tx_status - transmit status callback
@@ -3017,6 +3211,24 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
3017 struct ieee80211_sta *pubsta, bool block); 3211 struct ieee80211_sta *pubsta, bool block);
3018 3212
3019/** 3213/**
3214 * ieee80211_sta_eosp - notify mac80211 about end of SP
3215 * @pubsta: the station
3216 *
3217 * When a device transmits frames in a way that it can't tell
3218 * mac80211 in the TX status about the EOSP, it must clear the
3219 * %IEEE80211_TX_STATUS_EOSP bit and call this function instead.
3220 * This applies for PS-Poll as well as uAPSD.
3221 *
3222 * Note that there is no non-_irqsafe version right now as
3223 * it wasn't needed, but just like _tx_status() and _rx()
3224 * must not be mixed in irqsafe/non-irqsafe versions, this
3225 * function must not be mixed with those either. Use the
3226 * all irqsafe, or all non-irqsafe, don't mix! If you need
3227 * the non-irqsafe version of this, you need to add it.
3228 */
3229void ieee80211_sta_eosp_irqsafe(struct ieee80211_sta *pubsta);
3230
3231/**
3020 * ieee80211_iter_keys - iterate keys programmed into the device 3232 * ieee80211_iter_keys - iterate keys programmed into the device
3021 * @hw: pointer obtained from ieee80211_alloc_hw() 3233 * @hw: pointer obtained from ieee80211_alloc_hw()
3022 * @vif: virtual interface to iterate, may be %NULL for all 3234 * @vif: virtual interface to iterate, may be %NULL for all
@@ -3229,6 +3441,19 @@ void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
3229void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap, 3441void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
3230 const u8 *addr); 3442 const u8 *addr);
3231 3443
3444/**
3445 * ieee80211_send_bar - send a BlockAckReq frame
3446 *
3447 * can be used to flush pending frames from the peer's aggregation reorder
3448 * buffer.
3449 *
3450 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3451 * @ra: the peer's destination address
3452 * @tid: the TID of the aggregation session
3453 * @ssn: the new starting sequence number for the receiver
3454 */
3455void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn);
3456
3232/* Rate control API */ 3457/* Rate control API */
3233 3458
3234/** 3459/**
@@ -3419,4 +3644,9 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3419 int rssi_max_thold); 3644 int rssi_max_thold);
3420 3645
3421void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); 3646void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3647
3648int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb);
3649
3650int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif,
3651 struct sk_buff *skb);
3422#endif /* MAC80211_H */ 3652#endif /* MAC80211_H */