diff options
author | Guy Mishol <guym@ti.com> | 2015-07-27 08:46:02 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-08-06 09:18:14 +0200 |
commit | d1c5409612ad25d8a35a49a89ad302fc797eeb8e (patch) | |
tree | 2d0af030f1a2276e5c5f99d37c5413a5bc277fcb /drivers/net/wireless/ti/wl18xx/debugfs.c | |
parent | mwifiex: corrections in PCIe event skb handling (diff) | |
download | linux-d1c5409612ad25d8a35a49a89ad302fc797eeb8e.tar.xz linux-d1c5409612ad25d8a35a49a89ad302fc797eeb8e.zip |
wl18xx: add dynamic fw traces
add option to dynamically configure the fw
which debug traces to open
Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/debugfs.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/debugfs.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/debugfs.c b/drivers/net/wireless/ti/wl18xx/debugfs.c index 5fbd2230f372..8c6a1c86f526 100644 --- a/drivers/net/wireless/ti/wl18xx/debugfs.c +++ b/drivers/net/wireless/ti/wl18xx/debugfs.c @@ -281,6 +281,55 @@ static const struct file_operations radar_detection_ops = { .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)) + goto out; + + ret = wl1271_ps_elp_wakeup(wl); + if (ret < 0) + goto out; + + ret = wl18xx_acx_dynamic_fw_traces(wl); + if (ret < 0) + count = ret; + + wl1271_ps_elp_sleep(wl); +out: + mutex_unlock(&wl->mutex); + return count; +} + +static ssize_t dynamic_fw_traces_read(struct file *file, + char __user *userbuf, + size_t count, loff_t *ppos) +{ + struct wl1271 *wl = file->private_data; + return wl1271_format_buffer(userbuf, count, ppos, + "%d\n", wl->dynamic_fw_traces); +} + +static const struct file_operations dynamic_fw_traces_ops = { + .read = dynamic_fw_traces_read, + .write = dynamic_fw_traces_write, + .open = simple_open, + .llseek = default_llseek, +}; + int wl18xx_debugfs_add_files(struct wl1271 *wl, struct dentry *rootdir) { @@ -433,6 +482,7 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl, DEBUGFS_ADD(conf, moddir); DEBUGFS_ADD(radar_detection, moddir); + DEBUGFS_ADD(dynamic_fw_traces, moddir); return 0; |