diff options
author | Eliad Peller <eliad@wizery.com> | 2011-08-25 11:11:00 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-09-14 04:47:18 -0400 |
commit | a0a521560a686ccb06c92919f1047f94acbb8835 (patch) | |
tree | 6397ac61281a7aac965e14098680805afa3d491e /drivers/net/wireless/wl12xx/debugfs.c | |
parent | 2a5bff091f4c32d07f007d6491453b67b497a3a4 (diff) |
wl12xx: add beacon_filtering debugfs file
Allow enabling/disabling beacon_filtering by debugfs,
in order to reduce the log size while debugging (beacon
filtering is disabled by default in AP mode, as beacons
are needed for ERP configuration).
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/debugfs.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/debugfs.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c index d59354f53702..d227385a8f9c 100644 --- a/drivers/net/wireless/wl12xx/debugfs.c +++ b/drivers/net/wireless/wl12xx/debugfs.c | |||
@@ -655,6 +655,47 @@ static const struct file_operations rx_streaming_always_ops = { | |||
655 | .llseek = default_llseek, | 655 | .llseek = default_llseek, |
656 | }; | 656 | }; |
657 | 657 | ||
658 | static ssize_t beacon_filtering_write(struct file *file, | ||
659 | const char __user *user_buf, | ||
660 | size_t count, loff_t *ppos) | ||
661 | { | ||
662 | struct wl1271 *wl = file->private_data; | ||
663 | char buf[10]; | ||
664 | size_t len; | ||
665 | unsigned long value; | ||
666 | int ret; | ||
667 | |||
668 | len = min(count, sizeof(buf) - 1); | ||
669 | if (copy_from_user(buf, user_buf, len)) | ||
670 | return -EFAULT; | ||
671 | buf[len] = '\0'; | ||
672 | |||
673 | ret = kstrtoul(buf, 0, &value); | ||
674 | if (ret < 0) { | ||
675 | wl1271_warning("illegal value for beacon_filtering!"); | ||
676 | return -EINVAL; | ||
677 | } | ||
678 | |||
679 | mutex_lock(&wl->mutex); | ||
680 | |||
681 | ret = wl1271_ps_elp_wakeup(wl); | ||
682 | if (ret < 0) | ||
683 | goto out; | ||
684 | |||
685 | ret = wl1271_acx_beacon_filter_opt(wl, !!value); | ||
686 | |||
687 | wl1271_ps_elp_sleep(wl); | ||
688 | out: | ||
689 | mutex_unlock(&wl->mutex); | ||
690 | return count; | ||
691 | } | ||
692 | |||
693 | static const struct file_operations beacon_filtering_ops = { | ||
694 | .write = beacon_filtering_write, | ||
695 | .open = wl1271_open_file_generic, | ||
696 | .llseek = default_llseek, | ||
697 | }; | ||
698 | |||
658 | static int wl1271_debugfs_add_files(struct wl1271 *wl, | 699 | static int wl1271_debugfs_add_files(struct wl1271 *wl, |
659 | struct dentry *rootdir) | 700 | struct dentry *rootdir) |
660 | { | 701 | { |
@@ -767,6 +808,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl, | |||
767 | DEBUGFS_ADD(driver_state, rootdir); | 808 | DEBUGFS_ADD(driver_state, rootdir); |
768 | DEBUGFS_ADD(dtim_interval, rootdir); | 809 | DEBUGFS_ADD(dtim_interval, rootdir); |
769 | DEBUGFS_ADD(beacon_interval, rootdir); | 810 | DEBUGFS_ADD(beacon_interval, rootdir); |
811 | DEBUGFS_ADD(beacon_filtering, rootdir); | ||
770 | 812 | ||
771 | streaming = debugfs_create_dir("rx_streaming", rootdir); | 813 | streaming = debugfs_create_dir("rx_streaming", rootdir); |
772 | if (!streaming || IS_ERR(streaming)) | 814 | if (!streaming || IS_ERR(streaming)) |