drivers/net/wireless/ath/wil6210/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wil6210/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wil6210/debugfs.c- Extension
.c- Size
- 63544 bytes
- Lines
- 2487
- 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/module.hlinux/debugfs.hlinux/seq_file.hlinux/pci.hlinux/rtnetlink.hlinux/power_supply.hwil6210.hwmi.htxrx.hpmc.h
Detected Declarations
struct dbg_offenum dbg_off_typefunction wil_print_desc_edmafunction wil_print_ringfunction ring_showfunction wil_print_sringfunction srings_showfunction wil_seq_hexdumpfunction wil_print_mbox_ringfunction mbox_showfunction wil_debugfs_iomem_x32_setfunction wil_debugfs_iomem_x32_getfunction wil_debugfs_create_iomem_x32function wil_debugfs_ulong_setfunction wil_debugfs_ulong_getfunction wil6210_debugfs_init_offsetfunction wil6210_debugfs_create_ISRfunction wil6210_debugfs_create_pseudo_ISRfunction wil6210_debugfs_create_ITR_CNTfunction memread_showfunction wil_read_file_ioblobfunction wil_write_file_rxonfunction wil_write_file_rbufcapfunction wil_write_backfunction wil_read_backfunction wil_write_pmccfgfunction wil_read_pmccfgfunction wil_pmcring_seq_openfunction wil_write_file_txmgmtfunction wil_write_file_wmifunction wil_seq_print_skbfunction txdesc_showfunction status_msg_showfunction wil_print_rx_bufffunction list_for_each_entryfunction rx_buff_mgmt_showfunction is_all_zerosfunction bf_showfunction print_tempfunction temp_showfunction link_showfunction info_showfunction wil_read_file_recoveryfunction wil_write_file_recoveryfunction wil_print_rxtidfunction wil_print_rxtid_cryptofunction sta_showfunction mids_show
Annotated Snippet
static const struct file_operations fops_ioblob = {
.read = wil_read_file_ioblob,
.open = simple_open,
.llseek = default_llseek,
};
static
struct dentry *wil_debugfs_create_ioblob(const char *name,
umode_t mode,
struct dentry *parent,
struct wil_blob_wrapper *wil_blob)
{
return debugfs_create_file(name, mode, parent, wil_blob, &fops_ioblob);
}
/*---write channel 1..4 to rxon for it, 0 to rxoff---*/
static ssize_t wil_write_file_rxon(struct file *file, const char __user *buf,
size_t len, loff_t *ppos)
{
struct wil6210_priv *wil = file->private_data;
int rc;
long channel;
bool on;
char *kbuf = memdup_user_nul(buf, len);
if (IS_ERR(kbuf))
return PTR_ERR(kbuf);
rc = kstrtol(kbuf, 0, &channel);
kfree(kbuf);
if (rc)
return rc;
if ((channel < 0) || (channel > 4)) {
wil_err(wil, "Invalid channel %ld\n", channel);
return -EINVAL;
}
on = !!channel;
if (on) {
rc = wmi_set_channel(wil, (int)channel);
if (rc)
return rc;
}
rc = wmi_rxon(wil, on);
if (rc)
return rc;
return len;
}
static const struct file_operations fops_rxon = {
.write = wil_write_file_rxon,
.open = simple_open,
};
static ssize_t wil_write_file_rbufcap(struct file *file,
const char __user *buf,
size_t count, loff_t *ppos)
{
struct wil6210_priv *wil = file->private_data;
int val;
int rc;
rc = kstrtoint_from_user(buf, count, 0, &val);
if (rc) {
wil_err(wil, "Invalid argument\n");
return rc;
}
/* input value: negative to disable, 0 to use system default,
* 1..ring size to set descriptor threshold
*/
wil_info(wil, "%s RBUFCAP, descriptors threshold - %d\n",
val < 0 ? "Disabling" : "Enabling", val);
if (!wil->ring_rx.va || val > wil->ring_rx.size) {
wil_err(wil, "Invalid descriptors threshold, %d\n", val);
return -EINVAL;
}
rc = wmi_rbufcap_cfg(wil, val < 0 ? 0 : 1, val < 0 ? 0 : val);
if (rc) {
wil_err(wil, "RBUFCAP config failed: %d\n", rc);
return rc;
}
return count;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/debugfs.h`, `linux/seq_file.h`, `linux/pci.h`, `linux/rtnetlink.h`, `linux/power_supply.h`, `wil6210.h`, `wmi.h`.
- Detected declarations: `struct dbg_off`, `enum dbg_off_type`, `function wil_print_desc_edma`, `function wil_print_ring`, `function ring_show`, `function wil_print_sring`, `function srings_show`, `function wil_seq_hexdump`, `function wil_print_mbox_ring`, `function mbox_show`.
- 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.