aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-01-05 04:50:33 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-01-05 04:50:33 -0500
commit353816f43d1fb340ff2d9a911dd5d0799c09f6a5 (patch)
tree517290fd884d286fe2971137ac89f89e3567785a /include/net/mac80211.h
parent160bbab3000dafccbe43688e48208cecf4deb879 (diff)
parentfe0bdec68b77020281dc814805edfe594ae89e0f (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: arch/arm/mach-pxa/corgi.c arch/arm/mach-pxa/poodle.c arch/arm/mach-pxa/spitz.c
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h446
1 files changed, 270 insertions, 176 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 73d81bc6aa75..b3bd00a9d992 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright 2002-2005, Devicescape Software, Inc. 4 * Copyright 2002-2005, Devicescape Software, Inc.
5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
6 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -107,7 +107,7 @@ enum ieee80211_max_queues {
107 * The information provided in this structure is required for QoS 107 * The information provided in this structure is required for QoS
108 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. 108 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
109 * 109 *
110 * @aifs: arbitration interface space [0..255] 110 * @aifs: arbitration interframe space [0..255]
111 * @cw_min: minimum contention window [a value of the form 111 * @cw_min: minimum contention window [a value of the form
112 * 2^n-1 in the range 1..32767] 112 * 2^n-1 in the range 1..32767]
113 * @cw_max: maximum contention window [like @cw_min] 113 * @cw_max: maximum contention window [like @cw_min]
@@ -164,6 +164,14 @@ enum ieee80211_bss_change {
164}; 164};
165 165
166/** 166/**
167 * struct ieee80211_bss_ht_conf - BSS's changing HT configuration
168 * @operation_mode: HT operation mode (like in &struct ieee80211_ht_info)
169 */
170struct ieee80211_bss_ht_conf {
171 u16 operation_mode;
172};
173
174/**
167 * struct ieee80211_bss_conf - holds the BSS's changing parameters 175 * struct ieee80211_bss_conf - holds the BSS's changing parameters
168 * 176 *
169 * This structure keeps information about a BSS (and an association 177 * This structure keeps information about a BSS (and an association
@@ -172,15 +180,17 @@ enum ieee80211_bss_change {
172 * @assoc: association status 180 * @assoc: association status
173 * @aid: association ID number, valid only when @assoc is true 181 * @aid: association ID number, valid only when @assoc is true
174 * @use_cts_prot: use CTS protection 182 * @use_cts_prot: use CTS protection
175 * @use_short_preamble: use 802.11b short preamble 183 * @use_short_preamble: use 802.11b short preamble;
176 * @use_short_slot: use short slot time (only relevant for ERP) 184 * if the hardware cannot handle this it must set the
185 * IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE hardware flag
186 * @use_short_slot: use short slot time (only relevant for ERP);
187 * if the hardware cannot handle this it must set the
188 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
177 * @dtim_period: num of beacons before the next DTIM, for PSM 189 * @dtim_period: num of beacons before the next DTIM, for PSM
178 * @timestamp: beacon timestamp 190 * @timestamp: beacon timestamp
179 * @beacon_int: beacon interval 191 * @beacon_int: beacon interval
180 * @assoc_capability: capabilities taken from assoc resp 192 * @assoc_capability: capabilities taken from assoc resp
181 * @assoc_ht: association in HT mode 193 * @ht: BSS's HT configuration
182 * @ht_conf: ht capabilities
183 * @ht_bss_conf: ht extended capabilities
184 * @basic_rates: bitmap of basic rates, each bit stands for an 194 * @basic_rates: bitmap of basic rates, each bit stands for an
185 * index into the rate table configured by the driver in 195 * index into the rate table configured by the driver in
186 * the current band. 196 * the current band.
@@ -198,10 +208,7 @@ struct ieee80211_bss_conf {
198 u16 assoc_capability; 208 u16 assoc_capability;
199 u64 timestamp; 209 u64 timestamp;
200 u64 basic_rates; 210 u64 basic_rates;
201 /* ht related data */ 211 struct ieee80211_bss_ht_conf ht;
202 bool assoc_ht;
203 struct ieee80211_ht_info *ht_conf;
204 struct ieee80211_ht_bss_info *ht_bss_conf;
205}; 212};
206 213
207/** 214/**
@@ -210,29 +217,24 @@ struct ieee80211_bss_conf {
210 * These flags are used with the @flags member of &ieee80211_tx_info. 217 * These flags are used with the @flags member of &ieee80211_tx_info.
211 * 218 *
212 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. 219 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
213 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame 220 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
214 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., 221 * number to this frame, taking care of not overwriting the fragment
215 * for combined 802.11g / 802.11b networks) 222 * number and increasing the sequence number only when the
223 * IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
224 * assign sequence numbers to QoS-data frames but cannot do so correctly
225 * for non-QoS-data and management frames because beacons need them from
226 * that counter as well and mac80211 cannot guarantee proper sequencing.
227 * If this flag is set, the driver should instruct the hardware to
228 * assign a sequence number to the frame or assign one itself. Cf. IEEE
229 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
230 * beacons and always be clear for frames without a sequence number field.
216 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack 231 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
217 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD
218 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination 232 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
219 * station 233 * station
220 * @IEEE80211_TX_CTL_REQUEUE: TBD
221 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame 234 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
222 * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD
223 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
224 * through set_retry_limit configured long retry value
225 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon 235 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
226 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU 236 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
227 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number 237 * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211.
228 * of streams when this flag is on can be extracted from antenna_sel_tx,
229 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
230 * antennas marked use MIMO_n.
231 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
232 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
233 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
234 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
235 * @IEEE80211_TX_CTL_INJECTED: TBD
236 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted 238 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
237 * because the destination STA was in powersave mode. 239 * because the destination STA was in powersave mode.
238 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged 240 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
@@ -240,63 +242,67 @@ struct ieee80211_bss_conf {
240 * is for the whole aggregation. 242 * is for the whole aggregation.
241 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned, 243 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
242 * so consider using block ack request (BAR). 244 * so consider using block ack request (BAR).
243 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence 245 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
244 * number to this frame, taking care of not overwriting the fragment 246 * set by rate control algorithms to indicate probe rate, will
245 * number and increasing the sequence number only when the 247 * be cleared for fragmented frames (except on the last fragment)
246 * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly
247 * assign sequence numbers to QoS-data frames but cannot do so correctly
248 * for non-QoS-data and management frames because beacons need them from
249 * that counter as well and mac80211 cannot guarantee proper sequencing.
250 * If this flag is set, the driver should instruct the hardware to
251 * assign a sequence number to the frame or assign one itself. Cf. IEEE
252 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
253 * beacons always be clear for frames without a sequence number field.
254 */ 248 */
255enum mac80211_tx_control_flags { 249enum mac80211_tx_control_flags {
256 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 250 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
257 IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2), 251 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
258 IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3), 252 IEEE80211_TX_CTL_NO_ACK = BIT(2),
259 IEEE80211_TX_CTL_NO_ACK = BIT(4), 253 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(3),
260 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5), 254 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(4),
261 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6), 255 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(5),
262 IEEE80211_TX_CTL_REQUEUE = BIT(7), 256 IEEE80211_TX_CTL_AMPDU = BIT(6),
263 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8), 257 IEEE80211_TX_CTL_INJECTED = BIT(7),
264 IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9), 258 IEEE80211_TX_STAT_TX_FILTERED = BIT(8),
265 IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10), 259 IEEE80211_TX_STAT_ACK = BIT(9),
266 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12), 260 IEEE80211_TX_STAT_AMPDU = BIT(10),
267 IEEE80211_TX_CTL_AMPDU = BIT(13), 261 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
268 IEEE80211_TX_CTL_OFDM_HT = BIT(14), 262 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
269 IEEE80211_TX_CTL_GREEN_FIELD = BIT(15), 263};
270 IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16), 264
271 IEEE80211_TX_CTL_DUP_DATA = BIT(17), 265enum mac80211_rate_control_flags {
272 IEEE80211_TX_CTL_SHORT_GI = BIT(18), 266 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0),
273 IEEE80211_TX_CTL_INJECTED = BIT(19), 267 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
274 IEEE80211_TX_STAT_TX_FILTERED = BIT(20), 268 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
275 IEEE80211_TX_STAT_ACK = BIT(21), 269
276 IEEE80211_TX_STAT_AMPDU = BIT(22), 270 /* rate index is an MCS rate number instead of an index */
277 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23), 271 IEEE80211_TX_RC_MCS = BIT(3),
278 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24), 272 IEEE80211_TX_RC_GREEN_FIELD = BIT(4),
273 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5),
274 IEEE80211_TX_RC_DUP_DATA = BIT(6),
275 IEEE80211_TX_RC_SHORT_GI = BIT(7),
279}; 276};
280 277
281 278
282#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \ 279/* there are 40 bytes if you don't need the rateset to be kept */
283 (sizeof(((struct sk_buff *)0)->cb) - 8) 280#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE 40
284#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
285 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
286 281
287/* maximum number of alternate rate retry stages */ 282/* if you do need the rateset, then you have less space */
288#define IEEE80211_TX_MAX_ALTRATE 3 283#define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24
284
285/* maximum number of rate stages */
286#define IEEE80211_TX_MAX_RATES 5
289 287
290/** 288/**
291 * struct ieee80211_tx_altrate - alternate rate selection/status 289 * struct ieee80211_tx_rate - rate selection/status
290 *
291 * @idx: rate index to attempt to send with
292 * @flags: rate control flags (&enum mac80211_rate_control_flags)
293 * @count: number of tries in this rate before going to the next rate
292 * 294 *
293 * @rate_idx: rate index to attempt to send with 295 * A value of -1 for @idx indicates an invalid rate and, if used
294 * @limit: number of retries before fallback 296 * in an array of retry rates, that no more rates should be tried.
297 *
298 * When used for transmit status reporting, the driver should
299 * always report the rate along with the flags it used.
295 */ 300 */
296struct ieee80211_tx_altrate { 301struct ieee80211_tx_rate {
297 s8 rate_idx; 302 s8 idx;
298 u8 limit; 303 u8 count;
299}; 304 u8 flags;
305} __attribute__((packed));
300 306
301/** 307/**
302 * struct ieee80211_tx_info - skb transmit information 308 * struct ieee80211_tx_info - skb transmit information
@@ -310,15 +316,13 @@ struct ieee80211_tx_altrate {
310 * it may be NULL. 316 * it may be NULL.
311 * 317 *
312 * @flags: transmit info flags, defined above 318 * @flags: transmit info flags, defined above
313 * @band: TBD 319 * @band: the band to transmit on (use for checking for races)
314 * @tx_rate_idx: TBD 320 * @antenna_sel_tx: antenna to use, 0 for automatic diversity
315 * @antenna_sel_tx: TBD 321 * @pad: padding, ignore
316 * @control: union for control data 322 * @control: union for control data
317 * @status: union for status data 323 * @status: union for status data
318 * @driver_data: array of driver_data pointers 324 * @driver_data: array of driver_data pointers
319 * @retry_count: number of retries 325 * @retry_count: number of retries
320 * @excessive_retries: set to 1 if the frame was retried many times
321 * but not acknowledged
322 * @ampdu_ack_len: number of aggregated frames. 326 * @ampdu_ack_len: number of aggregated frames.
323 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 327 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
324 * @ampdu_ack_map: block ack bit map for the aggregation. 328 * @ampdu_ack_map: block ack bit map for the aggregation.
@@ -329,31 +333,44 @@ struct ieee80211_tx_info {
329 /* common information */ 333 /* common information */
330 u32 flags; 334 u32 flags;
331 u8 band; 335 u8 band;
332 s8 tx_rate_idx; 336
333 u8 antenna_sel_tx; 337 u8 antenna_sel_tx;
334 338
335 /* 1 byte hole */ 339 /* 2 byte hole */
340 u8 pad[2];
336 341
337 union { 342 union {
338 struct { 343 struct {
344 union {
345 /* rate control */
346 struct {
347 struct ieee80211_tx_rate rates[
348 IEEE80211_TX_MAX_RATES];
349 s8 rts_cts_rate_idx;
350 };
351 /* only needed before rate control */
352 unsigned long jiffies;
353 };
339 /* NB: vif can be NULL for injected frames */ 354 /* NB: vif can be NULL for injected frames */
340 struct ieee80211_vif *vif; 355 struct ieee80211_vif *vif;
341 struct ieee80211_key_conf *hw_key; 356 struct ieee80211_key_conf *hw_key;
342 struct ieee80211_sta *sta; 357 struct ieee80211_sta *sta;
343 unsigned long jiffies;
344 s8 rts_cts_rate_idx;
345 u8 retry_limit;
346 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE];
347 } control; 358 } control;
348 struct { 359 struct {
360 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
361 u8 ampdu_ack_len;
349 u64 ampdu_ack_map; 362 u64 ampdu_ack_map;
350 int ack_signal; 363 int ack_signal;
351 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE + 1]; 364 /* 8 bytes free */
352 u8 retry_count;
353 bool excessive_retries;
354 u8 ampdu_ack_len;
355 } status; 365 } status;
356 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS]; 366 struct {
367 struct ieee80211_tx_rate driver_rates[
368 IEEE80211_TX_MAX_RATES];
369 void *rate_driver_data[
370 IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)];
371 };
372 void *driver_data[
373 IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)];
357 }; 374 };
358}; 375};
359 376
@@ -362,6 +379,41 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
362 return (struct ieee80211_tx_info *)skb->cb; 379 return (struct ieee80211_tx_info *)skb->cb;
363} 380}
364 381
382/**
383 * ieee80211_tx_info_clear_status - clear TX status
384 *
385 * @info: The &struct ieee80211_tx_info to be cleared.
386 *
387 * When the driver passes an skb back to mac80211, it must report
388 * a number of things in TX status. This function clears everything
389 * in the TX status but the rate control information (it does clear
390 * the count since you need to fill that in anyway).
391 *
392 * NOTE: You can only use this function if you do NOT use
393 * info->driver_data! Use info->rate_driver_data
394 * instead if you need only the less space that allows.
395 */
396static inline void
397ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
398{
399 int i;
400
401 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) !=
402 offsetof(struct ieee80211_tx_info, control.rates));
403 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) !=
404 offsetof(struct ieee80211_tx_info, driver_rates));
405 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) != 8);
406 /* clear the rate counts */
407 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++)
408 info->status.rates[i].count = 0;
409
410 BUILD_BUG_ON(
411 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23);
412 memset(&info->status.ampdu_ack_len, 0,
413 sizeof(struct ieee80211_tx_info) -
414 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len));
415}
416
365 417
366/** 418/**
367 * enum mac80211_rx_flags - receive flags 419 * enum mac80211_rx_flags - receive flags
@@ -384,6 +436,9 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
384 * is valid. This is useful in monitor mode and necessary for beacon frames 436 * is valid. This is useful in monitor mode and necessary for beacon frames
385 * to enable IBSS merging. 437 * to enable IBSS merging.
386 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame 438 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame
439 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
440 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
441 * @RX_FLAG_SHORT_GI: Short guard interval was used
387 */ 442 */
388enum mac80211_rx_flags { 443enum mac80211_rx_flags {
389 RX_FLAG_MMIC_ERROR = 1<<0, 444 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -394,7 +449,10 @@ enum mac80211_rx_flags {
394 RX_FLAG_FAILED_FCS_CRC = 1<<5, 449 RX_FLAG_FAILED_FCS_CRC = 1<<5,
395 RX_FLAG_FAILED_PLCP_CRC = 1<<6, 450 RX_FLAG_FAILED_PLCP_CRC = 1<<6,
396 RX_FLAG_TSFT = 1<<7, 451 RX_FLAG_TSFT = 1<<7,
397 RX_FLAG_SHORTPRE = 1<<8 452 RX_FLAG_SHORTPRE = 1<<8,
453 RX_FLAG_HT = 1<<9,
454 RX_FLAG_40MHZ = 1<<10,
455 RX_FLAG_SHORT_GI = 1<<11,
398}; 456};
399 457
400/** 458/**
@@ -414,7 +472,8 @@ enum mac80211_rx_flags {
414 * @noise: noise when receiving this frame, in dBm. 472 * @noise: noise when receiving this frame, in dBm.
415 * @qual: overall signal quality indication, in percent (0-100). 473 * @qual: overall signal quality indication, in percent (0-100).
416 * @antenna: antenna used 474 * @antenna: antenna used
417 * @rate_idx: index of data rate into band's supported rates 475 * @rate_idx: index of data rate into band's supported rates or MCS index if
476 * HT rates are use (RX_FLAG_HT)
418 * @flag: %RX_FLAG_* 477 * @flag: %RX_FLAG_*
419 */ 478 */
420struct ieee80211_rx_status { 479struct ieee80211_rx_status {
@@ -434,21 +493,49 @@ struct ieee80211_rx_status {
434 * 493 *
435 * Flags to define PHY configuration options 494 * Flags to define PHY configuration options
436 * 495 *
437 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
438 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 496 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
439 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
440 * @IEEE80211_CONF_PS: Enable 802.11 power save mode 497 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
441 */ 498 */
442enum ieee80211_conf_flags { 499enum ieee80211_conf_flags {
443 /* 500 IEEE80211_CONF_RADIOTAP = (1<<0),
444 * TODO: IEEE80211_CONF_SHORT_SLOT_TIME will be removed once drivers 501 IEEE80211_CONF_PS = (1<<1),
445 * have been converted to use bss_info_changed() for slot time 502};
446 * configuration 503
447 */ 504/* XXX: remove all this once drivers stop trying to use it */
448 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 505static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
449 IEEE80211_CONF_RADIOTAP = (1<<1), 506{
450 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 507 return 0;
451 IEEE80211_CONF_PS = (1<<3), 508}
509#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
510
511struct ieee80211_ht_conf {
512 bool enabled;
513 enum nl80211_channel_type channel_type;
514};
515
516/**
517 * enum ieee80211_conf_changed - denotes which configuration changed
518 *
519 * @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed
520 * @IEEE80211_CONF_CHANGE_BEACON_INTERVAL: the beacon interval changed
521 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
522 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
523 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
524 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
525 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed
526 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
527 * @IEEE80211_CONF_CHANGE_HT: HT configuration changed
528 */
529enum ieee80211_conf_changed {
530 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
531 IEEE80211_CONF_CHANGE_BEACON_INTERVAL = BIT(1),
532 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
533 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
534 IEEE80211_CONF_CHANGE_PS = BIT(4),
535 IEEE80211_CONF_CHANGE_POWER = BIT(5),
536 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
537 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
538 IEEE80211_CONF_CHANGE_HT = BIT(8),
452}; 539};
453 540
454/** 541/**
@@ -457,34 +544,31 @@ enum ieee80211_conf_flags {
457 * This struct indicates how the driver shall configure the hardware. 544 * This struct indicates how the driver shall configure the hardware.
458 * 545 *
459 * @radio_enabled: when zero, driver is required to switch off the radio. 546 * @radio_enabled: when zero, driver is required to switch off the radio.
460 * TODO make a flag
461 * @beacon_int: beacon interval (TODO make interface config) 547 * @beacon_int: beacon interval (TODO make interface config)
462 * @listen_interval: listen interval in units of beacon interval 548 * @listen_interval: listen interval in units of beacon interval
463 * @flags: configuration flags defined above 549 * @flags: configuration flags defined above
464 * @power_level: requested transmit power (in dBm) 550 * @power_level: requested transmit power (in dBm)
465 * @max_antenna_gain: maximum antenna gain (in dBi)
466 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
467 * 1/2: antenna 0/1
468 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
469 * @ht_conf: describes current self configuration of 802.11n HT capabilies
470 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
471 * @channel: the channel to tune to 551 * @channel: the channel to tune to
552 * @ht: the HT configuration for the device
553 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
554 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
555 * but actually means the number of transmissions not the number of retries
556 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
557 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
558 * number of transmissions not the number of retries
472 */ 559 */
473struct ieee80211_conf { 560struct ieee80211_conf {
474 int radio_enabled;
475
476 int beacon_int; 561 int beacon_int;
477 u16 listen_interval;
478 u32 flags; 562 u32 flags;
479 int power_level; 563 int power_level;
480 int max_antenna_gain;
481 u8 antenna_sel_tx;
482 u8 antenna_sel_rx;
483 564
484 struct ieee80211_channel *channel; 565 u16 listen_interval;
566 bool radio_enabled;
567
568 u8 long_frame_max_tx_count, short_frame_max_tx_count;
485 569
486 struct ieee80211_ht_info ht_conf; 570 struct ieee80211_channel *channel;
487 struct ieee80211_ht_bss_info ht_bss_conf; 571 struct ieee80211_ht_conf ht;
488}; 572};
489 573
490/** 574/**
@@ -494,11 +578,14 @@ struct ieee80211_conf {
494 * use during the life of a virtual interface. 578 * use during the life of a virtual interface.
495 * 579 *
496 * @type: type of this virtual interface 580 * @type: type of this virtual interface
581 * @bss_conf: BSS configuration for this interface, either our own
582 * or the BSS we're associated to
497 * @drv_priv: data area for driver use, will always be aligned to 583 * @drv_priv: data area for driver use, will always be aligned to
498 * sizeof(void *). 584 * sizeof(void *).
499 */ 585 */
500struct ieee80211_vif { 586struct ieee80211_vif {
501 enum nl80211_iftype type; 587 enum nl80211_iftype type;
588 struct ieee80211_bss_conf bss_conf;
502 /* must be last */ 589 /* must be last */
503 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 590 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
504}; 591};
@@ -542,14 +629,12 @@ struct ieee80211_if_init_conf {
542 * enum ieee80211_if_conf_change - interface config change flags 629 * enum ieee80211_if_conf_change - interface config change flags
543 * 630 *
544 * @IEEE80211_IFCC_BSSID: The BSSID changed. 631 * @IEEE80211_IFCC_BSSID: The BSSID changed.
545 * @IEEE80211_IFCC_SSID: The SSID changed.
546 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed 632 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed
547 * (currently AP and MESH only), use ieee80211_beacon_get(). 633 * (currently AP and MESH only), use ieee80211_beacon_get().
548 */ 634 */
549enum ieee80211_if_conf_change { 635enum ieee80211_if_conf_change {
550 IEEE80211_IFCC_BSSID = BIT(0), 636 IEEE80211_IFCC_BSSID = BIT(0),
551 IEEE80211_IFCC_SSID = BIT(1), 637 IEEE80211_IFCC_BEACON = BIT(1),
552 IEEE80211_IFCC_BEACON = BIT(2),
553}; 638};
554 639
555/** 640/**
@@ -557,11 +642,6 @@ enum ieee80211_if_conf_change {
557 * 642 *
558 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. 643 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change.
559 * @bssid: BSSID of the network we are associated to/creating. 644 * @bssid: BSSID of the network we are associated to/creating.
560 * @ssid: used (together with @ssid_len) by drivers for hardware that
561 * generate beacons independently. The pointer is valid only during the
562 * config_interface() call, so copy the value somewhere if you need
563 * it.
564 * @ssid_len: length of the @ssid field.
565 * 645 *
566 * This structure is passed to the config_interface() callback of 646 * This structure is passed to the config_interface() callback of
567 * &struct ieee80211_hw. 647 * &struct ieee80211_hw.
@@ -569,8 +649,6 @@ enum ieee80211_if_conf_change {
569struct ieee80211_if_conf { 649struct ieee80211_if_conf {
570 u32 changed; 650 u32 changed;
571 u8 *bssid; 651 u8 *bssid;
572 u8 *ssid;
573 size_t ssid_len;
574}; 652};
575 653
576/** 654/**
@@ -677,7 +755,7 @@ enum set_key_cmd {
677 * @addr: MAC address 755 * @addr: MAC address
678 * @aid: AID we assigned to the station if we're an AP 756 * @aid: AID we assigned to the station if we're an AP
679 * @supp_rates: Bitmap of supported rates (per band) 757 * @supp_rates: Bitmap of supported rates (per band)
680 * @ht_info: HT capabilities of this STA 758 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
681 * @drv_priv: data area for driver use, will always be aligned to 759 * @drv_priv: data area for driver use, will always be aligned to
682 * sizeof(void *), size is determined in hw information. 760 * sizeof(void *), size is determined in hw information.
683 */ 761 */
@@ -685,7 +763,7 @@ struct ieee80211_sta {
685 u64 supp_rates[IEEE80211_NUM_BANDS]; 763 u64 supp_rates[IEEE80211_NUM_BANDS];
686 u8 addr[ETH_ALEN]; 764 u8 addr[ETH_ALEN];
687 u16 aid; 765 u16 aid;
688 struct ieee80211_ht_info ht_info; 766 struct ieee80211_sta_ht_cap ht_cap;
689 767
690 /* must be last */ 768 /* must be last */
691 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 769 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -695,13 +773,17 @@ struct ieee80211_sta {
695 * enum sta_notify_cmd - sta notify command 773 * enum sta_notify_cmd - sta notify command
696 * 774 *
697 * Used with the sta_notify() callback in &struct ieee80211_ops, this 775 * Used with the sta_notify() callback in &struct ieee80211_ops, this
698 * indicates addition and removal of a station to station table. 776 * indicates addition and removal of a station to station table,
777 * or if a associated station made a power state transition.
699 * 778 *
700 * @STA_NOTIFY_ADD: a station was added to the station table 779 * @STA_NOTIFY_ADD: a station was added to the station table
701 * @STA_NOTIFY_REMOVE: a station being removed from the station table 780 * @STA_NOTIFY_REMOVE: a station being removed from the station table
781 * @STA_NOTIFY_SLEEP: a station is now sleeping
782 * @STA_NOTIFY_AWAKE: a sleeping station woke up
702 */ 783 */
703enum sta_notify_cmd { 784enum sta_notify_cmd {
704 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE 785 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE,
786 STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE,
705}; 787};
706 788
707/** 789/**
@@ -769,6 +851,14 @@ enum ieee80211_tkip_key_type {
769 * @IEEE80211_HW_SPECTRUM_MGMT: 851 * @IEEE80211_HW_SPECTRUM_MGMT:
770 * Hardware supports spectrum management defined in 802.11h 852 * Hardware supports spectrum management defined in 802.11h
771 * Measurement, Channel Switch, Quieting, TPC 853 * Measurement, Channel Switch, Quieting, TPC
854 *
855 * @IEEE80211_HW_AMPDU_AGGREGATION:
856 * Hardware supports 11n A-MPDU aggregation.
857 *
858 * @IEEE80211_HW_NO_STACK_DYNAMIC_PS:
859 * Hardware which has dynamic power save support, meaning
860 * that power save is enabled in idle periods, and don't need support
861 * from stack.
772 */ 862 */
773enum ieee80211_hw_flags { 863enum ieee80211_hw_flags {
774 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 864 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
@@ -780,6 +870,8 @@ enum ieee80211_hw_flags {
780 IEEE80211_HW_SIGNAL_DBM = 1<<7, 870 IEEE80211_HW_SIGNAL_DBM = 1<<7,
781 IEEE80211_HW_NOISE_DBM = 1<<8, 871 IEEE80211_HW_NOISE_DBM = 1<<8,
782 IEEE80211_HW_SPECTRUM_MGMT = 1<<9, 872 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
873 IEEE80211_HW_AMPDU_AGGREGATION = 1<<10,
874 IEEE80211_HW_NO_STACK_DYNAMIC_PS = 1<<11,
783}; 875};
784 876
785/** 877/**
@@ -838,8 +930,8 @@ enum ieee80211_hw_flags {
838 * @sta_data_size: size (in bytes) of the drv_priv data area 930 * @sta_data_size: size (in bytes) of the drv_priv data area
839 * within &struct ieee80211_sta. 931 * within &struct ieee80211_sta.
840 * 932 *
841 * @max_altrates: maximum number of alternate rate retry stages 933 * @max_rates: maximum number of alternate rate retry stages
842 * @max_altrate_tries: maximum number of tries for each stage 934 * @max_rate_tries: maximum number of tries for each stage
843 */ 935 */
844struct ieee80211_hw { 936struct ieee80211_hw {
845 struct ieee80211_conf conf; 937 struct ieee80211_conf conf;
@@ -856,12 +948,10 @@ struct ieee80211_hw {
856 u16 ampdu_queues; 948 u16 ampdu_queues;
857 u16 max_listen_interval; 949 u16 max_listen_interval;
858 s8 max_signal; 950 s8 max_signal;
859 u8 max_altrates; 951 u8 max_rates;
860 u8 max_altrate_tries; 952 u8 max_rate_tries;
861}; 953};
862 954
863struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy);
864
865/** 955/**
866 * SET_IEEE80211_DEV - set device for 802.11 hardware 956 * SET_IEEE80211_DEV - set device for 802.11 hardware
867 * 957 *
@@ -874,7 +964,7 @@ static inline void SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev
874} 964}
875 965
876/** 966/**
877 * SET_IEEE80211_PERM_ADDR - set the permanenet MAC address for 802.11 hardware 967 * SET_IEEE80211_PERM_ADDR - set the permanent MAC address for 802.11 hardware
878 * 968 *
879 * @hw: the &struct ieee80211_hw to set the MAC address for 969 * @hw: the &struct ieee80211_hw to set the MAC address for
880 * @addr: the address to set 970 * @addr: the address to set
@@ -898,9 +988,9 @@ static inline struct ieee80211_rate *
898ieee80211_get_tx_rate(const struct ieee80211_hw *hw, 988ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
899 const struct ieee80211_tx_info *c) 989 const struct ieee80211_tx_info *c)
900{ 990{
901 if (WARN_ON(c->tx_rate_idx < 0)) 991 if (WARN_ON(c->control.rates[0].idx < 0))
902 return NULL; 992 return NULL;
903 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; 993 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx];
904} 994}
905 995
906static inline struct ieee80211_rate * 996static inline struct ieee80211_rate *
@@ -916,9 +1006,9 @@ static inline struct ieee80211_rate *
916ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, 1006ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
917 const struct ieee80211_tx_info *c, int idx) 1007 const struct ieee80211_tx_info *c, int idx)
918{ 1008{
919 if (c->control.retries[idx].rate_idx < 0) 1009 if (c->control.rates[idx + 1].idx < 0)
920 return NULL; 1010 return NULL;
921 return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx]; 1011 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[idx + 1].idx];
922} 1012}
923 1013
924/** 1014/**
@@ -967,7 +1057,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
967 * This happens everytime the iv16 wraps around (every 65536 packets). The 1057 * This happens everytime the iv16 wraps around (every 65536 packets). The
968 * set_key() call will happen only once for each key (unless the AP did 1058 * set_key() call will happen only once for each key (unless the AP did
969 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is 1059 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is
970 * provided by udpate_tkip_key only. The trigger that makes mac80211 call this 1060 * provided by update_tkip_key only. The trigger that makes mac80211 call this
971 * handler is software decryption with wrap around of iv16. 1061 * handler is software decryption with wrap around of iv16.
972 */ 1062 */
973 1063
@@ -1060,12 +1150,14 @@ enum ieee80211_filter_flags {
1060 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 1150 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
1061 * @IEEE80211_AMPDU_TX_START: start Tx aggregation 1151 * @IEEE80211_AMPDU_TX_START: start Tx aggregation
1062 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation 1152 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
1153 * @IEEE80211_AMPDU_TX_RESUME: resume TX aggregation
1063 */ 1154 */
1064enum ieee80211_ampdu_mlme_action { 1155enum ieee80211_ampdu_mlme_action {
1065 IEEE80211_AMPDU_RX_START, 1156 IEEE80211_AMPDU_RX_START,
1066 IEEE80211_AMPDU_RX_STOP, 1157 IEEE80211_AMPDU_RX_STOP,
1067 IEEE80211_AMPDU_TX_START, 1158 IEEE80211_AMPDU_TX_START,
1068 IEEE80211_AMPDU_TX_STOP, 1159 IEEE80211_AMPDU_TX_STOP,
1160 IEEE80211_AMPDU_TX_RESUME,
1069}; 1161};
1070 1162
1071/** 1163/**
@@ -1101,7 +1193,7 @@ enum ieee80211_ampdu_mlme_action {
1101 * Must be implemented. 1193 * Must be implemented.
1102 * 1194 *
1103 * @add_interface: Called when a netdevice attached to the hardware is 1195 * @add_interface: Called when a netdevice attached to the hardware is
1104 * enabled. Because it is not called for monitor mode devices, @open 1196 * enabled. Because it is not called for monitor mode devices, @start
1105 * and @stop must be implemented. 1197 * and @stop must be implemented.
1106 * The driver should perform any initialization it needs before 1198 * The driver should perform any initialization it needs before
1107 * the device can be enabled. The initial configuration for the 1199 * the device can be enabled. The initial configuration for the
@@ -1163,14 +1255,9 @@ enum ieee80211_ampdu_mlme_action {
1163 * 1255 *
1164 * @set_rts_threshold: Configuration of RTS threshold (if device needs it) 1256 * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
1165 * 1257 *
1166 * @set_frag_threshold: Configuration of fragmentation threshold. Assign this if 1258 * @sta_notify: Notifies low level driver about addition, removal or power
1167 * the device does fragmentation by itself; if this method is assigned then 1259 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc.
1168 * the stack will not do fragmentation. 1260 * Must be atomic.
1169 *
1170 * @set_retry_limit: Configuration of retry limits (if device needs it)
1171 *
1172 * @sta_notify: Notifies low level driver about addition or removal
1173 * of assocaited station or AP.
1174 * 1261 *
1175 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1262 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1176 * bursting) for a hardware TX queue. 1263 * bursting) for a hardware TX queue.
@@ -1194,8 +1281,6 @@ enum ieee80211_ampdu_mlme_action {
1194 * This is needed only for IBSS mode and the result of this function is 1281 * This is needed only for IBSS mode and the result of this function is
1195 * used to determine whether to reply to Probe Requests. 1282 * used to determine whether to reply to Probe Requests.
1196 * 1283 *
1197 * @conf_ht: Configures low level driver with 802.11n HT data. Must be atomic.
1198 *
1199 * @ampdu_action: Perform a certain A-MPDU action 1284 * @ampdu_action: Perform a certain A-MPDU action
1200 * The RA/TID combination determines the destination and TID we want 1285 * The RA/TID combination determines the destination and TID we want
1201 * the ampdu action to be performed for. The action is defined through 1286 * the ampdu action to be performed for. The action is defined through
@@ -1211,7 +1296,7 @@ struct ieee80211_ops {
1211 struct ieee80211_if_init_conf *conf); 1296 struct ieee80211_if_init_conf *conf);
1212 void (*remove_interface)(struct ieee80211_hw *hw, 1297 void (*remove_interface)(struct ieee80211_hw *hw,
1213 struct ieee80211_if_init_conf *conf); 1298 struct ieee80211_if_init_conf *conf);
1214 int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1299 int (*config)(struct ieee80211_hw *hw, u32 changed);
1215 int (*config_interface)(struct ieee80211_hw *hw, 1300 int (*config_interface)(struct ieee80211_hw *hw,
1216 struct ieee80211_vif *vif, 1301 struct ieee80211_vif *vif,
1217 struct ieee80211_if_conf *conf); 1302 struct ieee80211_if_conf *conf);
@@ -1237,9 +1322,6 @@ struct ieee80211_ops {
1237 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, 1322 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
1238 u32 *iv32, u16 *iv16); 1323 u32 *iv32, u16 *iv16);
1239 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1324 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1240 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1241 int (*set_retry_limit)(struct ieee80211_hw *hw,
1242 u32 short_retry, u32 long_retr);
1243 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1325 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1244 enum sta_notify_cmd, struct ieee80211_sta *sta); 1326 enum sta_notify_cmd, struct ieee80211_sta *sta);
1245 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1327 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
@@ -1472,7 +1554,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1472 * the next beacon frame from the 802.11 code. The low-level is responsible 1554 * the next beacon frame from the 802.11 code. The low-level is responsible
1473 * for calling this function before beacon data is needed (e.g., based on 1555 * for calling this function before beacon data is needed (e.g., based on
1474 * hardware interrupt). Returned skb is used only once and low-level driver 1556 * hardware interrupt). Returned skb is used only once and low-level driver
1475 * is responsible of freeing it. 1557 * is responsible for freeing it.
1476 */ 1558 */
1477struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1559struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1478 struct ieee80211_vif *vif); 1560 struct ieee80211_vif *vif);
@@ -1803,24 +1885,38 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
1803 1885
1804 1886
1805/* Rate control API */ 1887/* Rate control API */
1888
1806/** 1889/**
1807 * struct rate_selection - rate information for/from rate control algorithms 1890 * struct ieee80211_tx_rate_control - rate control information for/from RC algo
1808 * 1891 *
1809 * @rate_idx: selected transmission rate index 1892 * @hw: The hardware the algorithm is invoked for.
1810 * @nonerp_idx: Non-ERP rate to use instead if ERP cannot be used 1893 * @sband: The band this frame is being transmitted on.
1811 * @probe_idx: rate for probing (or -1) 1894 * @bss_conf: the current BSS configuration
1812 * @max_rate_idx: maximum rate index that can be used, this is 1895 * @reported_rate: The rate control algorithm can fill this in to indicate
1813 * input to the algorithm and will be enforced 1896 * which rate should be reported to userspace as the current rate and
1814 */ 1897 * used for rate calculations in the mesh network.
1815struct rate_selection { 1898 * @rts: whether RTS will be used for this frame because it is longer than the
1816 s8 rate_idx, nonerp_idx, probe_idx, max_rate_idx; 1899 * RTS threshold
1900 * @short_preamble: whether mac80211 will request short-preamble transmission
1901 * if the selected rate supports it
1902 * @max_rate_idx: user-requested maximum rate (not MCS for now)
1903 * @skb: the skb that will be transmitted, the control information in it needs
1904 * to be filled in
1905 */
1906struct ieee80211_tx_rate_control {
1907 struct ieee80211_hw *hw;
1908 struct ieee80211_supported_band *sband;
1909 struct ieee80211_bss_conf *bss_conf;
1910 struct sk_buff *skb;
1911 struct ieee80211_tx_rate reported_rate;
1912 bool rts, short_preamble;
1913 u8 max_rate_idx;
1817}; 1914};
1818 1915
1819struct rate_control_ops { 1916struct rate_control_ops {
1820 struct module *module; 1917 struct module *module;
1821 const char *name; 1918 const char *name;
1822 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); 1919 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
1823 void (*clear)(void *priv);
1824 void (*free)(void *priv); 1920 void (*free)(void *priv);
1825 1921
1826 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 1922 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
@@ -1832,10 +1928,8 @@ struct rate_control_ops {
1832 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband, 1928 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
1833 struct ieee80211_sta *sta, void *priv_sta, 1929 struct ieee80211_sta *sta, void *priv_sta,
1834 struct sk_buff *skb); 1930 struct sk_buff *skb);
1835 void (*get_rate)(void *priv, struct ieee80211_supported_band *sband, 1931 void (*get_rate)(void *priv, struct ieee80211_sta *sta, void *priv_sta,
1836 struct ieee80211_sta *sta, void *priv_sta, 1932 struct ieee80211_tx_rate_control *txrc);
1837 struct sk_buff *skb,
1838 struct rate_selection *sel);
1839 1933
1840 void (*add_sta_debugfs)(void *priv, void *priv_sta, 1934 void (*add_sta_debugfs)(void *priv, void *priv_sta,
1841 struct dentry *dir); 1935 struct dentry *dir);