diff mbox series

[v7,3/5] mt76: mt76x02: remove a copy call for usb speedup

Message ID 20191120222826.14871-4-markus.theil@tu-ilmenau.de (mailing list archive)
State Superseded
Delegated to: Felix Fietkau
Headers show
Series mt76: channel switch support for USB devices | expand

Commit Message

Markus Theil Nov. 20, 2019, 10:28 p.m. UTC
This patch removes a mt76_wr_copy call from the beacon path to hw.
The skb which is used in this place gets therefore build with txwi
inside its data. For mt76 usb drivers, this saves one synchronuous
copy call over usb, which lets the beacon work complete faster.

In mmio case, there is not enough headroom to put the txwi into the
skb, it is therefore using an additional mt76_wr_copy, which is fast
over mmio. Thanks Stanislaw for pointing this out.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
index 50e68af63d4f..060f0fc7a563 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
@@ -26,7 +26,6 @@  static int
 mt76x02_write_beacon(struct mt76x02_dev *dev, int offset, struct sk_buff *skb)
 {
 	int beacon_len = dev->beacon_ops->slot_size;
-	struct mt76x02_txwi txwi;
 
 	if (WARN_ON_ONCE(beacon_len < skb->len + sizeof(struct mt76x02_txwi)))
 		return -ENOSPC;
@@ -44,6 +43,7 @@  mt76x02_write_beacon(struct mt76x02_dev *dev, int offset, struct sk_buff *skb)
 	} else {
 		struct mt76x02_txwi txwi;
 
+		mt76x02_mac_write_txwi(dev, &txwi, skb, NULL, NULL, skb->len);
 		mt76_wr_copy(dev, offset, &txwi, sizeof(txwi));
 		offset += sizeof(txwi);
 	}