drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
Extension
.c
Size
937034 bytes
Lines
28572
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 nphy_iqcal_params {
	u16 txlpf;
	u16 txgm;
	u16 pga;
	u16 pad;
	u16 ipa;
	u16 cal_gain;
	u16 ncorr[5];
};

struct nphy_txiqcal_ladder {
	u8 percent;
	u8 g_env;
};

struct nphy_ipa_txcalgains {
	struct nphy_txgains gains;
	bool useindex;
	u8 index;
};

struct nphy_papd_restore_state {
	u16 fbmix[2];
	u16 vga_master[2];
	u16 intpa_master[2];
	u16 afectrl[2];
	u16 afeoverride[2];
	u16 pwrup[2];
	u16 atten[2];
	u16 mm;
};

struct nphy_ipa_txrxgain {
	u16 hpvga;
	u16 lpf_biq1;
	u16 lpf_biq0;
	u16 lna2;
	u16 lna1;
	s8 txpwrindex;
};

#define NPHY_IPA_RXCAL_MAXGAININDEX (6 - 1)

static const struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_5GHz[] = {
	{0, 0, 0, 0, 0, 100},
	{0, 0, 0, 0, 0, 50},
	{0, 0, 0, 0, 0, -1},
	{0, 0, 0, 3, 0, -1},
	{0, 0, 3, 3, 0, -1},
	{0, 2, 3, 3, 0, -1}
};

static const struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_2GHz[] = {
	{0, 0, 0, 0, 0, 128},
	{0, 0, 0, 0, 0, 70},
	{0, 0, 0, 0, 0, 20},
	{0, 0, 0, 3, 0, 20},
	{0, 0, 3, 3, 0, 20},
	{0, 2, 3, 3, 0, 20}
};

static const struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_5GHz_rev7[] = {
	{0, 0, 0, 0, 0, 100},
	{0, 0, 0, 0, 0, 50},
	{0, 0, 0, 0, 0, -1},
	{0, 0, 0, 3, 0, -1},
	{0, 0, 3, 3, 0, -1},
	{0, 0, 5, 3, 0, -1}
};

static const struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_2GHz_rev7[] = {
	{0, 0, 0, 0, 0, 10},
	{0, 0, 0, 1, 0, 10},
	{0, 0, 1, 2, 0, 10},
	{0, 0, 1, 3, 0, 10},
	{0, 0, 4, 3, 0, 10},
	{0, 0, 6, 3, 0, 10}
};

enum {
	NPHY_RXCAL_GAIN_INIT = 0,
	NPHY_RXCAL_GAIN_UP,
	NPHY_RXCAL_GAIN_DOWN
};

#define wlc_phy_get_papd_nphy(pi) \
	(read_phy_reg((pi), 0x1e7) & \
	 ((0x1 << 15) |	\
	  (0x1 << 14) |	\
	  (0x1 << 13)))

Annotation

Implementation Notes