drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c- Extension
.c- Size
- 62056 bytes
- Lines
- 2202
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/vmalloc.hlinux/err.hlinux/hex.hlinux/ieee80211.hlinux/netdevice.hlinux/dmi.hmvm.hsta.hiwl-io.hdebugfs.hiwl-modparams.hiwl-drv.hiwl-utils.hfw/error-dump.hfw/api/phy-ctxt.h
Detected Declarations
struct iwl_mvm_sniffer_applyfunction Copyrightfunction iwl_dbgfs_stop_ctdp_writefunction iwl_dbgfs_start_ctdp_writefunction iwl_dbgfs_force_ctkill_writefunction iwl_dbgfs_tx_flush_writefunction iwl_dbgfs_sram_readfunction iwl_dbgfs_sram_writefunction iwl_dbgfs_set_nic_temperature_readfunction iwl_dbgfs_set_nic_temperature_writefunction iwl_dbgfs_nic_temp_readfunction iwl_dbgfs_sar_geo_profile_readfunction iwl_dbgfs_wifi_6e_enable_readfunction iwl_dbgfs_stations_readfunction iwl_dbgfs_rs_data_readfunction iwl_dbgfs_amsdu_len_writefunction iwl_dbgfs_amsdu_len_readfunction iwl_dbgfs_disable_power_off_readfunction iwl_dbgfs_disable_power_off_writefunction iwl_dbgfs_tas_get_status_readfunction for_each_set_bitfunction iwl_dbgfs_phy_integration_ver_readfunction le32_to_cpufunction iwl_dbgfs_fw_system_stats_readfunction for_each_mvm_vif_valid_linkfunction iwl_dbgfs_frame_stats_readfunction iwl_dbgfs_drv_rx_stats_readfunction iwl_dbgfs_fw_restart_writefunction iwl_dbgfs_fw_nmi_writefunction iwl_dbgfs_scan_ant_rxchain_readfunction iwl_dbgfs_scan_ant_rxchain_writefunction iwl_dbgfs_indirection_tbl_writefunction iwl_dbgfs_inject_packet_writefunction _iwl_dbgfs_inject_beacon_iefunction for_each_mvm_vif_valid_linkfunction iwl_dbgfs_inject_beacon_ie_writefunction iwl_dbgfs_inject_beacon_ie_restore_writefunction iwl_dbgfs_fw_dbg_conf_readfunction iwl_dbgfs_fw_dbg_conf_writefunction iwl_dbgfs_fw_dbg_clear_writefunction iwl_dbgfs_dbg_time_point_writefunction _iwl_dbgfs_link_sta_wrap_writefunction _iwl_dbgfs_link_sta_wrap_readfunction debugfs_create_filefunction iwl_dbgfs_prph_reg_writefunction iwl_dbgfs_send_echo_cmd_writefunction iwl_mvm_sniffer_applyfunction iwl_dbgfs_he_sniffer_params_write
Annotated Snippet
static const struct file_operations iwl_dbgfs_link_sta_##name##_ops = { \
.write = _iwl_dbgfs_link_sta_##name##_write, \
.open = simple_open, \
.llseek = generic_file_llseek, \
}
#define MVM_DEBUGFS_READ_LINK_STA_FILE_OPS(name) \
MVM_DEBUGFS_LINK_STA_READ_WRAPPER(name) \
static const struct file_operations iwl_dbgfs_link_sta_##name##_ops = { \
.read = _iwl_dbgfs_link_sta_##name##_read, \
.open = simple_open, \
.llseek = generic_file_llseek, \
}
#define MVM_DEBUGFS_READ_WRITE_LINK_STA_FILE_OPS(name, bufsz) \
MVM_DEBUGFS_LINK_STA_READ_WRAPPER(name) \
MVM_DEBUGFS_LINK_STA_WRITE_WRAPPER(name, bufsz) \
static const struct file_operations iwl_dbgfs_link_sta_##name##_ops = { \
.read = _iwl_dbgfs_link_sta_##name##_read, \
.write = _iwl_dbgfs_link_sta_##name##_write, \
.open = simple_open, \
.llseek = generic_file_llseek, \
}
#define MVM_DEBUGFS_ADD_LINK_STA_FILE_ALIAS(alias, name, parent, mode) \
debugfs_create_file(alias, mode, parent, link_sta, \
&iwl_dbgfs_link_sta_##name##_ops)
#define MVM_DEBUGFS_ADD_LINK_STA_FILE(name, parent, mode) \
MVM_DEBUGFS_ADD_LINK_STA_FILE_ALIAS(#name, name, parent, mode)
static ssize_t
iwl_dbgfs_prph_reg_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct iwl_mvm *mvm = file->private_data;
int pos = 0;
char buf[32];
const size_t bufsz = sizeof(buf);
if (!mvm->dbgfs_prph_reg_addr)
return -EINVAL;
pos += scnprintf(buf + pos, bufsz - pos, "Reg 0x%x: (0x%x)\n",
mvm->dbgfs_prph_reg_addr,
iwl_read_prph(mvm->trans, mvm->dbgfs_prph_reg_addr));
return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
}
static ssize_t
iwl_dbgfs_prph_reg_write(struct iwl_mvm *mvm, char *buf,
size_t count, loff_t *ppos)
{
u8 args;
u32 value;
args = sscanf(buf, "%i %i", &mvm->dbgfs_prph_reg_addr, &value);
/* if we only want to set the reg address - nothing more to do */
if (args == 1)
goto out;
/* otherwise, make sure we have both address and value */
if (args != 2)
return -EINVAL;
iwl_write_prph(mvm->trans, mvm->dbgfs_prph_reg_addr, value);
out:
return count;
}
static ssize_t
iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf,
size_t count, loff_t *ppos)
{
int ret;
if (!iwl_mvm_firmware_running(mvm))
return -EIO;
mutex_lock(&mvm->mutex);
ret = iwl_mvm_send_cmd_pdu(mvm, ECHO_CMD, 0, 0, NULL);
mutex_unlock(&mvm->mutex);
return ret ?: count;
}
struct iwl_mvm_sniffer_apply {
struct iwl_mvm *mvm;
Annotation
- Immediate include surface: `linux/vmalloc.h`, `linux/err.h`, `linux/hex.h`, `linux/ieee80211.h`, `linux/netdevice.h`, `linux/dmi.h`, `mvm.h`, `sta.h`.
- Detected declarations: `struct iwl_mvm_sniffer_apply`, `function Copyright`, `function iwl_dbgfs_stop_ctdp_write`, `function iwl_dbgfs_start_ctdp_write`, `function iwl_dbgfs_force_ctkill_write`, `function iwl_dbgfs_tx_flush_write`, `function iwl_dbgfs_sram_read`, `function iwl_dbgfs_sram_write`, `function iwl_dbgfs_set_nic_temperature_read`, `function iwl_dbgfs_set_nic_temperature_write`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.