mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-24 21:50:31 -04:00
wifi: mt76: move shared mac definitions in mt76_connac2_mac.h
Move some mac shared definitions between mt7996, mt7921 and mt7915 in mt76_connac2_mac.h. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
committed by
Felix Fietkau
parent
50cc972dde
commit
140efef36a
@@ -19,18 +19,6 @@
|
||||
#define MT_RXD0_NORMAL_GROUP_3 BIT(27)
|
||||
#define MT_RXD0_NORMAL_GROUP_4 BIT(28)
|
||||
|
||||
enum rx_pkt_type {
|
||||
PKT_TYPE_TXS,
|
||||
PKT_TYPE_TXRXV,
|
||||
PKT_TYPE_NORMAL,
|
||||
PKT_TYPE_RX_DUP_RFB,
|
||||
PKT_TYPE_RX_TMR,
|
||||
PKT_TYPE_RETRIEVE,
|
||||
PKT_TYPE_TXRX_NOTIFY,
|
||||
PKT_TYPE_RX_EVENT,
|
||||
PKT_TYPE_NORMAL_MCU,
|
||||
};
|
||||
|
||||
#define MT_RXD1_NORMAL_BSSID GENMASK(31, 26)
|
||||
#define MT_RXD1_NORMAL_PAYLOAD_FORMAT GENMASK(25, 24)
|
||||
#define MT_RXD1_FIRST_AMSDU_FRAME GENMASK(1, 0)
|
||||
|
||||
@@ -6,6 +6,20 @@
|
||||
|
||||
#include "mt76.h"
|
||||
|
||||
enum rx_pkt_type {
|
||||
PKT_TYPE_TXS,
|
||||
PKT_TYPE_TXRXV,
|
||||
PKT_TYPE_NORMAL,
|
||||
PKT_TYPE_RX_DUP_RFB,
|
||||
PKT_TYPE_RX_TMR,
|
||||
PKT_TYPE_RETRIEVE,
|
||||
PKT_TYPE_TXRX_NOTIFY,
|
||||
PKT_TYPE_RX_EVENT,
|
||||
PKT_TYPE_NORMAL_MCU,
|
||||
PKT_TYPE_RX_FW_MONITOR = 0x0c,
|
||||
PKT_TYPE_TXRX_NOTIFY_V0 = 0x18,
|
||||
};
|
||||
|
||||
#define MT76_CONNAC_SCAN_IE_LEN 600
|
||||
#define MT76_CONNAC_MAX_NUM_SCHED_SCAN_INTERVAL 10
|
||||
#define MT76_CONNAC_MAX_TIME_SCHED_SCAN_INTERVAL U16_MAX
|
||||
|
||||
@@ -32,6 +32,16 @@ enum {
|
||||
MT_LMAC_PSMP0,
|
||||
};
|
||||
|
||||
#define MT_TX_FREE_MSDU_CNT GENMASK(9, 0)
|
||||
#define MT_TX_FREE_WLAN_ID GENMASK(23, 14)
|
||||
#define MT_TX_FREE_LATENCY GENMASK(12, 0)
|
||||
/* 0: success, others: dropped */
|
||||
#define MT_TX_FREE_STATUS GENMASK(14, 13)
|
||||
#define MT_TX_FREE_MSDU_ID GENMASK(30, 16)
|
||||
#define MT_TX_FREE_PAIR BIT(31)
|
||||
/* will support this field in further revision */
|
||||
#define MT_TX_FREE_RATE GENMASK(13, 0)
|
||||
|
||||
#define MT_TXD0_Q_IDX GENMASK(31, 25)
|
||||
#define MT_TXD0_PKT_FMT GENMASK(24, 23)
|
||||
#define MT_TXD0_ETH_TYPE_OFFSET GENMASK(22, 16)
|
||||
@@ -166,6 +176,15 @@ enum {
|
||||
|
||||
#define MT_TXS7_MPDU_RETRY_CNT GENMASK(31, 23)
|
||||
|
||||
/* RXD DW0 */
|
||||
#define MT_RXD0_LENGTH GENMASK(15, 0)
|
||||
#define MT_RXD0_PKT_FLAG GENMASK(19, 16)
|
||||
#define MT_RXD0_PKT_TYPE GENMASK(31, 27)
|
||||
|
||||
#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16)
|
||||
#define MT_RXD0_NORMAL_IP_SUM BIT(23)
|
||||
#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24)
|
||||
|
||||
/* RXD DW1 */
|
||||
#define MT_RXD1_NORMAL_WLAN_IDX GENMASK(9, 0)
|
||||
#define MT_RXD1_NORMAL_GROUP_1 BIT(11)
|
||||
@@ -308,6 +327,9 @@ enum {
|
||||
#define MT_CRXV_FOE_HI GENMASK(6, 0)
|
||||
#define MT_CRXV_FOE_SHIFT 13
|
||||
|
||||
#define MT_CT_PARSE_LEN 72
|
||||
#define MT_CT_DMA_BUF_NUM 2
|
||||
|
||||
#define MT_CT_INFO_APPLY_TXD BIT(0)
|
||||
#define MT_CT_INFO_COPY_HOST_TXD_ALL BIT(1)
|
||||
#define MT_CT_INFO_MGMT_FRAME BIT(2)
|
||||
|
||||
@@ -6,43 +6,12 @@
|
||||
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
#define MT_CT_PARSE_LEN 72
|
||||
#define MT_CT_DMA_BUF_NUM 2
|
||||
|
||||
#define MT_RXD0_LENGTH GENMASK(15, 0)
|
||||
#define MT_RXD0_PKT_TYPE GENMASK(31, 27)
|
||||
|
||||
#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16)
|
||||
#define MT_RXD0_NORMAL_IP_SUM BIT(23)
|
||||
#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24)
|
||||
|
||||
enum rx_pkt_type {
|
||||
PKT_TYPE_TXS,
|
||||
PKT_TYPE_TXRXV,
|
||||
PKT_TYPE_NORMAL,
|
||||
PKT_TYPE_RX_DUP_RFB,
|
||||
PKT_TYPE_RX_TMR,
|
||||
PKT_TYPE_RETRIEVE,
|
||||
PKT_TYPE_TXRX_NOTIFY,
|
||||
PKT_TYPE_RX_EVENT,
|
||||
PKT_TYPE_RX_FW_MONITOR = 0x0c,
|
||||
PKT_TYPE_TXRX_NOTIFY_V0 = 0x18,
|
||||
};
|
||||
|
||||
#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)
|
||||
#define MT_TX_FREE_WLAN_ID GENMASK(23, 14)
|
||||
#define MT_TX_FREE_LATENCY GENMASK(12, 0)
|
||||
#define MT_TX_FREE_MSDU_CNT_V0 GENMASK(6, 0)
|
||||
/* 0: success, others: dropped */
|
||||
#define MT_TX_FREE_MSDU_ID GENMASK(30, 16)
|
||||
#define MT_TX_FREE_PAIR BIT(31)
|
||||
#define MT_TX_FREE_MPDU_HEADER BIT(30)
|
||||
#define MT_TX_FREE_MSDU_ID_V3 GENMASK(14, 0)
|
||||
|
||||
/* will support this field in further revision */
|
||||
#define MT_TX_FREE_RATE GENMASK(13, 0)
|
||||
|
||||
#define MT_TXS5_F0_FINAL_MPDU BIT(31)
|
||||
#define MT_TXS5_F0_QOS BIT(30)
|
||||
#define MT_TXS5_F0_TX_COUNT GENMASK(29, 25)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "../dma.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
static int mt7921_poll_tx(struct napi_struct *napi, int budget)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/firmware.h>
|
||||
#include "mt7921.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
#include "mcu.h"
|
||||
|
||||
static const struct ieee80211_iface_limit if_limits[] = {
|
||||
|
||||
@@ -6,9 +6,20 @@
|
||||
#include <linux/timekeeping.h>
|
||||
#include "mt7921.h"
|
||||
#include "../dma.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
#include "mcu.h"
|
||||
|
||||
#define MT_WTBL_TXRX_CAP_RATE_OFFSET 7
|
||||
#define MT_WTBL_TXRX_RATE_G2_HE 24
|
||||
#define MT_WTBL_TXRX_RATE_G2 12
|
||||
|
||||
#define MT_WTBL_AC0_CTT_OFFSET 20
|
||||
|
||||
static u32 mt7921_mac_wtbl_lmac_addr(int idx, u8 offset)
|
||||
{
|
||||
return MT_WTBL_LMAC_OFFS(idx, 0) + offset * 4;
|
||||
}
|
||||
|
||||
static struct mt76_wcid *mt7921_rx_get_wcid(struct mt7921_dev *dev,
|
||||
u16 idx, bool unicast)
|
||||
{
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/* SPDX-License-Identifier: ISC */
|
||||
/* Copyright (C) 2020 MediaTek Inc. */
|
||||
|
||||
#ifndef __MT7921_MAC_H
|
||||
#define __MT7921_MAC_H
|
||||
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
#define MT_CT_PARSE_LEN 72
|
||||
#define MT_CT_DMA_BUF_NUM 2
|
||||
|
||||
#define MT_RXD0_LENGTH GENMASK(15, 0)
|
||||
#define MT_RXD0_PKT_FLAG GENMASK(19, 16)
|
||||
#define MT_RXD0_PKT_TYPE GENMASK(31, 27)
|
||||
|
||||
#define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16)
|
||||
#define MT_RXD0_NORMAL_IP_SUM BIT(23)
|
||||
#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24)
|
||||
|
||||
enum rx_pkt_type {
|
||||
PKT_TYPE_TXS,
|
||||
PKT_TYPE_TXRXV,
|
||||
PKT_TYPE_NORMAL,
|
||||
PKT_TYPE_RX_DUP_RFB,
|
||||
PKT_TYPE_RX_TMR,
|
||||
PKT_TYPE_RETRIEVE,
|
||||
PKT_TYPE_TXRX_NOTIFY,
|
||||
PKT_TYPE_RX_EVENT,
|
||||
PKT_TYPE_NORMAL_MCU,
|
||||
};
|
||||
|
||||
#define MT_TX_FREE_MSDU_CNT GENMASK(9, 0)
|
||||
#define MT_TX_FREE_WLAN_ID GENMASK(23, 14)
|
||||
#define MT_TX_FREE_LATENCY GENMASK(12, 0)
|
||||
/* 0: success, others: dropped */
|
||||
#define MT_TX_FREE_STATUS GENMASK(14, 13)
|
||||
#define MT_TX_FREE_MSDU_ID GENMASK(30, 16)
|
||||
#define MT_TX_FREE_PAIR BIT(31)
|
||||
/* will support this field in further revision */
|
||||
#define MT_TX_FREE_RATE GENMASK(13, 0)
|
||||
|
||||
#define MT_WTBL_TXRX_CAP_RATE_OFFSET 7
|
||||
#define MT_WTBL_TXRX_RATE_G2_HE 24
|
||||
#define MT_WTBL_TXRX_RATE_G2 12
|
||||
|
||||
#define MT_WTBL_AC0_CTT_OFFSET 20
|
||||
|
||||
static inline u32 mt7921_mac_wtbl_lmac_addr(int idx, u8 offset)
|
||||
{
|
||||
return MT_WTBL_LMAC_OFFS(idx, 0) + offset * 4;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "mt7921.h"
|
||||
#include "mt7921_trace.h"
|
||||
#include "mcu.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
#define MT_STA_BFER BIT(0)
|
||||
#define MT_STA_BFEE BIT(1)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
#include "mcu.h"
|
||||
#include "../trace.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "../dma.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
|
||||
enum mt76_txq_id qid, struct mt76_wcid *wcid,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "../sdio.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
#include "mcu.h"
|
||||
|
||||
static const struct sdio_device_id mt7921s_table[] = {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/mmc/sdio_func.h>
|
||||
#include "mt7921.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
#include "../sdio.h"
|
||||
|
||||
static void mt7921s_enable_irq(struct mt76_dev *dev)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "../sdio.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
#include "mcu.h"
|
||||
#include "regs.h"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "mcu.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
static const struct usb_device_id mt7921u_device_table[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7961, 0xff, 0xff, 0xff),
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "mt7921.h"
|
||||
#include "mcu.h"
|
||||
#include "mac.h"
|
||||
#include "../mt76_connac2_mac.h"
|
||||
|
||||
static u32 mt7921u_uhw_rr(struct mt76_dev *dev, u32 addr)
|
||||
{
|
||||
|
||||
@@ -20,18 +20,6 @@
|
||||
#define MT_RXD0_SW_PKT_TYPE_MAP 0x380F
|
||||
#define MT_RXD0_SW_PKT_TYPE_FRAME 0x3801
|
||||
|
||||
enum rx_pkt_type {
|
||||
PKT_TYPE_TXS,
|
||||
PKT_TYPE_TXRXV,
|
||||
PKT_TYPE_NORMAL,
|
||||
PKT_TYPE_RX_DUP_RFB,
|
||||
PKT_TYPE_RX_TMR,
|
||||
PKT_TYPE_RETRIEVE,
|
||||
PKT_TYPE_TXRX_NOTIFY,
|
||||
PKT_TYPE_RX_EVENT,
|
||||
PKT_TYPE_RX_FW_MONITOR = 0x0c,
|
||||
};
|
||||
|
||||
/* RXD DW1 */
|
||||
#define MT_RXD1_NORMAL_WLAN_IDX GENMASK(11, 0)
|
||||
#define MT_RXD1_NORMAL_GROUP_1 BIT(16)
|
||||
|
||||
Reference in New Issue
Block a user