aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-18 18:10:42 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-11-19 13:15:50 -0500
commitf815e2b3c0126c26911cac72b837f03a31c0c2ed (patch)
treea0ffb718bd301afbbee9d106f87e7b886dbc52f0 /net/mac80211
parent8f894be2df9ad43d17763bc0201f7f303a91f091 (diff)
mac80211: notify drivers on sta rate table changes
This allows drivers with a firmware or chip-based rate lookup table to use the most recent default rate selection without having to get it from per-packet data or explicit ieee80211_get_tx_rate calls Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/driver-ops.h15
-rw-r--r--net/mac80211/rate.c3
-rw-r--r--net/mac80211/trace.h7
3 files changed, 25 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 5f5fc3f3ee7c..2ebc9ead9695 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -624,6 +624,21 @@ static inline void drv_sta_rc_update(struct ieee80211_local *local,
624 trace_drv_return_void(local); 624 trace_drv_return_void(local);
625} 625}
626 626
627static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
628 struct ieee80211_sub_if_data *sdata,
629 struct ieee80211_sta *sta)
630{
631 sdata = get_bss_sdata(sdata);
632 if (!check_sdata_in_driver(sdata))
633 return;
634
635 trace_drv_sta_rate_tbl_update(local, sdata, sta);
636 if (local->ops->sta_rate_tbl_update)
637 local->ops->sta_rate_tbl_update(&local->hw, &sdata->vif, sta);
638
639 trace_drv_return_void(local);
640}
641
627static inline int drv_conf_tx(struct ieee80211_local *local, 642static inline int drv_conf_tx(struct ieee80211_local *local,
628 struct ieee80211_sub_if_data *sdata, u16 ac, 643 struct ieee80211_sub_if_data *sdata, u16 ac,
629 const struct ieee80211_tx_queue_params *params) 644 const struct ieee80211_tx_queue_params *params)
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index f6fea67fcc5b..08ab7d6d1517 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -696,6 +696,7 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
696 struct ieee80211_sta *pubsta, 696 struct ieee80211_sta *pubsta,
697 struct ieee80211_sta_rates *rates) 697 struct ieee80211_sta_rates *rates)
698{ 698{
699 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
699 struct ieee80211_sta_rates *old; 700 struct ieee80211_sta_rates *old;
700 701
701 /* 702 /*
@@ -709,6 +710,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
709 if (old) 710 if (old)
710 kfree_rcu(old, rcu_head); 711 kfree_rcu(old, rcu_head);
711 712
713 drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
714
712 return 0; 715 return 0;
713} 716}
714EXPORT_SYMBOL(rate_control_set_rates); 717EXPORT_SYMBOL(rate_control_set_rates);
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index eb91505eb43e..85ccfbe863db 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -846,6 +846,13 @@ DEFINE_EVENT(sta_event, drv_sta_pre_rcu_remove,
846 TP_ARGS(local, sdata, sta) 846 TP_ARGS(local, sdata, sta)
847); 847);
848 848
849DEFINE_EVENT(sta_event, drv_sta_rate_tbl_update,
850 TP_PROTO(struct ieee80211_local *local,
851 struct ieee80211_sub_if_data *sdata,
852 struct ieee80211_sta *sta),
853 TP_ARGS(local, sdata, sta)
854);
855
849TRACE_EVENT(drv_conf_tx, 856TRACE_EVENT(drv_conf_tx,
850 TP_PROTO(struct ieee80211_local *local, 857 TP_PROTO(struct ieee80211_local *local,
851 struct ieee80211_sub_if_data *sdata, 858 struct ieee80211_sub_if_data *sdata,