drivers/net/wireless/realtek/rtw88/rtw8812a.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/rtw8812a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/rtw8812a.c- Extension
.c- Size
- 34030 bytes
- Lines
- 1126
- 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
main.hcoex.hphy.hreg.hrtw88xxa.hrtw8812a.hrtw8812a_table.htx.h
Detected Declarations
function rtw8812a_power_offfunction rtw8812a_cck_rx_pwrfunction rtw8812a_query_phy_statusfunction rtw8812a_cfg_ldo25function rtw8812a_iqk_backup_rffunction rtw8812a_iqk_restore_rffunction rtw8812a_iqk_restore_afefunction rtw8812a_iqk_rx_fillfunction rtw8812a_iqk_tx_fillfunction rtw8812a_iqkfunction rtw8812a_do_iqkfunction rtw8812a_phy_calibrationfunction rtw8812a_pwr_trackfunction rtw8812a_led_setfunction rtw8812a_fill_txdesc_checksumfunction rtw8812a_coex_cfg_initexport rtw8812a_hw_spec
Annotated Snippet
if (efuse->rfe_option == 1) {
rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403e3);
rtw_write32(rtwdev, REG_TXPITMB, 0x821403e3);
} else {
rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403f7);
rtw_write32(rtwdev, REG_TXPITMB, 0x821403f7);
}
} else {
rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403f1);
rtw_write32(rtwdev, REG_TXPITMB, 0x821403f1);
}
if (rtwdev->hal.current_band_type == RTW_BAND_5G) {
rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x68163e96);
rtw_write32(rtwdev, REG_RXPITMB, 0x68163e96);
} else {
rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28163e96);
rtw_write32(rtwdev, REG_RXPITMB, 0x28163e96);
if (efuse->rfe_option == 3) {
if (efuse->ext_pa_2g)
rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE,
0x821403e3);
else
rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE,
0x821403f7);
}
}
/* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */
rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10);
/* RX_Tone_idx[9:0], RxK_Mask[29] */
rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10);
rtw_write32(rtwdev, REG_INTPO_SETA, 0x00000000);
/* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */
rtw_write32(rtwdev, REG_TXTONEB, 0x18008c10);
/* RX_Tone_idx[9:0], RxK_Mask[29] */
rtw_write32(rtwdev, REG_RXTONEB, 0x38008c10);
rtw_write32(rtwdev, REG_INTPO_SETB, 0x00000000);
cal0_retry = 0;
cal1_retry = 0;
while (1) {
/* one shot */
rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
rtw_write32(rtwdev, REG_RFECTL_B, 0x00100000);
rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
rtw_write32(rtwdev, REG_IQK_COM64, 0xf8000000);
mdelay(10);
rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000);
rtw_write32(rtwdev, REG_RFECTL_B, 0x00000000);
for (delay_count = 0; delay_count < 20; delay_count++) {
if (!tx0_finish)
iqk0_ready = rtw_read32_mask(rtwdev,
REG_IQKA_END,
BIT(10));
if (!tx1_finish)
iqk1_ready = rtw_read32_mask(rtwdev,
REG_IQKB_END,
BIT(10));
if (iqk0_ready && iqk1_ready)
break;
mdelay(1);
}
rtw_dbg(rtwdev, RTW_DBG_RFK, "TX delay_count = %d\n",
delay_count);
if (delay_count < 20) { /* If 20ms No Result, then cal_retry++ */
/* ============TXIQK Check============== */
tx0_fail = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(12));
tx1_fail = rtw_read32_mask(rtwdev, REG_IQKB_END, BIT(12));
if (!(tx0_fail || tx0_finish)) {
rtw_write32(rtwdev, REG_RFECTL_A, 0x02000000);
tx_x0_temp[tx0_avg] = rtw_read32_mask(rtwdev,
REG_IQKA_END,
0x07ff0000);
rtw_write32(rtwdev, REG_RFECTL_A, 0x04000000);
tx_y0_temp[tx0_avg] = rtw_read32_mask(rtwdev,
REG_IQKA_END,
0x07ff0000);
rtw_dbg(rtwdev, RTW_DBG_RFK,
"tx_x0[%d] = %x ;; tx_y0[%d] = %x\n",
tx0_avg, tx_x0_temp[tx0_avg],
Annotation
- Immediate include surface: `main.h`, `coex.h`, `phy.h`, `reg.h`, `rtw88xxa.h`, `rtw8812a.h`, `rtw8812a_table.h`, `tx.h`.
- Detected declarations: `function rtw8812a_power_off`, `function rtw8812a_cck_rx_pwr`, `function rtw8812a_query_phy_status`, `function rtw8812a_cfg_ldo25`, `function rtw8812a_iqk_backup_rf`, `function rtw8812a_iqk_restore_rf`, `function rtw8812a_iqk_restore_afe`, `function rtw8812a_iqk_rx_fill`, `function rtw8812a_iqk_tx_fill`, `function rtw8812a_iqk`.
- 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.