Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266225
b: refs/heads/master
c: a0a5215
h: refs/heads/master
i:
  266223: 0f93f91
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Sep 14, 2011
1 parent 62e7c4e commit 3558bc7
Show file tree
Hide file tree
Showing 2 changed files with 43 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: 2a5bff091f4c32d07f007d6491453b67b497a3a4
refs/heads/master: a0a521560a686ccb06c92919f1047f94acbb8835
42 changes: 42 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,47 @@ static const struct file_operations rx_streaming_always_ops = {
.llseek = default_llseek,
};

static ssize_t beacon_filtering_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct wl1271 *wl = file->private_data;
char buf[10];
size_t len;
unsigned long value;
int ret;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;
buf[len] = '\0';

ret = kstrtoul(buf, 0, &value);
if (ret < 0) {
wl1271_warning("illegal value for beacon_filtering!");
return -EINVAL;
}

mutex_lock(&wl->mutex);

ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;

ret = wl1271_acx_beacon_filter_opt(wl, !!value);

wl1271_ps_elp_sleep(wl);
out:
mutex_unlock(&wl->mutex);
return count;
}

static const struct file_operations beacon_filtering_ops = {
.write = beacon_filtering_write,
.open = wl1271_open_file_generic,
.llseek = default_llseek,
};

static int wl1271_debugfs_add_files(struct wl1271 *wl,
struct dentry *rootdir)
{
Expand Down Expand Up @@ -767,6 +808,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl,
DEBUGFS_ADD(driver_state, rootdir);
DEBUGFS_ADD(dtim_interval, rootdir);
DEBUGFS_ADD(beacon_interval, rootdir);
DEBUGFS_ADD(beacon_filtering, rootdir);

streaming = debugfs_create_dir("rx_streaming", rootdir);
if (!streaming || IS_ERR(streaming))
Expand Down

0 comments on commit 3558bc7

Please sign in to comment.