Skip to content

Commit f684565

Browse files
Felix Fietkaujmberg-intel
authored andcommitted
mac80211: add tx_status_noskb to rate_control_ops
This op works like .tx_status, except it does not need access to the skb. This will be used by drivers that cannot match tx status information to specific packets. Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 9594342 commit f684565

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

include/net/mac80211.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4837,6 +4837,10 @@ struct rate_control_ops {
48374837
void (*free_sta)(void *priv, struct ieee80211_sta *sta,
48384838
void *priv_sta);
48394839

4840+
void (*tx_status_noskb)(void *priv,
4841+
struct ieee80211_supported_band *sband,
4842+
struct ieee80211_sta *sta, void *priv_sta,
4843+
struct ieee80211_tx_info *info);
48404844
void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
48414845
struct ieee80211_sta *sta, void *priv_sta,
48424846
struct sk_buff *skb);

net/mac80211/rate.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ static inline void rate_control_tx_status(struct ieee80211_local *local,
3737
struct rate_control_ref *ref = local->rate_ctrl;
3838
struct ieee80211_sta *ista = &sta->sta;
3939
void *priv_sta = sta->rate_ctrl_priv;
40+
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
4041

4142
if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
4243
return;
4344

44-
ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
45+
if (ref->ops->tx_status)
46+
ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
47+
else
48+
ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info);
4549
}
4650

4751

0 commit comments

Comments
 (0)