diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-02-07 05:47:44 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 03:41:30 -0500 |
commit | e1a0c6b3a4b27ed5f21291d0bbee2167ec201ef5 (patch) | |
tree | 18e5c9bd022ea469e7350a52ca67ce505a7608e6 /net/mac80211/mlme.c | |
parent | 4a34215ef7487b1cbd783e7cc485eb03de893bd0 (diff) |
mac80211: stop toggling IEEE80211_HT_CAP_SUP_WIDTH_20_40
For VHT, many more bandwidth changes are possible. As a first
step, stop toggling the IEEE80211_HT_CAP_SUP_WIDTH_20_40 flag
in the HT capabilities and instead introduce a bandwidth field
indicating the currently usable bandwidth to transmit to the
station. Of course, make all drivers use it.
To achieve this, make ieee80211_ht_cap_ie_to_sta_ht_cap() get
the station as an argument, rather than the new capabilities,
so it can set up the new bandwidth field.
If the station is a VHT station and VHT bandwidth is in use,
also set the bandwidth accordingly.
Doing this allows us to get rid of the supports_40mhz flag as
the HT capabilities now reflect the true capability instead of
the current setting.
While at it, also fix ieee80211_ht_cap_ie_to_sta_ht_cap() to not
ignore HT cap overrides when MCS TX isn't supported (not that it
really happens...)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 58b6e67ffbed..be1147286801 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -219,19 +219,20 @@ static u32 ieee80211_config_ht_tx(struct ieee80211_sub_if_data *sdata, | |||
219 | mutex_lock(&local->sta_mtx); | 219 | mutex_lock(&local->sta_mtx); |
220 | sta = sta_info_get(sdata, bssid); | 220 | sta = sta_info_get(sdata, bssid); |
221 | 221 | ||
222 | WARN_ON_ONCE(!sta); | 222 | if (WARN_ON_ONCE(!sta)) { |
223 | mutex_unlock(&local->sta_mtx); | ||
224 | return changed; | ||
225 | } | ||
223 | 226 | ||
224 | if (sta && !sta->supports_40mhz) | 227 | if (!(sta->sta.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)) |
225 | disable_40 = true; | 228 | disable_40 = true; |
226 | 229 | ||
227 | if (sta && (!reconfig || | 230 | if (!reconfig || |
228 | (disable_40 != !(sta->sta.ht_cap.cap & | 231 | disable_40 != (sta->sta.bandwidth < IEEE80211_STA_RX_BW_40)) { |
229 | IEEE80211_HT_CAP_SUP_WIDTH_20_40)))) { | ||
230 | |||
231 | if (disable_40) | 232 | if (disable_40) |
232 | sta->sta.ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | 233 | sta->sta.bandwidth = IEEE80211_STA_RX_BW_20; |
233 | else | 234 | else |
234 | sta->sta.ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; | 235 | sta->sta.bandwidth = ieee80211_sta_cur_vht_bw(sta); |
235 | 236 | ||
236 | rate_control_rate_update(local, sband, sta, | 237 | rate_control_rate_update(local, sband, sta, |
237 | IEEE80211_RC_BW_CHANGED); | 238 | IEEE80211_RC_BW_CHANGED); |
@@ -2210,10 +2211,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, | |||
2210 | 2211 | ||
2211 | if (elems.ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) | 2212 | if (elems.ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) |
2212 | ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, | 2213 | ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, |
2213 | elems.ht_cap_elem, &sta->sta.ht_cap); | 2214 | elems.ht_cap_elem, sta); |
2214 | |||
2215 | sta->supports_40mhz = | ||
2216 | sta->sta.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
2217 | 2215 | ||
2218 | if (elems.vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) | 2216 | if (elems.vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) |
2219 | ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, | 2217 | ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, |