drivers/net/wireless/ti/wlcore/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wlcore/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wlcore/debugfs.c- Extension
.c- Size
- 32838 bytes
- Lines
- 1338
- 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
debugfs.hlinux/skbuff.hlinux/slab.hlinux/module.hlinux/pm_runtime.hwlcore.hdebug.hacx.hps.hio.htx.hhw_ops.h
Detected Declarations
function Copyrightfunction wl1271_debugfs_update_statsfunction tx_queue_len_readfunction chip_op_handlerfunction gpio_power_readfunction gpio_power_writefunction start_recovery_writefunction dynamic_ps_timeout_readfunction dynamic_ps_timeout_writefunction wl12xx_for_each_wlvif_stafunction forced_ps_readfunction forced_ps_writefunction wl12xx_for_each_wlvif_stafunction split_scan_timeout_readfunction split_scan_timeout_writefunction driver_state_readfunction wl12xx_for_each_wlvif_stafunction vifs_state_readfunction wl12xx_for_each_wlviffunction dtim_interval_readfunction dtim_interval_writefunction suspend_dtim_interval_readfunction suspend_dtim_interval_writefunction beacon_interval_readfunction beacon_interval_writefunction rx_streaming_interval_writefunction wl12xx_for_each_wlvif_stafunction rx_streaming_interval_readfunction rx_streaming_always_writefunction wl12xx_for_each_wlvif_stafunction rx_streaming_always_readfunction beacon_filtering_writefunction wl12xx_for_each_wlviffunction fw_stats_raw_readfunction sleep_auth_readfunction sleep_auth_writefunction dev_mem_readfunction dev_mem_writefunction dev_mem_seekfunction fw_logger_readfunction fw_logger_writefunction wl1271_debugfs_add_filesfunction wl1271_debugfs_resetfunction wl1271_debugfs_initfunction wl1271_debugfs_exitexport wl1271_format_bufferexport wl1271_debugfs_update_stats
Annotated Snippet
static const struct file_operations tx_queue_len_ops = {
.read = tx_queue_len_read,
.open = simple_open,
.llseek = default_llseek,
};
static void chip_op_handler(struct wl1271 *wl, unsigned long value,
void *arg)
{
int ret;
int (*chip_op) (struct wl1271 *wl);
if (!arg) {
wl1271_warning("debugfs chip_op_handler with no callback");
return;
}
ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0)
return;
chip_op = arg;
chip_op(wl);
pm_runtime_put_autosuspend(wl->dev);
}
#define WL12XX_CONF_DEBUGFS(param, conf_sub_struct, \
min_val, max_val, write_handler_locked, \
write_handler_arg) \
static ssize_t param##_read(struct file *file, \
char __user *user_buf, \
size_t count, loff_t *ppos) \
{ \
struct wl1271 *wl = file->private_data; \
return wl1271_format_buffer(user_buf, count, \
ppos, "%d\n", \
wl->conf.conf_sub_struct.param); \
} \
\
static ssize_t param##_write(struct file *file, \
const char __user *user_buf, \
size_t count, loff_t *ppos) \
{ \
struct wl1271 *wl = file->private_data; \
unsigned long value; \
int ret; \
\
ret = kstrtoul_from_user(user_buf, count, 10, &value); \
if (ret < 0) { \
wl1271_warning("illegal value for " #param); \
return -EINVAL; \
} \
\
if (value < min_val || value > max_val) { \
wl1271_warning(#param " is not in valid range"); \
return -ERANGE; \
} \
\
mutex_lock(&wl->mutex); \
wl->conf.conf_sub_struct.param = value; \
\
write_handler_locked(wl, value, write_handler_arg); \
\
mutex_unlock(&wl->mutex); \
return count; \
} \
\
static const struct file_operations param##_ops = { \
.read = param##_read, \
.write = param##_write, \
.open = simple_open, \
.llseek = default_llseek, \
};
WL12XX_CONF_DEBUGFS(irq_pkt_threshold, rx, 0, 65535,
chip_op_handler, wl1271_acx_init_rx_interrupt)
WL12XX_CONF_DEBUGFS(irq_blk_threshold, rx, 0, 65535,
chip_op_handler, wl1271_acx_init_rx_interrupt)
WL12XX_CONF_DEBUGFS(irq_timeout, rx, 0, 100,
chip_op_handler, wl1271_acx_init_rx_interrupt)
static ssize_t gpio_power_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct wl1271 *wl = file->private_data;
bool state = test_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
int res;
char buf[10];
Annotation
- Immediate include surface: `debugfs.h`, `linux/skbuff.h`, `linux/slab.h`, `linux/module.h`, `linux/pm_runtime.h`, `wlcore.h`, `debug.h`, `acx.h`.
- Detected declarations: `function Copyright`, `function wl1271_debugfs_update_stats`, `function tx_queue_len_read`, `function chip_op_handler`, `function gpio_power_read`, `function gpio_power_write`, `function start_recovery_write`, `function dynamic_ps_timeout_read`, `function dynamic_ps_timeout_write`, `function wl12xx_for_each_wlvif_sta`.
- 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.