From c4f5e528f90a32fbd5412a8e7e63cbddc5e5fc05 Mon Sep 17 00:00:00 2001 From: Rishi Panjwani Date: Tue, 18 Oct 2011 17:20:06 -0700 Subject: [PATCH] --- yaml --- r: 278032 b: refs/heads/master c: 116b3a2e0fb79fbc2367f69167a7a84a4c864a2d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/ath/ath6kl/debug.c | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 34a0f0d223e7..62b37597f62c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 83973e0357e2b3792480aa02b672902b2aa774b0 +refs/heads/master: 116b3a2e0fb79fbc2367f69167a7a84a4c864a2d diff --git a/trunk/drivers/net/wireless/ath/ath6kl/debug.c b/trunk/drivers/net/wireless/ath/ath6kl/debug.c index e109f29f5862..bafc81058dcb 100644 --- a/trunk/drivers/net/wireless/ath/ath6kl/debug.c +++ b/trunk/drivers/net/wireless/ath/ath6kl/debug.c @@ -1455,6 +1455,39 @@ static const struct file_operations fops_delete_qos = { .llseek = default_llseek, }; +static ssize_t ath6kl_bgscan_int_write(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath6kl *ar = file->private_data; + u16 bgscan_int; + char buf[32]; + ssize_t len; + + len = min(count, sizeof(buf) - 1); + if (copy_from_user(buf, user_buf, len)) + return -EFAULT; + + buf[len] = '\0'; + if (kstrtou16(buf, 0, &bgscan_int)) + return -EINVAL; + + if (bgscan_int == 0) + bgscan_int = 0xffff; + + ath6kl_wmi_scanparams_cmd(ar->wmi, 0, 0, bgscan_int, 0, 0, 0, 3, + 0, 0, 0); + + return count; +} + +static const struct file_operations fops_bgscan_int = { + .write = ath6kl_bgscan_int_write, + .open = ath6kl_debugfs_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + int ath6kl_debug_init(struct ath6kl *ar) { ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE); @@ -1534,6 +1567,9 @@ int ath6kl_debug_init(struct ath6kl *ar) debugfs_create_file("delete_qos", S_IWUSR, ar->debugfs_phy, ar, &fops_delete_qos); + debugfs_create_file("bgscan_interval", S_IWUSR, + ar->debugfs_phy, ar, &fops_bgscan_int); + return 0; }