mac80211: pass station to ieee80211_vht_cap_ie_to_sta_vht_cap
authorJohannes Berg <johannes.berg@intel.com>
Thu, 7 Feb 2013 10:58:58 +0000 (11:58 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Feb 2013 08:41:29 +0000 (09:41 +0100)
Like with HT, make things a bit simpler in future patches by
passing the station to ieee80211_vht_cap_ie_to_sta_vht_cap()
instead of the vht_cap pointer. Also disable VHT here if HT
isn't supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/vht.c

index 9b179309e073ed02a2879054cee4ee292467f3d8..9c9496d011208e8f91482b04b22c94bd48312351 100644 (file)
@@ -1257,8 +1257,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
 
        if (params->vht_capa)
                ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
-                                                   params->vht_capa,
-                                                   &sta->sta.vht_cap);
+                                                   params->vht_capa, sta);
 
        if (ieee80211_vif_is_mesh(&sdata->vif)) {
 #ifdef CONFIG_MAC80211_MESH
index 8f9564460cb015e371b9e900bc3ff8cf50bb7a66..9206d43ca5720a02c657c7bb7be5b27bbd961e45 100644 (file)
@@ -1430,7 +1430,8 @@ u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
 void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
                                         struct ieee80211_supported_band *sband,
                                         struct ieee80211_vht_cap *vht_cap_ie,
-                                        struct ieee80211_sta_vht_cap *vht_cap);
+                                        struct sta_info *sta);
+
 /* Spectrum management */
 void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
                                       struct ieee80211_mgmt *mgmt,
index ac1374a8c30a66934598f67d2852819ee12cca0f..58b6e67ffbed27a69fed455b44fa7fc7663def8c 100644 (file)
@@ -2217,8 +2217,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
 
        if (elems.vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
                ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
-                                                   elems.vht_cap_elem,
-                                                   &sta->sta.vht_cap);
+                                                   elems.vht_cap_elem, sta);
 
        rate_control_rate_init(sta);
 
index f311388aeedf0f1dd8d2ef7d28a62331a2b0dbfe..1606aa165d5f536a0c4a7eb39699d677ecae738e 100644 (file)
 void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
                                         struct ieee80211_supported_band *sband,
                                         struct ieee80211_vht_cap *vht_cap_ie,
-                                        struct ieee80211_sta_vht_cap *vht_cap)
+                                        struct sta_info *sta)
 {
-       if (WARN_ON_ONCE(!vht_cap))
-               return;
+       struct ieee80211_sta_vht_cap *vht_cap = &sta->sta.vht_cap;
 
        memset(vht_cap, 0, sizeof(*vht_cap));
 
+       if (!sta->sta.ht_cap.ht_supported)
+               return;
+
        if (!vht_cap_ie || !sband->vht_cap.vht_supported)
                return;