aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorVladimir Koutny <vlado@work.ksp.sk>2008-03-31 11:05:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-01 15:44:08 -0400
commitd43c7b37ad787173d08683f05eadeea0398fefdf (patch)
tree3a618a512e0874876344300b5028b97c1dc61b7a /net/mac80211
parente645890115004fa6c4dd1f9541bb834970c8bcae (diff)
mac80211: correct use_short_preamble handling
ERP IE bit for preamble mode is 0 for short and 1 for long, not the other way around. This fixes the value reported to the driver via bss_conf->use_short_preamble field. 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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 9aeed5320228..e0c72d04584b 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -319,7 +319,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
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; 321 bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
322 bool preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; 322 bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0;
323 DECLARE_MAC_BUF(mac); 323 DECLARE_MAC_BUF(mac);
324 u32 changed = 0; 324 u32 changed = 0;
325 325
@@ -335,16 +335,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
335 changed |= BSS_CHANGED_ERP_CTS_PROT; 335 changed |= BSS_CHANGED_ERP_CTS_PROT;
336 } 336 }
337 337
338 if (preamble_mode != bss_conf->use_short_preamble) { 338 if (use_short_preamble != bss_conf->use_short_preamble) {
339 if (net_ratelimit()) { 339 if (net_ratelimit()) {
340 printk(KERN_DEBUG "%s: switched to %s barker preamble" 340 printk(KERN_DEBUG "%s: switched to %s barker preamble"
341 " (BSSID=%s)\n", 341 " (BSSID=%s)\n",
342 sdata->dev->name, 342 sdata->dev->name,
343 (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ? 343 use_short_preamble ? "short" : "long",
344 "short" : "long",
345 print_mac(mac, ifsta->bssid)); 344 print_mac(mac, ifsta->bssid));
346 } 345 }
347 bss_conf->use_short_preamble = preamble_mode; 346 bss_conf->use_short_preamble = use_short_preamble;
348 changed |= BSS_CHANGED_ERP_PREAMBLE; 347 changed |= BSS_CHANGED_ERP_PREAMBLE;
349 } 348 }
350 349