drivers/net/wireless/ti/wl18xx/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl18xx/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wl18xx/debugfs.c- Extension
.c- Size
- 19562 bytes
- Lines
- 561
- 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.
- 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/pm_runtime.h../wlcore/debugfs.h../wlcore/wlcore.h../wlcore/debug.h../wlcore/ps.hwl18xx.hacx.hcmd.hdebugfs.h
Detected Declarations
function conf_readfunction clear_fw_stats_writefunction radar_detection_writefunction dynamic_fw_traces_writefunction dynamic_fw_traces_readfunction radar_debug_mode_writefunction wl12xx_for_each_wlvif_apfunction radar_debug_mode_readfunction wl18xx_debugfs_add_files
Annotated Snippet
static const struct file_operations conf_ops = {
.read = conf_read,
.open = simple_open,
.llseek = default_llseek,
};
static ssize_t clear_fw_stats_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct wl1271 *wl = file->private_data;
int ret;
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl18xx_acx_clear_statistics(wl);
if (ret < 0) {
count = ret;
goto out;
}
out:
mutex_unlock(&wl->mutex);
return count;
}
static const struct file_operations clear_fw_stats_ops = {
.write = clear_fw_stats_write,
.open = simple_open,
.llseek = default_llseek,
};
static ssize_t radar_detection_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct wl1271 *wl = file->private_data;
int ret;
u8 channel;
ret = kstrtou8_from_user(user_buf, count, 10, &channel);
if (ret < 0) {
wl1271_warning("illegal channel");
return -EINVAL;
}
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0)
goto out;
ret = wl18xx_cmd_radar_detection_debug(wl, channel);
if (ret < 0)
count = ret;
pm_runtime_put_autosuspend(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
}
static const struct file_operations radar_detection_ops = {
.write = radar_detection_write,
.open = simple_open,
.llseek = default_llseek,
};
static ssize_t dynamic_fw_traces_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, 0, &value);
if (ret < 0)
return ret;
mutex_lock(&wl->mutex);
wl->dynamic_fw_traces = value;
if (unlikely(wl->state != WLCORE_STATE_ON))
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `../wlcore/debugfs.h`, `../wlcore/wlcore.h`, `../wlcore/debug.h`, `../wlcore/ps.h`, `wl18xx.h`, `acx.h`, `cmd.h`.
- Detected declarations: `function conf_read`, `function clear_fw_stats_write`, `function radar_detection_write`, `function dynamic_fw_traces_write`, `function dynamic_fw_traces_read`, `function radar_debug_mode_write`, `function wl12xx_for_each_wlvif_ap`, `function radar_debug_mode_read`, `function wl18xx_debugfs_add_files`.
- 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.
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.