aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-09 06:13:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:06 -0400
commitd9fe60dea7779d412b34679f1177c5ca1940ea8d (patch)
treea51e16b013f7c1d16ded502cb32c03872bcbfcaa /include/net
parent40333e4fb476014cdd939d27e20eb54573172b32 (diff)
802.11: clean up/fix HT support
This patch cleans up a number of things: * the unusable definition of the HT capabilities/HT information information elements * variable names that are hard to understand * mac80211: move ieee80211_handle_ht to ht.c and remove the unused enable_ht parameter * mac80211: fix bug with MCS rate 32 in ieee80211_handle_ht * mac80211: fix bug with casting the result of ieee80211_bss_get_ie to an information element _contents_ rather than the whole element, add size checking (another out-of-bounds access bug fixed!) * mac80211: remove some unused return values in favour of BUG_ON checking * a few minor other things Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/mac80211.h12
-rw-r--r--include/net/wireless.h15
2 files changed, 14 insertions, 13 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d1466e7a47b8..2870f3973f1a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -191,7 +191,7 @@ enum ieee80211_bss_change {
191 * @beacon_int: beacon interval 191 * @beacon_int: beacon interval
192 * @assoc_capability: capabilities taken from assoc resp 192 * @assoc_capability: capabilities taken from assoc resp
193 * @assoc_ht: association in HT mode 193 * @assoc_ht: association in HT mode
194 * @ht_conf: ht capabilities 194 * @ht_cap: ht capabilities
195 * @ht_bss_conf: ht extended capabilities 195 * @ht_bss_conf: ht extended capabilities
196 * @basic_rates: bitmap of basic rates, each bit stands for an 196 * @basic_rates: bitmap of basic rates, each bit stands for an
197 * index into the rate table configured by the driver in 197 * index into the rate table configured by the driver in
@@ -212,7 +212,7 @@ struct ieee80211_bss_conf {
212 u64 basic_rates; 212 u64 basic_rates;
213 /* ht related data */ 213 /* ht related data */
214 bool assoc_ht; 214 bool assoc_ht;
215 struct ieee80211_ht_info *ht_conf; 215 struct ieee80211_sta_ht_cap *ht_cap;
216 struct ieee80211_ht_bss_info *ht_bss_conf; 216 struct ieee80211_ht_bss_info *ht_bss_conf;
217}; 217};
218 218
@@ -477,7 +477,7 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
477 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, 477 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
478 * 1/2: antenna 0/1 478 * 1/2: antenna 0/1
479 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx 479 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
480 * @ht_conf: describes current self configuration of 802.11n HT capabilies 480 * @ht_cap: describes current self configuration of 802.11n HT capabilities
481 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters 481 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
482 * @channel: the channel to tune to 482 * @channel: the channel to tune to
483 */ 483 */
@@ -493,7 +493,7 @@ struct ieee80211_conf {
493 493
494 struct ieee80211_channel *channel; 494 struct ieee80211_channel *channel;
495 495
496 struct ieee80211_ht_info ht_conf; 496 struct ieee80211_sta_ht_cap ht_cap;
497 struct ieee80211_ht_bss_info ht_bss_conf; 497 struct ieee80211_ht_bss_info ht_bss_conf;
498}; 498};
499 499
@@ -687,7 +687,7 @@ enum set_key_cmd {
687 * @addr: MAC address 687 * @addr: MAC address
688 * @aid: AID we assigned to the station if we're an AP 688 * @aid: AID we assigned to the station if we're an AP
689 * @supp_rates: Bitmap of supported rates (per band) 689 * @supp_rates: Bitmap of supported rates (per band)
690 * @ht_info: HT capabilities of this STA 690 * @ht_cap: HT capabilities of this STA
691 * @drv_priv: data area for driver use, will always be aligned to 691 * @drv_priv: data area for driver use, will always be aligned to
692 * sizeof(void *), size is determined in hw information. 692 * sizeof(void *), size is determined in hw information.
693 */ 693 */
@@ -695,7 +695,7 @@ struct ieee80211_sta {
695 u64 supp_rates[IEEE80211_NUM_BANDS]; 695 u64 supp_rates[IEEE80211_NUM_BANDS];
696 u8 addr[ETH_ALEN]; 696 u8 addr[ETH_ALEN];
697 u16 aid; 697 u16 aid;
698 struct ieee80211_ht_info ht_info; 698 struct ieee80211_sta_ht_cap ht_cap;
699 699
700 /* must be last */ 700 /* must be last */
701 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 701 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 721efb363db7..c0aa0fb8db5e 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -10,6 +10,7 @@
10#include <linux/netdevice.h> 10#include <linux/netdevice.h>
11#include <linux/debugfs.h> 11#include <linux/debugfs.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/ieee80211.h>
13#include <net/cfg80211.h> 14#include <net/cfg80211.h>
14 15
15/** 16/**
@@ -133,23 +134,23 @@ struct ieee80211_rate {
133}; 134};
134 135
135/** 136/**
136 * struct ieee80211_ht_info - describing STA's HT capabilities 137 * struct ieee80211_sta_ht_cap - STA's HT capabilities
137 * 138 *
138 * This structure describes most essential parameters needed 139 * This structure describes most essential parameters needed
139 * to describe 802.11n HT capabilities for an STA. 140 * to describe 802.11n HT capabilities for an STA.
140 * 141 *
141 * @ht_supported: is HT supported by STA, 0: no, 1: yes 142 * @ht_supported: is HT supported by the STA
142 * @cap: HT capabilities map as described in 802.11n spec 143 * @cap: HT capabilities map as described in 802.11n spec
143 * @ampdu_factor: Maximum A-MPDU length factor 144 * @ampdu_factor: Maximum A-MPDU length factor
144 * @ampdu_density: Minimum A-MPDU spacing 145 * @ampdu_density: Minimum A-MPDU spacing
145 * @supp_mcs_set: Supported MCS set as described in 802.11n spec 146 * @mcs: Supported MCS rates
146 */ 147 */
147struct ieee80211_ht_info { 148struct ieee80211_sta_ht_cap {
148 u16 cap; /* use IEEE80211_HT_CAP_ */ 149 u16 cap; /* use IEEE80211_HT_CAP_ */
149 u8 ht_supported; 150 bool ht_supported;
150 u8 ampdu_factor; 151 u8 ampdu_factor;
151 u8 ampdu_density; 152 u8 ampdu_density;
152 u8 supp_mcs_set[16]; 153 struct ieee80211_mcs_info mcs;
153}; 154};
154 155
155/** 156/**
@@ -173,7 +174,7 @@ struct ieee80211_supported_band {
173 enum ieee80211_band band; 174 enum ieee80211_band band;
174 int n_channels; 175 int n_channels;
175 int n_bitrates; 176 int n_bitrates;
176 struct ieee80211_ht_info ht_info; 177 struct ieee80211_sta_ht_cap ht_cap;
177}; 178};
178 179
179/** 180/**