aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRishi Panjwani <rpanjwan@qca.qualcomm.com>2011-10-18 20:20:06 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:50:57 -0500
commit116b3a2e0fb79fbc2367f69167a7a84a4c864a2d (patch)
tree528ed063159f0e197c54865f3f55d73133726fbb
parent83973e0357e2b3792480aa02b672902b2aa774b0 (diff)
ath6kl: Implement support for background scan control from userspace
In order to allow user space based control of background scan interval, we use available debugfs infrastructure. The feature has been added for testing purposes. The user has to write the bgscan interval (in secs) to the bgscan_interval file in ath6kl debug directory. To disable bgscan, a '0' is to be written to the bgscan_interval file. Example: echo "2" > bgscan_interval This will make the background scan interval as 2 seconds kvalo: changed implementation so that there's only one call to ath6kl_wmi_scanparams_cmd() Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index e109f29f5862..bafc81058dcb 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -1455,6 +1455,39 @@ static const struct file_operations fops_delete_qos = {
1455 .llseek = default_llseek, 1455 .llseek = default_llseek,
1456}; 1456};
1457 1457
1458static ssize_t ath6kl_bgscan_int_write(struct file *file,
1459 const char __user *user_buf,
1460 size_t count, loff_t *ppos)
1461{
1462 struct ath6kl *ar = file->private_data;
1463 u16 bgscan_int;
1464 char buf[32];
1465 ssize_t len;
1466
1467 len = min(count, sizeof(buf) - 1);
1468 if (copy_from_user(buf, user_buf, len))
1469 return -EFAULT;
1470
1471 buf[len] = '\0';
1472 if (kstrtou16(buf, 0, &bgscan_int))
1473 return -EINVAL;
1474
1475 if (bgscan_int == 0)
1476 bgscan_int = 0xffff;
1477
1478 ath6kl_wmi_scanparams_cmd(ar->wmi, 0, 0, bgscan_int, 0, 0, 0, 3,
1479 0, 0, 0);
1480
1481 return count;
1482}
1483
1484static const struct file_operations fops_bgscan_int = {
1485 .write = ath6kl_bgscan_int_write,
1486 .open = ath6kl_debugfs_open,
1487 .owner = THIS_MODULE,
1488 .llseek = default_llseek,
1489};
1490
1458int ath6kl_debug_init(struct ath6kl *ar) 1491int ath6kl_debug_init(struct ath6kl *ar)
1459{ 1492{
1460 ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE); 1493 ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE);
@@ -1534,6 +1567,9 @@ int ath6kl_debug_init(struct ath6kl *ar)
1534 debugfs_create_file("delete_qos", S_IWUSR, ar->debugfs_phy, ar, 1567 debugfs_create_file("delete_qos", S_IWUSR, ar->debugfs_phy, ar,
1535 &fops_delete_qos); 1568 &fops_delete_qos);
1536 1569
1570 debugfs_create_file("bgscan_interval", S_IWUSR,
1571 ar->debugfs_phy, ar, &fops_bgscan_int);
1572
1537 return 0; 1573 return 0;
1538} 1574}
1539 1575