summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7925
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2023-09-21 13:23:47 +0300
committerFelix Fietkau <nbd@nbd.name>2023-09-30 21:17:18 +0300
commit4d2cb56afaf7a96f04bab4c03506e4f5ad8f03db (patch)
treec0e41e5e78382c2da08df660cb76e5f5399d0eff /drivers/net/wireless/mediatek/mt76/mt7925
parent81af5418049ff673ddad0ba9377230bdb13a1f24 (diff)
downloadlinux-4d2cb56afaf7a96f04bab4c03506e4f5ad8f03db.tar.xz
wifi: mt76: mt792x: move mt7921_skb_add_usb_sdio_hdr in mt792x module
Since mt7921_skb_add_usb_sdio_hdr is shared between mt7925 and mt7921 drivers, move it in mt792x module. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7925')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/mac.c2
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h15
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/usb.c2
3 files changed, 2 insertions, 17 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 2b27611c7f4b..1b9fbd9a140d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -1378,7 +1378,7 @@ int mt7925_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
pktid = mt76_tx_status_skb_add(&dev->mt76, wcid, skb);
mt7925_usb_sdio_write_txwi(dev, wcid, qid, sta, key, pktid, skb);
- mt7925_skb_add_usb_sdio_hdr(dev, skb, 0);
+ mt792x_skb_add_usb_sdio_hdr(dev, skb, 0);
pad = round_up(skb->len, 4) - skb->len;
if (mt76_is_usb(mdev))
pad += 4;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
index 1133d95383ca..9a2d38a2b2bd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
@@ -25,9 +25,6 @@
#define MT7925_SKU_MAX_DELTA_IDX MT7925_SKU_RATE_NUM
#define MT7925_SKU_TABLE_SIZE (MT7925_SKU_RATE_NUM + 1)
-#define MT7925_SDIO_HDR_TX_BYTES GENMASK(15, 0)
-#define MT7925_SDIO_HDR_PKT_TYPE GENMASK(17, 16)
-
#define MCU_UNI_EVENT_ROC 0x27
enum {
@@ -210,18 +207,6 @@ void mt7925_mcu_rx_event(struct mt792x_dev *dev, struct sk_buff *skb);
int mt7925_mcu_chip_config(struct mt792x_dev *dev, const char *cmd);
int mt7925_mcu_set_rxfilter(struct mt792x_dev *dev, u32 fif,
u8 bit_op, u32 bit_map);
-static inline void
-mt7925_skb_add_usb_sdio_hdr(struct mt792x_dev *dev, struct sk_buff *skb,
- int type)
-{
- u32 hdr, len;
-
- len = mt76_is_usb(&dev->mt76) ? skb->len : skb->len + sizeof(hdr);
- hdr = FIELD_PREP(MT7925_SDIO_HDR_TX_BYTES, len) |
- FIELD_PREP(MT7925_SDIO_HDR_PKT_TYPE, type);
-
- put_unaligned_le32(hdr, skb_push(skb, sizeof(hdr)));
-}
void mt7925_stop(struct ieee80211_hw *hw);
int mt7925_mac_init(struct mt792x_dev *dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
index 6cbcecabf40e..ea09b9b9d303 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
@@ -34,7 +34,7 @@ mt7925u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
else
ep = MT_EP_OUT_AC_BE;
- mt7925_skb_add_usb_sdio_hdr(dev, skb, 0);
+ mt792x_skb_add_usb_sdio_hdr(dev, skb, 0);
pad = round_up(skb->len, 4) + 4 - skb->len;
__skb_put_zero(skb, pad);