diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-04-26 11:11:35 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-04-28 04:57:33 -0400 |
commit | 18fb84d986b398c59be6729f38f1c4bbbe8c4e9a (patch) | |
tree | a8c08b180e5b12d34322204914b3df9c19353217 /net/mac80211/rate.c | |
parent | dcba665b1f4a5e986f22ac4230d536341d3ea5da (diff) |
mac80211: make rate control tx status API more extensible
Rename .tx_status_noskb to .tx_status_ext and pass a new on-stack
struct ieee80211_tx_status instead of struct ieee80211_tx_info.
This struct can be used to pass extra information, e.g. for dynamic tx
power control
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rate.c')
-rw-r--r-- | net/mac80211/rate.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 9d7a1cd949fb..b387c07b8b47 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c | |||
@@ -62,6 +62,28 @@ void rate_control_rate_init(struct sta_info *sta) | |||
62 | set_sta_flag(sta, WLAN_STA_RATE_CONTROL); | 62 | set_sta_flag(sta, WLAN_STA_RATE_CONTROL); |
63 | } | 63 | } |
64 | 64 | ||
65 | void rate_control_tx_status(struct ieee80211_local *local, | ||
66 | struct ieee80211_supported_band *sband, | ||
67 | struct ieee80211_tx_status *st) | ||
68 | { | ||
69 | struct rate_control_ref *ref = local->rate_ctrl; | ||
70 | struct sta_info *sta = container_of(st->sta, struct sta_info, sta); | ||
71 | void *priv_sta = sta->rate_ctrl_priv; | ||
72 | |||
73 | if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) | ||
74 | return; | ||
75 | |||
76 | spin_lock_bh(&sta->rate_ctrl_lock); | ||
77 | if (ref->ops->tx_status_ext) | ||
78 | ref->ops->tx_status_ext(ref->priv, sband, priv_sta, st); | ||
79 | else if (st->skb) | ||
80 | ref->ops->tx_status(ref->priv, sband, st->sta, priv_sta, st->skb); | ||
81 | else | ||
82 | WARN_ON_ONCE(1); | ||
83 | |||
84 | spin_unlock_bh(&sta->rate_ctrl_lock); | ||
85 | } | ||
86 | |||
65 | void rate_control_rate_update(struct ieee80211_local *local, | 87 | void rate_control_rate_update(struct ieee80211_local *local, |
66 | struct ieee80211_supported_band *sband, | 88 | struct ieee80211_supported_band *sband, |
67 | struct sta_info *sta, u32 changed) | 89 | struct sta_info *sta, u32 changed) |