]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mlme.c: fixup some merge damage
authorJohn W. Linville <linville@tuxdriver.com>
Tue, 15 Apr 2008 18:09:27 +0000 (14:09 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 Apr 2008 15:42:59 +0000 (11:42 -0400)
This one got renamed, complicating the merge a bit...this should restore
it to its intended state.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mlme.c

index bdaab1391d4e904cf74ebcc0372529b1460de3a2..83e8b497e6dba1fe45a725f71ac9680b72e46ca6 100644 (file)
@@ -350,14 +350,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
        }
 }
 
-
-static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
-                                  u8 erp_value)
+static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata,
+                                          bool use_protection,
+                                          bool use_short_preamble)
 {
        struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
        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);
        u32 changed = 0;
 
@@ -388,6 +386,32 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
        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,
                                   struct ieee80211_ht_info *ht_info)
 {
@@ -511,9 +535,7 @@ static void ieee80211_set_associated(struct net_device *dev,
                        sdata->bss_conf.beacon_int = bss->beacon_int;
                        sdata->bss_conf.timestamp = bss->timestamp;
 
-                       if (bss->has_erp_value)
-                               changed |= ieee80211_handle_erp_ie(
-                                               sdata, bss->erp_value);
+                       changed |= ieee80211_handle_bss_capability(sdata, bss);
 
                        ieee80211_rx_bss_put(dev, bss);
                }
@@ -2777,6 +2799,11 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,
 
        if (elems.erp_info && elems.erp_info_len >= 1)
                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 &&
            elems.wmm_param && conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) {