Commit a8021cb9 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau
Browse files

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: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 2b25b855
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;
+6 −5
Original line number Diff line number Diff line
@@ -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;
+0 −8
Original line number Diff line number Diff line
@@ -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)