drivers/net/wireless/realtek/rtw88/rtw8723x.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/rtw8723x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/rtw8723x.c- Extension
.c- Size
- 24693 bytes
- Lines
- 789
- 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.hdebug.hphy.hreg.htx.hrtw8723x.h
Detected Declarations
function __rtw8723x_lckfunction rtw8723xe_efuse_debugfunction rtw8723xu_efuse_debugfunction rtw8723xs_efuse_debugfunction __rtw8723x_debug_txpwr_limitfunction efuse_debug_dumpfunction rtw8723xe_efuse_parsingfunction rtw8723xu_efuse_parsingfunction rtw8723xs_efuse_parsingfunction __rtw8723x_read_efusefunction __rtw8723x_mac_initfunction __rtw8723x_mac_postinitfunction __rtw8723x_cfg_ldo25function rtw8723x_set_tx_power_index_by_ratefunction __rtw8723x_set_tx_power_indexfunction __rtw8723x_efuse_grantfunction __rtw8723x_false_alarm_statisticsfunction __rtw8723x_iqk_backup_regsfunction __rtw8723x_iqk_restore_regsfunction __rtw8723x_iqk_similarity_cmpfunction __rtw8723x_pwrtrack_get_limit_ofdmfunction __rtw8723x_pwrtrack_set_xtalfunction __rtw8723x_fill_txdesc_checksumfunction __rtw8723x_coex_cfg_initexport rtw8723x_common
Annotated Snippet
if (pwr[i] != 0xff) {
valid = true;
break;
}
if (!valid) {
for (i = 0; i < ARRAY_SIZE(rtw8723x_txpwr_idx_table); i++)
pwr[i] = rtw8723x_txpwr_idx_table[i];
rtw_dbg(rtwdev, RTW_DBG_EFUSE,
"Replaced invalid EFUSE TX power index table.");
rtw8723x_debug_txpwr_limit(rtwdev,
efuse->txpwr_idx_table, 2);
}
/* Override invalid antenna settings. */
if (efuse->bt_setting == 0xff) {
/* shared antenna */
efuse->bt_setting |= BIT(0);
/* RF path A */
efuse->bt_setting &= ~BIT(6);
DBG_EFUSE_FIX(rtwdev, bt_setting);
}
/* Override invalid board options: The coex code incorrectly
* assumes that if bits 6 & 7 are set the board doesn't
* support coex. Regd is also derived from rf_board_option and
* should be 0 if there's no valid data.
*/
if (efuse->rf_board_option == 0xff) {
efuse->regd = 0;
efuse->rf_board_option &= GENMASK(5, 0);
DBG_EFUSE_FIX(rtwdev, rf_board_option);
}
/* Override invalid crystal cap setting, default comes from
* vendor driver. Chip specific.
*/
if (efuse->crystal_cap == 0xff) {
efuse->crystal_cap = 0x20;
DBG_EFUSE_FIX(rtwdev, crystal_cap);
}
return 0;
}
#define BIT_CFENDFORM BIT(9)
#define BIT_WMAC_TCR_ERR0 BIT(12)
#define BIT_WMAC_TCR_ERR1 BIT(13)
#define BIT_TCR_CFG (BIT_CFENDFORM | BIT_WMAC_TCR_ERR0 | \
BIT_WMAC_TCR_ERR1)
#define WLAN_RX_FILTER0 0xFFFF
#define WLAN_RX_FILTER1 0x400
#define WLAN_RX_FILTER2 0xFFFF
#define WLAN_RCR_CFG 0x700060CE
static int __rtw8723x_mac_init(struct rtw_dev *rtwdev)
{
rtw_write32(rtwdev, REG_TCR, BIT_TCR_CFG);
rtw_write16(rtwdev, REG_RXFLTMAP0, WLAN_RX_FILTER0);
rtw_write16(rtwdev, REG_RXFLTMAP1, WLAN_RX_FILTER1);
rtw_write16(rtwdev, REG_RXFLTMAP2, WLAN_RX_FILTER2);
rtw_write32(rtwdev, REG_RCR, WLAN_RCR_CFG);
rtw_write32(rtwdev, REG_INT_MIG, 0);
rtw_write32(rtwdev, REG_MCUTST_1, 0x0);
rtw_write8(rtwdev, REG_MISC_CTRL, BIT_DIS_SECOND_CCA);
rtw_write8(rtwdev, REG_2ND_CCA_CTRL, 0);
return 0;
}
static int __rtw8723x_mac_postinit(struct rtw_dev *rtwdev)
{
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 1, WLAN_TXQ_RPT_EN);
return 0;
}
static void __rtw8723x_cfg_ldo25(struct rtw_dev *rtwdev, bool enable)
{
u8 ldo_pwr;
ldo_pwr = rtw_read8(rtwdev, REG_LDO_EFUSE_CTRL + 3);
if (enable) {
ldo_pwr &= ~BIT_MASK_LDO25_VOLTAGE;
ldo_pwr |= (BIT_LDO25_VOLTAGE_V25 << 4) | BIT_LDO25_EN;
} else {
ldo_pwr &= ~BIT_LDO25_EN;
}
Annotation
- Immediate include surface: `main.h`, `debug.h`, `phy.h`, `reg.h`, `tx.h`, `rtw8723x.h`.
- Detected declarations: `function __rtw8723x_lck`, `function rtw8723xe_efuse_debug`, `function rtw8723xu_efuse_debug`, `function rtw8723xs_efuse_debug`, `function __rtw8723x_debug_txpwr_limit`, `function efuse_debug_dump`, `function rtw8723xe_efuse_parsing`, `function rtw8723xu_efuse_parsing`, `function rtw8723xs_efuse_parsing`, `function __rtw8723x_read_efuse`.
- 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.