diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 591 |
1 files changed, 313 insertions, 278 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index bcd1623245cb..4dd3d93e1960 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -42,7 +42,7 @@ | |||
42 | * tasklet function. | 42 | * tasklet function. |
43 | * | 43 | * |
44 | * NOTE: If the driver opts to use the _irqsafe() functions, it may not also | 44 | * NOTE: If the driver opts to use the _irqsafe() functions, it may not also |
45 | * use the non-irqsafe functions! | 45 | * use the non-IRQ-safe functions! |
46 | */ | 46 | */ |
47 | 47 | ||
48 | /** | 48 | /** |
@@ -85,7 +85,7 @@ enum ieee80211_notification_types { | |||
85 | * struct ieee80211_ht_bss_info - describing BSS's HT characteristics | 85 | * struct ieee80211_ht_bss_info - describing BSS's HT characteristics |
86 | * | 86 | * |
87 | * This structure describes most essential parameters needed | 87 | * This structure describes most essential parameters needed |
88 | * to describe 802.11n HT characteristics in a BSS | 88 | * to describe 802.11n HT characteristics in a BSS. |
89 | * | 89 | * |
90 | * @primary_channel: channel number of primery channel | 90 | * @primary_channel: channel number of primery channel |
91 | * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) | 91 | * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) |
@@ -98,77 +98,49 @@ struct ieee80211_ht_bss_info { | |||
98 | }; | 98 | }; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * enum ieee80211_max_queues - maximum number of queues | ||
102 | * | ||
103 | * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. | ||
104 | * @IEEE80211_MAX_AMPDU_QUEUES: Maximum number of queues usable | ||
105 | * for A-MPDU operation. | ||
106 | */ | ||
107 | enum ieee80211_max_queues { | ||
108 | IEEE80211_MAX_QUEUES = 16, | ||
109 | IEEE80211_MAX_AMPDU_QUEUES = 16, | ||
110 | }; | ||
111 | |||
112 | /** | ||
101 | * struct ieee80211_tx_queue_params - transmit queue configuration | 113 | * struct ieee80211_tx_queue_params - transmit queue configuration |
102 | * | 114 | * |
103 | * The information provided in this structure is required for QoS | 115 | * The information provided in this structure is required for QoS |
104 | * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. | 116 | * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. |
105 | * | 117 | * |
106 | * @aifs: arbitration interface space [0..255, -1: use default] | 118 | * @aifs: arbitration interface space [0..255] |
107 | * @cw_min: minimum contention window [will be a value of the form | 119 | * @cw_min: minimum contention window [a value of the form |
108 | * 2^n-1 in the range 1..1023; 0: use default] | 120 | * 2^n-1 in the range 1..32767] |
109 | * @cw_max: maximum contention window [like @cw_min] | 121 | * @cw_max: maximum contention window [like @cw_min] |
110 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled | 122 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled |
111 | */ | 123 | */ |
112 | struct ieee80211_tx_queue_params { | 124 | struct ieee80211_tx_queue_params { |
113 | s16 aifs; | 125 | u16 txop; |
114 | u16 cw_min; | 126 | u16 cw_min; |
115 | u16 cw_max; | 127 | u16 cw_max; |
116 | u16 txop; | 128 | u8 aifs; |
117 | }; | 129 | }; |
118 | 130 | ||
119 | /** | 131 | /** |
120 | * struct ieee80211_tx_queue_stats_data - transmit queue statistics | 132 | * struct ieee80211_tx_queue_stats - transmit queue statistics |
121 | * | 133 | * |
122 | * @len: number of packets in queue | 134 | * @len: number of packets in queue |
123 | * @limit: queue length limit | 135 | * @limit: queue length limit |
124 | * @count: number of frames sent | 136 | * @count: number of frames sent |
125 | */ | 137 | */ |
126 | struct ieee80211_tx_queue_stats_data { | 138 | struct ieee80211_tx_queue_stats { |
127 | unsigned int len; | 139 | unsigned int len; |
128 | unsigned int limit; | 140 | unsigned int limit; |
129 | unsigned int count; | 141 | unsigned int count; |
130 | }; | 142 | }; |
131 | 143 | ||
132 | /** | ||
133 | * enum ieee80211_tx_queue - transmit queue number | ||
134 | * | ||
135 | * These constants are used with some callbacks that take a | ||
136 | * queue number to set parameters for a queue. | ||
137 | * | ||
138 | * @IEEE80211_TX_QUEUE_DATA0: data queue 0 | ||
139 | * @IEEE80211_TX_QUEUE_DATA1: data queue 1 | ||
140 | * @IEEE80211_TX_QUEUE_DATA2: data queue 2 | ||
141 | * @IEEE80211_TX_QUEUE_DATA3: data queue 3 | ||
142 | * @IEEE80211_TX_QUEUE_DATA4: data queue 4 | ||
143 | * @IEEE80211_TX_QUEUE_SVP: ?? | ||
144 | * @NUM_TX_DATA_QUEUES: number of data queues | ||
145 | * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be | ||
146 | * sent after a beacon | ||
147 | * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames | ||
148 | * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU | ||
149 | */ | ||
150 | enum ieee80211_tx_queue { | ||
151 | IEEE80211_TX_QUEUE_DATA0, | ||
152 | IEEE80211_TX_QUEUE_DATA1, | ||
153 | IEEE80211_TX_QUEUE_DATA2, | ||
154 | IEEE80211_TX_QUEUE_DATA3, | ||
155 | IEEE80211_TX_QUEUE_DATA4, | ||
156 | IEEE80211_TX_QUEUE_SVP, | ||
157 | |||
158 | NUM_TX_DATA_QUEUES, | ||
159 | |||
160 | /* due to stupidity in the sub-ioctl userspace interface, the items in | ||
161 | * this struct need to have fixed values. As soon as it is removed, we can | ||
162 | * fix these entries. */ | ||
163 | IEEE80211_TX_QUEUE_AFTER_BEACON = 6, | ||
164 | IEEE80211_TX_QUEUE_BEACON = 7, | ||
165 | NUM_TX_DATA_QUEUES_AMPDU = 16 | ||
166 | }; | ||
167 | |||
168 | struct ieee80211_tx_queue_stats { | ||
169 | struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU]; | ||
170 | }; | ||
171 | |||
172 | struct ieee80211_low_level_stats { | 144 | struct ieee80211_low_level_stats { |
173 | unsigned int dot11ACKFailureCount; | 145 | unsigned int dot11ACKFailureCount; |
174 | unsigned int dot11RTSFailureCount; | 146 | unsigned int dot11RTSFailureCount; |
@@ -229,91 +201,151 @@ struct ieee80211_bss_conf { | |||
229 | }; | 201 | }; |
230 | 202 | ||
231 | /** | 203 | /** |
232 | * enum mac80211_tx_control_flags - flags to describe Tx configuration for | 204 | * enum mac80211_tx_control_flags - flags to describe transmission information/status |
233 | * the Tx frame | 205 | * |
234 | * | 206 | * These flags are used with the @flags member of &ieee80211_tx_info. |
235 | * These flags are used with the @flags member of &ieee80211_tx_control | 207 | * |
236 | * | 208 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. |
237 | * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame. | 209 | * @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption; |
238 | * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption; | 210 | * e.g., for EAPOL frame |
239 | * e.g., for EAPOL frame | 211 | * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame |
240 | * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame | 212 | * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., |
241 | * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., | 213 | * for combined 802.11g / 802.11b networks) |
242 | * for combined 802.11g / 802.11b networks) | 214 | * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack |
243 | * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack | 215 | * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD |
244 | * @IEEE80211_TXCTL_RATE_CTRL_PROBE | 216 | * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination |
245 | * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter | 217 | * station |
246 | * for destination station | 218 | * @IEEE80211_TX_CTL_REQUEUE: TBD |
247 | * @IEEE80211_TXCTL_REQUEUE: | 219 | * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame |
248 | * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame | 220 | * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD |
249 | * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the | 221 | * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the |
250 | * through set_retry_limit configured long | 222 | * through set_retry_limit configured long retry value |
251 | * retry value | 223 | * @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211 |
252 | * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211 | 224 | * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon |
253 | * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon | 225 | * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU |
254 | * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU | 226 | * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number |
255 | * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number | 227 | * of streams when this flag is on can be extracted from antenna_sel_tx, |
256 | * of streams when this flag is on can be extracted | 228 | * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n |
257 | * from antenna_sel_tx, so if 1 antenna is marked | 229 | * antennas marked use MIMO_n. |
258 | * use SISO, 2 antennas marked use MIMO, n antennas | 230 | * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame |
259 | * marked use MIMO_n. | 231 | * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width |
260 | * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame | 232 | * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels |
261 | * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width | 233 | * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval |
262 | * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels | 234 | * @IEEE80211_TX_CTL_INJECTED: TBD |
263 | * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval | 235 | * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted |
236 | * because the destination STA was in powersave mode. | ||
237 | * @IEEE80211_TX_STAT_ACK: Frame was acknowledged | ||
238 | * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status | ||
239 | * is for the whole aggregation. | ||
240 | * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned, | ||
241 | * so consider using block ack request (BAR). | ||
242 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence | ||
243 | * number to this frame, taking care of not overwriting the fragment | ||
244 | * number and increasing the sequence number only when the | ||
245 | * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly | ||
246 | * assign sequence numbers to QoS-data frames but cannot do so correctly | ||
247 | * for non-QoS-data and management frames because beacons need them from | ||
248 | * that counter as well and mac80211 cannot guarantee proper sequencing. | ||
249 | * If this flag is set, the driver should instruct the hardware to | ||
250 | * assign a sequence number to the frame or assign one itself. Cf. IEEE | ||
251 | * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for | ||
252 | * beacons always be clear for frames without a sequence number field. | ||
264 | */ | 253 | */ |
265 | enum mac80211_tx_control_flags { | 254 | enum mac80211_tx_control_flags { |
266 | IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0), | 255 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
267 | IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1), | 256 | IEEE80211_TX_CTL_DO_NOT_ENCRYPT = BIT(1), |
268 | IEEE80211_TXCTL_USE_RTS_CTS = (1<<2), | 257 | IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2), |
269 | IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3), | 258 | IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3), |
270 | IEEE80211_TXCTL_NO_ACK = (1<<4), | 259 | IEEE80211_TX_CTL_NO_ACK = BIT(4), |
271 | IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5), | 260 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5), |
272 | IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6), | 261 | IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6), |
273 | IEEE80211_TXCTL_REQUEUE = (1<<7), | 262 | IEEE80211_TX_CTL_REQUEUE = BIT(7), |
274 | IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8), | 263 | IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8), |
275 | IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9), | 264 | IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9), |
276 | IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10), | 265 | IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10), |
277 | IEEE80211_TXCTL_EAPOL_FRAME = (1<<11), | 266 | IEEE80211_TX_CTL_EAPOL_FRAME = BIT(11), |
278 | IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12), | 267 | IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12), |
279 | IEEE80211_TXCTL_AMPDU = (1<<13), | 268 | IEEE80211_TX_CTL_AMPDU = BIT(13), |
280 | IEEE80211_TXCTL_OFDM_HT = (1<<14), | 269 | IEEE80211_TX_CTL_OFDM_HT = BIT(14), |
281 | IEEE80211_TXCTL_GREEN_FIELD = (1<<15), | 270 | IEEE80211_TX_CTL_GREEN_FIELD = BIT(15), |
282 | IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16), | 271 | IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16), |
283 | IEEE80211_TXCTL_DUP_DATA = (1<<17), | 272 | IEEE80211_TX_CTL_DUP_DATA = BIT(17), |
284 | IEEE80211_TXCTL_SHORT_GI = (1<<18), | 273 | IEEE80211_TX_CTL_SHORT_GI = BIT(18), |
274 | IEEE80211_TX_CTL_INJECTED = BIT(19), | ||
275 | IEEE80211_TX_STAT_TX_FILTERED = BIT(20), | ||
276 | IEEE80211_TX_STAT_ACK = BIT(21), | ||
277 | IEEE80211_TX_STAT_AMPDU = BIT(22), | ||
278 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23), | ||
279 | IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24), | ||
285 | }; | 280 | }; |
286 | 281 | ||
287 | /* Transmit control fields. This data structure is passed to low-level driver | ||
288 | * with each TX frame. The low-level driver is responsible for configuring | ||
289 | * the hardware to use given values (depending on what is supported). */ | ||
290 | 282 | ||
291 | struct ieee80211_tx_control { | 283 | #define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \ |
292 | struct ieee80211_vif *vif; | 284 | (sizeof(((struct sk_buff *)0)->cb) - 8) |
293 | struct ieee80211_rate *tx_rate; | 285 | #define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ |
294 | 286 | (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) | |
295 | /* Transmit rate for RTS/CTS frame */ | 287 | |
296 | struct ieee80211_rate *rts_cts_rate; | 288 | /** |
297 | 289 | * struct ieee80211_tx_info - skb transmit information | |
298 | /* retry rate for the last retries */ | 290 | * |
299 | struct ieee80211_rate *alt_retry_rate; | 291 | * This structure is placed in skb->cb for three uses: |
300 | 292 | * (1) mac80211 TX control - mac80211 tells the driver what to do | |
301 | u32 flags; /* tx control flags defined above */ | 293 | * (2) driver internal use (if applicable) |
302 | u8 key_idx; /* keyidx from hw->set_key(), undefined if | 294 | * (3) TX status information - driver tells mac80211 what happened |
303 | * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ | 295 | * |
304 | u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. | 296 | * @flags: transmit info flags, defined above |
305 | * This could be used when set_retry_limit | 297 | * @band: TBD |
306 | * is not implemented by the driver */ | 298 | * @tx_rate_idx: TBD |
307 | u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit | 299 | * @antenna_sel_tx: TBD |
308 | * position represents antenna number used */ | 300 | * @control: union for control data |
309 | u8 icv_len; /* length of the ICV/MIC field in octets */ | 301 | * @status: union for status data |
310 | u8 iv_len; /* length of the IV field in octets */ | 302 | * @driver_data: array of driver_data pointers |
311 | u8 queue; /* hardware queue to use for this frame; | 303 | * @retry_count: number of retries |
312 | * 0 = highest, hw->queues-1 = lowest */ | 304 | * @excessive_retries: set to 1 if the frame was retried many times |
313 | u16 aid; /* Station AID */ | 305 | * but not acknowledged |
314 | int type; /* internal */ | 306 | * @ampdu_ack_len: number of aggregated frames. |
307 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
308 | * @ampdu_ack_map: block ack bit map for the aggregation. | ||
309 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
310 | * @ack_signal: signal strength of the ACK frame | ||
311 | */ | ||
312 | struct ieee80211_tx_info { | ||
313 | /* common information */ | ||
314 | u32 flags; | ||
315 | u8 band; | ||
316 | s8 tx_rate_idx; | ||
317 | u8 antenna_sel_tx; | ||
318 | |||
319 | /* 1 byte hole */ | ||
320 | |||
321 | union { | ||
322 | struct { | ||
323 | struct ieee80211_vif *vif; | ||
324 | struct ieee80211_key_conf *hw_key; | ||
325 | unsigned long jiffies; | ||
326 | int ifindex; | ||
327 | u16 aid; | ||
328 | s8 rts_cts_rate_idx, alt_retry_rate_idx; | ||
329 | u8 retry_limit; | ||
330 | u8 icv_len; | ||
331 | u8 iv_len; | ||
332 | } control; | ||
333 | struct { | ||
334 | u64 ampdu_ack_map; | ||
335 | int ack_signal; | ||
336 | u8 retry_count; | ||
337 | bool excessive_retries; | ||
338 | u8 ampdu_ack_len; | ||
339 | } status; | ||
340 | void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS]; | ||
341 | }; | ||
315 | }; | 342 | }; |
316 | 343 | ||
344 | static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) | ||
345 | { | ||
346 | return (struct ieee80211_tx_info *)skb->cb; | ||
347 | } | ||
348 | |||
317 | 349 | ||
318 | /** | 350 | /** |
319 | * enum mac80211_rx_flags - receive flags | 351 | * enum mac80211_rx_flags - receive flags |
@@ -353,13 +385,16 @@ enum mac80211_rx_flags { | |||
353 | * The low-level driver should provide this information (the subset | 385 | * The low-level driver should provide this information (the subset |
354 | * supported by hardware) to the 802.11 code with each received | 386 | * supported by hardware) to the 802.11 code with each received |
355 | * frame. | 387 | * frame. |
388 | * | ||
356 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function | 389 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function |
357 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. | 390 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. |
358 | * @band: the active band when this frame was received | 391 | * @band: the active band when this frame was received |
359 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz | 392 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz |
360 | * @ssi: signal strength when receiving this frame | 393 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
361 | * @signal: used as 'qual' in statistics reporting | 394 | * unspecified depending on the hardware capabilities flags |
362 | * @noise: PHY noise when receiving this frame | 395 | * @IEEE80211_HW_SIGNAL_* |
396 | * @noise: noise when receiving this frame, in dBm. | ||
397 | * @qual: overall signal quality indication, in percent (0-100). | ||
363 | * @antenna: antenna used | 398 | * @antenna: antenna used |
364 | * @rate_idx: index of data rate into band's supported rates | 399 | * @rate_idx: index of data rate into band's supported rates |
365 | * @flag: %RX_FLAG_* | 400 | * @flag: %RX_FLAG_* |
@@ -368,64 +403,15 @@ struct ieee80211_rx_status { | |||
368 | u64 mactime; | 403 | u64 mactime; |
369 | enum ieee80211_band band; | 404 | enum ieee80211_band band; |
370 | int freq; | 405 | int freq; |
371 | int ssi; | ||
372 | int signal; | 406 | int signal; |
373 | int noise; | 407 | int noise; |
408 | int qual; | ||
374 | int antenna; | 409 | int antenna; |
375 | int rate_idx; | 410 | int rate_idx; |
376 | int flag; | 411 | int flag; |
377 | }; | 412 | }; |
378 | 413 | ||
379 | /** | 414 | /** |
380 | * enum ieee80211_tx_status_flags - transmit status flags | ||
381 | * | ||
382 | * Status flags to indicate various transmit conditions. | ||
383 | * | ||
384 | * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted | ||
385 | * because the destination STA was in powersave mode. | ||
386 | * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged | ||
387 | * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status | ||
388 | * is for the whole aggregation. | ||
389 | */ | ||
390 | enum ieee80211_tx_status_flags { | ||
391 | IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, | ||
392 | IEEE80211_TX_STATUS_ACK = 1<<1, | ||
393 | IEEE80211_TX_STATUS_AMPDU = 1<<2, | ||
394 | }; | ||
395 | |||
396 | /** | ||
397 | * struct ieee80211_tx_status - transmit status | ||
398 | * | ||
399 | * As much information as possible should be provided for each transmitted | ||
400 | * frame with ieee80211_tx_status(). | ||
401 | * | ||
402 | * @control: a copy of the &struct ieee80211_tx_control passed to the driver | ||
403 | * in the tx() callback. | ||
404 | * @flags: transmit status flags, defined above | ||
405 | * @retry_count: number of retries | ||
406 | * @excessive_retries: set to 1 if the frame was retried many times | ||
407 | * but not acknowledged | ||
408 | * @ampdu_ack_len: number of aggregated frames. | ||
409 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
410 | * @ampdu_ack_map: block ack bit map for the aggregation. | ||
411 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
412 | * @ack_signal: signal strength of the ACK frame | ||
413 | * @queue_length: ?? REMOVE | ||
414 | * @queue_number: ?? REMOVE | ||
415 | */ | ||
416 | struct ieee80211_tx_status { | ||
417 | struct ieee80211_tx_control control; | ||
418 | u8 flags; | ||
419 | u8 retry_count; | ||
420 | bool excessive_retries; | ||
421 | u8 ampdu_ack_len; | ||
422 | u64 ampdu_ack_map; | ||
423 | int ack_signal; | ||
424 | int queue_length; | ||
425 | int queue_number; | ||
426 | }; | ||
427 | |||
428 | /** | ||
429 | * enum ieee80211_conf_flags - configuration flags | 415 | * enum ieee80211_conf_flags - configuration flags |
430 | * | 416 | * |
431 | * Flags to define PHY configuration options | 417 | * Flags to define PHY configuration options |
@@ -433,11 +419,13 @@ struct ieee80211_tx_status { | |||
433 | * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time | 419 | * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time |
434 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) | 420 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) |
435 | * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) | 421 | * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) |
422 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode | ||
436 | */ | 423 | */ |
437 | enum ieee80211_conf_flags { | 424 | enum ieee80211_conf_flags { |
438 | IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), | 425 | IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), |
439 | IEEE80211_CONF_RADIOTAP = (1<<1), | 426 | IEEE80211_CONF_RADIOTAP = (1<<1), |
440 | IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), | 427 | IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), |
428 | IEEE80211_CONF_PS = (1<<3), | ||
441 | }; | 429 | }; |
442 | 430 | ||
443 | /** | 431 | /** |
@@ -553,34 +541,38 @@ struct ieee80211_if_init_conf { | |||
553 | }; | 541 | }; |
554 | 542 | ||
555 | /** | 543 | /** |
544 | * enum ieee80211_if_conf_change - interface config change flags | ||
545 | * | ||
546 | * @IEEE80211_IFCC_BSSID: The BSSID changed. | ||
547 | * @IEEE80211_IFCC_SSID: The SSID changed. | ||
548 | * @IEEE80211_IFCC_BEACON: The beacon for this interface changed | ||
549 | * (currently AP and MESH only), use ieee80211_beacon_get(). | ||
550 | */ | ||
551 | enum ieee80211_if_conf_change { | ||
552 | IEEE80211_IFCC_BSSID = BIT(0), | ||
553 | IEEE80211_IFCC_SSID = BIT(1), | ||
554 | IEEE80211_IFCC_BEACON = BIT(2), | ||
555 | }; | ||
556 | |||
557 | /** | ||
556 | * struct ieee80211_if_conf - configuration of an interface | 558 | * struct ieee80211_if_conf - configuration of an interface |
557 | * | 559 | * |
558 | * @type: type of the interface. This is always the same as was specified in | 560 | * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. |
559 | * &struct ieee80211_if_init_conf. The type of an interface never changes | ||
560 | * during the life of the interface; this field is present only for | ||
561 | * convenience. | ||
562 | * @bssid: BSSID of the network we are associated to/creating. | 561 | * @bssid: BSSID of the network we are associated to/creating. |
563 | * @ssid: used (together with @ssid_len) by drivers for hardware that | 562 | * @ssid: used (together with @ssid_len) by drivers for hardware that |
564 | * generate beacons independently. The pointer is valid only during the | 563 | * generate beacons independently. The pointer is valid only during the |
565 | * config_interface() call, so copy the value somewhere if you need | 564 | * config_interface() call, so copy the value somewhere if you need |
566 | * it. | 565 | * it. |
567 | * @ssid_len: length of the @ssid field. | 566 | * @ssid_len: length of the @ssid field. |
568 | * @beacon: beacon template. Valid only if @host_gen_beacon_template in | ||
569 | * &struct ieee80211_hw is set. The driver is responsible of freeing | ||
570 | * the sk_buff. | ||
571 | * @beacon_control: tx_control for the beacon template, this field is only | ||
572 | * valid when the @beacon field was set. | ||
573 | * | 567 | * |
574 | * This structure is passed to the config_interface() callback of | 568 | * This structure is passed to the config_interface() callback of |
575 | * &struct ieee80211_hw. | 569 | * &struct ieee80211_hw. |
576 | */ | 570 | */ |
577 | struct ieee80211_if_conf { | 571 | struct ieee80211_if_conf { |
578 | int type; | 572 | u32 changed; |
579 | u8 *bssid; | 573 | u8 *bssid; |
580 | u8 *ssid; | 574 | u8 *ssid; |
581 | size_t ssid_len; | 575 | size_t ssid_len; |
582 | struct sk_buff *beacon; | ||
583 | struct ieee80211_tx_control *beacon_control; | ||
584 | }; | 576 | }; |
585 | 577 | ||
586 | /** | 578 | /** |
@@ -597,8 +589,8 @@ enum ieee80211_key_alg { | |||
597 | 589 | ||
598 | /** | 590 | /** |
599 | * enum ieee80211_key_len - key length | 591 | * enum ieee80211_key_len - key length |
600 | * @WEP40: WEP 5 byte long key | 592 | * @LEN_WEP40: WEP 5-byte long key |
601 | * @WEP104: WEP 13 byte long key | 593 | * @LEN_WEP104: WEP 13-byte long key |
602 | */ | 594 | */ |
603 | enum ieee80211_key_len { | 595 | enum ieee80211_key_len { |
604 | LEN_WEP40 = 5, | 596 | LEN_WEP40 = 5, |
@@ -619,11 +611,14 @@ enum ieee80211_key_len { | |||
619 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by | 611 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by |
620 | * the driver for a TKIP key if it requires Michael MIC | 612 | * the driver for a TKIP key if it requires Michael MIC |
621 | * generation in software. | 613 | * generation in software. |
614 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates | ||
615 | * that the key is pairwise rather then a shared key. | ||
622 | */ | 616 | */ |
623 | enum ieee80211_key_flags { | 617 | enum ieee80211_key_flags { |
624 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, | 618 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, |
625 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, | 619 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, |
626 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, | 620 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, |
621 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, | ||
627 | }; | 622 | }; |
628 | 623 | ||
629 | /** | 624 | /** |
@@ -639,7 +634,12 @@ enum ieee80211_key_flags { | |||
639 | * @flags: key flags, see &enum ieee80211_key_flags. | 634 | * @flags: key flags, see &enum ieee80211_key_flags. |
640 | * @keyidx: the key index (0-3) | 635 | * @keyidx: the key index (0-3) |
641 | * @keylen: key material length | 636 | * @keylen: key material length |
642 | * @key: key material | 637 | * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) |
638 | * data block: | ||
639 | * - Temporal Encryption Key (128 bits) | ||
640 | * - Temporal Authenticator Tx MIC Key (64 bits) | ||
641 | * - Temporal Authenticator Rx MIC Key (64 bits) | ||
642 | * | ||
643 | */ | 643 | */ |
644 | struct ieee80211_key_conf { | 644 | struct ieee80211_key_conf { |
645 | enum ieee80211_key_alg alg; | 645 | enum ieee80211_key_alg alg; |
@@ -667,7 +667,7 @@ enum set_key_cmd { | |||
667 | * enum sta_notify_cmd - sta notify command | 667 | * enum sta_notify_cmd - sta notify command |
668 | * | 668 | * |
669 | * Used with the sta_notify() callback in &struct ieee80211_ops, this | 669 | * Used with the sta_notify() callback in &struct ieee80211_ops, this |
670 | * indicates addition and removal of a station to station table | 670 | * indicates addition and removal of a station to station table. |
671 | * | 671 | * |
672 | * @STA_NOTIFY_ADD: a station was added to the station table | 672 | * @STA_NOTIFY_ADD: a station was added to the station table |
673 | * @STA_NOTIFY_REMOVE: a station being removed from the station table | 673 | * @STA_NOTIFY_REMOVE: a station being removed from the station table |
@@ -700,15 +700,6 @@ enum ieee80211_tkip_key_type { | |||
700 | * any particular flags. There are some exceptions to this rule, | 700 | * any particular flags. There are some exceptions to this rule, |
701 | * however, so you are advised to review these flags carefully. | 701 | * however, so you are advised to review these flags carefully. |
702 | * | 702 | * |
703 | * @IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE: | ||
704 | * The device only needs to be supplied with a beacon template. | ||
705 | * If you need the host to generate each beacon then don't use | ||
706 | * this flag and call ieee80211_beacon_get() when you need the | ||
707 | * next beacon frame. Note that if you set this flag, you must | ||
708 | * implement the set_tim() callback for powersave mode to work | ||
709 | * properly. | ||
710 | * This flag is only relevant for access-point mode. | ||
711 | * | ||
712 | * @IEEE80211_HW_RX_INCLUDES_FCS: | 703 | * @IEEE80211_HW_RX_INCLUDES_FCS: |
713 | * Indicates that received frames passed to the stack include | 704 | * Indicates that received frames passed to the stack include |
714 | * the FCS at the end. | 705 | * the FCS at the end. |
@@ -730,6 +721,29 @@ enum ieee80211_tkip_key_type { | |||
730 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: | 721 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: |
731 | * Hardware is not capable of receiving frames with short preamble on | 722 | * Hardware is not capable of receiving frames with short preamble on |
732 | * the 2.4 GHz band. | 723 | * the 2.4 GHz band. |
724 | * | ||
725 | * @IEEE80211_HW_SIGNAL_UNSPEC: | ||
726 | * Hardware can provide signal values but we don't know its units. We | ||
727 | * expect values between 0 and @max_signal. | ||
728 | * If possible please provide dB or dBm instead. | ||
729 | * | ||
730 | * @IEEE80211_HW_SIGNAL_DB: | ||
731 | * Hardware gives signal values in dB, decibel difference from an | ||
732 | * arbitrary, fixed reference. We expect values between 0 and @max_signal. | ||
733 | * If possible please provide dBm instead. | ||
734 | * | ||
735 | * @IEEE80211_HW_SIGNAL_DBM: | ||
736 | * Hardware gives signal values in dBm, decibel difference from | ||
737 | * one milliwatt. This is the preferred method since it is standardized | ||
738 | * between different devices. @max_signal does not need to be set. | ||
739 | * | ||
740 | * @IEEE80211_HW_NOISE_DBM: | ||
741 | * Hardware can provide noise (radio interference) values in units dBm, | ||
742 | * decibel difference from one milliwatt. | ||
743 | * | ||
744 | * @IEEE80211_HW_SPECTRUM_MGMT: | ||
745 | * Hardware supports spectrum management defined in 802.11h | ||
746 | * Measurement, Channel Switch, Quieting, TPC | ||
733 | */ | 747 | */ |
734 | enum ieee80211_hw_flags { | 748 | enum ieee80211_hw_flags { |
735 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, | 749 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, |
@@ -737,6 +751,11 @@ enum ieee80211_hw_flags { | |||
737 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 751 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
738 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 752 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
739 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 753 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
754 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | ||
755 | IEEE80211_HW_SIGNAL_DB = 1<<6, | ||
756 | IEEE80211_HW_SIGNAL_DBM = 1<<7, | ||
757 | IEEE80211_HW_NOISE_DBM = 1<<8, | ||
758 | IEEE80211_HW_SPECTRUM_MGMT = 1<<9, | ||
740 | }; | 759 | }; |
741 | 760 | ||
742 | /** | 761 | /** |
@@ -754,8 +773,11 @@ enum ieee80211_hw_flags { | |||
754 | * @conf: &struct ieee80211_conf, device configuration, don't use. | 773 | * @conf: &struct ieee80211_conf, device configuration, don't use. |
755 | * | 774 | * |
756 | * @workqueue: single threaded workqueue available for driver use, | 775 | * @workqueue: single threaded workqueue available for driver use, |
757 | * allocated by mac80211 on registration and flushed on | 776 | * allocated by mac80211 on registration and flushed when an |
758 | * unregistration. | 777 | * interface is removed. |
778 | * NOTICE: All work performed on this workqueue should NEVER | ||
779 | * acquire the RTNL lock (i.e. Don't use the function | ||
780 | * ieee80211_iterate_active_interfaces()) | ||
759 | * | 781 | * |
760 | * @priv: pointer to private area that was allocated for driver use | 782 | * @priv: pointer to private area that was allocated for driver use |
761 | * along with this structure. | 783 | * along with this structure. |
@@ -767,15 +789,18 @@ enum ieee80211_hw_flags { | |||
767 | * | 789 | * |
768 | * @channel_change_time: time (in microseconds) it takes to change channels. | 790 | * @channel_change_time: time (in microseconds) it takes to change channels. |
769 | * | 791 | * |
770 | * @max_rssi: Maximum value for ssi in RX information, use | 792 | * @max_signal: Maximum value for signal (rssi) in RX information, used |
771 | * negative numbers for dBm and 0 to indicate no support. | 793 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB |
772 | * | ||
773 | * @max_signal: like @max_rssi, but for the signal value. | ||
774 | * | ||
775 | * @max_noise: like @max_rssi, but for the noise value. | ||
776 | * | 794 | * |
777 | * @queues: number of available hardware transmit queues for | 795 | * @queues: number of available hardware transmit queues for |
778 | * data packets. WMM/QoS requires at least four. | 796 | * data packets. WMM/QoS requires at least four, these |
797 | * queues need to have configurable access parameters. | ||
798 | * | ||
799 | * @ampdu_queues: number of available hardware transmit queues | ||
800 | * for A-MPDU packets, these have no access parameters | ||
801 | * because they're used only for A-MPDU frames. Note that | ||
802 | * mac80211 will not currently use any of the regular queues | ||
803 | * for aggregation. | ||
779 | * | 804 | * |
780 | * @rate_control_algorithm: rate control algorithm for this hardware. | 805 | * @rate_control_algorithm: rate control algorithm for this hardware. |
781 | * If unset (NULL), the default algorithm will be used. Must be | 806 | * If unset (NULL), the default algorithm will be used. Must be |
@@ -794,10 +819,8 @@ struct ieee80211_hw { | |||
794 | unsigned int extra_tx_headroom; | 819 | unsigned int extra_tx_headroom; |
795 | int channel_change_time; | 820 | int channel_change_time; |
796 | int vif_data_size; | 821 | int vif_data_size; |
797 | u8 queues; | 822 | u16 queues, ampdu_queues; |
798 | s8 max_rssi; | ||
799 | s8 max_signal; | 823 | s8 max_signal; |
800 | s8 max_noise; | ||
801 | }; | 824 | }; |
802 | 825 | ||
803 | /** | 826 | /** |
@@ -822,6 +845,43 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr) | |||
822 | memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); | 845 | memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); |
823 | } | 846 | } |
824 | 847 | ||
848 | static inline int ieee80211_num_regular_queues(struct ieee80211_hw *hw) | ||
849 | { | ||
850 | return hw->queues; | ||
851 | } | ||
852 | |||
853 | static inline int ieee80211_num_queues(struct ieee80211_hw *hw) | ||
854 | { | ||
855 | return hw->queues + hw->ampdu_queues; | ||
856 | } | ||
857 | |||
858 | static inline struct ieee80211_rate * | ||
859 | ieee80211_get_tx_rate(const struct ieee80211_hw *hw, | ||
860 | const struct ieee80211_tx_info *c) | ||
861 | { | ||
862 | if (WARN_ON(c->tx_rate_idx < 0)) | ||
863 | return NULL; | ||
864 | return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; | ||
865 | } | ||
866 | |||
867 | static inline struct ieee80211_rate * | ||
868 | ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw, | ||
869 | const struct ieee80211_tx_info *c) | ||
870 | { | ||
871 | if (c->control.rts_cts_rate_idx < 0) | ||
872 | return NULL; | ||
873 | return &hw->wiphy->bands[c->band]->bitrates[c->control.rts_cts_rate_idx]; | ||
874 | } | ||
875 | |||
876 | static inline struct ieee80211_rate * | ||
877 | ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | ||
878 | const struct ieee80211_tx_info *c) | ||
879 | { | ||
880 | if (c->control.alt_retry_rate_idx < 0) | ||
881 | return NULL; | ||
882 | return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx]; | ||
883 | } | ||
884 | |||
825 | /** | 885 | /** |
826 | * DOC: Hardware crypto acceleration | 886 | * DOC: Hardware crypto acceleration |
827 | * | 887 | * |
@@ -979,8 +1039,10 @@ enum ieee80211_ampdu_mlme_action { | |||
979 | * @tx: Handler that 802.11 module calls for each transmitted frame. | 1039 | * @tx: Handler that 802.11 module calls for each transmitted frame. |
980 | * skb contains the buffer starting from the IEEE 802.11 header. | 1040 | * skb contains the buffer starting from the IEEE 802.11 header. |
981 | * The low-level driver should send the frame out based on | 1041 | * The low-level driver should send the frame out based on |
982 | * configuration in the TX control data. Must be implemented and | 1042 | * configuration in the TX control data. This handler should, |
983 | * atomic. | 1043 | * preferably, never fail and stop queues appropriately, more |
1044 | * importantly, however, it must never fail for A-MPDU-queues. | ||
1045 | * Must be implemented and atomic. | ||
984 | * | 1046 | * |
985 | * @start: Called before the first netdevice attached to the hardware | 1047 | * @start: Called before the first netdevice attached to the hardware |
986 | * is enabled. This should turn on the hardware and must turn on | 1048 | * is enabled. This should turn on the hardware and must turn on |
@@ -1072,15 +1134,13 @@ enum ieee80211_ampdu_mlme_action { | |||
1072 | * of assocaited station or AP. | 1134 | * of assocaited station or AP. |
1073 | * | 1135 | * |
1074 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1136 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1075 | * bursting) for a hardware TX queue. The @queue parameter uses the | 1137 | * bursting) for a hardware TX queue. Must be atomic. |
1076 | * %IEEE80211_TX_QUEUE_* constants. Must be atomic. | ||
1077 | * | 1138 | * |
1078 | * @get_tx_stats: Get statistics of the current TX queue status. This is used | 1139 | * @get_tx_stats: Get statistics of the current TX queue status. This is used |
1079 | * to get number of currently queued packets (queue length), maximum queue | 1140 | * to get number of currently queued packets (queue length), maximum queue |
1080 | * size (limit), and total number of packets sent using each TX queue | 1141 | * size (limit), and total number of packets sent using each TX queue |
1081 | * (count). This information is used for WMM to find out which TX | 1142 | * (count). The 'stats' pointer points to an array that has hw->queues + |
1082 | * queues have room for more packets and by hostapd to provide | 1143 | * hw->ampdu_queues items. |
1083 | * statistics about the current queueing state to external programs. | ||
1084 | * | 1144 | * |
1085 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, | 1145 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, |
1086 | * this is only used for IBSS mode debugging and, as such, is not a | 1146 | * this is only used for IBSS mode debugging and, as such, is not a |
@@ -1091,17 +1151,6 @@ enum ieee80211_ampdu_mlme_action { | |||
1091 | * function is optional if the firmware/hardware takes full care of | 1151 | * function is optional if the firmware/hardware takes full care of |
1092 | * TSF synchronization. | 1152 | * TSF synchronization. |
1093 | * | 1153 | * |
1094 | * @beacon_update: Setup beacon data for IBSS beacons. Unlike access point, | ||
1095 | * IBSS uses a fixed beacon frame which is configured using this | ||
1096 | * function. | ||
1097 | * If the driver returns success (0) from this callback, it owns | ||
1098 | * the skb. That means the driver is responsible to kfree_skb() it. | ||
1099 | * The control structure is not dynamically allocated. That means the | ||
1100 | * driver does not own the pointer and if it needs it somewhere | ||
1101 | * outside of the context of this function, it must copy it | ||
1102 | * somewhere else. | ||
1103 | * This handler is required only for IBSS mode. | ||
1104 | * | ||
1105 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. | 1154 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. |
1106 | * This is needed only for IBSS mode and the result of this function is | 1155 | * This is needed only for IBSS mode and the result of this function is |
1107 | * used to determine whether to reply to Probe Requests. | 1156 | * used to determine whether to reply to Probe Requests. |
@@ -1116,8 +1165,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1116 | * that TX/RX_STOP can pass NULL for this parameter. | 1165 | * that TX/RX_STOP can pass NULL for this parameter. |
1117 | */ | 1166 | */ |
1118 | struct ieee80211_ops { | 1167 | struct ieee80211_ops { |
1119 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, | 1168 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
1120 | struct ieee80211_tx_control *control); | ||
1121 | int (*start)(struct ieee80211_hw *hw); | 1169 | int (*start)(struct ieee80211_hw *hw); |
1122 | void (*stop)(struct ieee80211_hw *hw); | 1170 | void (*stop)(struct ieee80211_hw *hw); |
1123 | int (*add_interface)(struct ieee80211_hw *hw, | 1171 | int (*add_interface)(struct ieee80211_hw *hw, |
@@ -1154,15 +1202,12 @@ struct ieee80211_ops { | |||
1154 | u32 short_retry, u32 long_retr); | 1202 | u32 short_retry, u32 long_retr); |
1155 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1203 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1156 | enum sta_notify_cmd, const u8 *addr); | 1204 | enum sta_notify_cmd, const u8 *addr); |
1157 | int (*conf_tx)(struct ieee80211_hw *hw, int queue, | 1205 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |
1158 | const struct ieee80211_tx_queue_params *params); | 1206 | const struct ieee80211_tx_queue_params *params); |
1159 | int (*get_tx_stats)(struct ieee80211_hw *hw, | 1207 | int (*get_tx_stats)(struct ieee80211_hw *hw, |
1160 | struct ieee80211_tx_queue_stats *stats); | 1208 | struct ieee80211_tx_queue_stats *stats); |
1161 | u64 (*get_tsf)(struct ieee80211_hw *hw); | 1209 | u64 (*get_tsf)(struct ieee80211_hw *hw); |
1162 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1210 | void (*reset_tsf)(struct ieee80211_hw *hw); |
1163 | int (*beacon_update)(struct ieee80211_hw *hw, | ||
1164 | struct sk_buff *skb, | ||
1165 | struct ieee80211_tx_control *control); | ||
1166 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1211 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1167 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1212 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1168 | enum ieee80211_ampdu_mlme_action action, | 1213 | enum ieee80211_ampdu_mlme_action action, |
@@ -1292,7 +1337,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw); | |||
1292 | * | 1337 | * |
1293 | * This function frees everything that was allocated, including the | 1338 | * This function frees everything that was allocated, including the |
1294 | * private data for the driver. You must call ieee80211_unregister_hw() | 1339 | * private data for the driver. You must call ieee80211_unregister_hw() |
1295 | * before calling this function | 1340 | * before calling this function. |
1296 | * | 1341 | * |
1297 | * @hw: the hardware to free | 1342 | * @hw: the hardware to free |
1298 | */ | 1343 | */ |
@@ -1358,16 +1403,12 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | |||
1358 | * | 1403 | * |
1359 | * @hw: the hardware the frame was transmitted by | 1404 | * @hw: the hardware the frame was transmitted by |
1360 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 1405 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
1361 | * @status: status information for this frame; the status pointer need not | ||
1362 | * be valid after this function returns and is not freed by mac80211, | ||
1363 | * it is recommended that it points to a stack area | ||
1364 | */ | 1406 | */ |
1365 | void ieee80211_tx_status(struct ieee80211_hw *hw, | 1407 | void ieee80211_tx_status(struct ieee80211_hw *hw, |
1366 | struct sk_buff *skb, | 1408 | struct sk_buff *skb); |
1367 | struct ieee80211_tx_status *status); | ||
1368 | 1409 | ||
1369 | /** | 1410 | /** |
1370 | * ieee80211_tx_status_irqsafe - irq-safe transmit status callback | 1411 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback |
1371 | * | 1412 | * |
1372 | * Like ieee80211_tx_status() but can be called in IRQ context | 1413 | * Like ieee80211_tx_status() but can be called in IRQ context |
1373 | * (internally defers to a tasklet.) | 1414 | * (internally defers to a tasklet.) |
@@ -1377,13 +1418,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, | |||
1377 | * | 1418 | * |
1378 | * @hw: the hardware the frame was transmitted by | 1419 | * @hw: the hardware the frame was transmitted by |
1379 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 1420 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
1380 | * @status: status information for this frame; the status pointer need not | ||
1381 | * be valid after this function returns and is not freed by mac80211, | ||
1382 | * it is recommended that it points to a stack area | ||
1383 | */ | 1421 | */ |
1384 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | 1422 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, |
1385 | struct sk_buff *skb, | 1423 | struct sk_buff *skb); |
1386 | struct ieee80211_tx_status *status); | ||
1387 | 1424 | ||
1388 | /** | 1425 | /** |
1389 | * ieee80211_beacon_get - beacon generation function | 1426 | * ieee80211_beacon_get - beacon generation function |
@@ -1399,8 +1436,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
1399 | * is responsible of freeing it. | 1436 | * is responsible of freeing it. |
1400 | */ | 1437 | */ |
1401 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 1438 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, |
1402 | struct ieee80211_vif *vif, | 1439 | struct ieee80211_vif *vif); |
1403 | struct ieee80211_tx_control *control); | ||
1404 | 1440 | ||
1405 | /** | 1441 | /** |
1406 | * ieee80211_rts_get - RTS frame generation function | 1442 | * ieee80211_rts_get - RTS frame generation function |
@@ -1408,7 +1444,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1408 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1444 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1409 | * @frame: pointer to the frame that is going to be protected by the RTS. | 1445 | * @frame: pointer to the frame that is going to be protected by the RTS. |
1410 | * @frame_len: the frame length (in octets). | 1446 | * @frame_len: the frame length (in octets). |
1411 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1447 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1412 | * @rts: The buffer where to store the RTS frame. | 1448 | * @rts: The buffer where to store the RTS frame. |
1413 | * | 1449 | * |
1414 | * If the RTS frames are generated by the host system (i.e., not in | 1450 | * If the RTS frames are generated by the host system (i.e., not in |
@@ -1418,7 +1454,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1418 | */ | 1454 | */ |
1419 | void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1455 | void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1420 | const void *frame, size_t frame_len, | 1456 | const void *frame, size_t frame_len, |
1421 | const struct ieee80211_tx_control *frame_txctl, | 1457 | const struct ieee80211_tx_info *frame_txctl, |
1422 | struct ieee80211_rts *rts); | 1458 | struct ieee80211_rts *rts); |
1423 | 1459 | ||
1424 | /** | 1460 | /** |
@@ -1426,7 +1462,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1426 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1462 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1427 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1463 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1428 | * @frame_len: the length of the frame that is going to be protected by the RTS. | 1464 | * @frame_len: the length of the frame that is going to be protected by the RTS. |
1429 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1465 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1430 | * | 1466 | * |
1431 | * If the RTS is generated in firmware, but the host system must provide | 1467 | * If the RTS is generated in firmware, but the host system must provide |
1432 | * the duration field, the low-level driver uses this function to receive | 1468 | * the duration field, the low-level driver uses this function to receive |
@@ -1434,7 +1470,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1434 | */ | 1470 | */ |
1435 | __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | 1471 | __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, |
1436 | struct ieee80211_vif *vif, size_t frame_len, | 1472 | struct ieee80211_vif *vif, size_t frame_len, |
1437 | const struct ieee80211_tx_control *frame_txctl); | 1473 | const struct ieee80211_tx_info *frame_txctl); |
1438 | 1474 | ||
1439 | /** | 1475 | /** |
1440 | * ieee80211_ctstoself_get - CTS-to-self frame generation function | 1476 | * ieee80211_ctstoself_get - CTS-to-self frame generation function |
@@ -1442,7 +1478,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | |||
1442 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1478 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1443 | * @frame: pointer to the frame that is going to be protected by the CTS-to-self. | 1479 | * @frame: pointer to the frame that is going to be protected by the CTS-to-self. |
1444 | * @frame_len: the frame length (in octets). | 1480 | * @frame_len: the frame length (in octets). |
1445 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1481 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1446 | * @cts: The buffer where to store the CTS-to-self frame. | 1482 | * @cts: The buffer where to store the CTS-to-self frame. |
1447 | * | 1483 | * |
1448 | * If the CTS-to-self frames are generated by the host system (i.e., not in | 1484 | * If the CTS-to-self frames are generated by the host system (i.e., not in |
@@ -1453,7 +1489,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | |||
1453 | void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | 1489 | void ieee80211_ctstoself_get(struct ieee80211_hw *hw, |
1454 | struct ieee80211_vif *vif, | 1490 | struct ieee80211_vif *vif, |
1455 | const void *frame, size_t frame_len, | 1491 | const void *frame, size_t frame_len, |
1456 | const struct ieee80211_tx_control *frame_txctl, | 1492 | const struct ieee80211_tx_info *frame_txctl, |
1457 | struct ieee80211_cts *cts); | 1493 | struct ieee80211_cts *cts); |
1458 | 1494 | ||
1459 | /** | 1495 | /** |
@@ -1461,7 +1497,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | |||
1461 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1497 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1462 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1498 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1463 | * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. | 1499 | * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. |
1464 | * @frame_txctl: &struct ieee80211_tx_control of the frame. | 1500 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
1465 | * | 1501 | * |
1466 | * If the CTS-to-self is generated in firmware, but the host system must provide | 1502 | * If the CTS-to-self is generated in firmware, but the host system must provide |
1467 | * the duration field, the low-level driver uses this function to receive | 1503 | * the duration field, the low-level driver uses this function to receive |
@@ -1470,7 +1506,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | |||
1470 | __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | 1506 | __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, |
1471 | struct ieee80211_vif *vif, | 1507 | struct ieee80211_vif *vif, |
1472 | size_t frame_len, | 1508 | size_t frame_len, |
1473 | const struct ieee80211_tx_control *frame_txctl); | 1509 | const struct ieee80211_tx_info *frame_txctl); |
1474 | 1510 | ||
1475 | /** | 1511 | /** |
1476 | * ieee80211_generic_frame_duration - Calculate the duration field for a frame | 1512 | * ieee80211_generic_frame_duration - Calculate the duration field for a frame |
@@ -1509,8 +1545,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | |||
1509 | * use common code for all beacons. | 1545 | * use common code for all beacons. |
1510 | */ | 1546 | */ |
1511 | struct sk_buff * | 1547 | struct sk_buff * |
1512 | ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1548 | ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
1513 | struct ieee80211_tx_control *control); | ||
1514 | 1549 | ||
1515 | /** | 1550 | /** |
1516 | * ieee80211_get_hdrlen_from_skb - get header length from data | 1551 | * ieee80211_get_hdrlen_from_skb - get header length from data |
@@ -1522,7 +1557,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1522 | * | 1557 | * |
1523 | * @skb: the frame | 1558 | * @skb: the frame |
1524 | */ | 1559 | */ |
1525 | int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | 1560 | unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); |
1526 | 1561 | ||
1527 | /** | 1562 | /** |
1528 | * ieee80211_get_hdrlen - get header length from frame control | 1563 | * ieee80211_get_hdrlen - get header length from frame control |
@@ -1535,6 +1570,12 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
1535 | int ieee80211_get_hdrlen(u16 fc); | 1570 | int ieee80211_get_hdrlen(u16 fc); |
1536 | 1571 | ||
1537 | /** | 1572 | /** |
1573 | * ieee80211_hdrlen - get header length in bytes from frame control | ||
1574 | * @fc: frame control field in little-endian format | ||
1575 | */ | ||
1576 | unsigned int ieee80211_hdrlen(__le16 fc); | ||
1577 | |||
1578 | /** | ||
1538 | * ieee80211_get_tkip_key - get a TKIP rc4 for skb | 1579 | * ieee80211_get_tkip_key - get a TKIP rc4 for skb |
1539 | * | 1580 | * |
1540 | * This function computes a TKIP rc4 key for an skb. It computes | 1581 | * This function computes a TKIP rc4 key for an skb. It computes |
@@ -1545,6 +1586,8 @@ int ieee80211_get_hdrlen(u16 fc); | |||
1545 | * @keyconf: the parameter passed with the set key | 1586 | * @keyconf: the parameter passed with the set key |
1546 | * @skb: the skb for which the key is needed | 1587 | * @skb: the skb for which the key is needed |
1547 | * @rc4key: a buffer to which the key will be written | 1588 | * @rc4key: a buffer to which the key will be written |
1589 | * @type: TBD | ||
1590 | * @key: TBD | ||
1548 | */ | 1591 | */ |
1549 | void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, | 1592 | void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, |
1550 | struct sk_buff *skb, | 1593 | struct sk_buff *skb, |
@@ -1568,14 +1611,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue); | |||
1568 | void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); | 1611 | void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); |
1569 | 1612 | ||
1570 | /** | 1613 | /** |
1571 | * ieee80211_start_queues - start all queues | ||
1572 | * @hw: pointer to as obtained from ieee80211_alloc_hw(). | ||
1573 | * | ||
1574 | * Drivers should use this function instead of netif_start_queue. | ||
1575 | */ | ||
1576 | void ieee80211_start_queues(struct ieee80211_hw *hw); | ||
1577 | |||
1578 | /** | ||
1579 | * ieee80211_stop_queues - stop all queues | 1614 | * ieee80211_stop_queues - stop all queues |
1580 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 1615 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
1581 | * | 1616 | * |
@@ -1603,7 +1638,7 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
1603 | void ieee80211_scan_completed(struct ieee80211_hw *hw); | 1638 | void ieee80211_scan_completed(struct ieee80211_hw *hw); |
1604 | 1639 | ||
1605 | /** | 1640 | /** |
1606 | * ieee80211_iterate_active_interfaces- iterate active interfaces | 1641 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
1607 | * | 1642 | * |
1608 | * This function iterates over the interfaces associated with a given | 1643 | * This function iterates over the interfaces associated with a given |
1609 | * hardware that are currently active and calls the callback for them. | 1644 | * hardware that are currently active and calls the callback for them. |
@@ -1670,7 +1705,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | |||
1670 | * | 1705 | * |
1671 | * This function must be called by low level driver once it has | 1706 | * This function must be called by low level driver once it has |
1672 | * finished with preparations for the BA session. | 1707 | * finished with preparations for the BA session. |
1673 | * This version of the function is irq safe. | 1708 | * This version of the function is IRQ-safe. |
1674 | */ | 1709 | */ |
1675 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 1710 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, |
1676 | u16 tid); | 1711 | u16 tid); |
@@ -1710,7 +1745,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | |||
1710 | * | 1745 | * |
1711 | * This function must be called by low level driver once it has | 1746 | * This function must be called by low level driver once it has |
1712 | * finished with preparations for the BA session tear down. | 1747 | * finished with preparations for the BA session tear down. |
1713 | * This version of the function is irq safe. | 1748 | * This version of the function is IRQ-safe. |
1714 | */ | 1749 | */ |
1715 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 1750 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, |
1716 | u16 tid); | 1751 | u16 tid); |
@@ -1718,7 +1753,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
1718 | /** | 1753 | /** |
1719 | * ieee80211_notify_mac - low level driver notification | 1754 | * ieee80211_notify_mac - low level driver notification |
1720 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 1755 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
1721 | * @notification_types: enum ieee80211_notification_types | 1756 | * @notif_type: enum ieee80211_notification_types |
1722 | * | 1757 | * |
1723 | * This function must be called by low level driver to inform mac80211 of | 1758 | * This function must be called by low level driver to inform mac80211 of |
1724 | * low level driver status change or force mac80211 to re-assoc for low | 1759 | * low level driver status change or force mac80211 to re-assoc for low |