drivers/net/wireless/realtek/rtw88/rtw8822c.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/rtw8822c.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/rtw8822c.c- Extension
.c- Size
- 166280 bytes
- Lines
- 5449
- 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.hrtw8822c.hrtw8822c_table.hmac.hreg.hdebug.hutil.hbf.hefuse.h
Detected Declarations
struct dpk_cfg_pairstruct rtw8822c_dpk_datafunction rtw8822ce_efuse_parsingfunction rtw8822cu_efuse_parsingfunction rtw8822cs_efuse_parsingfunction rtw8822c_read_efusefunction rtw8822c_header_file_initfunction rtw8822c_bb_resetfunction rtw8822c_dac_backup_regfunction rtw8822c_dac_restore_regfunction rtw8822c_rf_minmax_cmpfunction __rtw8822c_dac_iq_sortfunction rtw8822c_dac_iq_sortfunction rtw8822c_dac_iq_offsetfunction rtw8822c_get_path_write_addrfunction rtw8822c_get_path_read_addrfunction rtw8822c_dac_iq_checkfunction rtw8822c_dac_cal_iq_samplefunction rtw8822c_dac_cal_iq_searchfunction rtw8822c_dac_cal_rf_modefunction rtw8822c_dac_bb_settingfunction rtw8822c_dac_cal_adcfunction rtw8822c_dac_cal_step1function rtw8822c_dac_cal_step2function rtw8822c_dac_cal_step3function rtw8822c_dac_cal_step4function rtw8822c_dac_cal_backup_vecfunction rtw8822c_dac_cal_backup_pathfunction rtw8822c_dac_cal_backup_dckfunction rtw8822c_dac_cal_backupfunction rtw8822c_dac_cal_restore_dckfunction rtw8822c_dac_cal_restore_preparefunction rtw8822c_dac_cal_restore_waitfunction rtw8822c_dac_cal_restore_pathfunction __rtw8822c_dac_cal_restorefunction rtw8822c_dac_cal_restorefunction rtw8822c_rf_dac_calfunction rtw8822c_rf_x2_checkfunction rtw8822c_set_power_trimfunction rtw8822c_power_trimfunction rtw8822c_thermal_trimfunction rtw8822c_pa_biasfunction rtw8822c_rfk_handshakefunction rtw8822c_rfk_power_savefunction rtw8822c_txgapk_backup_bb_regfunction rtw8822c_txgapk_reload_bb_regfunction check_rf_statusfunction rtw8822c_txgapk_tx_pause
Annotated Snippet
struct dpk_cfg_pair {
u32 addr;
u32 bitmask;
u32 data;
};
void rtw8822c_parse_tbl_dpk(struct rtw_dev *rtwdev,
const struct rtw_table *tbl)
{
const struct dpk_cfg_pair *p = tbl->data;
const struct dpk_cfg_pair *end = p + tbl->size / 3;
BUILD_BUG_ON(sizeof(struct dpk_cfg_pair) != sizeof(u32) * 3);
for (; p < end; p++)
rtw_write32_mask(rtwdev, p->addr, p->bitmask, p->data);
}
static void rtw8822c_dpk_set_gnt_wl(struct rtw_dev *rtwdev, bool is_before_k)
{
struct rtw_dpk_info *dpk_info = &rtwdev->dm_info.dpk_info;
if (is_before_k) {
dpk_info->gnt_control = rtw_read32(rtwdev, 0x70);
dpk_info->gnt_value = rtw_coex_read_indirect_reg(rtwdev, 0x38);
rtw_write32_mask(rtwdev, 0x70, BIT(26), 0x1);
rtw_coex_write_indirect_reg(rtwdev, 0x38, MASKBYTE1, 0x77);
} else {
rtw_coex_write_indirect_reg(rtwdev, 0x38, MASKDWORD,
dpk_info->gnt_value);
rtw_write32(rtwdev, 0x70, dpk_info->gnt_control);
}
}
static void
rtw8822c_dpk_restore_registers(struct rtw_dev *rtwdev, u32 reg_num,
struct rtw_backup_info *bckp)
{
rtw_restore_reg(rtwdev, bckp, reg_num);
rtw_write32_mask(rtwdev, REG_NCTL0, BIT_SUBPAGE, 0xc);
rtw_write32_mask(rtwdev, REG_RXSRAM_CTL, BIT_DPD_CLK, 0x4);
}
static void
rtw8822c_dpk_backup_registers(struct rtw_dev *rtwdev, u32 *reg,
u32 reg_num, struct rtw_backup_info *bckp)
{
u32 i;
for (i = 0; i < reg_num; i++) {
bckp[i].len = 4;
bckp[i].reg = reg[i];
bckp[i].val = rtw_read32(rtwdev, reg[i]);
}
}
static void rtw8822c_dpk_backup_rf_registers(struct rtw_dev *rtwdev,
u32 *rf_reg,
u32 rf_reg_bak[][2])
{
u32 i;
for (i = 0; i < DPK_RF_REG_NUM; i++) {
rf_reg_bak[i][RF_PATH_A] = rtw_read_rf(rtwdev, RF_PATH_A,
rf_reg[i], RFREG_MASK);
rf_reg_bak[i][RF_PATH_B] = rtw_read_rf(rtwdev, RF_PATH_B,
rf_reg[i], RFREG_MASK);
}
}
static void rtw8822c_dpk_reload_rf_registers(struct rtw_dev *rtwdev,
u32 *rf_reg,
u32 rf_reg_bak[][2])
{
u32 i;
for (i = 0; i < DPK_RF_REG_NUM; i++) {
rtw_write_rf(rtwdev, RF_PATH_A, rf_reg[i], RFREG_MASK,
rf_reg_bak[i][RF_PATH_A]);
rtw_write_rf(rtwdev, RF_PATH_B, rf_reg[i], RFREG_MASK,
rf_reg_bak[i][RF_PATH_B]);
}
}
static void rtw8822c_dpk_information(struct rtw_dev *rtwdev)
{
struct rtw_dpk_info *dpk_info = &rtwdev->dm_info.dpk_info;
u32 reg;
u8 band_shift;
Annotation
- Immediate include surface: `linux/module.h`, `main.h`, `coex.h`, `fw.h`, `tx.h`, `rx.h`, `phy.h`, `rtw8822c.h`.
- Detected declarations: `struct dpk_cfg_pair`, `struct rtw8822c_dpk_data`, `function rtw8822ce_efuse_parsing`, `function rtw8822cu_efuse_parsing`, `function rtw8822cs_efuse_parsing`, `function rtw8822c_read_efuse`, `function rtw8822c_header_file_init`, `function rtw8822c_bb_reset`, `function rtw8822c_dac_backup_reg`, `function rtw8822c_dac_restore_reg`.
- 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.