aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/vht.c
diff options
context:
space:
mode:
authorMarek Kwaczynski <marek.kwaczynski@tieto.com>2014-02-03 08:44:44 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-05 08:03:23 -0500
commitb1bce14a7954790d0fd3bba29375a65aa96fc57c (patch)
tree167db77bcc08a2241de6aba667508aebf17f792c /net/mac80211/vht.c
parent9752482083066af7ac18a5ca376ff35d72418b29 (diff)
mac80211: update opmode when adding new station
Update the operating mode field is needed when an association request contains the operating mode notification element and it's not just changed later on the fly. Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> [clarify commit log, comments & fix whitespace] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/vht.c')
-rw-r--r--net/mac80211/vht.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
index d75f35c6e1a0..e9e36a256165 100644
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -349,9 +349,9 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta)
349 sta->sta.rx_nss = max_t(u8, 1, ht_rx_nss); 349 sta->sta.rx_nss = max_t(u8, 1, ht_rx_nss);
350} 350}
351 351
352void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata, 352u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
353 struct sta_info *sta, u8 opmode, 353 struct sta_info *sta, u8 opmode,
354 enum ieee80211_band band, bool nss_only) 354 enum ieee80211_band band, bool nss_only)
355{ 355{
356 struct ieee80211_local *local = sdata->local; 356 struct ieee80211_local *local = sdata->local;
357 struct ieee80211_supported_band *sband; 357 struct ieee80211_supported_band *sband;
@@ -363,7 +363,7 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
363 363
364 /* ignore - no support for BF yet */ 364 /* ignore - no support for BF yet */
365 if (opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF) 365 if (opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF)
366 return; 366 return 0;
367 367
368 nss = opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_MASK; 368 nss = opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_MASK;
369 nss >>= IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT; 369 nss >>= IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
@@ -375,7 +375,7 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
375 } 375 }
376 376
377 if (nss_only) 377 if (nss_only)
378 goto change; 378 return changed;
379 379
380 switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) { 380 switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) {
381 case IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ: 381 case IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ:
@@ -398,7 +398,19 @@ void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
398 changed |= IEEE80211_RC_BW_CHANGED; 398 changed |= IEEE80211_RC_BW_CHANGED;
399 } 399 }
400 400
401 change: 401 return changed;
402 if (changed) 402}
403
404void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
405 struct sta_info *sta, u8 opmode,
406 enum ieee80211_band band, bool nss_only)
407{
408 struct ieee80211_local *local = sdata->local;
409 struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
410
411 u32 changed = __ieee80211_vht_handle_opmode(sdata, sta, opmode,
412 band, nss_only);
413
414 if (changed > 0)
403 rate_control_rate_update(local, sband, sta, changed); 415 rate_control_rate_update(local, sband, sta, changed);
404} 416}