drivers/net/wireless/realtek/rtw89/debug.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/debug.c- Extension
.c- Size
- 170125 bytes
- Lines
- 5614
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hex.hlinux/vmalloc.hcoex.hdebug.hfw.hmac.hpci.hphy.hps.hreg.hsar.hutil.h
Detected Declarations
struct rtw89_debugfs_priv_optstruct rtw89_debugfs_privstruct rtw89_debugfsstruct rtw89_debugfs_iter_datastruct txpwr_entstruct txpwr_mapstruct dbgfs_txpwr_tablestruct rtw89_dbg_ser_countersstruct __diag_mac_rule_headerstruct __diag_mac_rule_equalstruct __diag_mac_rule_incrementstruct __diag_mac_msg_bufenum rtw89_dbg_crash_simulation_typeenum __diag_mac_cmdenum __diag_mac_iofunction rtw89_debugfs_iter_data_setupfunction rtw89_debugfs_iter_data_nextfunction rtw89_rate_info_bw_to_mhzfunction rtw89_debugfs_file_read_helperfunction rtw89_debugfs_file_readfunction rtw89_debugfs_file_write_helperfunction rtw89_debugfs_file_writefunction rtw89_debug_priv_read_reg_selectfunction rtw89_debug_priv_read_reg_getfunction rtw89_debug_priv_write_reg_setfunction rtw89_debug_priv_read_rf_selectfunction rtw89_debug_priv_read_rf_getfunction rtw89_debug_priv_write_rf_setfunction rtw89_debug_priv_rf_reg_dump_getfunction __print_txpwr_entfunction __print_txpwr_mapfunction __print_regdfunction rtw89_debug_priv_txpwr_table_get_regdfunction rtw89_debug_priv_txpwr_table_getfunction rtw89_debug_priv_mac_reg_dump_selectfunction rtw89_debug_priv_mac_reg_dump_getfunction rtw89_debug_priv_mac_mem_dump_selectfunction rtw89_debug_dump_mac_memfunction rtw89_debug_priv_mac_mem_dump_getfunction rtw89_debug_priv_mac_dbg_port_dump_selectfunction rtw89_debug_mac_dump_ss_dbgfunction rtw89_debug_mac_dump_dle_dbgfunction rtw89_debug_mac_dump_dmac_dbgfunction rtw89_debug_mac_dump_cmac_errfunction rtw89_debug_mac_dump_cmac_dbgfunction rtw89_debug_mac_dbg_port_selfunction is_dbg_port_validfunction rtw89_debug_mac_dbg_port_dump
Annotated Snippet
struct rtw89_debugfs_priv_opt {
bool rlock:1;
bool wlock:1;
size_t rsize;
};
struct rtw89_debugfs_priv {
struct rtw89_dev *rtwdev;
ssize_t (*cb_read)(struct rtw89_dev *rtwdev,
struct rtw89_debugfs_priv *debugfs_priv,
char *buf, size_t bufsz);
ssize_t (*cb_write)(struct rtw89_dev *rtwdev,
struct rtw89_debugfs_priv *debugfs_priv,
const char *buf, size_t count);
struct rtw89_debugfs_priv_opt opt;
union {
u32 cb_data;
struct {
u32 addr;
u32 len;
} read_reg;
struct {
u32 addr;
u32 mask;
u8 path;
} read_rf;
struct {
u8 ss_dbg:1;
u8 dle_dbg:1;
u8 dmac_dbg:1;
u8 cmac_dbg:1;
u8 dbg_port:1;
} dbgpkg_en;
struct {
u32 start;
u32 len;
u8 sel;
} mac_mem;
};
ssize_t rused;
char *rbuf;
};
struct rtw89_debugfs {
struct rtw89_debugfs_priv read_reg;
struct rtw89_debugfs_priv write_reg;
struct rtw89_debugfs_priv read_rf;
struct rtw89_debugfs_priv write_rf;
struct rtw89_debugfs_priv rf_reg_dump;
struct rtw89_debugfs_priv txpwr_table;
struct rtw89_debugfs_priv mac_reg_dump;
struct rtw89_debugfs_priv mac_mem_dump;
struct rtw89_debugfs_priv mac_dbg_port_dump;
struct rtw89_debugfs_priv send_h2c;
struct rtw89_debugfs_priv early_h2c;
struct rtw89_debugfs_priv fw_crash;
struct rtw89_debugfs_priv ser_counters;
struct rtw89_debugfs_priv btc_info;
struct rtw89_debugfs_priv btc_manual;
struct rtw89_debugfs_priv fw_log_manual;
struct rtw89_debugfs_priv phy_info;
struct rtw89_debugfs_priv bb_info;
struct rtw89_debugfs_priv stations;
struct rtw89_debugfs_priv disable_dm;
struct rtw89_debugfs_priv static_pd_th;
struct rtw89_debugfs_priv mlo_mode;
struct rtw89_debugfs_priv beacon_info;
struct rtw89_debugfs_priv diag_mac;
struct rtw89_debugfs_priv diag_bb;
struct rtw89_debugfs_priv monitor_opts;
};
struct rtw89_debugfs_iter_data {
char *buf;
size_t bufsz;
int written_sz;
};
static void rtw89_debugfs_iter_data_setup(struct rtw89_debugfs_iter_data *iter_data,
char *buf, size_t bufsz)
{
iter_data->buf = buf;
iter_data->bufsz = bufsz;
iter_data->written_sz = 0;
}
static void rtw89_debugfs_iter_data_next(struct rtw89_debugfs_iter_data *iter_data,
char *buf, size_t bufsz, int written_sz)
{
iter_data->buf = buf;
Annotation
- Immediate include surface: `linux/hex.h`, `linux/vmalloc.h`, `coex.h`, `debug.h`, `fw.h`, `mac.h`, `pci.h`, `phy.h`.
- Detected declarations: `struct rtw89_debugfs_priv_opt`, `struct rtw89_debugfs_priv`, `struct rtw89_debugfs`, `struct rtw89_debugfs_iter_data`, `struct txpwr_ent`, `struct txpwr_map`, `struct dbgfs_txpwr_table`, `struct rtw89_dbg_ser_counters`, `struct __diag_mac_rule_header`, `struct __diag_mac_rule_equal`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.