drivers/net/wireless/realtek/rtl8xxxu/8188f.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtl8xxxu/8188f.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtl8xxxu/8188f.c- Extension
.c- Size
- 52769 bytes
- Lines
- 1767
- 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
function rtl8188fu_identify_chipfunction rtl8188f_channel_to_groupfunction rtl8188f_set_tx_powerfunction rtl8188f_spur_calibrationfunction rtl8188fu_config_channelfunction rtl8188fu_init_aggregationfunction rtl8188fu_init_statisticsfunction rtl8188fu_parse_efusefunction rtl8188fu_load_firmwarefunction rtl8188fu_init_phy_bbfunction rtl8188fu_init_phy_rffunction rtl8188f_phy_lc_calibratefunction rtl8188fu_iqk_path_afunction rtl8188fu_rx_iqk_path_afunction rtl8188fu_phy_iqcalibratefunction rtl8188fu_phy_iq_calibratefunction rtl8188f_disabled_to_emufunction rtl8188f_emu_to_activefunction rtl8188fu_active_to_emufunction rtl8188fu_emu_to_disabledfunction rtl8188fu_active_to_lpsfunction rtl8188fu_power_onfunction rtl8188fu_power_offfunction rtl8188f_enable_rffunction rtl8188f_disable_rffunction rtl8188f_usb_quirksfunction rtl8188f_set_crystal_capfunction rtl8188f_cck_rssi
Annotated Snippet
if (hw_ctrl) {
val32 = rtl8xxxu_read32(priv, REG_FPGA0_XB_RF_INT_OE);
val32 &= GENMASK(5, 3);
hw_ctrl_s1 = val32 == BIT(3);
} else if (sw_ctrl) {
sw_ctrl_s1 = !(reg948 & BIT(9));
}
if (hw_ctrl_s1 || sw_ctrl_s1) {
initial_gain = rtl8xxxu_read32(priv, REG_OFDM0_XA_AGC_CORE1);
/* Disable CCK block */
val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
val32 &= ~FPGA_RF_MODE_CCK;
rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
val32 = initial_gain & ~OFDM0_X_AGC_CORE1_IGI_MASK;
val32 |= 0x30;
rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, val32);
/* disable 3-wire */
rtl8xxxu_write32(priv, REG_FPGA0_ANALOG4, 0xccf000c0);
/* Setup PSD */
rtl8xxxu_write32(priv, REG_FPGA0_PSD_FUNC, frequencies[channel]);
/* Start PSD */
rtl8xxxu_write32(priv, REG_FPGA0_PSD_FUNC, 0x400000 | frequencies[channel]);
msleep(30);
do_notch = rtl8xxxu_read32(priv, REG_FPGA0_PSD_REPORT) >= threshold;
/* turn off PSD */
rtl8xxxu_write32(priv, REG_FPGA0_PSD_FUNC, frequencies[channel]);
/* enable 3-wire */
rtl8xxxu_write32(priv, REG_FPGA0_ANALOG4, 0xccc000c0);
/* Enable CCK block */
val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
val32 |= FPGA_RF_MODE_CCK;
rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, initial_gain);
if (do_notch) {
rtl8xxxu_write32(priv, REG_OFDM1_CSI_FIX_MASK1, reg_d40[channel]);
rtl8xxxu_write32(priv, REG_OFDM1_CSI_FIX_MASK2, reg_d44[channel]);
rtl8xxxu_write32(priv, 0xd48, 0x0);
rtl8xxxu_write32(priv, 0xd4c, reg_d4c[channel]);
/* enable CSI mask */
val32 = rtl8xxxu_read32(priv, REG_OFDM1_CFO_TRACKING);
val32 |= BIT(28);
rtl8xxxu_write32(priv, REG_OFDM1_CFO_TRACKING, val32);
return;
}
}
}
/* disable CSI mask function */
val32 = rtl8xxxu_read32(priv, REG_OFDM1_CFO_TRACKING);
val32 &= ~BIT(28);
rtl8xxxu_write32(priv, REG_OFDM1_CFO_TRACKING, val32);
}
static void rtl8188fu_config_channel(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
u32 val32;
u8 channel, subchannel;
bool sec_ch_above;
channel = (u8)hw->conf.chandef.chan->hw_value;
/* Set channel */
val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_MODE_AG);
val32 &= ~MODE_AG_CHANNEL_MASK;
val32 |= channel;
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_MODE_AG, val32);
/* Spur calibration */
rtl8188f_spur_calibration(priv, channel);
/* Set bandwidth mode */
val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
val32 &= ~FPGA_RF_MODE;
val32 |= hw->conf.chandef.width == NL80211_CHAN_WIDTH_40;
Annotation
- Immediate include surface: `regs.h`, `rtl8xxxu.h`.
- Detected declarations: `function rtl8188fu_identify_chip`, `function rtl8188f_channel_to_group`, `function rtl8188f_set_tx_power`, `function rtl8188f_spur_calibration`, `function rtl8188fu_config_channel`, `function rtl8188fu_init_aggregation`, `function rtl8188fu_init_statistics`, `function rtl8188fu_parse_efuse`, `function rtl8188fu_load_firmware`, `function rtl8188fu_init_phy_bb`.
- 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.