315-mac80211-add-tx_status_noskb-to-rate_control_ops.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. This op works like .tx_status, except it does not need access to the
  5. skb. This will be used by drivers that cannot match tx status
  6. information to specific packets.
  7. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8. ---
  9. --- a/include/net/mac80211.h
  10. +++ b/include/net/mac80211.h
  11. @@ -4727,6 +4727,10 @@ struct rate_control_ops {
  12. void (*free_sta)(void *priv, struct ieee80211_sta *sta,
  13. void *priv_sta);
  14. + void (*tx_status_noskb)(void *priv,
  15. + struct ieee80211_supported_band *sband,
  16. + struct ieee80211_sta *sta, void *priv_sta,
  17. + struct ieee80211_tx_info *info);
  18. void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
  19. struct ieee80211_sta *sta, void *priv_sta,
  20. struct sk_buff *skb);
  21. --- a/net/mac80211/rate.h
  22. +++ b/net/mac80211/rate.h
  23. @@ -37,11 +37,15 @@ static inline void rate_control_tx_statu
  24. struct rate_control_ref *ref = local->rate_ctrl;
  25. struct ieee80211_sta *ista = &sta->sta;
  26. void *priv_sta = sta->rate_ctrl_priv;
  27. + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  28. if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
  29. return;
  30. - ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
  31. + if (ref->ops->tx_status)
  32. + ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
  33. + else
  34. + ref->ops->tx_status_noskb(ref->priv, sband, ista, priv_sta, info);
  35. }