drivers/net/wireless/realtek/rtw88/rtw88xxa.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/rtw88xxa.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/rtw88xxa.c- Extension
.c- Size
- 56186 bytes
- Lines
- 1990
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/usb.hmain.hcoex.hphy.hrtw88xxa.hmac.hreg.hsec.hdebug.hbf.hefuse.husb.h
Detected Declarations
function rtw88xxa_efuse_grantfunction rtw8812a_read_amplifier_typefunction rtw8812a_read_rfe_typefunction rtw88xxa_read_usb_typefunction rtw88xxa_read_efusefunction rtw88xxa_reset_8051function rtw88xxau_hw_resetfunction rtw88xxau_init_power_onfunction rtw88xxa_llt_writefunction rtw88xxa_llt_initfunction rtw88xxau_init_queue_reserved_pagefunction rtw88xxau_init_tx_buffer_boundaryfunction rtw88xxau_init_queue_priorityfunction rtw88xxa_init_wmac_settingfunction rtw88xxa_init_adaptive_ctrlfunction rtw88xxa_init_edcafunction rtw88xxau_tx_aggregationfunction rtw88xxa_init_beacon_parametersfunction rtw88xxa_phy_bb_configfunction rtw88xxa_phy_rf_configfunction rtw8812a_config_1tfunction rtw88xxa_get_bb_swingfunction rtw88xxa_get_swing_indexfunction rtw88xxa_pwrtrack_initfunction rtw88xxa_power_offfunction rtw88xxa_set_channel_bb_swingfunction rtw8821a_set_ext_band_switchfunction rtw8821a_phy_set_rfe_reg_24gfunction rtw8821a_phy_set_rfe_reg_5gfunction rtw8812a_phy_set_rfe_reg_24gfunction rtw8812a_phy_set_rfe_reg_5gfunction rtw88xxa_switch_bandfunction rtw88xxa_power_onfunction rtw88xxa_phy_read_rffunction rtw8812a_phy_fix_spurfunction rtw88xxa_switch_channelfunction rtw88xxa_set_reg_bwfunction rtw88xxa_post_set_bw_modefunction rtw88xxa_set_channel_rffunction rtw88xxa_set_channelfunction rtw88xxa_query_phy_statusfunction rtw88xxa_set_tx_power_index_by_ratefunction rtw88xxa_tx_power_trainingfunction rtw88xxa_set_tx_power_indexfunction rtw88xxa_false_alarm_statisticsfunction rtw88xxa_iqk_backup_mac_bbfunction rtw88xxa_iqk_backup_afefunction rtw88xxa_iqk_restore_mac_bb
Annotated Snippet
if (efuse->ext_lna_5g) {
if (efuse->ext_pa_5g) {
if (efuse->ext_lna_2g && efuse->ext_pa_2g)
efuse->rfe_option = 3;
else
efuse->rfe_option = 0;
} else {
efuse->rfe_option = 2;
}
} else {
efuse->rfe_option = 4;
}
} else {
efuse->rfe_option = map->rfe_option & 0x3f;
/* Due to other customer already use incorrect EFUSE map for
* their product. We need to add workaround to prevent to
* modify spec and notify all customer to revise the IC 0xca
* content.
*/
if (efuse->rfe_option == 4 &&
(efuse->ext_pa_5g || efuse->ext_pa_2g ||
efuse->ext_lna_5g || efuse->ext_lna_2g)) {
if (rtwdev->hci.type == RTW_HCI_TYPE_USB)
efuse->rfe_option = 0;
else if (rtwdev->hci.type == RTW_HCI_TYPE_PCIE)
efuse->rfe_option = 2;
}
}
}
static void rtw88xxa_read_usb_type(struct rtw_dev *rtwdev)
{
struct rtw_efuse *efuse = &rtwdev->efuse;
struct rtw_hal *hal = &rtwdev->hal;
u8 antenna = 0;
u8 wmode = 0;
u8 val8, i;
efuse->hw_cap.bw = BIT(RTW_CHANNEL_WIDTH_20) |
BIT(RTW_CHANNEL_WIDTH_40) |
BIT(RTW_CHANNEL_WIDTH_80);
efuse->hw_cap.ptcl = EFUSE_HW_CAP_PTCL_VHT;
if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A)
efuse->hw_cap.nss = 1;
else
efuse->hw_cap.nss = 2;
if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A)
goto print_hw_cap;
for (i = 0; i < 2; i++) {
rtw_read8_physical_efuse(rtwdev, 1019 - i, &val8);
antenna = u8_get_bits(val8, GENMASK(7, 5));
if (antenna)
break;
antenna = u8_get_bits(val8, GENMASK(3, 1));
if (antenna)
break;
}
for (i = 0; i < 2; i++) {
rtw_read8_physical_efuse(rtwdev, 1021 - i, &val8);
wmode = u8_get_bits(val8, GENMASK(3, 2));
if (wmode)
break;
}
if (antenna == 1) {
rtw_info(rtwdev, "This RTL8812AU says it is 1T1R.\n");
efuse->hw_cap.nss = 1;
hal->rf_type = RF_1T1R;
hal->rf_path_num = 1;
hal->rf_phy_num = 1;
hal->antenna_tx = BB_PATH_A;
hal->antenna_rx = BB_PATH_A;
} else {
/* Override rtw_chip_parameter_setup(). It detects 8812au as 1T1R. */
efuse->hw_cap.nss = 2;
hal->rf_type = RF_2T2R;
hal->rf_path_num = 2;
hal->rf_phy_num = 2;
hal->antenna_tx = BB_PATH_AB;
hal->antenna_rx = BB_PATH_AB;
if (antenna == 2 && wmode == 2) {
Annotation
- Immediate include surface: `linux/usb.h`, `main.h`, `coex.h`, `phy.h`, `rtw88xxa.h`, `mac.h`, `reg.h`, `sec.h`.
- Detected declarations: `function rtw88xxa_efuse_grant`, `function rtw8812a_read_amplifier_type`, `function rtw8812a_read_rfe_type`, `function rtw88xxa_read_usb_type`, `function rtw88xxa_read_efuse`, `function rtw88xxa_reset_8051`, `function rtw88xxau_hw_reset`, `function rtw88xxau_init_power_on`, `function rtw88xxa_llt_write`, `function rtw88xxa_llt_init`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.