diff options
author | Vladimir Koutny <vlado@work.ksp.sk> | 2008-03-31 11:05:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-09 10:33:49 -0400 |
commit | 216bce90b811a35eb5cd2ed8216bdbb1753e9b2b (patch) | |
tree | 1e0b8fd87ca2e36bdf668afe264f15555bf65b5a /net/mac80211 | |
parent | 16f2e85d3151efa643879fa5aa87c9d77d60f57e (diff) |
mac80211: use short_preamble mode from capability if ERP IE not present
When associating to a b-only AP where there is no ERP IE, short preamble
mode is left at previous state (probably also protection mode). In this
case, disable protection and use short preamble mode as specified in
capability field. The same is done if capability field is changed on-the-fly.
Signed-off-by: Vladimir Koutny <vlado@ksp.sk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index e0c72d04584b..c1706855460a 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -312,14 +312,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev, | |||
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
315 | 315 | static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata, | |
316 | static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | 316 | bool use_protection, |
317 | u8 erp_value) | 317 | bool use_short_preamble) |
318 | { | 318 | { |
319 | struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; | 319 | struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; |
320 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 320 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
321 | bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; | ||
322 | bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0; | ||
323 | DECLARE_MAC_BUF(mac); | 321 | DECLARE_MAC_BUF(mac); |
324 | u32 changed = 0; | 322 | u32 changed = 0; |
325 | 323 | ||
@@ -350,6 +348,32 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | |||
350 | return changed; | 348 | return changed; |
351 | } | 349 | } |
352 | 350 | ||
351 | static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | ||
352 | u8 erp_value) | ||
353 | { | ||
354 | bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; | ||
355 | bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0; | ||
356 | |||
357 | return ieee80211_handle_protect_preamb(sdata, | ||
358 | use_protection, use_short_preamble); | ||
359 | } | ||
360 | |||
361 | static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, | ||
362 | struct ieee80211_sta_bss *bss) | ||
363 | { | ||
364 | u32 changed = 0; | ||
365 | |||
366 | if (bss->has_erp_value) | ||
367 | changed |= ieee80211_handle_erp_ie(sdata, bss->erp_value); | ||
368 | else { | ||
369 | u16 capab = bss->capability; | ||
370 | changed |= ieee80211_handle_protect_preamb(sdata, false, | ||
371 | (capab & WLAN_CAPABILITY_SHORT_PREAMBLE) != 0); | ||
372 | } | ||
373 | |||
374 | return changed; | ||
375 | } | ||
376 | |||
353 | int ieee80211_ht_cap_ie_to_ht_info(struct ieee80211_ht_cap *ht_cap_ie, | 377 | int ieee80211_ht_cap_ie_to_ht_info(struct ieee80211_ht_cap *ht_cap_ie, |
354 | struct ieee80211_ht_info *ht_info) | 378 | struct ieee80211_ht_info *ht_info) |
355 | { | 379 | { |
@@ -468,9 +492,7 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
468 | local->hw.conf.channel, | 492 | local->hw.conf.channel, |
469 | ifsta->ssid, ifsta->ssid_len); | 493 | ifsta->ssid, ifsta->ssid_len); |
470 | if (bss) { | 494 | if (bss) { |
471 | if (bss->has_erp_value) | 495 | changed |= ieee80211_handle_bss_capability(sdata, bss); |
472 | changed |= ieee80211_handle_erp_ie( | ||
473 | sdata, bss->erp_value); | ||
474 | ieee80211_rx_bss_put(dev, bss); | 496 | ieee80211_rx_bss_put(dev, bss); |
475 | } | 497 | } |
476 | 498 | ||
@@ -2116,6 +2138,11 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev, | |||
2116 | 2138 | ||
2117 | if (elems.erp_info && elems.erp_info_len >= 1) | 2139 | if (elems.erp_info && elems.erp_info_len >= 1) |
2118 | changed |= ieee80211_handle_erp_ie(sdata, elems.erp_info[0]); | 2140 | changed |= ieee80211_handle_erp_ie(sdata, elems.erp_info[0]); |
2141 | else { | ||
2142 | u16 capab = le16_to_cpu(mgmt->u.beacon.capab_info); | ||
2143 | changed |= ieee80211_handle_protect_preamb(sdata, false, | ||
2144 | (capab & WLAN_CAPABILITY_SHORT_PREAMBLE) != 0); | ||
2145 | } | ||
2119 | 2146 | ||
2120 | if (elems.ht_cap_elem && elems.ht_info_elem && | 2147 | if (elems.ht_cap_elem && elems.ht_info_elem && |
2121 | elems.wmm_param && local->ops->conf_ht && | 2148 | elems.wmm_param && local->ops->conf_ht && |