diff options
author | Ben Greear <greearb@candelatech.com> | 2011-11-18 14:32:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-21 16:22:06 -0500 |
commit | ef96a84202ccfb48a4569256ffba45e32308f7ee (patch) | |
tree | 708275d21455ecbf3b5408241b73f95fa4c484e0 /net/mac80211/work.c | |
parent | 7e7c8926b2f4e3453b8aeb39cd814d2af3fec24f (diff) |
mac80211: Support ht-cap over-rides.
This implements ht-cap over-rides for mac80211 drivers.
HT may be disabled, making an /a/b/g/n station act like an
a/b/g station. HT40 may be disabled forcing the station to
be HT20 even if the AP and local hardware support HT40.
MAX-AMSDU may be disabled.
AMPDU-Density may be increased.
AMPDU-Factor may be decreased.
This has been successfully tested with ath9k using patched
wpa_supplicant and iw.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/work.c')
-rw-r--r-- | net/mac80211/work.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index 3dd5a89e99a7..6884a2d986dc 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -94,7 +94,8 @@ static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len, | |||
94 | 94 | ||
95 | /* frame sending functions */ | 95 | /* frame sending functions */ |
96 | 96 | ||
97 | static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie, | 97 | static void ieee80211_add_ht_ie(struct ieee80211_sub_if_data *sdata, |
98 | struct sk_buff *skb, const u8 *ht_info_ie, | ||
98 | struct ieee80211_supported_band *sband, | 99 | struct ieee80211_supported_band *sband, |
99 | struct ieee80211_channel *channel, | 100 | struct ieee80211_channel *channel, |
100 | enum ieee80211_smps_mode smps) | 101 | enum ieee80211_smps_mode smps) |
@@ -102,7 +103,10 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie, | |||
102 | struct ieee80211_ht_info *ht_info; | 103 | struct ieee80211_ht_info *ht_info; |
103 | u8 *pos; | 104 | u8 *pos; |
104 | u32 flags = channel->flags; | 105 | u32 flags = channel->flags; |
105 | u16 cap = sband->ht_cap.cap; | 106 | u16 cap; |
107 | struct ieee80211_sta_ht_cap ht_cap; | ||
108 | |||
109 | BUILD_BUG_ON(sizeof(ht_cap) != sizeof(sband->ht_cap)); | ||
106 | 110 | ||
107 | if (!sband->ht_cap.ht_supported) | 111 | if (!sband->ht_cap.ht_supported) |
108 | return; | 112 | return; |
@@ -113,9 +117,13 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie, | |||
113 | if (ht_info_ie[1] < sizeof(struct ieee80211_ht_info)) | 117 | if (ht_info_ie[1] < sizeof(struct ieee80211_ht_info)) |
114 | return; | 118 | return; |
115 | 119 | ||
120 | memcpy(&ht_cap, &sband->ht_cap, sizeof(ht_cap)); | ||
121 | ieee80211_apply_htcap_overrides(sdata, &ht_cap); | ||
122 | |||
116 | ht_info = (struct ieee80211_ht_info *)(ht_info_ie + 2); | 123 | ht_info = (struct ieee80211_ht_info *)(ht_info_ie + 2); |
117 | 124 | ||
118 | /* determine capability flags */ | 125 | /* determine capability flags */ |
126 | cap = ht_cap.cap; | ||
119 | 127 | ||
120 | switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { | 128 | switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { |
121 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: | 129 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: |
@@ -154,7 +162,7 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie, | |||
154 | 162 | ||
155 | /* reserve and fill IE */ | 163 | /* reserve and fill IE */ |
156 | pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2); | 164 | pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2); |
157 | ieee80211_ie_build_ht_cap(pos, sband, cap); | 165 | ieee80211_ie_build_ht_cap(pos, &ht_cap, cap); |
158 | } | 166 | } |
159 | 167 | ||
160 | static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | 168 | static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, |
@@ -329,7 +337,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
329 | 337 | ||
330 | if (wk->assoc.use_11n && wk->assoc.wmm_used && | 338 | if (wk->assoc.use_11n && wk->assoc.wmm_used && |
331 | local->hw.queues >= 4) | 339 | local->hw.queues >= 4) |
332 | ieee80211_add_ht_ie(skb, wk->assoc.ht_information_ie, | 340 | ieee80211_add_ht_ie(sdata, skb, wk->assoc.ht_information_ie, |
333 | sband, wk->chan, wk->assoc.smps); | 341 | sband, wk->chan, wk->assoc.smps); |
334 | 342 | ||
335 | /* if present, add any custom non-vendor IEs that go after HT */ | 343 | /* if present, add any custom non-vendor IEs that go after HT */ |