ath5k: channel change fix
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 315-mac80211-add-tx_status_noskb-to-rate_control_ops.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Sat, 15 Nov 2014 22:23:44 +0100
3 Subject: [PATCH] mac80211: add tx_status_noskb to rate_control_ops
4
5 This op works like .tx_status, except it does not need access to the
6 skb. This will be used by drivers that cannot match tx status
7 information to specific packets.
8
9 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 ---
11
12 --- a/include/net/mac80211.h
13 +++ b/include/net/mac80211.h
14 @@ -4727,6 +4727,10 @@ struct rate_control_ops {
15 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
16 void *priv_sta);
17
18 + void (*tx_status_noskb)(void *priv,
19 + struct ieee80211_supported_band *sband,
20 + struct ieee80211_sta *sta, void *priv_sta,
21 + struct ieee80211_tx_info *info);
22 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
23 struct ieee80211_sta *sta, void *priv_sta,
24 struct sk_buff *skb);
25 --- a/net/mac80211/rate.h
26 +++ b/net/mac80211/rate.h
27 @@ -37,11 +37,15 @@ static inline void rate_control_tx_statu
28 struct rate_control_ref *ref = local->rate_ctrl;
29 struct ieee80211_sta *ista = &sta->sta;
30 void *priv_sta = sta->rate_ctrl_priv;
31 + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
32
33 if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
34 return;
35
36 - ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
37 + if (ref->ops->tx_status)
38 + ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
39 + else
40 + ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info);
41 }
42
43