diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2013-01-23 15:18:13 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-24 10:03:52 -0500 |
commit | f68d776a04bfcebc426f605c4440ffe38c583a4b (patch) | |
tree | 0097f96da211760cd4a6b740bc54d3beaf5966bb | |
parent | 296fcba3ba1b8888aa8f5211de1e25a78b47aeee (diff) |
mac80211: support mesh rate updates
An existing mesh station entry may change its rate
capabilities, so call rate_control_rate_update() to notify
the rate control.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
[fix compilation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/driver-ops.h | 3 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index e75f5b9eb24f..434b3c4f31b5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -569,7 +569,8 @@ static inline void drv_sta_rc_update(struct ieee80211_local *local, | |||
569 | check_sdata_in_driver(sdata); | 569 | check_sdata_in_driver(sdata); |
570 | 570 | ||
571 | WARN_ON(changed & IEEE80211_RC_SUPP_RATES_CHANGED && | 571 | WARN_ON(changed & IEEE80211_RC_SUPP_RATES_CHANGED && |
572 | sdata->vif.type != NL80211_IFTYPE_ADHOC); | 572 | (sdata->vif.type != NL80211_IFTYPE_ADHOC && |
573 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT)); | ||
573 | 574 | ||
574 | trace_drv_sta_rc_update(local, sdata, sta, changed); | 575 | trace_drv_sta_rc_update(local, sdata, sta, changed); |
575 | if (local->ops->sta_rc_update) | 576 | if (local->ops->sta_rc_update) |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index ef92d2705851..4e1d406fd9b1 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -292,7 +292,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, | |||
292 | struct ieee80211_local *local = sdata->local; | 292 | struct ieee80211_local *local = sdata->local; |
293 | enum ieee80211_band band = ieee80211_get_sdata_band(sdata); | 293 | enum ieee80211_band band = ieee80211_get_sdata_band(sdata); |
294 | struct ieee80211_supported_band *sband; | 294 | struct ieee80211_supported_band *sband; |
295 | u32 rates, basic_rates = 0; | 295 | u32 rates, basic_rates = 0, changed = 0; |
296 | 296 | ||
297 | sband = local->hw.wiphy->bands[band]; | 297 | sband = local->hw.wiphy->bands[band]; |
298 | rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates); | 298 | rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates); |
@@ -304,6 +304,8 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, | |||
304 | if (sta->plink_state == NL80211_PLINK_ESTAB) | 304 | if (sta->plink_state == NL80211_PLINK_ESTAB) |
305 | goto out; | 305 | goto out; |
306 | 306 | ||
307 | if (sta->sta.supp_rates[band] != rates) | ||
308 | changed |= IEEE80211_RC_SUPP_RATES_CHANGED; | ||
307 | sta->sta.supp_rates[band] = rates; | 309 | sta->sta.supp_rates[band] = rates; |
308 | if (elems->ht_cap_elem && | 310 | if (elems->ht_cap_elem && |
309 | sdata->vif.bss_conf.chandef.width != NL80211_CHAN_WIDTH_20_NOHT) | 311 | sdata->vif.bss_conf.chandef.width != NL80211_CHAN_WIDTH_20_NOHT) |
@@ -322,11 +324,15 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, | |||
322 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | 324 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
323 | ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan, | 325 | ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan, |
324 | elems->ht_operation, &chandef); | 326 | elems->ht_operation, &chandef); |
327 | if (sta->ch_width != chandef.width) | ||
328 | changed |= IEEE80211_RC_BW_CHANGED; | ||
325 | sta->ch_width = chandef.width; | 329 | sta->ch_width = chandef.width; |
326 | } | 330 | } |
327 | 331 | ||
328 | if (insert) | 332 | if (insert) |
329 | rate_control_rate_init(sta); | 333 | rate_control_rate_init(sta); |
334 | else | ||
335 | rate_control_rate_update(local, sband, sta, changed); | ||
330 | out: | 336 | out: |
331 | spin_unlock_bh(&sta->lock); | 337 | spin_unlock_bh(&sta->lock); |
332 | } | 338 | } |