summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Chiu <chui-hao.chiu@mediatek.com>2023-05-10 06:53:19 +0200
committerFelix Fietkau <nbd@nbd.name>2023-07-25 21:59:40 +0200
commite890c3cf7897b1d07b19124ad2e42c687b3b99e5 (patch)
treecee81f3d8718959dce0034209c8260f39439b48b
parentwifi: mt76: mt7915: rework tx bytes counting when WED is active (diff)
downloadlinux-e890c3cf7897b1d07b19124ad2e42c687b3b99e5.tar.xz
linux-e890c3cf7897b1d07b19124ad2e42c687b3b99e5.zip
wifi: mt76: report non-binding skb tx rate when WED is active
AQL relies on accurate tx rate reporting, so add this patch for non-binding skb rate when WED is enabled. Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/tx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index e9b9728458a9..6cc26cc6c517 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -270,8 +270,15 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
#endif
if (cb->pktid < MT_PACKET_ID_FIRST) {
+ struct ieee80211_rate_status rs = {};
+
hw = mt76_tx_status_get_hw(dev, skb);
status.sta = wcid_to_sta(wcid);
+ if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
+ rs.rate_idx = wcid->rate;
+ status.rates = &rs;
+ status.n_rates = 1;
+ }
spin_lock_bh(&dev->rx_lock);
ieee80211_tx_status_ext(hw, &status);
spin_unlock_bh(&dev->rx_lock);