aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-14 10:58:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:16 -0400
commitae5eb02641233a4e9d1b92d22090f1b1afa14466 (patch)
tree117b7cb5efa3ff1cf714218098fc6db3820ed4e0 /include/net/mac80211.h
parentbda3933a8aceedd03e0dd410844bd310033ca756 (diff)
mac80211: rewrite HT handling
The HT handling has the following deficiencies, which I've (partially) fixed: * it always uses the AP info even if there is no AP, hence has no chance of working as an AP * it pretends to be HW config, but really is per-BSS * channel sanity checking is left to the drivers * it generally lets the driver control too much HT enabling is still wrong with this patch if you have more than one virtual STA mode interface, but that never happens currently. Once WDS, IBSS or AP/VLAN gets HT capabilities, it will also be wrong, see the comment in ieee80211_enable_ht(). Additionally, this fixes a number of bugs: * mac80211: ieee80211_set_disassoc doesn't notify the driver any more since the refactoring * iwl-agn-rs: always uses the HT capabilities from the wrong stuff mac80211 gives it rather than the actual peer STA * ath9k: a number of bugs resulting from the broken HT API I'm not entirely happy with putting the HT capabilities into struct ieee80211_sta as restricted to our own HT TX capabilities, but I see no cleaner solution for now. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h59
1 files changed, 26 insertions, 33 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 94ff3eface49..9801afb62545 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
@@ -82,22 +82,6 @@ enum ieee80211_notification_types {
82}; 82};
83 83
84/** 84/**
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 *
87 * This structure describes most essential parameters needed
88 * to describe 802.11n HT characteristics in a BSS.
89 *
90 * @primary_channel: channel number of primery channel
91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
92 * @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection)
93 */
94struct ieee80211_ht_bss_info {
95 u8 primary_channel;
96 u8 bss_cap; /* use IEEE80211_HT_IE_CHA_ */
97 u8 bss_op_mode; /* use IEEE80211_HT_IE_ */
98};
99
100/**
101 * enum ieee80211_max_queues - maximum number of queues 85 * enum ieee80211_max_queues - maximum number of queues
102 * 86 *
103 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. 87 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
@@ -172,6 +156,19 @@ enum ieee80211_bss_change {
172}; 156};
173 157
174/** 158/**
159 * struct ieee80211_bss_ht_conf - BSS's changing HT configuration
160 * @secondary_channel_offset: secondary channel offset, uses
161 * %IEEE80211_HT_PARAM_CHA_SEC_ values
162 * @width_40_ok: indicates that 40 MHz bandwidth may be used for TX
163 * @operation_mode: HT operation mode (like in &struct ieee80211_ht_info)
164 */
165struct ieee80211_bss_ht_conf {
166 u8 secondary_channel_offset;
167 bool width_40_ok;
168 u16 operation_mode;
169};
170
171/**
175 * struct ieee80211_bss_conf - holds the BSS's changing parameters 172 * struct ieee80211_bss_conf - holds the BSS's changing parameters
176 * 173 *
177 * This structure keeps information about a BSS (and an association 174 * This structure keeps information about a BSS (and an association
@@ -190,9 +187,7 @@ enum ieee80211_bss_change {
190 * @timestamp: beacon timestamp 187 * @timestamp: beacon timestamp
191 * @beacon_int: beacon interval 188 * @beacon_int: beacon interval
192 * @assoc_capability: capabilities taken from assoc resp 189 * @assoc_capability: capabilities taken from assoc resp
193 * @assoc_ht: association in HT mode 190 * @ht: BSS's HT configuration
194 * @ht_cap: ht capabilities
195 * @ht_bss_conf: ht extended capabilities
196 * @basic_rates: bitmap of basic rates, each bit stands for an 191 * @basic_rates: bitmap of basic rates, each bit stands for an
197 * index into the rate table configured by the driver in 192 * index into the rate table configured by the driver in
198 * the current band. 193 * the current band.
@@ -210,10 +205,7 @@ struct ieee80211_bss_conf {
210 u16 assoc_capability; 205 u16 assoc_capability;
211 u64 timestamp; 206 u64 timestamp;
212 u64 basic_rates; 207 u64 basic_rates;
213 /* ht related data */ 208 struct ieee80211_bss_ht_conf ht;
214 bool assoc_ht;
215 struct ieee80211_sta_ht_cap *ht_cap;
216 struct ieee80211_ht_bss_info *ht_bss_conf;
217}; 209};
218 210
219/** 211/**
@@ -447,13 +439,11 @@ struct ieee80211_rx_status {
447 * Flags to define PHY configuration options 439 * Flags to define PHY configuration options
448 * 440 *
449 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 441 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
450 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
451 * @IEEE80211_CONF_PS: Enable 802.11 power save mode 442 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
452 */ 443 */
453enum ieee80211_conf_flags { 444enum ieee80211_conf_flags {
454 IEEE80211_CONF_RADIOTAP = (1<<0), 445 IEEE80211_CONF_RADIOTAP = (1<<0),
455 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<1), 446 IEEE80211_CONF_PS = (1<<1),
456 IEEE80211_CONF_PS = (1<<2),
457}; 447};
458 448
459/* XXX: remove all this once drivers stop trying to use it */ 449/* XXX: remove all this once drivers stop trying to use it */
@@ -463,6 +453,10 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
463} 453}
464#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME()) 454#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
465 455
456struct ieee80211_ht_conf {
457 bool enabled;
458};
459
466/** 460/**
467 * enum ieee80211_conf_changed - denotes which configuration changed 461 * enum ieee80211_conf_changed - denotes which configuration changed
468 * 462 *
@@ -474,6 +468,7 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
474 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed 468 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
475 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed 469 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed
476 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 470 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
471 * @IEEE80211_CONF_CHANGE_HT: HT configuration changed
477 */ 472 */
478enum ieee80211_conf_changed { 473enum ieee80211_conf_changed {
479 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), 474 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
@@ -484,6 +479,7 @@ enum ieee80211_conf_changed {
484 IEEE80211_CONF_CHANGE_POWER = BIT(5), 479 IEEE80211_CONF_CHANGE_POWER = BIT(5),
485 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), 480 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
486 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), 481 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
482 IEEE80211_CONF_CHANGE_HT = BIT(8),
487}; 483};
488 484
489/** 485/**
@@ -496,9 +492,8 @@ enum ieee80211_conf_changed {
496 * @listen_interval: listen interval in units of beacon interval 492 * @listen_interval: listen interval in units of beacon interval
497 * @flags: configuration flags defined above 493 * @flags: configuration flags defined above
498 * @power_level: requested transmit power (in dBm) 494 * @power_level: requested transmit power (in dBm)
499 * @ht_cap: describes current self configuration of 802.11n HT capabilities
500 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
501 * @channel: the channel to tune to 495 * @channel: the channel to tune to
496 * @ht: the HT configuration for the device
502 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 497 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
503 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 498 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
504 * but actually means the number of transmissions not the number of retries 499 * but actually means the number of transmissions not the number of retries
@@ -517,9 +512,7 @@ struct ieee80211_conf {
517 u8 long_frame_max_tx_count, short_frame_max_tx_count; 512 u8 long_frame_max_tx_count, short_frame_max_tx_count;
518 513
519 struct ieee80211_channel *channel; 514 struct ieee80211_channel *channel;
520 515 struct ieee80211_ht_conf ht;
521 struct ieee80211_sta_ht_cap ht_cap;
522 struct ieee80211_ht_bss_info ht_bss_conf;
523}; 516};
524 517
525/** 518/**
@@ -715,7 +708,7 @@ enum set_key_cmd {
715 * @addr: MAC address 708 * @addr: MAC address
716 * @aid: AID we assigned to the station if we're an AP 709 * @aid: AID we assigned to the station if we're an AP
717 * @supp_rates: Bitmap of supported rates (per band) 710 * @supp_rates: Bitmap of supported rates (per band)
718 * @ht_cap: HT capabilities of this STA 711 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
719 * @drv_priv: data area for driver use, will always be aligned to 712 * @drv_priv: data area for driver use, will always be aligned to
720 * sizeof(void *), size is determined in hw information. 713 * sizeof(void *), size is determined in hw information.
721 */ 714 */