drivers/net/wireless/broadcom/brcm80211/brcmsmac/rate.h
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/rate.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/rate.h- Extension
.h- Size
- 7171 bytes
- Lines
- 246
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
types.hd11.hphy_hal.h
Detected Declarations
struct brcms_mcs_infofunction mcs_2_txstreamsfunction mcs_2_ratefunction pastfunction rspec_phytxbyte2function rspec_get_bwfunction rspec_issgifunction rspec_is40mhzfunction rspec2ratefunction rspec_mimoplcp3function plcp3_issgifunction rspec_stcfunction rspec_stffunction is_mcs_ratefunction is_ofdm_ratefunction is_cck_ratefunction is_single_streamfunction cck_rspecfunction ofdm_phy2mac_ratefunction cck_phy2mac_rate
Annotated Snippet
struct brcms_mcs_info {
/* phy rate in kbps [20Mhz] */
u32 phy_rate_20;
/* phy rate in kbps [40Mhz] */
u32 phy_rate_40;
/* phy rate in kbps [20Mhz] with SGI */
u32 phy_rate_20_sgi;
/* phy rate in kbps [40Mhz] with SGI */
u32 phy_rate_40_sgi;
/* phy ctl byte 3, code rate, modulation type, # of streams */
u8 tx_phy_ctl3;
/* matching legacy ofdm rate in 500bkps */
u8 leg_ofdm;
};
#define BRCMS_MAXMCS 32 /* max valid mcs index */
#define MCS_TABLE_SIZE 33 /* Number of mcs entries in the table */
extern const struct brcms_mcs_info mcs_table[];
#define MCS_TXS_MASK 0xc0 /* num tx streams - 1 bit mask */
#define MCS_TXS_SHIFT 6 /* num tx streams - 1 bit shift */
/* returns num tx streams - 1 */
static inline u8 mcs_2_txstreams(u8 mcs)
{
return (mcs_table[mcs].tx_phy_ctl3 & MCS_TXS_MASK) >> MCS_TXS_SHIFT;
}
static inline uint mcs_2_rate(u8 mcs, bool is40, bool sgi)
{
if (sgi) {
if (is40)
return mcs_table[mcs].phy_rate_40_sgi;
return mcs_table[mcs].phy_rate_20_sgi;
}
if (is40)
return mcs_table[mcs].phy_rate_40;
return mcs_table[mcs].phy_rate_20;
}
/* Macro to use the rate_info table */
#define BRCMS_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */
/*
* rate spec : holds rate and mode specific information required to generate a
* tx frame. Legacy CCK and OFDM information is held in the same manner as was
* done in the past (in the lower byte) the upper 3 bytes primarily hold MIMO
* specific information
*/
/* rate spec bit fields */
/* Either 500Kbps units or MIMO MCS idx */
#define RSPEC_RATE_MASK 0x0000007F
/* mimo MCS is stored in RSPEC_RATE_MASK */
#define RSPEC_MIMORATE 0x08000000
/* mimo bw mask */
#define RSPEC_BW_MASK 0x00000700
/* mimo bw shift */
#define RSPEC_BW_SHIFT 8
/* mimo Space/Time/Frequency mode mask */
#define RSPEC_STF_MASK 0x00003800
/* mimo Space/Time/Frequency mode shift */
#define RSPEC_STF_SHIFT 11
/* mimo coding type mask */
#define RSPEC_CT_MASK 0x0000C000
/* mimo coding type shift */
#define RSPEC_CT_SHIFT 14
/* mimo num STC streams per PLCP defn. */
#define RSPEC_STC_MASK 0x00300000
/* mimo num STC streams per PLCP defn. */
#define RSPEC_STC_SHIFT 20
/* mimo bit indicates adv coding in use */
#define RSPEC_LDPC_CODING 0x00400000
/* mimo bit indicates short GI in use */
#define RSPEC_SHORT_GI 0x00800000
/* bit indicates override both rate & mode */
#define RSPEC_OVERRIDE 0x80000000
/* bit indicates override rate only */
#define RSPEC_OVERRIDE_MCS_ONLY 0x40000000
static inline bool rspec_active(u32 rspec)
{
return rspec & (RSPEC_RATE_MASK | RSPEC_MIMORATE);
}
static inline u8 rspec_phytxbyte2(u32 rspec)
{
return (rspec & 0xff00) >> 8;
Annotation
- Immediate include surface: `types.h`, `d11.h`, `phy_hal.h`.
- Detected declarations: `struct brcms_mcs_info`, `function mcs_2_txstreams`, `function mcs_2_rate`, `function past`, `function rspec_phytxbyte2`, `function rspec_get_bw`, `function rspec_issgi`, `function rspec_is40mhz`, `function rspec2rate`, `function rspec_mimoplcp3`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.