mac80211: add tx_status_noskb to rate_control_ops
authorFelix Fietkau <nbd@openwrt.org>
Wed, 19 Nov 2014 19:08:08 +0000 (20:08 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 28 Nov 2014 14:01:50 +0000 (15:01 +0100)
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 <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/rate.h

index 66cbfe46428d72fab9f4e9dae3050441d8fbd206..01dfd22e45fdc4c185485ba3561dba71c7c09511 100644 (file)
@@ -4837,6 +4837,10 @@ struct rate_control_ops {
        void (*free_sta)(void *priv, struct ieee80211_sta *sta,
                         void *priv_sta);
 
+       void (*tx_status_noskb)(void *priv,
+                               struct ieee80211_supported_band *sband,
+                               struct ieee80211_sta *sta, void *priv_sta,
+                               struct ieee80211_tx_info *info);
        void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
                          struct ieee80211_sta *sta, void *priv_sta,
                          struct sk_buff *skb);
index 18babe30283212c18ddb113f3295d211a310d014..dd25964a300ad7b037d494ce4645a4c52f67e342 100644 (file)
@@ -37,11 +37,15 @@ static inline void rate_control_tx_status(struct ieee80211_local *local,
        struct rate_control_ref *ref = local->rate_ctrl;
        struct ieee80211_sta *ista = &sta->sta;
        void *priv_sta = sta->rate_ctrl_priv;
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 
        if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
                return;
 
-       ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
+       if (ref->ops->tx_status)
+               ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
+       else
+               ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info);
 }