drivers/net/wireless/realtek/rtw89/pci_be.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/pci_be.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/pci_be.c- Extension
.c- Size
- 27909 bytes
- Lines
- 902
- 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/pci.hmac.hpci.hreg.h
Detected Declarations
enum pcie_rxbd_modefunction rtw89_pci_aspm_set_befunction rtw89_pci_l1ss_set_befunction rtw89_pci_clkreq_set_befunction _patch_pcie_power_wake_befunction _patch_pre_init_befunction rtw89_pci_set_io_rcy_befunction rtw89_pci_ctrl_wpdma_pcie_befunction rtw89_pci_ctrl_trxdma_pcie_befunction rtw89_pci_clr_idx_all_befunction rtw89_pci_poll_txdma_ch_idle_befunction rtw89_pci_poll_rxdma_ch_idle_befunction rtw89_pci_poll_dma_all_idle_befunction rtw89_pci_mode_op_befunction rtw89_pci_rst_bdram_befunction rtw89_pci_debounce_befunction rtw89_pci_ldo_low_pwr_befunction rtw89_pci_pcie_setting_befunction rtw89_pci_ser_setting_befunction rtw89_pci_ctrl_txdma_ch_befunction rtw89_pci_ctrl_txdma_fw_ch_befunction rtw89_pci_ops_mac_pre_init_befunction rtw89_pci_ops_mac_pre_deinit_befunction rtw89_pci_ltr_set_v2function rtw89_pci_configure_mit_befunction rtw89_pci_ops_mac_post_init_befunction rtw89_pci_poll_io_idle_befunction rtw89_pci_lv1rst_stop_dma_befunction rtw89_pci_lv1rst_start_dma_befunction rtw89_pci_disable_eq_befunction rtw89_pci_suspend_befunction rtw89_pci_resume_beexport rtw89_pci_ltr_set_v2export rtw89_pm_ops_beexport rtw89_pci_isr_beexport rtw89_pci_isr_be_v1export rtw89_pci_gen_be
Annotated Snippet
if (info->rxbd_mode == MAC_AX_RXBD_PKT) {
val32_init1 = u32_replace_bits(val32_init1, PCIE_RXBD_NORM,
B_BE_RXQ_RXBD_MODE_MASK);
} else if (info->rxbd_mode == MAC_AX_RXBD_SEP) {
val32_init1 = u32_replace_bits(val32_init1, PCIE_RXBD_SEP,
B_BE_RXQ_RXBD_MODE_MASK);
val32_rxapp = u32_replace_bits(val32_rxapp, 0,
B_BE_APPEND_LEN_MASK);
}
}
val32_init1 = u32_replace_bits(val32_init1, info->tx_burst,
B_BE_MAX_TXDMA_MASK);
val32_init1 = u32_replace_bits(val32_init1, info->rx_burst,
B_BE_MAX_RXDMA_MASK);
val32_exp = u32_replace_bits(val32_exp, info->multi_tag_num,
B_BE_MAX_TAG_NUM_MASK);
val32_init1 = u32_replace_bits(val32_init1, info->wd_dma_idle_intvl,
B_BE_CFG_WD_PERIOD_IDLE_MASK);
val32_init1 = u32_replace_bits(val32_init1, info->wd_dma_act_intvl,
B_BE_CFG_WD_PERIOD_ACTIVE_MASK);
rtw89_write32(rtwdev, R_BE_HAXI_INIT_CFG1, val32_init1);
if (chip->chip_id == RTL8922A)
rtw89_write32(rtwdev, R_BE_RX_APPEND_MODE, val32_rxapp);
rtw89_write32(rtwdev, R_BE_HAXI_EXP_CTRL_V1, val32_exp);
}
static int rtw89_pci_rst_bdram_be(struct rtw89_dev *rtwdev)
{
u32 val;
rtw89_write32_set(rtwdev, R_BE_HAXI_INIT_CFG1, B_BE_SET_BDRAM_BOUND);
return read_poll_timeout(rtw89_read32, val, !(val & B_BE_SET_BDRAM_BOUND),
50, 500000, false, rtwdev, R_BE_HAXI_INIT_CFG1);
}
static void rtw89_pci_debounce_be(struct rtw89_dev *rtwdev)
{
u32 val32;
val32 = rtw89_read32(rtwdev, R_BE_SYS_PAGE_CLK_GATED);
val32 = u32_replace_bits(val32, 0, B_BE_PCIE_PRST_DEBUNC_PERIOD_MASK);
val32 |= B_BE_SYM_PRST_DEBUNC_SEL;
rtw89_write32(rtwdev, R_BE_SYS_PAGE_CLK_GATED, val32);
}
static void rtw89_pci_ldo_low_pwr_be(struct rtw89_dev *rtwdev)
{
enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id;
struct rtw89_hal *hal = &rtwdev->hal;
u32 clr;
rtw89_write32_set(rtwdev, R_BE_SYS_PW_CTRL, B_BE_PSUS_OFF_CAPC_EN);
rtw89_write32_set(rtwdev, R_BE_SYS_PAGE_CLK_GATED,
B_BE_SOP_OFFPOOBS_PC | B_BE_CPHY_AUXCLK_OP |
B_BE_CPHY_POWER_READY_CHK);
rtw89_write32_clr(rtwdev, R_BE_SYS_SDIO_CTRL, B_BE_PCIE_FORCE_IBX_EN |
B_BE_PCIE_DIS_L2_RTK_PERST |
B_BE_PCIE_DIS_L2__CTRL_LDO_HCI);
if (chip_id == RTL8922D && hal->cid == RTL8922D_CID7090)
clr = B_BE_PCIE_DIS_L1_2_CTRL_HCILDO |
B_BE_PCIE_DIS_L1_2_CTRL_APHY_SUSB |
B_BE_PCIE_DIS_RTK_PRST_N_L1_2 |
B_BE_PCIE_DIS_L2_CTRL_APHY_SUSB;
else
clr = B_BE_PCIE_DIS_L1_2_CTRL_HCILDO;
rtw89_write32_clr(rtwdev, R_BE_L1_2_CTRL_HCILDO, clr);
}
static void rtw89_pci_pcie_setting_be(struct rtw89_dev *rtwdev)
{
const struct rtw89_chip_info *chip = rtwdev->chip;
struct rtw89_hal *hal = &rtwdev->hal;
rtw89_write32_set(rtwdev, R_BE_PCIE_FRZ_CLK, B_BE_PCIE_EN_AUX_CLK);
rtw89_write32_clr(rtwdev, R_BE_PCIE_PS_CTRL, B_BE_CMAC_EXIT_L1_EN);
if (chip->chip_id == RTL8922A && hal->cv == CHIP_CAV)
return;
rtw89_write32_set(rtwdev, R_BE_EFUSE_CTRL_2_V1, B_BE_R_SYM_AUTOLOAD_WITH_PMC_SEL);
rtw89_write32_set(rtwdev, R_BE_PCIE_LAT_CTRL, B_BE_SYM_AUX_CLK_SEL);
if (chip->chip_id != RTL8922D)
return;
Annotation
- Immediate include surface: `linux/pci.h`, `mac.h`, `pci.h`, `reg.h`.
- Detected declarations: `enum pcie_rxbd_mode`, `function rtw89_pci_aspm_set_be`, `function rtw89_pci_l1ss_set_be`, `function rtw89_pci_clkreq_set_be`, `function _patch_pcie_power_wake_be`, `function _patch_pre_init_be`, `function rtw89_pci_set_io_rcy_be`, `function rtw89_pci_ctrl_wpdma_pcie_be`, `function rtw89_pci_ctrl_trxdma_pcie_be`, `function rtw89_pci_clr_idx_all_be`.
- 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.