Commit 4a34215e authored by Johannes Berg's avatar Johannes Berg

mac80211: pass station to ieee80211_vht_cap_ie_to_sta_vht_cap

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: default avatarJohannes Berg <johannes.berg@intel.com>
parent 8cdc196b
...@@ -1257,8 +1257,7 @@ static int sta_apply_parameters(struct ieee80211_local *local, ...@@ -1257,8 +1257,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
if (params->vht_capa) if (params->vht_capa)
ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
params->vht_capa, params->vht_capa, sta);
&sta->sta.vht_cap);
if (ieee80211_vif_is_mesh(&sdata->vif)) { if (ieee80211_vif_is_mesh(&sdata->vif)) {
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
......
...@@ -1430,7 +1430,8 @@ u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs); ...@@ -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, void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband, struct ieee80211_supported_band *sband,
struct ieee80211_vht_cap *vht_cap_ie, struct ieee80211_vht_cap *vht_cap_ie,
struct ieee80211_sta_vht_cap *vht_cap); struct sta_info *sta);
/* Spectrum management */ /* Spectrum management */
void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt, struct ieee80211_mgmt *mgmt,
......
...@@ -2217,8 +2217,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, ...@@ -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)) if (elems.vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
elems.vht_cap_elem, elems.vht_cap_elem, sta);
&sta->sta.vht_cap);
rate_control_rate_init(sta); rate_control_rate_init(sta);
......
...@@ -15,13 +15,15 @@ ...@@ -15,13 +15,15 @@
void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, void ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband, struct ieee80211_supported_band *sband,
struct ieee80211_vht_cap *vht_cap_ie, struct ieee80211_vht_cap *vht_cap_ie,
struct ieee80211_sta_vht_cap *vht_cap) struct sta_info *sta)
{ {
if (WARN_ON_ONCE(!vht_cap)) struct ieee80211_sta_vht_cap *vht_cap = &sta->sta.vht_cap;
return;
memset(vht_cap, 0, sizeof(*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) if (!vht_cap_ie || !sband->vht_cap.vht_supported)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment