OSDN Git Service

mt76: mt76x02u: update ewma pkt len in mt76x02u_tx_prepare_skb
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 17 Oct 2019 22:50:04 +0000 (00:50 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Nov 2019 12:23:50 +0000 (13:23 +0100)
Update ewma packet length in mt76x02u_tx_prepare_skb as it is
done for pci counterpart in order to properly estimate tx time on
current channel

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c

index 4294ffc..d03d3c8 100644 (file)
@@ -120,6 +120,12 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data,
        if (!wcid || wcid->hw_key_idx == 0xff || wcid->sw_iv)
                flags |= MT_TXD_INFO_WIV;
 
+       if (sta) {
+               struct mt76x02_sta *msta = (struct mt76x02_sta *)sta->drv_priv;
+
+               ewma_pktlen_add(&msta->pktlen, tx_info->skb->len);
+       }
+
        return mt76x02u_skb_dma_info(tx_info->skb, WLAN_PORT, flags);
 }
 EXPORT_SYMBOL_GPL(mt76x02u_tx_prepare_skb);