drivers/net/wireless/realtek/rtw88/rtw8814a.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/rtw8814a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/rtw8814a.c- Extension
.c- Size
- 66259 bytes
- Lines
- 2271
- 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/usb.hmain.hcoex.htx.hphy.hrtw8814a.hrtw8814a_table.hrtw88xxa.hreg.hdebug.hefuse.hregd.husb.h
Detected Declarations
function rtw8814a_efuse_grantfunction rtw8814a_read_rfe_typefunction rtw8814a_read_amplifier_typefunction rtw8814a_read_rf_typefunction rtw8814a_init_hwcapfunction rtw8814a_read_efusefunction rtw8814a_init_rfe_regfunction rtw8814a_get_bb_swingfunction rtw8814a_get_swing_indexfunction rtw8814a_pwrtrack_initfunction rtw8814a_config_trx_pathfunction rtw8814a_config_cck_rx_antenna_initfunction rtw8814a_phy_set_paramfunction rtw8814ae_enable_rf_1_2vfunction rtw8814a_mac_initfunction rtw8814a_set_rfe_reg_24gfunction rtw8814a_set_rfe_reg_5gfunction rtw8814a_set_channel_bb_swingfunction rtw8814a_set_bw_reg_adcfunction rtw8814a_set_bw_reg_agcfunction rtw8814a_switch_bandfunction rtw8814a_switch_channelfunction rtw8814a_24g_cck_tx_dfirfunction rtw8814a_set_bw_reg_macfunction rtw8814a_set_bw_rffunction rtw8814a_adc_clkfunction rtw8814a_spur_calibration_ch140function rtw8814a_set_nbi_regfunction rtw8814a_nbi_settingfunction rtw8814a_spur_nbi_settingfunction rtw8814a_spur_calibrationfunction rtw8814a_set_bw_modefunction rtw8814a_set_channelfunction rtw8814a_cck_rx_pwrfunction rtw8814a_query_phy_statusfunction rtw8814a_set_tx_power_index_by_ratefunction rtw8814a_set_tx_power_indexfunction rtw8814a_cfg_ldo25function rtw8814a_false_alarm_statisticsfunction rtw8814a_iqk_backup_mac_bbfunction rtw8814a_iqk_backup_rffunction rtw8814a_iqk_afe_settingfunction rtw8814a_iqk_restore_mac_bbfunction rtw8814a_iqk_restore_rffunction rtw8814a_iqk_reset_nctlfunction rtw8814a_iqk_configure_macfunction rtw8814a_lok_one_shotfunction rtw8814a_iqk_tx_one_shot
Annotated Snippet
switch (channel) {
case 36 ... 64:
rf_mod_ag = 0x101;
break;
case 100 ... 140:
rf_mod_ag = 0x301;
break;
default:
if (channel > 140)
rf_mod_ag = 0x501;
else
rf_mod_ag = 0x000;
break;
}
cfgch = (rf_mod_ag << 8) | channel;
rtw_write_rf(rtwdev, path, RF_CFGCH,
RF18_RFSI_MASK | RF18_BAND_MASK | RF18_CHANNEL_MASK, cfgch);
}
switch (channel) {
case 36 ... 64:
rtw_write32_mask(rtwdev, REG_AGC_TABLE, 0x1f, 1);
break;
case 100 ... 144:
rtw_write32_mask(rtwdev, REG_AGC_TABLE, 0x1f, 2);
break;
default:
if (channel >= 149)
rtw_write32_mask(rtwdev, REG_AGC_TABLE, 0x1f, 3);
break;
}
}
static void rtw8814a_24g_cck_tx_dfir(struct rtw_dev *rtwdev, u8 channel)
{
if (channel >= 1 && channel <= 11) {
rtw_write32(rtwdev, REG_CCK0_TX_FILTER1, 0x1a1b0030);
rtw_write32(rtwdev, REG_CCK0_TX_FILTER2, 0x090e1317);
rtw_write32(rtwdev, REG_CCK0_DEBUG_PORT, 0x00000204);
} else if (channel >= 12 && channel <= 13) {
rtw_write32(rtwdev, REG_CCK0_TX_FILTER1, 0x1a1b0030);
rtw_write32(rtwdev, REG_CCK0_TX_FILTER2, 0x090e1217);
rtw_write32(rtwdev, REG_CCK0_DEBUG_PORT, 0x00000305);
} else if (channel == 14) {
rtw_write32(rtwdev, REG_CCK0_TX_FILTER1, 0x1a1b0030);
rtw_write32(rtwdev, REG_CCK0_TX_FILTER2, 0x00000E17);
rtw_write32(rtwdev, REG_CCK0_DEBUG_PORT, 0x00000000);
}
}
static void rtw8814a_set_bw_reg_mac(struct rtw_dev *rtwdev, u8 bw)
{
u16 val16 = rtw_read16(rtwdev, REG_WMAC_TRXPTCL_CTL);
val16 &= ~BIT_RFMOD;
if (bw == RTW_CHANNEL_WIDTH_80)
val16 |= BIT_RFMOD_80M;
else if (bw == RTW_CHANNEL_WIDTH_40)
val16 |= BIT_RFMOD_40M;
rtw_write16(rtwdev, REG_WMAC_TRXPTCL_CTL, val16);
}
static void rtw8814a_set_bw_rf(struct rtw_dev *rtwdev, u8 bw)
{
u8 path;
for (path = RF_PATH_A; path < rtwdev->hal.rf_path_num; path++) {
switch (bw) {
case RTW_CHANNEL_WIDTH_5:
case RTW_CHANNEL_WIDTH_10:
case RTW_CHANNEL_WIDTH_20:
default:
rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_BW_MASK, 3);
break;
case RTW_CHANNEL_WIDTH_40:
rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_BW_MASK, 1);
break;
case RTW_CHANNEL_WIDTH_80:
rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_BW_MASK, 0);
break;
}
}
}
static void rtw8814a_adc_clk(struct rtw_dev *rtwdev)
{
Annotation
- Immediate include surface: `linux/usb.h`, `main.h`, `coex.h`, `tx.h`, `phy.h`, `rtw8814a.h`, `rtw8814a_table.h`, `rtw88xxa.h`.
- Detected declarations: `function rtw8814a_efuse_grant`, `function rtw8814a_read_rfe_type`, `function rtw8814a_read_amplifier_type`, `function rtw8814a_read_rf_type`, `function rtw8814a_init_hwcap`, `function rtw8814a_read_efuse`, `function rtw8814a_init_rfe_reg`, `function rtw8814a_get_bb_swing`, `function rtw8814a_get_swing_index`, `function rtw8814a_pwrtrack_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.