drivers/net/wireless/broadcom/brcm80211/brcmsmac/rate.c

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

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/rate.c
Extension
.c
Size
16697 bytes
Lines
515
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 legacy_phycfg {
	u32 rate_ofdm;	/* ofdm mac rate */
	/* phy ctl byte 3, code rate, modulation type, # of streams */
	u8 tx_phy_ctl3;
};

/* Number of legacy_rate_cfg entries in the table */
#define LEGACY_PHYCFG_TABLE_SIZE	12

/*
 * In CCK mode LPPHY overloads OFDM Modulation bits with CCK Data Rate
 * Eventually MIMOPHY would also be converted to this format
 * 0 = 1Mbps; 1 = 2Mbps; 2 = 5.5Mbps; 3 = 11Mbps
 */
static const struct
legacy_phycfg legacy_phycfg_table[LEGACY_PHYCFG_TABLE_SIZE] = {
	{BRCM_RATE_1M, 0x00},	/* CCK  1Mbps,  data rate  0 */
	{BRCM_RATE_2M, 0x08},	/* CCK  2Mbps,  data rate  1 */
	{BRCM_RATE_5M5, 0x10},	/* CCK  5.5Mbps,  data rate  2 */
	{BRCM_RATE_11M, 0x18},	/* CCK  11Mbps,  data rate   3 */
	/* OFDM  6Mbps,  code rate 1/2, BPSK,   1 spatial stream */
	{BRCM_RATE_6M, 0x00},
	/* OFDM  9Mbps,  code rate 3/4, BPSK,   1 spatial stream */
	{BRCM_RATE_9M, 0x02},
	/* OFDM  12Mbps, code rate 1/2, QPSK,   1 spatial stream */
	{BRCM_RATE_12M, 0x08},
	/* OFDM  18Mbps, code rate 3/4, QPSK,   1 spatial stream */
	{BRCM_RATE_18M, 0x0A},
	/* OFDM  24Mbps, code rate 1/2, 16-QAM, 1 spatial stream */
	{BRCM_RATE_24M, 0x10},
	/* OFDM  36Mbps, code rate 3/4, 16-QAM, 1 spatial stream */
	{BRCM_RATE_36M, 0x12},
	/* OFDM  48Mbps, code rate 2/3, 64-QAM, 1 spatial stream */
	{BRCM_RATE_48M, 0x19},
	/* OFDM  54Mbps, code rate 3/4, 64-QAM, 1 spatial stream */
	{BRCM_RATE_54M, 0x1A},
};

/* Hardware rates (also encodes default basic rates) */

const struct brcms_c_rateset cck_ofdm_mimo_rates = {
	12,
	/*  1b,   2b,   5.5b, 6,    9,    11b,  12,   18,   24,   36,   48, */
	{ 0x82, 0x84, 0x8b, 0x0c, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60,
	/* 54 Mbps */
	  0x6c},
	0x00,
	{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x00, 0x00, 0x00, 0x00, 0x00}
};

const struct brcms_c_rateset ofdm_mimo_rates = {
	8,
	/*  6b,   9,    12b,  18,   24b,  36,   48,   54 Mbps */
	{ 0x8c, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6c},
	0x00,
	{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x00, 0x00, 0x00, 0x00, 0x00}
};

/* Default ratesets that include MCS32 for 40BW channels */
static const struct brcms_c_rateset cck_ofdm_40bw_mimo_rates = {
	12,
	/*  1b,   2b,   5.5b, 6,    9,    11b,  12,   18,   24,   36,   48 */
	{ 0x82, 0x84, 0x8b, 0x0c, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60,
	/* 54 Mbps */
	  0x6c},
	0x00,
	{ 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x00, 0x00, 0x00, 0x00, 0x00}
};

static const struct brcms_c_rateset ofdm_40bw_mimo_rates = {
	8,
	/*  6b,   9,    12b,  18,   24b,  36,   48,   54 Mbps */
	{ 0x8c, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6c},
	0x00,
	{ 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x00, 0x00, 0x00, 0x00, 0x00}
};

const struct brcms_c_rateset cck_ofdm_rates = {
	12,
	/*  1b,   2b, 5.5b, 6,    9,    11b,  12,   18,   24,   36,   48,*/
	{ 0x82, 0x84, 0x8b, 0x0c, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60,
	/*54 Mbps */
	  0x6c},
	0x00,
	{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x00, 0x00, 0x00, 0x00, 0x00}

Annotation

Implementation Notes