diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-04-26 17:11:35 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-04-28 10:57:33 +0200 |
commit | 18fb84d986b398c59be6729f38f1c4bbbe8c4e9a (patch) | |
tree | a8c08b180e5b12d34322204914b3df9c19353217 /net/mac80211/rate.c | |
parent | mac80211: use bitfield macros for encoded rate (diff) | |
download | linux-18fb84d986b398c59be6729f38f1c4bbbe8c4e9a.tar.xz linux-18fb84d986b398c59be6729f38f1c4bbbe8c4e9a.zip |
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) set_sta_flag(sta, WLAN_STA_RATE_CONTROL); } +void rate_control_tx_status(struct ieee80211_local *local, + struct ieee80211_supported_band *sband, + struct ieee80211_tx_status *st) +{ + struct rate_control_ref *ref = local->rate_ctrl; + struct sta_info *sta = container_of(st->sta, struct sta_info, sta); + void *priv_sta = sta->rate_ctrl_priv; + + if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) + return; + + spin_lock_bh(&sta->rate_ctrl_lock); + if (ref->ops->tx_status_ext) + ref->ops->tx_status_ext(ref->priv, sband, priv_sta, st); + else if (st->skb) + ref->ops->tx_status(ref->priv, sband, st->sta, priv_sta, st->skb); + else + WARN_ON_ONCE(1); + + spin_unlock_bh(&sta->rate_ctrl_lock); +} + void rate_control_rate_update(struct ieee80211_local *local, struct ieee80211_supported_band *sband, struct sta_info *sta, u32 changed) |