drivers/net/wireless/realtek/rtl8xxxu/8188e.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtl8xxxu/8188e.c- Extension
.c- Size
- 54910 bytes
- Lines
- 1887
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
regs.hrtl8xxxu.h
Detected Declarations
enum rtl8188e_tx_rpt_timingfunction rtl8188eu_identify_chipfunction rtl8188eu_config_channelfunction rtl8188eu_init_aggregationfunction rtl8188eu_parse_efusefunction rtl8188eu_reset_8051function rtl8188eu_load_firmwarefunction rtl8188eu_init_phy_bbfunction rtl8188eu_init_phy_rffunction rtl8188eu_iqk_path_afunction rtl8188eu_rx_iqk_path_afunction rtl8188eu_phy_iqcalibratefunction rtl8188eu_phy_iq_calibratefunction rtl8188e_disabled_to_emufunction rtl8188e_emu_to_activefunction rtl8188eu_active_to_emufunction rtl8188eu_emu_to_disabledfunction rtl8188eu_active_to_lpsfunction rtl8188eu_power_onfunction rtl8188eu_power_offfunction rtl8188e_enable_rffunction rtl8188e_disable_rffunction rtl8188e_usb_quirksfunction rtl8188e_cck_rssifunction rtl8188eu_led_brightness_setfunction rtl8188e_set_tx_rpt_timingfunction rtl8188e_rate_downfunction rtl8188e_rate_upfunction rtl8188e_reset_ra_counterfunction rtl8188e_rate_decisionfunction rtl8188e_power_training_try_statefunction rtl8188e_power_training_decisionfunction rtl8188e_handle_ra_tx_report2function rtl8188e_arfb_refreshfunction rtl8188e_update_rate_maskfunction rtl8188e_ra_set_rssifunction rtl8188e_ra_info_init_all
Annotated Snippet
if (path_a_ok == 0x01) {
val32 = rtl8xxxu_read32(priv,
REG_TX_POWER_BEFORE_IQK_A);
result[t][0] = (val32 >> 16) & 0x3ff;
val32 = rtl8xxxu_read32(priv,
REG_TX_POWER_AFTER_IQK_A);
result[t][1] = (val32 >> 16) & 0x3ff;
break;
}
}
if (!path_a_ok)
dev_dbg(dev, "%s: Path A TX IQK failed!\n", __func__);
for (i = 0; i < retry; i++) {
path_a_ok = rtl8188eu_rx_iqk_path_a(priv);
if (path_a_ok == 0x03) {
val32 = rtl8xxxu_read32(priv,
REG_RX_POWER_BEFORE_IQK_A_2);
result[t][2] = (val32 >> 16) & 0x3ff;
val32 = rtl8xxxu_read32(priv,
REG_RX_POWER_AFTER_IQK_A_2);
result[t][3] = (val32 >> 16) & 0x3ff;
break;
}
}
if (!path_a_ok)
dev_dbg(dev, "%s: Path A RX IQK failed!\n", __func__);
/* Back to BB mode, load original value */
val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
u32p_replace_bits(&val32, 0, 0xffffff00);
rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
if (t == 0)
return;
if (!priv->pi_enabled) {
/* Switch back BB to SI mode after finishing IQ Calibration */
rtl8xxxu_write32(priv, REG_FPGA0_XA_HSSI_PARM1, 0x01000000);
rtl8xxxu_write32(priv, REG_FPGA0_XB_HSSI_PARM1, 0x01000000);
}
/* Reload ADDA power saving parameters */
rtl8xxxu_restore_regs(priv, adda_regs, priv->adda_backup,
RTL8XXXU_ADDA_REGS);
/* Reload MAC parameters */
rtl8xxxu_restore_mac_regs(priv, iqk_mac_regs, priv->mac_backup);
/* Reload BB parameters */
rtl8xxxu_restore_regs(priv, iqk_bb_regs,
priv->bb_backup, RTL8XXXU_BB_REGS);
/* Restore RX initial gain */
rtl8xxxu_write32(priv, REG_FPGA0_XA_LSSI_PARM, 0x00032ed3);
/* Load 0xe30 IQC default value */
rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x01008c00);
rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x01008c00);
}
static void rtl8188eu_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
{
struct device *dev = &priv->udev->dev;
int result[4][8]; /* last is final result */
int i, candidate;
bool path_a_ok;
u32 reg_e94, reg_e9c, reg_ea4, reg_eac;
u32 reg_eb4, reg_ebc, reg_ec4, reg_ecc;
bool simu;
memset(result, 0, sizeof(result));
result[3][0] = 0x100;
result[3][2] = 0x100;
result[3][4] = 0x100;
result[3][6] = 0x100;
candidate = -1;
path_a_ok = false;
for (i = 0; i < 3; i++) {
rtl8188eu_phy_iqcalibrate(priv, result, i);
if (i == 1) {
simu = rtl8xxxu_simularity_compare(priv,
result, 0, 1);
Annotation
- Immediate include surface: `regs.h`, `rtl8xxxu.h`.
- Detected declarations: `enum rtl8188e_tx_rpt_timing`, `function rtl8188eu_identify_chip`, `function rtl8188eu_config_channel`, `function rtl8188eu_init_aggregation`, `function rtl8188eu_parse_efuse`, `function rtl8188eu_reset_8051`, `function rtl8188eu_load_firmware`, `function rtl8188eu_init_phy_bb`, `function rtl8188eu_init_phy_rf`, `function rtl8188eu_iqk_path_a`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.