summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2022-06-20 14:37:34 +0200
committerFelix Fietkau <nbd@nbd.name>2022-07-11 13:40:02 +0200
commita8021cb9c1ef26536a766a0c3ecdd1f702516cb0 (patch)
tree61bdc36d97b9458c74f714ba41bf9ddecac6c6fc
parentmt76: connac: move mt7615_txp_skb_unmap in common code (diff)
downloadlinux-a8021cb9c1ef26536a766a0c3ecdd1f702516cb0.tar.xz
linux-a8021cb9c1ef26536a766a0c3ecdd1f702516cb0.zip
mt76: mt7915: rely on mt76_connac_tx_free
As for mt7921 and mt7615 drivers, rely on mt76_connac_tx_free data structure in mt7915e driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76_connac.h3
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/mac.c11
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/mac.h8
3 files changed, 7 insertions, 15 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac.h
index 077239b0820a..1d32d55ba587 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac.h
@@ -146,8 +146,7 @@ struct mt76_connac_txp_common {
struct mt76_connac_tx_free {
__le16 rx_byte_cnt;
__le16 ctrl;
- u8 txd_cnt;
- u8 rsv[3];
+ __le32 txd;
} __packed __aligned(4);
extern const struct wiphy_wowlan_support mt76_connac_wowlan_support;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index dabcd425cd34..f696c20dc6e3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -884,7 +884,8 @@ mt7915_mac_tx_free_done(struct mt7915_dev *dev,
static void
mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
{
- struct mt7915_tx_free *free = (struct mt7915_tx_free *)data;
+ struct mt76_connac_tx_free *free = data;
+ __le32 *tx_info = (__le32 *)(data + sizeof(*free));
struct mt76_dev *mdev = &dev->mt76;
struct mt76_txwi_cache *txwi;
struct ieee80211_sta *sta = NULL;
@@ -899,10 +900,10 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
total = le16_get_bits(free->ctrl, MT_TX_FREE_MSDU_CNT);
v3 = (FIELD_GET(MT_TX_FREE_VER, txd) == 0x4);
- if (WARN_ON_ONCE((void *)&free->info[total >> v3] > end))
+ if (WARN_ON_ONCE((void *)&tx_info[total >> v3] > end))
return;
- for (cur_info = &free->info[0]; count < total; cur_info++) {
+ for (cur_info = tx_info; count < total; cur_info++) {
u32 msdu, info = le32_to_cpu(*cur_info);
u8 i;
@@ -955,9 +956,9 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
static void
mt7915_mac_tx_free_v0(struct mt7915_dev *dev, void *data, int len)
{
- struct mt7915_tx_free *free = (struct mt7915_tx_free *)data;
+ struct mt76_connac_tx_free *free = data;
+ __le16 *info = (__le16 *)(data + sizeof(*free));
struct mt76_dev *mdev = &dev->mt76;
- __le16 *info = (__le16 *)free->info;
void *end = data + len;
LIST_HEAD(free_list);
bool wake = false;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.h b/drivers/net/wireless/mediatek/mt76/mt7915/mac.h
index ed71a7bc25eb..3876a7457cde 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.h
@@ -41,14 +41,6 @@ enum tx_mcu_port_q_idx {
MT_TX_MCU_PORT_RX_Q3,
MT_TX_MCU_PORT_RX_FWDL = 0x3e
};
-
-struct mt7915_tx_free {
- __le16 rx_byte_cnt;
- __le16 ctrl;
- __le32 txd;
- __le32 info[];
-} __packed __aligned(4);
-
#define MT_TX_FREE_VER GENMASK(18, 16)
#define MT_TX_FREE_MSDU_CNT GENMASK(9, 0)
#define MT_TX_FREE_MSDU_CNT_V0 GENMASK(6, 0)