drivers/net/wireless/realtek/rtl8xxxu/8710b.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtl8xxxu/8710b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtl8xxxu/8710b.c- Extension
.c- Size
- 59141 bytes
- Lines
- 1877
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
regs.hrtl8xxxu.h
Detected Declarations
function rtl8710b_indirect_read32function rtl8710b_indirect_write32function rtl8710b_read_syson_regfunction rtl8710b_write_syson_regfunction rtl8710b_read_efuse8function rtl8710bu_identify_chipfunction rtl8710b_revise_cck_tx_psffunction rtl8710bu_config_channelfunction rtl8710bu_init_aggregationfunction rtl8710bu_init_statisticsfunction rtl8710b_read_efusefunction rtl8710bu_parse_efusefunction rtl8710bu_load_firmwarefunction rtl8710bu_init_phy_bbfunction rtl8710bu_init_phy_rffunction rtl8710bu_iqk_path_afunction rtl8710bu_rx_iqk_path_afunction rtl8710bu_phy_iqcalibratefunction rtl8710bu_phy_iq_calibratefunction rtl8710b_emu_to_activefunction rtl8710bu_active_to_emufunction rtl8710bu_active_to_lpsfunction rtl8710bu_power_onfunction rtl8710bu_power_offfunction rtl8710b_reset_8051function rtl8710b_enable_rffunction rtl8710b_disable_rffunction rtl8710b_usb_quirksfunction rtl8710b_set_crystal_capfunction rtl8710b_cck_rssi
Annotated Snippet
if (priv->vendor_umc) {
package_type = PACKAGE_QFN48M_U;
} else if (priv->vendor_smic) {
package_type = PACKAGE_QFN48M_S;
} else {
dev_warn(dev, "The vendor is neither UMC nor SMIC. Assuming the package type is QFN48M_U.\n");
/*
* In this case the vendor driver doesn't set
* the package type to anything, which is the
* same as setting it to PACKAGE_DEFAULT (0).
*/
package_type = PACKAGE_QFN48M_U;
}
} else if (package_type != PACKAGE_QFN48M_S &&
package_type != PACKAGE_QFN48M_U) {
dev_warn(dev, "Failed to read the package type. Assuming it's the default QFN48M_U.\n");
/*
* In this case the vendor driver actually sets it to
* PACKAGE_DEFAULT, but that selects the same values
* from the init tables as PACKAGE_QFN48M_U.
*/
package_type = PACKAGE_QFN48M_U;
}
priv->package_type = package_type;
dev_dbg(dev, "Package type: 0x%x\n", package_type);
cfg2 = rtl8710b_read_syson_reg(priv, REG_SYS_SYSTEM_CFG2_8710B);
priv->rom_rev = cfg2 & 0xf;
return rtl8xxxu_config_endpoints_no_sie(priv);
}
static void rtl8710b_revise_cck_tx_psf(struct rtl8xxxu_priv *priv, u8 channel)
{
if (channel == 13) {
/* Normal values */
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER2, 0x64B80C1C);
rtl8xxxu_write32(priv, REG_CCK0_DEBUG_PORT, 0x00008810);
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER3, 0x01235667);
/* Special value for channel 13 */
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER1, 0xd1d80001);
} else if (channel == 14) {
/* Special values for channel 14 */
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER2, 0x0000B81C);
rtl8xxxu_write32(priv, REG_CCK0_DEBUG_PORT, 0x00000000);
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER3, 0x00003667);
/* Normal value */
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER1, 0xE82C0001);
} else {
/* Restore normal values from the phy init table */
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER2, 0x64B80C1C);
rtl8xxxu_write32(priv, REG_CCK0_DEBUG_PORT, 0x00008810);
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER3, 0x01235667);
rtl8xxxu_write32(priv, REG_CCK0_TX_FILTER1, 0xE82C0001);
}
}
static void rtl8710bu_config_channel(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
bool ht40 = conf_is_ht40(&hw->conf);
u8 channel, subchannel = 0;
bool sec_ch_above = 0;
u32 val32;
u16 val16;
channel = (u8)hw->conf.chandef.chan->hw_value;
if (conf_is_ht40_plus(&hw->conf)) {
sec_ch_above = 1;
channel += 2;
subchannel = 2;
} else if (conf_is_ht40_minus(&hw->conf)) {
sec_ch_above = 0;
channel -= 2;
subchannel = 1;
}
/* Set channel */
val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_MODE_AG);
u32p_replace_bits(&val32, channel, MODE_AG_CHANNEL_MASK);
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_MODE_AG, val32);
rtl8710b_revise_cck_tx_psf(priv, channel);
/* Set bandwidth mode */
Annotation
- Immediate include surface: `regs.h`, `rtl8xxxu.h`.
- Detected declarations: `function rtl8710b_indirect_read32`, `function rtl8710b_indirect_write32`, `function rtl8710b_read_syson_reg`, `function rtl8710b_write_syson_reg`, `function rtl8710b_read_efuse8`, `function rtl8710bu_identify_chip`, `function rtl8710b_revise_cck_tx_psf`, `function rtl8710bu_config_channel`, `function rtl8710bu_init_aggregation`, `function rtl8710bu_init_statistics`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.