drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c- Extension
.c- Size
- 28148 bytes
- Lines
- 912
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
mvm.hdebugfs.h
Detected Declarations
function Copyrightfunction iwl_dbgfs_pm_params_writefunction iwl_dbgfs_tx_pwr_lmt_readfunction iwl_dbgfs_pm_params_readfunction iwl_dbgfs_mac_params_readfunction iwl_dbgfs_update_bffunction iwl_dbgfs_bf_params_writefunction iwl_dbgfs_bf_params_readfunction iwl_dbgfs_os_device_timediff_readfunction iwl_dbgfs_low_latency_write_handlefunction iwl_dbgfs_low_latency_writefunction iwl_dbgfs_low_latency_force_write_handlefunction iwl_dbgfs_low_latency_force_writefunction iwl_dbgfs_low_latency_readfunction iwl_dbgfs_uapsd_misbehaving_readfunction iwl_dbgfs_uapsd_misbehaving_writefunction iwl_dbgfs_rx_phyinfo_writefunction for_each_vif_active_linkfunction iwl_dbgfs_rx_phyinfo_readfunction iwl_dbgfs_quota_checkfunction iwl_dbgfs_quota_min_writefunction iwl_dbgfs_quota_min_readfunction iwl_dbgfs_max_tx_op_writefunction iwl_dbgfs_max_tx_op_readfunction iwl_mvm_vif_add_debugfsfunction iwl_mvm_vif_dbgfs_add_linkfunction iwl_mvm_vif_dbgfs_rm_linkfunction iwl_mvm_debugfs_add_link_files
Annotated Snippet
static const struct file_operations iwl_dbgfs_low_latency_ops = {
.write = iwl_dbgfs_low_latency_write,
.read = iwl_dbgfs_low_latency_read,
.open = simple_open,
.llseek = generic_file_llseek,
};
static const struct file_operations iwl_dbgfs_low_latency_force_ops = {
.write = iwl_dbgfs_low_latency_force_write,
.open = simple_open,
.llseek = generic_file_llseek,
};
MVM_DEBUGFS_READ_WRITE_FILE_OPS(uapsd_misbehaving, 20);
MVM_DEBUGFS_READ_WRITE_FILE_OPS(rx_phyinfo, 10);
MVM_DEBUGFS_READ_WRITE_FILE_OPS(quota_min, 32);
MVM_DEBUGFS_READ_FILE_OPS(os_device_timediff);
MVM_DEBUGFS_READ_WRITE_FILE_OPS(max_tx_op, 10);
void iwl_mvm_vif_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct dentry *dbgfs_dir = vif->debugfs_dir;
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir);
if (IS_ERR_OR_NULL(mvmvif->dbgfs_dir)) {
IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n",
dbgfs_dir);
return;
}
if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM &&
((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) ||
(vif->type == NL80211_IFTYPE_STATION && vif->p2p)))
MVM_DEBUGFS_ADD_FILE_VIF(pm_params, mvmvif->dbgfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE_VIF(tx_pwr_lmt, mvmvif->dbgfs_dir, 0400);
MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir, 0400);
MVM_DEBUGFS_ADD_FILE_VIF(low_latency, mvmvif->dbgfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE_VIF(low_latency_force, mvmvif->dbgfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE_VIF(uapsd_misbehaving, mvmvif->dbgfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE_VIF(rx_phyinfo, mvmvif->dbgfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE_VIF(quota_min, mvmvif->dbgfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE_VIF(os_device_timediff, mvmvif->dbgfs_dir, 0400);
MVM_DEBUGFS_ADD_FILE_VIF(max_tx_op, mvmvif->dbgfs_dir, 0600);
debugfs_create_bool("ftm_unprotected", 0200, mvmvif->dbgfs_dir,
&mvmvif->ftm_unprotected);
if (vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
mvmvif == mvm->bf_allowed_vif)
MVM_DEBUGFS_ADD_FILE_VIF(bf_params, mvmvif->dbgfs_dir, 0600);
}
void iwl_mvm_vif_dbgfs_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
struct dentry *dbgfs_dir = vif->debugfs_dir;
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
char buf[3 * 3 + 11 + (NL80211_WIPHY_NAME_MAXLEN + 1) +
(7 + IFNAMSIZ + 1) + 6 + 1];
char name[7 + IFNAMSIZ + 1];
/* this will happen in monitor mode */
if (!dbgfs_dir)
return;
/*
* Create symlink for convenience pointing to interface specific
* debugfs entries for the driver. For example, under
* /sys/kernel/debug/iwlwifi/0000\:02\:00.0/iwlmvm/
* find
* netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/
*/
snprintf(name, sizeof(name), "%pd", dbgfs_dir);
snprintf(buf, sizeof(buf), "../../../%pd3/iwlmvm", dbgfs_dir);
mvmvif->dbgfs_slink =
debugfs_create_symlink(name, mvm->debugfs_dir, buf);
}
void iwl_mvm_vif_dbgfs_rm_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
debugfs_remove(mvmvif->dbgfs_slink);
mvmvif->dbgfs_slink = NULL;
}
#define MVM_DEBUGFS_WRITE_LINK_FILE_OPS(name, bufsz) \
_MVM_DEBUGFS_WRITE_FILE_OPS(link_##name, bufsz, \
Annotation
- Immediate include surface: `mvm.h`, `debugfs.h`.
- Detected declarations: `function Copyright`, `function iwl_dbgfs_pm_params_write`, `function iwl_dbgfs_tx_pwr_lmt_read`, `function iwl_dbgfs_pm_params_read`, `function iwl_dbgfs_mac_params_read`, `function iwl_dbgfs_update_bf`, `function iwl_dbgfs_bf_params_write`, `function iwl_dbgfs_bf_params_read`, `function iwl_dbgfs_os_device_timediff_read`, `function iwl_dbgfs_low_latency_write_handle`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.