diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 43 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 2 |
2 files changed, 36 insertions, 9 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 && |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index e3a214f63f91..f68a5c8f2147 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -945,7 +945,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) | |||
945 | nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); | 945 | nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); |
946 | params.listen_interval = | 946 | params.listen_interval = |
947 | nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); | 947 | nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); |
948 | params.listen_interval = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]); | 948 | params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]); |
949 | 949 | ||
950 | if (parse_station_flags(info->attrs[NL80211_ATTR_STA_FLAGS], | 950 | if (parse_station_flags(info->attrs[NL80211_ATTR_STA_FLAGS], |
951 | ¶ms.station_flags)) | 951 | ¶ms.station_flags)) |