drivers/net/wireless/realtek/rtw88/rtw8822b.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/rtw8822b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/rtw8822b.c- Extension
.c- Size
- 79069 bytes
- Lines
- 2619
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hmain.hcoex.hfw.htx.hrx.hphy.hrtw8822b.hrtw8822b_table.hmac.hreg.hdebug.hbf.hregd.h
Detected Declarations
struct cca_ccutstruct rtw8822b_rfe_infofunction rtw8822be_efuse_parsingfunction rtw8822bu_efuse_parsingfunction rtw8822bs_efuse_parsingfunction rtw8822b_read_efusefunction rtw8822b_phy_rfe_initfunction rtw8822b_get_swing_indexfunction rtw8822b_pwrtrack_initfunction rtw8822b_phy_bf_initfunction rtw8822b_phy_set_paramfunction rtw8822b_mac_initfunction rtw8822b_set_channel_rfe_efemfunction rtw8822b_set_channel_rfe_ifemfunction rtw8822b_get_cca_valfunction rtw8822b_set_channel_ccafunction rtw8822b_set_channel_rffunction rtw8822b_toggle_igifunction rtw8822b_set_channel_rxdfirfunction rtw8822b_set_channel_bbfunction rtw8822b_set_channelfunction rtw8822b_config_trx_modefunction query_phy_status_page0function query_phy_status_page1function query_phy_statusfunction rtw8822b_set_tx_power_index_by_ratefunction rtw8822b_set_tx_power_indexfunction rtw8822b_check_rf_pathfunction rtw8822b_set_antennafunction rtw8822b_cfg_ldo25function rtw8822b_false_alarm_statisticsfunction rtw8822b_do_iqkfunction rtw8822b_phy_calibrationfunction rtw8822b_coex_cfg_initfunction rtw8822b_coex_cfg_ant_switchfunction rtw8822b_coex_cfg_gnt_fixfunction rtw8822b_coex_cfg_rfe_typefunction rtw8822b_coex_cfg_wl_tx_powerfunction rtw8822b_coex_cfg_wl_rx_gainfunction rtw8822b_txagc_swing_offsetfunction rtw8822b_pwrtrack_set_pwrfunction rtw8822b_pwrtrack_setfunction rtw8822b_phy_pwrtrack_pathfunction rtw8822b_phy_pwrtrackfunction rtw8822b_pwr_trackfunction rtw8822b_bf_config_bfee_sufunction rtw8822b_bf_config_bfee_mufunction rtw8822b_bf_config_bfee
Annotated Snippet
struct cca_ccut {
u32 reg82c[CCUT_IDX_NR];
u32 reg830[CCUT_IDX_NR];
u32 reg838[CCUT_IDX_NR];
};
static const struct cca_ccut cca_ifem_ccut = {
{0x75C97010, 0x75C97010, 0x75C97010, 0x75C97010}, /*Reg82C*/
{0x79a0eaaa, 0x79A0EAAC, 0x79a0eaaa, 0x79a0eaaa}, /*Reg830*/
{0x87765541, 0x87746341, 0x87765541, 0x87746341}, /*Reg838*/
};
static const struct cca_ccut cca_efem_ccut = {
{0x75B86010, 0x75B76010, 0x75B86010, 0x75B76010}, /*Reg82C*/
{0x79A0EAA8, 0x79A0EAAC, 0x79A0EAA8, 0x79a0eaaa}, /*Reg830*/
{0x87766451, 0x87766431, 0x87766451, 0x87766431}, /*Reg838*/
};
static const struct cca_ccut cca_ifem_ccut_ext = {
{0x75da8010, 0x75da8010, 0x75da8010, 0x75da8010}, /*Reg82C*/
{0x79a0eaaa, 0x97A0EAAC, 0x79a0eaaa, 0x79a0eaaa}, /*Reg830*/
{0x87765541, 0x86666341, 0x87765561, 0x86666361}, /*Reg838*/
};
static void rtw8822b_get_cca_val(const struct cca_ccut *cca_ccut, u8 col,
u32 *reg82c, u32 *reg830, u32 *reg838)
{
*reg82c = cca_ccut->reg82c[col];
*reg830 = cca_ccut->reg830[col];
*reg838 = cca_ccut->reg838[col];
}
struct rtw8822b_rfe_info {
const struct cca_ccut *cca_ccut_2g;
const struct cca_ccut *cca_ccut_5g;
enum rtw_rfe_fem fem;
bool ifem_ext;
void (*rtw_set_channel_rfe)(struct rtw_dev *rtwdev, u8 channel);
};
#define I2GE5G_CCUT(set_ch) { \
.cca_ccut_2g = &cca_ifem_ccut, \
.cca_ccut_5g = &cca_efem_ccut, \
.fem = RTW_RFE_IFEM2G_EFEM5G, \
.ifem_ext = false, \
.rtw_set_channel_rfe = &rtw8822b_set_channel_rfe_ ## set_ch, \
}
#define IFEM_EXT_CCUT(set_ch) { \
.cca_ccut_2g = &cca_ifem_ccut_ext, \
.cca_ccut_5g = &cca_ifem_ccut_ext, \
.fem = RTW_RFE_IFEM, \
.ifem_ext = true, \
.rtw_set_channel_rfe = &rtw8822b_set_channel_rfe_ ## set_ch, \
}
static const struct rtw8822b_rfe_info rtw8822b_rfe_info[] = {
[2] = I2GE5G_CCUT(efem),
[3] = IFEM_EXT_CCUT(ifem),
[5] = IFEM_EXT_CCUT(ifem),
};
static void rtw8822b_set_channel_cca(struct rtw_dev *rtwdev, u8 channel, u8 bw,
const struct rtw8822b_rfe_info *rfe_info)
{
struct rtw_hal *hal = &rtwdev->hal;
struct rtw_efuse *efuse = &rtwdev->efuse;
const struct cca_ccut *cca_ccut;
u8 col;
u32 reg82c, reg830, reg838;
bool is_efem_cca = false, is_ifem_cca = false, is_rfe_type = false;
if (IS_CH_2G_BAND(channel)) {
cca_ccut = rfe_info->cca_ccut_2g;
if (hal->antenna_rx == BB_PATH_A ||
hal->antenna_rx == BB_PATH_B)
col = CCUT_IDX_1R_2G;
else
col = CCUT_IDX_2R_2G;
} else {
cca_ccut = rfe_info->cca_ccut_5g;
if (hal->antenna_rx == BB_PATH_A ||
hal->antenna_rx == BB_PATH_B)
col = CCUT_IDX_1R_5G;
else
col = CCUT_IDX_2R_5G;
}
rtw8822b_get_cca_val(cca_ccut, col, ®82c, ®830, ®838);
Annotation
- Immediate include surface: `linux/module.h`, `main.h`, `coex.h`, `fw.h`, `tx.h`, `rx.h`, `phy.h`, `rtw8822b.h`.
- Detected declarations: `struct cca_ccut`, `struct rtw8822b_rfe_info`, `function rtw8822be_efuse_parsing`, `function rtw8822bu_efuse_parsing`, `function rtw8822bs_efuse_parsing`, `function rtw8822b_read_efuse`, `function rtw8822b_phy_rfe_init`, `function rtw8822b_get_swing_index`, `function rtw8822b_pwrtrack_init`, `function rtw8822b_phy_bf_init`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.