drivers/net/wireless/realtek/rtw89/rtw8852b.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/rtw8852b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/rtw8852b.c- Extension
.c- Size
- 37587 bytes
- Lines
- 1123
- 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
coex.hfw.hmac.hphy.hreg.hrtw8852b.hrtw8852b_common.hrtw8852b_rfk.hrtw8852b_table.htxrx.h
Detected Declarations
function rtw8852b_pwr_sps_anafunction rtw8852b_pwr_sps_dig_offfunction rtw8852b_pwr_on_funcfunction rtw8852b_pwr_off_funcfunction rtw8852b_bb_reset_enfunction rtw8852b_bb_resetfunction rtw8852b_set_channelfunction rtw8852b_tssi_cont_enfunction rtw8852b_tssi_cont_en_phyidxfunction rtw8852b_adc_enfunction rtw8852b_set_channel_helpfunction rtw8852b_rfk_initfunction rtw8852b_rfk_channelfunction rtw8852b_rfk_band_changedfunction rtw8852b_rfk_scanfunction rtw8852b_rfk_trackfunction rtw8852b_btc_set_rfefunction rtw8852b_btc_set_wl_txpwr_ctrlexport rtw8852b_chip_info
Annotated Snippet
if (md->md_v7.ant.num == 3) {
md->md_v7.ant.type = BTC_ANT_DEDICATED;
md->md_v7.bt_pos = BTC_BT_ALONE;
} else {
md->md_v7.ant.type = BTC_ANT_SHARED;
md->md_v7.bt_pos = BTC_BT_BTG;
}
rtwdev->btc.btg_pos = md->md_v7.ant.btg_pos;
rtwdev->btc.ant_type = md->md_v7.ant.type;
} else {
md->md.rfe_type = rtwdev->efuse.rfe_type;
md->md.cv = rtwdev->hal.cv;
md->md.bt_solo = 0;
md->md.switch_type = BTC_SWITCH_INTERNAL;
if (md->md.rfe_type > 0)
md->md.ant.num = (md->md.rfe_type % 2 ? 2 : 3);
else
md->md.ant.num = 2;
md->md.ant.diversity = 0;
md->md.ant.isolation = 10;
if (md->md.ant.num == 3) {
md->md.ant.type = BTC_ANT_DEDICATED;
md->md.bt_pos = BTC_BT_ALONE;
} else {
md->md.ant.type = BTC_ANT_SHARED;
md->md.bt_pos = BTC_BT_BTG;
}
rtwdev->btc.btg_pos = md->md.ant.btg_pos;
rtwdev->btc.ant_type = md->md.ant.type;
}
}
union rtw8852b_btc_wl_txpwr_ctrl {
u32 txpwr_val;
struct {
union {
u16 ctrl_all_time;
struct {
s16 data:9;
u16 rsvd:6;
u16 flag:1;
} all_time;
};
union {
u16 ctrl_gnt_bt;
struct {
s16 data:9;
u16 rsvd:7;
} gnt_bt;
};
};
} __packed;
static void
rtw8852b_btc_set_wl_txpwr_ctrl(struct rtw89_dev *rtwdev, u32 txpwr_val)
{
union rtw8852b_btc_wl_txpwr_ctrl arg = { .txpwr_val = txpwr_val };
s32 val;
#define __write_ctrl(_reg, _msk, _val, _en, _cond) \
do { \
u32 _wrt = FIELD_PREP(_msk, _val); \
BUILD_BUG_ON(!!(_msk & _en)); \
if (_cond) \
_wrt |= _en; \
else \
_wrt &= ~_en; \
rtw89_mac_txpwr_write32_mask(rtwdev, RTW89_PHY_0, _reg, \
_msk | _en, _wrt); \
} while (0)
switch (arg.ctrl_all_time) {
case 0xffff:
val = 0;
break;
default:
val = arg.all_time.data;
break;
}
__write_ctrl(R_AX_PWR_RATE_CTRL, B_AX_FORCE_PWR_BY_RATE_VALUE_MASK,
val, B_AX_FORCE_PWR_BY_RATE_EN,
arg.ctrl_all_time != 0xffff);
switch (arg.ctrl_gnt_bt) {
case 0xffff:
val = 0;
Annotation
- Immediate include surface: `coex.h`, `fw.h`, `mac.h`, `phy.h`, `reg.h`, `rtw8852b.h`, `rtw8852b_common.h`, `rtw8852b_rfk.h`.
- Detected declarations: `function rtw8852b_pwr_sps_ana`, `function rtw8852b_pwr_sps_dig_off`, `function rtw8852b_pwr_on_func`, `function rtw8852b_pwr_off_func`, `function rtw8852b_bb_reset_en`, `function rtw8852b_bb_reset`, `function rtw8852b_set_channel`, `function rtw8852b_tssi_cont_en`, `function rtw8852b_tssi_cont_en_phyidx`, `function rtw8852b_adc_en`.
- 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.