Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278074
b: refs/heads/master
c: ef8f0eb
h: refs/heads/master
v: v3
  • Loading branch information
Rishi Panjwani authored and Kalle Valo committed Nov 11, 2011
1 parent a24dfa2 commit 91d910e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 635412127e089cc401fdd793f4d3731450419231
refs/heads/master: ef8f0eba5a35327a9968e2a4d2116195240512c6
64 changes: 64 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,70 @@ static const struct file_operations fops_bgscan_int = {
.llseek = default_llseek,
};

static ssize_t ath6kl_listen_int_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath6kl *ar = file->private_data;
u16 listen_int_t, listen_int_b;
char buf[32];
char *sptr, *token;
ssize_t len;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;

buf[len] = '\0';
sptr = buf;

token = strsep(&sptr, " ");
if (!token)
return -EINVAL;

if (kstrtou16(token, 0, &listen_int_t))
return -EINVAL;

if (kstrtou16(sptr, 0, &listen_int_b))
return -EINVAL;

if ((listen_int_t < 15) || (listen_int_t > 5000))
return -EINVAL;

if ((listen_int_b < 1) || (listen_int_b > 50))
return -EINVAL;

ar->listen_intvl_t = listen_int_t;
ar->listen_intvl_b = listen_int_b;

ath6kl_wmi_listeninterval_cmd(ar->wmi, 0, ar->listen_intvl_t,
ar->listen_intvl_b);

return count;
}

static ssize_t ath6kl_listen_int_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath6kl *ar = file->private_data;
char buf[16];
int len;

len = snprintf(buf, sizeof(buf), "%u %u\n", ar->listen_intvl_t,
ar->listen_intvl_b);

return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static const struct file_operations fops_listen_int = {
.read = ath6kl_listen_int_read,
.write = ath6kl_listen_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);
Expand Down

0 comments on commit 91d910e

Please sign in to comment.