diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-30 02:43:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-10 14:54:08 -0400 |
commit | 8f727ef3c4859f2c397a7609beb845dcd66729f5 (patch) | |
tree | 9843df4721d5510c464f7ea4e1f4da940b247c80 /net/mac80211 | |
parent | 7213cf2cb0dfbb4d6b55a1da000d34338f76c0e3 (diff) |
mac80211: notify driver of rate control updates
Devices that have internal rate control need to be
notified when the bandwidth or SMPS state changes
just like external rate control algorithms get a
notification now.
Add this notification and clarify the change bits
while at it, the HT_CHANGED bit really meant only
bandwidth changed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/driver-ops.h | 15 | ||||
-rw-r--r-- | net/mac80211/driver-trace.h | 28 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
-rw-r--r-- | net/mac80211/rate.h | 2 |
4 files changed, 46 insertions, 1 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index e8dbda1b5b8a..0eb2bc003058 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -476,6 +476,21 @@ int drv_sta_state(struct ieee80211_local *local, | |||
476 | return ret; | 476 | return ret; |
477 | } | 477 | } |
478 | 478 | ||
479 | static inline void drv_sta_rc_update(struct ieee80211_local *local, | ||
480 | struct ieee80211_sub_if_data *sdata, | ||
481 | struct ieee80211_sta *sta, u32 changed) | ||
482 | { | ||
483 | sdata = get_bss_sdata(sdata); | ||
484 | check_sdata_in_driver(sdata); | ||
485 | |||
486 | trace_drv_sta_rc_update(local, sdata, sta, changed); | ||
487 | if (local->ops->sta_rc_update) | ||
488 | local->ops->sta_rc_update(&local->hw, &sdata->vif, | ||
489 | sta, changed); | ||
490 | |||
491 | trace_drv_return_void(local); | ||
492 | } | ||
493 | |||
479 | static inline int drv_conf_tx(struct ieee80211_local *local, | 494 | static inline int drv_conf_tx(struct ieee80211_local *local, |
480 | struct ieee80211_sub_if_data *sdata, u16 queue, | 495 | struct ieee80211_sub_if_data *sdata, u16 queue, |
481 | const struct ieee80211_tx_queue_params *params) | 496 | const struct ieee80211_tx_queue_params *params) |
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h index 21d6f5290a1c..7ea544d86436 100644 --- a/net/mac80211/driver-trace.h +++ b/net/mac80211/driver-trace.h | |||
@@ -624,6 +624,34 @@ TRACE_EVENT(drv_sta_state, | |||
624 | ) | 624 | ) |
625 | ); | 625 | ); |
626 | 626 | ||
627 | TRACE_EVENT(drv_sta_rc_update, | ||
628 | TP_PROTO(struct ieee80211_local *local, | ||
629 | struct ieee80211_sub_if_data *sdata, | ||
630 | struct ieee80211_sta *sta, | ||
631 | u32 changed), | ||
632 | |||
633 | TP_ARGS(local, sdata, sta, changed), | ||
634 | |||
635 | TP_STRUCT__entry( | ||
636 | LOCAL_ENTRY | ||
637 | VIF_ENTRY | ||
638 | STA_ENTRY | ||
639 | __field(u32, changed) | ||
640 | ), | ||
641 | |||
642 | TP_fast_assign( | ||
643 | LOCAL_ASSIGN; | ||
644 | VIF_ASSIGN; | ||
645 | STA_ASSIGN; | ||
646 | __entry->changed = changed; | ||
647 | ), | ||
648 | |||
649 | TP_printk( | ||
650 | LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x", | ||
651 | LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed | ||
652 | ) | ||
653 | ); | ||
654 | |||
627 | TRACE_EVENT(drv_sta_add, | 655 | TRACE_EVENT(drv_sta_add, |
628 | TP_PROTO(struct ieee80211_local *local, | 656 | TP_PROTO(struct ieee80211_local *local, |
629 | struct ieee80211_sub_if_data *sdata, | 657 | struct ieee80211_sub_if_data *sdata, |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 594af5f4079c..4974f998c7dd 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -219,7 +219,7 @@ static u32 ieee80211_config_ht_tx(struct ieee80211_sub_if_data *sdata, | |||
219 | sta->sta.ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; | 219 | sta->sta.ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
220 | 220 | ||
221 | rate_control_rate_update(local, sband, sta, | 221 | rate_control_rate_update(local, sband, sta, |
222 | IEEE80211_RC_HT_CHANGED); | 222 | IEEE80211_RC_BW_CHANGED); |
223 | } | 223 | } |
224 | mutex_unlock(&local->sta_mtx); | 224 | mutex_unlock(&local->sta_mtx); |
225 | 225 | ||
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index 27b66be8ac8f..6e4fd32c6617 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
18 | #include "ieee80211_i.h" | 18 | #include "ieee80211_i.h" |
19 | #include "sta_info.h" | 19 | #include "sta_info.h" |
20 | #include "driver-ops.h" | ||
20 | 21 | ||
21 | struct rate_control_ref { | 22 | struct rate_control_ref { |
22 | struct ieee80211_local *local; | 23 | struct ieee80211_local *local; |
@@ -72,6 +73,7 @@ static inline void rate_control_rate_update(struct ieee80211_local *local, | |||
72 | if (ref && ref->ops->rate_update) | 73 | if (ref && ref->ops->rate_update) |
73 | ref->ops->rate_update(ref->priv, sband, ista, | 74 | ref->ops->rate_update(ref->priv, sband, ista, |
74 | priv_sta, changed); | 75 | priv_sta, changed); |
76 | drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); | ||
75 | } | 77 | } |
76 | 78 | ||
77 | static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, | 79 | static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, |