aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-28 06:12:10 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 07:01:44 -0500
commitec61cd63dd3f3bf982180b2bcc1b325160d73837 (patch)
tree19fa85aa9fc26698bd9635b8f260b09df368ccda /net/mac80211/rx.c
parent598a5938e04ce30d837dca4c3c3326c69435342a (diff)
mac80211: support HT notify channel width action
Support the HT notify channel width action frame to update the rate scaling about the bandwidth the peer can receive in. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 580704eba8b8..a19089565c4b 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2353,7 +2353,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2353 sdata->vif.type != NL80211_IFTYPE_ADHOC) 2353 sdata->vif.type != NL80211_IFTYPE_ADHOC)
2354 break; 2354 break;
2355 2355
2356 /* verify action & smps_control are present */ 2356 /* verify action & smps_control/chanwidth are present */
2357 if (len < IEEE80211_MIN_ACTION_SIZE + 2) 2357 if (len < IEEE80211_MIN_ACTION_SIZE + 2)
2358 goto invalid; 2358 goto invalid;
2359 2359
@@ -2392,6 +2392,35 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2392 IEEE80211_RC_SMPS_CHANGED); 2392 IEEE80211_RC_SMPS_CHANGED);
2393 goto handled; 2393 goto handled;
2394 } 2394 }
2395 case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: {
2396 struct ieee80211_supported_band *sband;
2397 u8 chanwidth = mgmt->u.action.u.ht_notify_cw.chanwidth;
2398 bool old_40mhz, new_40mhz;
2399
2400 /* If it doesn't support 40 MHz it can't change ... */
2401 if (!rx->sta->supports_40mhz)
2402 goto handled;
2403
2404 old_40mhz = rx->sta->sta.ht_cap.cap &
2405 IEEE80211_HT_CAP_SUP_WIDTH_20_40;
2406 new_40mhz = chanwidth == IEEE80211_HT_CHANWIDTH_ANY;
2407
2408 if (old_40mhz == new_40mhz)
2409 goto handled;
2410
2411 if (new_40mhz)
2412 rx->sta->sta.ht_cap.cap |=
2413 IEEE80211_HT_CAP_SUP_WIDTH_20_40;
2414 else
2415 rx->sta->sta.ht_cap.cap &=
2416 ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
2417
2418 sband = rx->local->hw.wiphy->bands[status->band];
2419
2420 rate_control_rate_update(local, sband, rx->sta,
2421 IEEE80211_RC_BW_CHANGED);
2422 goto handled;
2423 }
2395 default: 2424 default:
2396 goto invalid; 2425 goto invalid;
2397 } 2426 }