提交 50c4afb9 编写于 作者: J John W. Linville

mlme.c: fixup some merge damage

This one got renamed, complicating the merge a bit...this should restore
it to its intended state.
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 dd9e0dda
...@@ -350,14 +350,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev, ...@@ -350,14 +350,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
} }
} }
static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata,
static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, bool use_protection,
u8 erp_value) bool use_short_preamble)
{ {
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_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
u32 changed = 0; u32 changed = 0;
...@@ -388,6 +386,32 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, ...@@ -388,6 +386,32 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
return changed; return changed;
} }
static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
u8 erp_value)
{
bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0;
return ieee80211_handle_protect_preamb(sdata,
use_protection, use_short_preamble);
}
static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta_bss *bss)
{
u32 changed = 0;
if (bss->has_erp_value)
changed |= ieee80211_handle_erp_ie(sdata, bss->erp_value);
else {
u16 capab = bss->capability;
changed |= ieee80211_handle_protect_preamb(sdata, false,
(capab & WLAN_CAPABILITY_SHORT_PREAMBLE) != 0);
}
return changed;
}
int ieee80211_ht_cap_ie_to_ht_info(struct ieee80211_ht_cap *ht_cap_ie, int ieee80211_ht_cap_ie_to_ht_info(struct ieee80211_ht_cap *ht_cap_ie,
struct ieee80211_ht_info *ht_info) struct ieee80211_ht_info *ht_info)
{ {
...@@ -511,9 +535,7 @@ static void ieee80211_set_associated(struct net_device *dev, ...@@ -511,9 +535,7 @@ static void ieee80211_set_associated(struct net_device *dev,
sdata->bss_conf.beacon_int = bss->beacon_int; sdata->bss_conf.beacon_int = bss->beacon_int;
sdata->bss_conf.timestamp = bss->timestamp; sdata->bss_conf.timestamp = bss->timestamp;
if (bss->has_erp_value) changed |= ieee80211_handle_bss_capability(sdata, bss);
changed |= ieee80211_handle_erp_ie(
sdata, bss->erp_value);
ieee80211_rx_bss_put(dev, bss); ieee80211_rx_bss_put(dev, bss);
} }
...@@ -2777,6 +2799,11 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev, ...@@ -2777,6 +2799,11 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,
if (elems.erp_info && elems.erp_info_len >= 1) if (elems.erp_info && elems.erp_info_len >= 1)
changed |= ieee80211_handle_erp_ie(sdata, elems.erp_info[0]); changed |= ieee80211_handle_erp_ie(sdata, elems.erp_info[0]);
else {
u16 capab = le16_to_cpu(mgmt->u.beacon.capab_info);
changed |= ieee80211_handle_protect_preamb(sdata, false,
(capab & WLAN_CAPABILITY_SHORT_PREAMBLE) != 0);
}
if (elems.ht_cap_elem && elems.ht_info_elem && if (elems.ht_cap_elem && elems.ht_info_elem &&
elems.wmm_param && conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) { elems.wmm_param && conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册