drivers/net/wireless/realtek/rtw88/coex.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw88/coex.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw88/coex.c- Extension
.c- Size
- 117173 bytes
- Lines
- 4206
- 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.
- 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
main.hcoex.hfw.hps.hdebug.hreg.hphy.h
Detected Declarations
struct rtw_coex_sta_stat_iter_datastruct rtw_coex_vif_stat_iter_datafunction rtw_coex_next_rssi_statefunction rtw_coex_limited_txfunction rtw_coex_limited_wlfunction rtw_coex_freerun_checkfunction rtw_coex_wl_slot_extendfunction rtw_coex_wl_ccklock_actionfunction rtw_coex_wl_ccklock_detectfunction rtw_coex_wl_noisy_detectfunction rtw_coex_tdma_timer_basefunction rtw_coex_set_wl_pri_maskfunction rtw_coex_write_scbdfunction rtw_coex_read_scbdfunction rtw_coex_check_rfkfunction rtw_coex_query_bt_infofunction rtw_coex_gnt_workaroundfunction rtw_coex_monitor_bt_ctrfunction rtw_coex_monitor_bt_enablefunction rtw_coex_update_wl_link_infofunction rtw_coex_info_responsefunction rtw_coex_get_bt_scan_typefunction rtw_coex_set_lna_constrain_levelfunction rtw_coex_update_bt_link_infofunction rtw_coex_update_wl_ch_infofunction rtw_coex_set_bt_tx_powerfunction rtw_coex_set_bt_rx_gainfunction rtw_coex_set_rf_parafunction rtw_coex_read_indirect_regfunction rtw_coex_write_indirect_regfunction rtw_coex_coex_ctrl_ownerfunction rtw_coex_set_gnt_btfunction rtw_coex_set_gnt_wlfunction rtw_coex_mimo_psfunction rtw_btc_wltoggle_table_afunction rtw_btc_wltoggle_table_bfunction rtw_coex_set_tablefunction rtw_coex_tablefunction rtw_coex_ignore_wlan_actfunction rtw_coex_power_save_statefunction rtw_coex_set_tdmafunction rtw_coex_tdmafunction rtw_coex_set_ant_pathfunction rtw_coex_algorithmfunction rtw_coex_action_coex_all_offfunction rtw_coex_action_freerunfunction rtw_coex_action_rf4cefunction rtw_coex_action_bt_whql_test
Annotated Snippet
struct rtw_coex_sta_stat_iter_data {
struct rtw_vif *rtwvif;
struct seq_file *file;
};
static void rtw_coex_sta_stat_iter(void *data, struct ieee80211_sta *sta)
{
struct rtw_coex_sta_stat_iter_data *sta_iter_data = data;
struct rtw_vif *rtwvif = sta_iter_data->rtwvif;
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
struct seq_file *m = sta_iter_data->file;
struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif);
u8 rssi;
if (si->vif != vif)
return;
rssi = ewma_rssi_read(&si->avg_rssi);
seq_printf(m, "\tPeer %3d\n", si->mac_id);
seq_printf(m, "\t\t%-24s = %d\n", "RSSI", rssi);
seq_printf(m, "\t\t%-24s = %d\n", "BW mode", si->bw_mode);
}
struct rtw_coex_vif_stat_iter_data {
struct rtw_dev *rtwdev;
struct seq_file *file;
};
static void rtw_coex_vif_stat_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct rtw_coex_vif_stat_iter_data *vif_iter_data = data;
struct rtw_coex_sta_stat_iter_data sta_iter_data;
struct rtw_dev *rtwdev = vif_iter_data->rtwdev;
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
struct seq_file *m = vif_iter_data->file;
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
seq_printf(m, "Iface on Port (%d)\n", rtwvif->port);
seq_printf(m, "\t%-32s = %d\n",
"Beacon interval", bss_conf->beacon_int);
seq_printf(m, "\t%-32s = %d\n",
"Network Type", rtwvif->net_type);
sta_iter_data.rtwvif = rtwvif;
sta_iter_data.file = m;
rtw_iterate_stas_atomic(rtwdev, rtw_coex_sta_stat_iter,
&sta_iter_data);
}
#define case_WLINK(src) \
case COEX_WLINK_##src: return #src
static const char *rtw_coex_get_wl_coex_mode(u8 coex_wl_link_mode)
{
switch (coex_wl_link_mode) {
case_WLINK(2G1PORT);
case_WLINK(5G);
case_WLINK(2GFREE);
default:
return "Unknown";
}
}
void rtw_coex_display_coex_info(struct rtw_dev *rtwdev, struct seq_file *m)
{
const struct rtw_chip_info *chip = rtwdev->chip;
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
struct rtw_coex *coex = &rtwdev->coex;
struct rtw_coex_stat *coex_stat = &coex->stat;
struct rtw_coex_dm *coex_dm = &coex->dm;
struct rtw_hal *hal = &rtwdev->hal;
struct rtw_efuse *efuse = &rtwdev->efuse;
struct rtw_fw_state *fw = &rtwdev->fw;
struct rtw_coex_vif_stat_iter_data vif_iter_data;
u8 reason = coex_dm->reason;
u8 sys_lte;
u16 score_board_WB, score_board_BW;
u32 wl_reg_6c0, wl_reg_6c4, wl_reg_6c8, wl_reg_778, wl_reg_6cc;
u32 lte_coex = 0, bt_coex = 0;
int i;
score_board_BW = rtw_coex_read_scbd(rtwdev);
score_board_WB = coex_stat->score_board;
wl_reg_6c0 = rtw_read32(rtwdev, REG_BT_COEX_TABLE0);
wl_reg_6c4 = rtw_read32(rtwdev, REG_BT_COEX_TABLE1);
wl_reg_6c8 = rtw_read32(rtwdev, REG_BT_COEX_BRK_TABLE);
wl_reg_6cc = rtw_read32(rtwdev, REG_BT_COEX_TABLE_H);
wl_reg_778 = rtw_read8(rtwdev, REG_BT_STAT_CTRL);
Annotation
- Immediate include surface: `main.h`, `coex.h`, `fw.h`, `ps.h`, `debug.h`, `reg.h`, `phy.h`.
- Detected declarations: `struct rtw_coex_sta_stat_iter_data`, `struct rtw_coex_vif_stat_iter_data`, `function rtw_coex_next_rssi_state`, `function rtw_coex_limited_tx`, `function rtw_coex_limited_wl`, `function rtw_coex_freerun_check`, `function rtw_coex_wl_slot_extend`, `function rtw_coex_wl_ccklock_action`, `function rtw_coex_wl_ccklock_detect`, `function rtw_coex_wl_noisy_detect`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.