drivers/net/wireless/intel/iwlwifi/mld/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mld/debugfs.c- Extension
.c- Size
- 33185 bytes
- Lines
- 1167
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
mld.hdebugfs.hiwl-io.hhcmd.hiface.hsta.htlc.hpower.hnotif.hap.hiwl-utils.hscan.hthermal.hfw/api/rs.hfw/api/dhc.hfw/api/rfi.hfw/dhc-utils.hlinux/dmi.hlinux/hex.h
Detected Declarations
struct iwl_mld_sniffer_applyfunction Copyrightfunction iwl_dbgfs_fw_dbg_clear_writefunction iwl_dbgfs_fw_nmi_writefunction iwl_dbgfs_fw_restart_writefunction iwl_dbgfs_send_echo_cmd_writefunction iwl_mld_sniffer_applyfunction iwl_dbgfs_he_sniffer_params_writefunction iwl_dbgfs_he_sniffer_params_readfunction iwl_mld_dump_tas_respfunction for_each_set_bitfunction for_each_set_bitfunction iwl_dbgfs_tas_get_status_readfunction iwl_dbgfs_wifi_6e_enable_readfunction iwl_dbgfs_inject_packet_writefunction iwl_dbgfs_stop_ctdp_writefunction iwl_dbgfs_start_ctdp_writefunction iwl_mld_add_debugfs_filesfunction exitsfunction iwl_dbgfs_vif_bf_params_writefunction iwl_dbgfs_vif_pm_params_writefunction iwl_dbgfs_vif_low_latency_writefunction iwl_dbgfs_vif_low_latency_readfunction _iwl_dbgfs_inject_beacon_iefunction for_each_mld_vif_valid_linkfunction iwl_dbgfs_vif_inject_beacon_ie_writefunction iwl_dbgfs_vif_inject_beacon_ie_restore_writefunction iwl_dbgfs_vif_twt_setup_writefunction iwl_dbgfs_vif_twt_operation_writefunction iwl_dbgfs_vif_int_mlo_scan_writefunction iwl_mld_add_vif_debugfsfunction iwl_dbgfs_link_fw_id_readfunction iwl_mld_add_link_debugfsfunction _iwl_dbgfs_fixed_rate_writefunction iwl_dbgfs_link_sta_fixed_rate_writefunction iwl_dbgfs_link_sta_fixed_rate_v3_writefunction iwl_dbgfs_link_sta_tlc_dhc_writefunction iwl_dbgfs_link_sta_fw_id_readfunction iwl_mld_add_link_sta_debugfs
Annotated Snippet
struct iwl_mld_sniffer_apply {
struct iwl_mld *mld;
const u8 *bssid;
u16 aid;
};
static bool iwl_mld_sniffer_apply(struct iwl_notif_wait_data *notif_data,
struct iwl_rx_packet *pkt, void *data)
{
struct iwl_mld_sniffer_apply *apply = data;
apply->mld->monitor.cur_aid = cpu_to_le16(apply->aid);
memcpy(apply->mld->monitor.cur_bssid, apply->bssid,
sizeof(apply->mld->monitor.cur_bssid));
return true;
}
static ssize_t
iwl_dbgfs_he_sniffer_params_write(struct iwl_mld *mld, char *buf,
size_t count)
{
struct iwl_notification_wait wait;
struct iwl_he_monitor_cmd he_mon_cmd = {};
struct iwl_mld_sniffer_apply apply = {
.mld = mld,
};
u16 wait_cmds[] = {
WIDE_ID(DATA_PATH_GROUP, HE_AIR_SNIFFER_CONFIG_CMD),
};
u32 aid;
int ret;
if (iwl_mld_dbgfs_fw_cmd_disabled(mld))
return -EIO;
if (!mld->monitor.on)
return -ENODEV;
ret = sscanf(buf, "%x %2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", &aid,
&he_mon_cmd.bssid[0], &he_mon_cmd.bssid[1],
&he_mon_cmd.bssid[2], &he_mon_cmd.bssid[3],
&he_mon_cmd.bssid[4], &he_mon_cmd.bssid[5]);
if (ret != 7)
return -EINVAL;
he_mon_cmd.aid = cpu_to_le16(aid);
apply.aid = aid;
apply.bssid = (void *)he_mon_cmd.bssid;
/* Use the notification waiter to get our function triggered
* in sequence with other RX. This ensures that frames we get
* on the RX queue _before_ the new configuration is applied
* still have mld->cur_aid pointing to the old AID, and that
* frames on the RX queue _after_ the firmware processed the
* new configuration (and sent the response, synchronously)
* get mld->cur_aid correctly set to the new AID.
*/
iwl_init_notification_wait(&mld->notif_wait, &wait,
wait_cmds, ARRAY_SIZE(wait_cmds),
iwl_mld_sniffer_apply, &apply);
ret = iwl_mld_send_cmd_pdu(mld,
WIDE_ID(DATA_PATH_GROUP,
HE_AIR_SNIFFER_CONFIG_CMD),
&he_mon_cmd);
/* no need to really wait, we already did anyway */
iwl_remove_notification(&mld->notif_wait, &wait);
return ret ?: count;
}
static ssize_t
iwl_dbgfs_he_sniffer_params_read(struct iwl_mld *mld, char *buf, size_t count)
{
return scnprintf(buf, count,
"%d %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n",
le16_to_cpu(mld->monitor.cur_aid),
mld->monitor.cur_bssid[0], mld->monitor.cur_bssid[1],
mld->monitor.cur_bssid[2], mld->monitor.cur_bssid[3],
mld->monitor.cur_bssid[4], mld->monitor.cur_bssid[5]);
}
/* The size computation is as follows:
* each number needs at most 3 characters, number of rows is the size of
* the table; So, need 5 chars for the "freq: " part and each tuple afterwards
* needs 6 characters for numbers and 5 for the punctuation around. 32 bytes
* for feature support message.
Annotation
- Immediate include surface: `mld.h`, `debugfs.h`, `iwl-io.h`, `hcmd.h`, `iface.h`, `sta.h`, `tlc.h`, `power.h`.
- Detected declarations: `struct iwl_mld_sniffer_apply`, `function Copyright`, `function iwl_dbgfs_fw_dbg_clear_write`, `function iwl_dbgfs_fw_nmi_write`, `function iwl_dbgfs_fw_restart_write`, `function iwl_dbgfs_send_echo_cmd_write`, `function iwl_mld_sniffer_apply`, `function iwl_dbgfs_he_sniffer_params_write`, `function iwl_dbgfs_he_sniffer_params_read`, `function iwl_mld_dump_tas_resp`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- 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.