drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
Extension
.h
Size
9661 bytes
Lines
354
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct mt7921_realease_info {
	__le16 len;
	u8 pad_len;
	u8 tag;
} __packed;

struct mt7921_fw_features {
	u8 segment;
	u8 data;
	u8 rsv[14];
} __packed;

struct mt7921_roc_grant_tlv {
	__le16 tag;
	__le16 len;
	u8 bss_idx;
	u8 tokenid;
	u8 status;
	u8 primarychannel;
	u8 rfsco;
	u8 rfband;
	u8 channelwidth;
	u8 centerfreqseg1;
	u8 centerfreqseg2;
	u8 reqtype;
	u8 dbdcband;
	u8 rsv[1];
	__le32 max_interval;
} __packed;

enum mt7921_sdio_pkt_type {
	MT7921_SDIO_TXD,
	MT7921_SDIO_DATA,
	MT7921_SDIO_CMD,
	MT7921_SDIO_FWDL,
};

struct mt7921_sdio_intr {
	u32 isr;
	struct {
		u32 wtqcr[16];
	} tx;
	struct {
		u16 num[2];
		u16 len0[16];
		u16 len1[128];
	} rx;
	u32 rec_mb[2];
} __packed;

#define to_rssi(field, rxv)		((FIELD_GET(field, rxv) - 220) / 2)
#define to_rcpi(rssi)			(2 * (rssi) + 220)

enum mt7921_txq_id {
	MT7921_TXQ_BAND0,
	MT7921_TXQ_BAND1,
	MT7921_TXQ_FWDL = 16,
	MT7921_TXQ_MCU_WM,
};

enum mt7921_rxq_id {
	MT7921_RXQ_BAND0 = 0,
	MT7921_RXQ_BAND1,
	MT7921_RXQ_MCU_WM = 0,
};

/* MT7902 assigns its MCU-WM TXQ at index 15 */
enum mt7902_txq_id {
	MT7902_TXQ_MCU_WM = 15,
};

struct mt7921_dma_layout {
	u8 mcu_wm_txq;
	u16 mcu_rxdone_ring_size;
	bool has_mcu_wa;
};

enum {
	MT7921_CLC_POWER,
	MT7921_CLC_CHAN,
	MT7921_CLC_MAX_NUM,
};

struct mt7921_clc_rule {
	u8 alpha2[2];
	u8 type[2];
	__le16 len;
	u8 data[];
} __packed;

Annotation

Implementation Notes