diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 266 |
1 files changed, 207 insertions, 59 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 45d7d44d7cbe..b0787a1dea90 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -144,6 +144,11 @@ struct ieee80211_low_level_stats { | |||
144 | * new beacon (beaconing modes) | 144 | * new beacon (beaconing modes) |
145 | * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be | 145 | * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be |
146 | * enabled/disabled (beaconing modes) | 146 | * enabled/disabled (beaconing modes) |
147 | * @BSS_CHANGED_CQM: Connection quality monitor config changed | ||
148 | * @BSS_CHANGED_IBSS: IBSS join status changed | ||
149 | * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. | ||
150 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | ||
151 | * that it is only ever disabled for station mode. | ||
147 | */ | 152 | */ |
148 | enum ieee80211_bss_change { | 153 | enum ieee80211_bss_change { |
149 | BSS_CHANGED_ASSOC = 1<<0, | 154 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -156,8 +161,21 @@ enum ieee80211_bss_change { | |||
156 | BSS_CHANGED_BSSID = 1<<7, | 161 | BSS_CHANGED_BSSID = 1<<7, |
157 | BSS_CHANGED_BEACON = 1<<8, | 162 | BSS_CHANGED_BEACON = 1<<8, |
158 | BSS_CHANGED_BEACON_ENABLED = 1<<9, | 163 | BSS_CHANGED_BEACON_ENABLED = 1<<9, |
164 | BSS_CHANGED_CQM = 1<<10, | ||
165 | BSS_CHANGED_IBSS = 1<<11, | ||
166 | BSS_CHANGED_ARP_FILTER = 1<<12, | ||
167 | BSS_CHANGED_QOS = 1<<13, | ||
168 | |||
169 | /* when adding here, make sure to change ieee80211_reconfig */ | ||
159 | }; | 170 | }; |
160 | 171 | ||
172 | /* | ||
173 | * The maximum number of IPv4 addresses listed for ARP filtering. If the number | ||
174 | * of addresses for an interface increase beyond this value, hardware ARP | ||
175 | * filtering will be disabled. | ||
176 | */ | ||
177 | #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 | ||
178 | |||
161 | /** | 179 | /** |
162 | * struct ieee80211_bss_conf - holds the BSS's changing parameters | 180 | * struct ieee80211_bss_conf - holds the BSS's changing parameters |
163 | * | 181 | * |
@@ -165,6 +183,8 @@ enum ieee80211_bss_change { | |||
165 | * to that BSS) that can change during the lifetime of the BSS. | 183 | * to that BSS) that can change during the lifetime of the BSS. |
166 | * | 184 | * |
167 | * @assoc: association status | 185 | * @assoc: association status |
186 | * @ibss_joined: indicates whether this station is part of an IBSS | ||
187 | * or not | ||
168 | * @aid: association ID number, valid only when @assoc is true | 188 | * @aid: association ID number, valid only when @assoc is true |
169 | * @use_cts_prot: use CTS protection | 189 | * @use_cts_prot: use CTS protection |
170 | * @use_short_preamble: use 802.11b short preamble; | 190 | * @use_short_preamble: use 802.11b short preamble; |
@@ -174,7 +194,9 @@ enum ieee80211_bss_change { | |||
174 | * if the hardware cannot handle this it must set the | 194 | * if the hardware cannot handle this it must set the |
175 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag | 195 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag |
176 | * @dtim_period: num of beacons before the next DTIM, for beaconing, | 196 | * @dtim_period: num of beacons before the next DTIM, for beaconing, |
177 | * not valid in station mode (cf. hw conf ps_dtim_period) | 197 | * valid in station mode only while @assoc is true and if also |
198 | * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf | ||
199 | * @ps_dtim_period) | ||
178 | * @timestamp: beacon timestamp | 200 | * @timestamp: beacon timestamp |
179 | * @beacon_int: beacon interval | 201 | * @beacon_int: beacon interval |
180 | * @assoc_capability: capabilities taken from assoc resp | 202 | * @assoc_capability: capabilities taken from assoc resp |
@@ -183,13 +205,29 @@ enum ieee80211_bss_change { | |||
183 | * the current band. | 205 | * the current band. |
184 | * @bssid: The BSSID for this BSS | 206 | * @bssid: The BSSID for this BSS |
185 | * @enable_beacon: whether beaconing should be enabled or not | 207 | * @enable_beacon: whether beaconing should be enabled or not |
208 | * @channel_type: Channel type for this BSS -- the hardware might be | ||
209 | * configured for HT40+ while this BSS only uses no-HT, for | ||
210 | * example. | ||
186 | * @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info). | 211 | * @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info). |
187 | * This field is only valid when the channel type is one of the HT types. | 212 | * This field is only valid when the channel type is one of the HT types. |
213 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | ||
214 | * implies disabled | ||
215 | * @cqm_rssi_hyst: Connection quality monitor RSSI hysteresis | ||
216 | * @arp_addr_list: List of IPv4 addresses for hardware ARP filtering. The | ||
217 | * may filter ARP queries targeted for other addresses than listed here. | ||
218 | * The driver must allow ARP queries targeted for all address listed here | ||
219 | * to pass through. An empty list implies no ARP queries need to pass. | ||
220 | * @arp_addr_cnt: Number of addresses currently on the list. | ||
221 | * @arp_filter_enabled: Enable ARP filtering - if enabled, the hardware may | ||
222 | * filter ARP queries based on the @arp_addr_list, if disabled, the | ||
223 | * hardware must not perform any ARP filtering. Note, that the filter will | ||
224 | * be enabled also in promiscuous mode. | ||
225 | * @qos: This is a QoS-enabled BSS. | ||
188 | */ | 226 | */ |
189 | struct ieee80211_bss_conf { | 227 | struct ieee80211_bss_conf { |
190 | const u8 *bssid; | 228 | const u8 *bssid; |
191 | /* association related data */ | 229 | /* association related data */ |
192 | bool assoc; | 230 | bool assoc, ibss_joined; |
193 | u16 aid; | 231 | u16 aid; |
194 | /* erp related data */ | 232 | /* erp related data */ |
195 | bool use_cts_prot; | 233 | bool use_cts_prot; |
@@ -202,6 +240,13 @@ struct ieee80211_bss_conf { | |||
202 | u64 timestamp; | 240 | u64 timestamp; |
203 | u32 basic_rates; | 241 | u32 basic_rates; |
204 | u16 ht_operation_mode; | 242 | u16 ht_operation_mode; |
243 | s32 cqm_rssi_thold; | ||
244 | u32 cqm_rssi_hyst; | ||
245 | enum nl80211_channel_type channel_type; | ||
246 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | ||
247 | u8 arp_addr_cnt; | ||
248 | bool arp_filter_enabled; | ||
249 | bool qos; | ||
205 | }; | 250 | }; |
206 | 251 | ||
207 | /** | 252 | /** |
@@ -267,6 +312,9 @@ struct ieee80211_bss_conf { | |||
267 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 | 312 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 |
268 | * MLME command (internal to mac80211 to figure out whether to send TX | 313 | * MLME command (internal to mac80211 to figure out whether to send TX |
269 | * status to user space) | 314 | * status to user space) |
315 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | ||
316 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | ||
317 | * frame and selects the maximum number of streams that it can use. | ||
270 | */ | 318 | */ |
271 | enum mac80211_tx_control_flags { | 319 | enum mac80211_tx_control_flags { |
272 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 320 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
@@ -290,8 +338,12 @@ enum mac80211_tx_control_flags { | |||
290 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), | 338 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), |
291 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), | 339 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), |
292 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 340 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
341 | IEEE80211_TX_CTL_LDPC = BIT(22), | ||
342 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | ||
293 | }; | 343 | }; |
294 | 344 | ||
345 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | ||
346 | |||
295 | /** | 347 | /** |
296 | * enum mac80211_rate_control_flags - per-rate flags set by the | 348 | * enum mac80211_rate_control_flags - per-rate flags set by the |
297 | * Rate Control algorithm. | 349 | * Rate Control algorithm. |
@@ -367,7 +419,7 @@ struct ieee80211_tx_rate { | |||
367 | s8 idx; | 419 | s8 idx; |
368 | u8 count; | 420 | u8 count; |
369 | u8 flags; | 421 | u8 flags; |
370 | } __attribute__((packed)); | 422 | } __packed; |
371 | 423 | ||
372 | /** | 424 | /** |
373 | * struct ieee80211_tx_info - skb transmit information | 425 | * struct ieee80211_tx_info - skb transmit information |
@@ -388,11 +440,9 @@ struct ieee80211_tx_rate { | |||
388 | * @status: union for status data | 440 | * @status: union for status data |
389 | * @driver_data: array of driver_data pointers | 441 | * @driver_data: array of driver_data pointers |
390 | * @ampdu_ack_len: number of acked aggregated frames. | 442 | * @ampdu_ack_len: number of acked aggregated frames. |
391 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 443 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
392 | * @ampdu_ack_map: block ack bit map for the aggregation. | ||
393 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
394 | * @ampdu_len: number of aggregated frames. | 444 | * @ampdu_len: number of aggregated frames. |
395 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 445 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
396 | * @ack_signal: signal strength of the ACK frame | 446 | * @ack_signal: signal strength of the ACK frame |
397 | */ | 447 | */ |
398 | struct ieee80211_tx_info { | 448 | struct ieee80211_tx_info { |
@@ -425,10 +475,9 @@ struct ieee80211_tx_info { | |||
425 | struct { | 475 | struct { |
426 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; | 476 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; |
427 | u8 ampdu_ack_len; | 477 | u8 ampdu_ack_len; |
428 | u64 ampdu_ack_map; | ||
429 | int ack_signal; | 478 | int ack_signal; |
430 | u8 ampdu_len; | 479 | u8 ampdu_len; |
431 | /* 7 bytes free */ | 480 | /* 15 bytes free */ |
432 | } status; | 481 | } status; |
433 | struct { | 482 | struct { |
434 | struct ieee80211_tx_rate driver_rates[ | 483 | struct ieee80211_tx_rate driver_rates[ |
@@ -543,7 +592,6 @@ enum mac80211_rx_flags { | |||
543 | * @signal: signal strength when receiving this frame, either in dBm, in dB or | 592 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
544 | * unspecified depending on the hardware capabilities flags | 593 | * unspecified depending on the hardware capabilities flags |
545 | * @IEEE80211_HW_SIGNAL_* | 594 | * @IEEE80211_HW_SIGNAL_* |
546 | * @noise: noise when receiving this frame, in dBm. | ||
547 | * @antenna: antenna used | 595 | * @antenna: antenna used |
548 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 596 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
549 | * HT rates are use (RX_FLAG_HT) | 597 | * HT rates are use (RX_FLAG_HT) |
@@ -554,7 +602,6 @@ struct ieee80211_rx_status { | |||
554 | enum ieee80211_band band; | 602 | enum ieee80211_band band; |
555 | int freq; | 603 | int freq; |
556 | int signal; | 604 | int signal; |
557 | int noise; | ||
558 | int antenna; | 605 | int antenna; |
559 | int rate_idx; | 606 | int rate_idx; |
560 | int flag; | 607 | int flag; |
@@ -580,11 +627,14 @@ struct ieee80211_rx_status { | |||
580 | * may turn the device off as much as possible. Typically, this flag will | 627 | * may turn the device off as much as possible. Typically, this flag will |
581 | * be set when an interface is set UP but not associated or scanning, but | 628 | * be set when an interface is set UP but not associated or scanning, but |
582 | * it can also be unset in that case when monitor interfaces are active. | 629 | * it can also be unset in that case when monitor interfaces are active. |
630 | * @IEEE80211_CONF_OFFCHANNEL: The device is currently not on its main | ||
631 | * operating channel. | ||
583 | */ | 632 | */ |
584 | enum ieee80211_conf_flags { | 633 | enum ieee80211_conf_flags { |
585 | IEEE80211_CONF_MONITOR = (1<<0), | 634 | IEEE80211_CONF_MONITOR = (1<<0), |
586 | IEEE80211_CONF_PS = (1<<1), | 635 | IEEE80211_CONF_PS = (1<<1), |
587 | IEEE80211_CONF_IDLE = (1<<2), | 636 | IEEE80211_CONF_IDLE = (1<<2), |
637 | IEEE80211_CONF_OFFCHANNEL = (1<<3), | ||
588 | }; | 638 | }; |
589 | 639 | ||
590 | 640 | ||
@@ -682,6 +732,28 @@ struct ieee80211_conf { | |||
682 | }; | 732 | }; |
683 | 733 | ||
684 | /** | 734 | /** |
735 | * struct ieee80211_channel_switch - holds the channel switch data | ||
736 | * | ||
737 | * The information provided in this structure is required for channel switch | ||
738 | * operation. | ||
739 | * | ||
740 | * @timestamp: value in microseconds of the 64-bit Time Synchronization | ||
741 | * Function (TSF) timer when the frame containing the channel switch | ||
742 | * announcement was received. This is simply the rx.mactime parameter | ||
743 | * the driver passed into mac80211. | ||
744 | * @block_tx: Indicates whether transmission must be blocked before the | ||
745 | * scheduled channel switch, as indicated by the AP. | ||
746 | * @channel: the new channel to switch to | ||
747 | * @count: the number of TBTT's until the channel switch event | ||
748 | */ | ||
749 | struct ieee80211_channel_switch { | ||
750 | u64 timestamp; | ||
751 | bool block_tx; | ||
752 | struct ieee80211_channel *channel; | ||
753 | u8 count; | ||
754 | }; | ||
755 | |||
756 | /** | ||
685 | * struct ieee80211_vif - per-interface data | 757 | * struct ieee80211_vif - per-interface data |
686 | * | 758 | * |
687 | * Data in this structure is continually present for driver | 759 | * Data in this structure is continually present for driver |
@@ -828,16 +900,12 @@ struct ieee80211_sta { | |||
828 | * enum sta_notify_cmd - sta notify command | 900 | * enum sta_notify_cmd - sta notify command |
829 | * | 901 | * |
830 | * Used with the sta_notify() callback in &struct ieee80211_ops, this | 902 | * Used with the sta_notify() callback in &struct ieee80211_ops, this |
831 | * indicates addition and removal of a station to station table, | 903 | * indicates if an associated station made a power state transition. |
832 | * or if a associated station made a power state transition. | ||
833 | * | 904 | * |
834 | * @STA_NOTIFY_ADD: (DEPRECATED) a station was added to the station table | ||
835 | * @STA_NOTIFY_REMOVE: (DEPRECATED) a station being removed from the station table | ||
836 | * @STA_NOTIFY_SLEEP: a station is now sleeping | 905 | * @STA_NOTIFY_SLEEP: a station is now sleeping |
837 | * @STA_NOTIFY_AWAKE: a sleeping station woke up | 906 | * @STA_NOTIFY_AWAKE: a sleeping station woke up |
838 | */ | 907 | */ |
839 | enum sta_notify_cmd { | 908 | enum sta_notify_cmd { |
840 | STA_NOTIFY_ADD, STA_NOTIFY_REMOVE, | ||
841 | STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE, | 909 | STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE, |
842 | }; | 910 | }; |
843 | 911 | ||
@@ -907,10 +975,6 @@ enum ieee80211_tkip_key_type { | |||
907 | * one milliwatt. This is the preferred method since it is standardized | 975 | * one milliwatt. This is the preferred method since it is standardized |
908 | * between different devices. @max_signal does not need to be set. | 976 | * between different devices. @max_signal does not need to be set. |
909 | * | 977 | * |
910 | * @IEEE80211_HW_NOISE_DBM: | ||
911 | * Hardware can provide noise (radio interference) values in units dBm, | ||
912 | * decibel difference from one milliwatt. | ||
913 | * | ||
914 | * @IEEE80211_HW_SPECTRUM_MGMT: | 978 | * @IEEE80211_HW_SPECTRUM_MGMT: |
915 | * Hardware supports spectrum management defined in 802.11h | 979 | * Hardware supports spectrum management defined in 802.11h |
916 | * Measurement, Channel Switch, Quieting, TPC | 980 | * Measurement, Channel Switch, Quieting, TPC |
@@ -954,6 +1018,20 @@ enum ieee80211_tkip_key_type { | |||
954 | * Hardware can provide ack status reports of Tx frames to | 1018 | * Hardware can provide ack status reports of Tx frames to |
955 | * the stack. | 1019 | * the stack. |
956 | * | 1020 | * |
1021 | * @IEEE80211_HW_CONNECTION_MONITOR: | ||
1022 | * The hardware performs its own connection monitoring, including | ||
1023 | * periodic keep-alives to the AP and probing the AP on beacon loss. | ||
1024 | * When this flag is set, signaling beacon-loss will cause an immediate | ||
1025 | * change to disassociated state. | ||
1026 | * | ||
1027 | * @IEEE80211_HW_SUPPORTS_CQM_RSSI: | ||
1028 | * Hardware can do connection quality monitoring - i.e. it can monitor | ||
1029 | * connection quality related parameters, such as the RSSI level and | ||
1030 | * provide notifications if configured trigger levels are reached. | ||
1031 | * | ||
1032 | * @IEEE80211_HW_NEED_DTIM_PERIOD: | ||
1033 | * This device needs to know the DTIM period for the BSS before | ||
1034 | * associating. | ||
957 | */ | 1035 | */ |
958 | enum ieee80211_hw_flags { | 1036 | enum ieee80211_hw_flags { |
959 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1037 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -963,7 +1041,7 @@ enum ieee80211_hw_flags { | |||
963 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 1041 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
964 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | 1042 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, |
965 | IEEE80211_HW_SIGNAL_DBM = 1<<6, | 1043 | IEEE80211_HW_SIGNAL_DBM = 1<<6, |
966 | IEEE80211_HW_NOISE_DBM = 1<<7, | 1044 | IEEE80211_HW_NEED_DTIM_PERIOD = 1<<7, |
967 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, | 1045 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, |
968 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, | 1046 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, |
969 | IEEE80211_HW_SUPPORTS_PS = 1<<10, | 1047 | IEEE80211_HW_SUPPORTS_PS = 1<<10, |
@@ -975,6 +1053,8 @@ enum ieee80211_hw_flags { | |||
975 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, | 1053 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, |
976 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, | 1054 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, |
977 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | 1055 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, |
1056 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | ||
1057 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, | ||
978 | }; | 1058 | }; |
979 | 1059 | ||
980 | /** | 1060 | /** |
@@ -1198,6 +1278,15 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1198 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS | 1278 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS |
1199 | * enabled whenever user has enabled powersave. | 1279 | * enabled whenever user has enabled powersave. |
1200 | * | 1280 | * |
1281 | * Some hardware need to toggle a single shared antenna between WLAN and | ||
1282 | * Bluetooth to facilitate co-existence. These types of hardware set | ||
1283 | * limitations on the use of host controlled dynamic powersave whenever there | ||
1284 | * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the | ||
1285 | * driver may request temporarily going into full power save, in order to | ||
1286 | * enable toggling the antenna between BT and WLAN. If the driver requests | ||
1287 | * disabling dynamic powersave, the @dynamic_ps_timeout value will be | ||
1288 | * temporarily set to zero until the driver re-enables dynamic powersave. | ||
1289 | * | ||
1201 | * Driver informs U-APSD client support by enabling | 1290 | * Driver informs U-APSD client support by enabling |
1202 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the | 1291 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the |
1203 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS | 1292 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS |
@@ -1389,7 +1478,7 @@ enum ieee80211_filter_flags { | |||
1389 | * | 1478 | * |
1390 | * Note that drivers MUST be able to deal with a TX aggregation | 1479 | * Note that drivers MUST be able to deal with a TX aggregation |
1391 | * session being stopped even before they OK'ed starting it by | 1480 | * session being stopped even before they OK'ed starting it by |
1392 | * calling ieee80211_start_tx_ba_cb(_irqsafe), because the peer | 1481 | * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer |
1393 | * might receive the addBA frame and send a delBA right away! | 1482 | * might receive the addBA frame and send a delBA right away! |
1394 | * | 1483 | * |
1395 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation | 1484 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation |
@@ -1574,7 +1663,9 @@ enum ieee80211_ampdu_mlme_action { | |||
1574 | * is the first frame we expect to perform the action on. Notice | 1663 | * is the first frame we expect to perform the action on. Notice |
1575 | * that TX/RX_STOP can pass NULL for this parameter. | 1664 | * that TX/RX_STOP can pass NULL for this parameter. |
1576 | * Returns a negative error code on failure. | 1665 | * Returns a negative error code on failure. |
1577 | * The callback must be atomic. | 1666 | * The callback can sleep. |
1667 | * | ||
1668 | * @get_survey: Return per-channel survey information | ||
1578 | * | 1669 | * |
1579 | * @rfkill_poll: Poll rfkill hardware state. If you need this, you also | 1670 | * @rfkill_poll: Poll rfkill hardware state. If you need this, you also |
1580 | * need to set wiphy->rfkill_poll to %true before registration, | 1671 | * need to set wiphy->rfkill_poll to %true before registration, |
@@ -1591,6 +1682,11 @@ enum ieee80211_ampdu_mlme_action { | |||
1591 | * @flush: Flush all pending frames from the hardware queue, making sure | 1682 | * @flush: Flush all pending frames from the hardware queue, making sure |
1592 | * that the hardware queues are empty. If the parameter @drop is set | 1683 | * that the hardware queues are empty. If the parameter @drop is set |
1593 | * to %true, pending frames may be dropped. The callback can sleep. | 1684 | * to %true, pending frames may be dropped. The callback can sleep. |
1685 | * | ||
1686 | * @channel_switch: Drivers that need (or want) to offload the channel | ||
1687 | * switch operation for CSAs received from the AP may implement this | ||
1688 | * callback. They must then call ieee80211_chswitch_done() to indicate | ||
1689 | * completion of the channel switch. | ||
1594 | */ | 1690 | */ |
1595 | struct ieee80211_ops { | 1691 | struct ieee80211_ops { |
1596 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1692 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1606,7 +1702,7 @@ struct ieee80211_ops { | |||
1606 | struct ieee80211_bss_conf *info, | 1702 | struct ieee80211_bss_conf *info, |
1607 | u32 changed); | 1703 | u32 changed); |
1608 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 1704 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
1609 | int mc_count, struct dev_addr_list *mc_list); | 1705 | struct netdev_hw_addr_list *mc_list); |
1610 | void (*configure_filter)(struct ieee80211_hw *hw, | 1706 | void (*configure_filter)(struct ieee80211_hw *hw, |
1611 | unsigned int changed_flags, | 1707 | unsigned int changed_flags, |
1612 | unsigned int *total_flags, | 1708 | unsigned int *total_flags, |
@@ -1621,7 +1717,7 @@ struct ieee80211_ops { | |||
1621 | struct ieee80211_key_conf *conf, | 1717 | struct ieee80211_key_conf *conf, |
1622 | struct ieee80211_sta *sta, | 1718 | struct ieee80211_sta *sta, |
1623 | u32 iv32, u16 *phase1key); | 1719 | u32 iv32, u16 *phase1key); |
1624 | int (*hw_scan)(struct ieee80211_hw *hw, | 1720 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1625 | struct cfg80211_scan_request *req); | 1721 | struct cfg80211_scan_request *req); |
1626 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 1722 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
1627 | void (*sw_scan_complete)(struct ieee80211_hw *hw); | 1723 | void (*sw_scan_complete)(struct ieee80211_hw *hw); |
@@ -1646,13 +1742,16 @@ struct ieee80211_ops { | |||
1646 | struct ieee80211_vif *vif, | 1742 | struct ieee80211_vif *vif, |
1647 | enum ieee80211_ampdu_mlme_action action, | 1743 | enum ieee80211_ampdu_mlme_action action, |
1648 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1744 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
1649 | 1745 | int (*get_survey)(struct ieee80211_hw *hw, int idx, | |
1746 | struct survey_info *survey); | ||
1650 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 1747 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
1651 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); | 1748 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); |
1652 | #ifdef CONFIG_NL80211_TESTMODE | 1749 | #ifdef CONFIG_NL80211_TESTMODE |
1653 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); | 1750 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); |
1654 | #endif | 1751 | #endif |
1655 | void (*flush)(struct ieee80211_hw *hw, bool drop); | 1752 | void (*flush)(struct ieee80211_hw *hw, bool drop); |
1753 | void (*channel_switch)(struct ieee80211_hw *hw, | ||
1754 | struct ieee80211_channel_switch *ch_switch); | ||
1656 | }; | 1755 | }; |
1657 | 1756 | ||
1658 | /** | 1757 | /** |
@@ -1802,7 +1901,10 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw); | |||
1802 | * ieee80211_rx - receive frame | 1901 | * ieee80211_rx - receive frame |
1803 | * | 1902 | * |
1804 | * Use this function to hand received frames to mac80211. The receive | 1903 | * Use this function to hand received frames to mac80211. The receive |
1805 | * buffer in @skb must start with an IEEE 802.11 header. | 1904 | * buffer in @skb must start with an IEEE 802.11 header. In case of a |
1905 | * paged @skb is used, the driver is recommended to put the ieee80211 | ||
1906 | * header of the frame on the linear part of the @skb to avoid memory | ||
1907 | * allocation and/or memcpy by the stack. | ||
1806 | * | 1908 | * |
1807 | * This function may not be called in IRQ context. Calls to this function | 1909 | * This function may not be called in IRQ context. Calls to this function |
1808 | * for a single hardware must be synchronized against each other. Calls to | 1910 | * for a single hardware must be synchronized against each other. Calls to |
@@ -2232,25 +2334,14 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2232 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | 2334 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
2233 | 2335 | ||
2234 | /** | 2336 | /** |
2235 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | ||
2236 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | ||
2237 | * @ra: receiver address of the BA session recipient. | ||
2238 | * @tid: the TID to BA on. | ||
2239 | * | ||
2240 | * This function must be called by low level driver once it has | ||
2241 | * finished with preparations for the BA session. | ||
2242 | */ | ||
2243 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); | ||
2244 | |||
2245 | /** | ||
2246 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2337 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
2247 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | 2338 | * @vif: &struct ieee80211_vif pointer from the add_interface callback |
2248 | * @ra: receiver address of the BA session recipient. | 2339 | * @ra: receiver address of the BA session recipient. |
2249 | * @tid: the TID to BA on. | 2340 | * @tid: the TID to BA on. |
2250 | * | 2341 | * |
2251 | * This function must be called by low level driver once it has | 2342 | * This function must be called by low level driver once it has |
2252 | * finished with preparations for the BA session. | 2343 | * finished with preparations for the BA session. It can be called |
2253 | * This version of the function is IRQ-safe. | 2344 | * from any context. |
2254 | */ | 2345 | */ |
2255 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | 2346 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2256 | u16 tid); | 2347 | u16 tid); |
@@ -2259,27 +2350,14 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | |||
2259 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. | 2350 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. |
2260 | * @sta: the station whose BA session to stop | 2351 | * @sta: the station whose BA session to stop |
2261 | * @tid: the TID to stop BA. | 2352 | * @tid: the TID to stop BA. |
2262 | * @initiator: if indicates initiator DELBA frame will be sent. | ||
2263 | * | 2353 | * |
2264 | * Return: error if no sta with matching da found, success otherwise | 2354 | * Return: negative error if the TID is invalid, or no aggregation active |
2265 | * | 2355 | * |
2266 | * Although mac80211/low level driver/user space application can estimate | 2356 | * Although mac80211/low level driver/user space application can estimate |
2267 | * the need to stop aggregation on a certain RA/TID, the session level | 2357 | * the need to stop aggregation on a certain RA/TID, the session level |
2268 | * will be managed by the mac80211. | 2358 | * will be managed by the mac80211. |
2269 | */ | 2359 | */ |
2270 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid, | 2360 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
2271 | enum ieee80211_back_parties initiator); | ||
2272 | |||
2273 | /** | ||
2274 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | ||
2275 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | ||
2276 | * @ra: receiver address of the BA session recipient. | ||
2277 | * @tid: the desired TID to BA on. | ||
2278 | * | ||
2279 | * This function must be called by low level driver once it has | ||
2280 | * finished with preparations for the BA session tear down. | ||
2281 | */ | ||
2282 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | ||
2283 | 2361 | ||
2284 | /** | 2362 | /** |
2285 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | 2363 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. |
@@ -2288,8 +2366,8 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | |||
2288 | * @tid: the desired TID to BA on. | 2366 | * @tid: the desired TID to BA on. |
2289 | * | 2367 | * |
2290 | * This function must be called by low level driver once it has | 2368 | * This function must be called by low level driver once it has |
2291 | * finished with preparations for the BA session tear down. | 2369 | * finished with preparations for the BA session tear down. It |
2292 | * This version of the function is IRQ-safe. | 2370 | * can be called from any context. |
2293 | */ | 2371 | */ |
2294 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | 2372 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2295 | u16 tid); | 2373 | u16 tid); |
@@ -2364,12 +2442,82 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
2364 | * | 2442 | * |
2365 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2443 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
2366 | * | 2444 | * |
2367 | * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and | 2445 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and |
2368 | * IEEE80211_CONF_PS is set, the driver needs to inform whenever the | 2446 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the |
2369 | * hardware is not receiving beacons with this function. | 2447 | * hardware is not receiving beacons with this function. |
2370 | */ | 2448 | */ |
2371 | void ieee80211_beacon_loss(struct ieee80211_vif *vif); | 2449 | void ieee80211_beacon_loss(struct ieee80211_vif *vif); |
2372 | 2450 | ||
2451 | /** | ||
2452 | * ieee80211_connection_loss - inform hardware has lost connection to the AP | ||
2453 | * | ||
2454 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2455 | * | ||
2456 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and | ||
2457 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver | ||
2458 | * needs to inform if the connection to the AP has been lost. | ||
2459 | * | ||
2460 | * This function will cause immediate change to disassociated state, | ||
2461 | * without connection recovery attempts. | ||
2462 | */ | ||
2463 | void ieee80211_connection_loss(struct ieee80211_vif *vif); | ||
2464 | |||
2465 | /** | ||
2466 | * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm | ||
2467 | * | ||
2468 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2469 | * | ||
2470 | * Some hardware require full power save to manage simultaneous BT traffic | ||
2471 | * on the WLAN frequency. Full PSM is required periodically, whenever there are | ||
2472 | * burst of BT traffic. The hardware gets information of BT traffic via | ||
2473 | * hardware co-existence lines, and consequentially requests mac80211 to | ||
2474 | * (temporarily) enter full psm. | ||
2475 | * This function will only temporarily disable dynamic PS, not enable PSM if | ||
2476 | * it was not already enabled. | ||
2477 | * The driver must make sure to re-enable dynamic PS using | ||
2478 | * ieee80211_enable_dyn_ps() if the driver has disabled it. | ||
2479 | * | ||
2480 | */ | ||
2481 | void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif); | ||
2482 | |||
2483 | /** | ||
2484 | * ieee80211_enable_dyn_ps - restore dynamic psm after being disabled | ||
2485 | * | ||
2486 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2487 | * | ||
2488 | * This function restores dynamic PS after being temporarily disabled via | ||
2489 | * ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must | ||
2490 | * be coupled with an eventual call to this function. | ||
2491 | * | ||
2492 | */ | ||
2493 | void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif); | ||
2494 | |||
2495 | /** | ||
2496 | * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring | ||
2497 | * rssi threshold triggered | ||
2498 | * | ||
2499 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2500 | * @rssi_event: the RSSI trigger event type | ||
2501 | * @gfp: context flags | ||
2502 | * | ||
2503 | * When the %IEEE80211_HW_SUPPORTS_CQM_RSSI is set, and a connection quality | ||
2504 | * monitoring is configured with an rssi threshold, the driver will inform | ||
2505 | * whenever the rssi level reaches the threshold. | ||
2506 | */ | ||
2507 | void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | ||
2508 | enum nl80211_cqm_rssi_threshold_event rssi_event, | ||
2509 | gfp_t gfp); | ||
2510 | |||
2511 | /** | ||
2512 | * ieee80211_chswitch_done - Complete channel switch process | ||
2513 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2514 | * @success: make the channel switch successful or not | ||
2515 | * | ||
2516 | * Complete the channel switch post-process: set the new operational channel | ||
2517 | * and wake up the suspended queues. | ||
2518 | */ | ||
2519 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); | ||
2520 | |||
2373 | /* Rate control API */ | 2521 | /* Rate control API */ |
2374 | 2522 | ||
2375 | /** | 2523 | /** |