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

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

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/mediatek/mt76/mt76x02.h
Extension
.h
Size
7571 bytes
Lines
285
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 mt76x02_rx_freq_cal {
	s8 high_gain[MT_MAX_CHAINS];
	s8 rssi_offset[MT_MAX_CHAINS];
	s8 lna_gain;
	u32 mcu_gain;
	s16 temp_offset;
	u8 freq_offset;
};

struct mt76x02_calibration {
	struct mt76x02_rx_freq_cal rx;

	u8 agc_gain_init[MT_MAX_CHAINS];
	u8 agc_gain_cur[MT_MAX_CHAINS];

	u16 false_cca;
	s8 avg_rssi_all;
	s8 agc_gain_adjust;
	s8 agc_lowest_gain;
	s8 low_gain;

	s8 temp_vco;
	s8 temp;

	bool init_cal_done;
	bool tssi_cal_done;
	bool tssi_comp_pending;
	bool dpd_cal_done;
	bool channel_cal_done;
	bool gain_init_done;

	int tssi_target;
	s8 tssi_dc;
};

struct mt76x02_beacon_ops {
	unsigned int nslots;
	unsigned int slot_size;
	void (*pre_tbtt_enable)(struct mt76x02_dev *dev, bool en);
	void (*beacon_enable)(struct mt76x02_dev *dev, bool en);
};

#define mt76x02_beacon_enable(dev, enable)	\
	(dev)->beacon_ops->beacon_enable(dev, enable)
#define mt76x02_pre_tbtt_enable(dev, enable)	\
	(dev)->beacon_ops->pre_tbtt_enable(dev, enable)

struct mt76x02_rate_power {
	union {
		struct {
			s8 cck[4];
			s8 ofdm[8];
			s8 ht[16];
			s8 vht[2];
		};
		s8 all[30];
	};
};

struct mt76x02_dev {
	union { /* must be first */
		struct mt76_dev mt76;
		struct mt76_phy mphy;
	};

	struct mac_address macaddr_list[8];

	struct mutex phy_mutex;

	u8 txdone_seq;
	DECLARE_KFIFO_PTR(txstatus_fifo, struct mt76x02_tx_status);
	spinlock_t txstatus_fifo_lock;
	u32 tx_airtime;
	u32 ampdu_ref;

	struct sk_buff *rx_head;

	struct delayed_work cal_work;
	struct delayed_work wdt_work;

	struct hrtimer pre_tbtt_timer;
	struct work_struct pre_tbtt_work;

	const struct mt76x02_beacon_ops *beacon_ops;

	u8 beacon_data_count;

	u8 tbtt_count;

	u32 tx_hang_reset;

Annotation

Implementation Notes