drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c- Extension
.c- Size
- 46221 bytes
- Lines
- 1611
- 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
../wifi.h../pci.h../ps.h../core.hreg.hdef.hphy.hrf.hdm.hfw.hhw.htable.h
Detected Declarations
function rtl92s_phy_query_bb_regfunction rtl92s_phy_set_bb_regfunction _rtl92s_phy_rf_serial_readfunction _rtl92s_phy_rf_serial_writefunction rtl92s_phy_query_rf_regfunction rtl92s_phy_set_rf_regfunction rtl92s_phy_scan_operation_backupfunction rtl92s_phy_set_bw_modefunction _rtl92s_phy_set_sw_chnl_cmdarrayfunction _rtl92s_phy_sw_chnl_step_by_stepfunction rtl92s_phy_sw_chnlfunction _rtl92se_phy_set_rf_sleepfunction rtl92s_phy_set_rf_power_statefunction _rtl92s_phy_config_rfpa_bias_currentfunction _rtl92s_store_pwrindex_diffrate_offsetfunction _rtl92s_phy_init_register_definitionfunction _rtl92s_phy_config_bbfunction _rtl92s_phy_set_bb_to_diff_rffunction _rtl92s_phy_config_bb_with_pgfunction _rtl92s_phy_bb_config_parafilefunction rtl92s_phy_config_rffunction rtl92s_phy_mac_configfunction rtl92s_phy_bb_configfunction rtl92s_phy_rf_configfunction rtl92s_phy_get_hw_reg_originalvaluefunction _rtl92s_phy_get_txpower_indexfunction _rtl92s_phy_ccxpower_indexcheckfunction rtl92s_phy_set_txpowerfunction rtl92s_phy_chk_fwcmd_iodonefunction _rtl92s_phy_set_fwcmd_iofunction rtl92s_phy_set_fw_cmdfunction _rtl92s_phy_check_ephy_switchreadyfunction rtl92s_phy_switch_ephy_parameterfunction rtl92s_phy_set_beacon_hwreg
Annotated Snippet
switch (operation) {
case SCAN_OPT_BACKUP:
rtl92s_phy_set_fw_cmd(hw, FW_CMD_PAUSE_DM_BY_SCAN);
break;
case SCAN_OPT_RESTORE:
rtl92s_phy_set_fw_cmd(hw, FW_CMD_RESUME_DM_BY_SCAN);
break;
default:
pr_err("Unknown operation\n");
break;
}
}
}
void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
enum nl80211_channel_type ch_type)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_phy *rtlphy = &(rtlpriv->phy);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
u8 reg_bw_opmode;
rtl_dbg(rtlpriv, COMP_SCAN, DBG_TRACE, "Switch to %s bandwidth\n",
rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
"20MHz" : "40MHz");
if (rtlphy->set_bwmode_inprogress)
return;
if (is_hal_stop(rtlhal))
return;
rtlphy->set_bwmode_inprogress = true;
reg_bw_opmode = rtl_read_byte(rtlpriv, BW_OPMODE);
/* dummy read */
rtl_read_byte(rtlpriv, RRSR + 2);
switch (rtlphy->current_chan_bw) {
case HT_CHANNEL_WIDTH_20:
reg_bw_opmode |= BW_OPMODE_20MHZ;
rtl_write_byte(rtlpriv, BW_OPMODE, reg_bw_opmode);
break;
case HT_CHANNEL_WIDTH_20_40:
reg_bw_opmode &= ~BW_OPMODE_20MHZ;
rtl_write_byte(rtlpriv, BW_OPMODE, reg_bw_opmode);
break;
default:
pr_err("unknown bandwidth: %#X\n",
rtlphy->current_chan_bw);
break;
}
switch (rtlphy->current_chan_bw) {
case HT_CHANNEL_WIDTH_20:
rtl_set_bbreg(hw, RFPGA0_RFMOD, BRFMOD, 0x0);
rtl_set_bbreg(hw, RFPGA1_RFMOD, BRFMOD, 0x0);
if (rtlhal->version >= VERSION_8192S_BCUT)
rtl_write_byte(rtlpriv, RFPGA0_ANALOGPARAMETER2, 0x58);
break;
case HT_CHANNEL_WIDTH_20_40:
rtl_set_bbreg(hw, RFPGA0_RFMOD, BRFMOD, 0x1);
rtl_set_bbreg(hw, RFPGA1_RFMOD, BRFMOD, 0x1);
rtl_set_bbreg(hw, RCCK0_SYSTEM, BCCK_SIDEBAND,
(mac->cur_40_prime_sc >> 1));
rtl_set_bbreg(hw, ROFDM1_LSTF, 0xC00, mac->cur_40_prime_sc);
if (rtlhal->version >= VERSION_8192S_BCUT)
rtl_write_byte(rtlpriv, RFPGA0_ANALOGPARAMETER2, 0x18);
break;
default:
pr_err("unknown bandwidth: %#X\n",
rtlphy->current_chan_bw);
break;
}
rtl92s_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
rtlphy->set_bwmode_inprogress = false;
rtl_dbg(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
}
static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
u32 cmdtableidx, u32 cmdtablesz, enum swchnlcmd_id cmdid,
u32 para1, u32 para2, u32 msdelay)
{
struct swchnlcmd *pcmd;
if (cmdtable == NULL) {
Annotation
- Immediate include surface: `../wifi.h`, `../pci.h`, `../ps.h`, `../core.h`, `reg.h`, `def.h`, `phy.h`, `rf.h`.
- Detected declarations: `function rtl92s_phy_query_bb_reg`, `function rtl92s_phy_set_bb_reg`, `function _rtl92s_phy_rf_serial_read`, `function _rtl92s_phy_rf_serial_write`, `function rtl92s_phy_query_rf_reg`, `function rtl92s_phy_set_rf_reg`, `function rtl92s_phy_scan_operation_backup`, `function rtl92s_phy_set_bw_mode`, `function _rtl92s_phy_set_sw_chnl_cmdarray`, `function _rtl92s_phy_sw_chnl_step_by_step`.
- 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.