提交 d43c7b37 编写于 作者: V Vladimir Koutny 提交者: John W. Linville

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: NVladimir Koutny <vlado@ksp.sk>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e6458901
...@@ -319,7 +319,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, ...@@ -319,7 +319,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
struct ieee80211_if_sta *ifsta = &sdata->u.sta; struct ieee80211_if_sta *ifsta = &sdata->u.sta;
bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
bool preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
u32 changed = 0; u32 changed = 0;
...@@ -335,16 +335,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, ...@@ -335,16 +335,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
changed |= BSS_CHANGED_ERP_CTS_PROT; changed |= BSS_CHANGED_ERP_CTS_PROT;
} }
if (preamble_mode != bss_conf->use_short_preamble) { if (use_short_preamble != bss_conf->use_short_preamble) {
if (net_ratelimit()) { if (net_ratelimit()) {
printk(KERN_DEBUG "%s: switched to %s barker preamble" printk(KERN_DEBUG "%s: switched to %s barker preamble"
" (BSSID=%s)\n", " (BSSID=%s)\n",
sdata->dev->name, sdata->dev->name,
(preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ? use_short_preamble ? "short" : "long",
"short" : "long",
print_mac(mac, ifsta->bssid)); print_mac(mac, ifsta->bssid));
} }
bss_conf->use_short_preamble = preamble_mode; bss_conf->use_short_preamble = use_short_preamble;
changed |= BSS_CHANGED_ERP_PREAMBLE; changed |= BSS_CHANGED_ERP_PREAMBLE;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册