aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-02-02 06:54:29 -0500
committerLuciano Coelho <coelho@ti.com>2012-02-15 01:38:35 -0500
commitf95f9aad150238236b2338efa60a14891081026e (patch)
treebe1e78c0ead58025ee45a01c09ef30f7e82d620e
parentd647f2dd1a445f5a683372f1b47919fe92c19896 (diff)
wl12xx: add split_scan_timeout debugfs file
Add control over split_scan_timeout through debugfs. Values are in ms while 0 will disable split scan. Signed-off-by: Eyal Shapira <eyal@wizey.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/debugfs.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index f063c704ebcf..00dbe1595a7f 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -445,6 +445,48 @@ static const struct file_operations forced_ps_ops = {
445 .llseek = default_llseek, 445 .llseek = default_llseek,
446}; 446};
447 447
448static ssize_t split_scan_timeout_read(struct file *file, char __user *user_buf,
449 size_t count, loff_t *ppos)
450{
451 struct wl1271 *wl = file->private_data;
452
453 return wl1271_format_buffer(user_buf, count,
454 ppos, "%d\n",
455 wl->conf.scan.split_scan_timeout / 1000);
456}
457
458static ssize_t split_scan_timeout_write(struct file *file,
459 const char __user *user_buf,
460 size_t count, loff_t *ppos)
461{
462 struct wl1271 *wl = file->private_data;
463 unsigned long value;
464 int ret;
465
466 ret = kstrtoul_from_user(user_buf, count, 10, &value);
467 if (ret < 0) {
468 wl1271_warning("illegal value in split_scan_timeout");
469 return -EINVAL;
470 }
471
472 if (value == 0)
473 wl1271_info("split scan will be disabled");
474
475 mutex_lock(&wl->mutex);
476
477 wl->conf.scan.split_scan_timeout = value * 1000;
478
479 mutex_unlock(&wl->mutex);
480 return count;
481}
482
483static const struct file_operations split_scan_timeout_ops = {
484 .read = split_scan_timeout_read,
485 .write = split_scan_timeout_write,
486 .open = wl1271_open_file_generic,
487 .llseek = default_llseek,
488};
489
448static ssize_t driver_state_read(struct file *file, char __user *user_buf, 490static ssize_t driver_state_read(struct file *file, char __user *user_buf,
449 size_t count, loff_t *ppos) 491 size_t count, loff_t *ppos)
450{ 492{
@@ -1082,6 +1124,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl,
1082 DEBUGFS_ADD(beacon_filtering, rootdir); 1124 DEBUGFS_ADD(beacon_filtering, rootdir);
1083 DEBUGFS_ADD(dynamic_ps_timeout, rootdir); 1125 DEBUGFS_ADD(dynamic_ps_timeout, rootdir);
1084 DEBUGFS_ADD(forced_ps, rootdir); 1126 DEBUGFS_ADD(forced_ps, rootdir);
1127 DEBUGFS_ADD(split_scan_timeout, rootdir);
1085 1128
1086 streaming = debugfs_create_dir("rx_streaming", rootdir); 1129 streaming = debugfs_create_dir("rx_streaming", rootdir);
1087 if (!streaming || IS_ERR(streaming)) 1130 if (!streaming || IS_ERR(streaming))