linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] wl12xx: add dynamic_ps_timeout debugfs entry
@ 2011-09-18 12:09 Eliad Peller
  2011-09-18 12:09 ` [PATCH 2/2] wl12xx: handle CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID Eliad Peller
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Eliad Peller @ 2011-09-18 12:09 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Add debugfs entry to control the dynamic ps default
timeout (value in ms).

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/debugfs.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index 3999fd5..271dac0 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -311,6 +311,33 @@ static const struct file_operations start_recovery_ops = {
 	.llseek = default_llseek,
 };
 
+static ssize_t dynamic_ps_timeout_write(struct file *file,
+				    const char __user *user_buf,
+				    size_t count, loff_t *ppos)
+{
+	struct wl1271 *wl = file->private_data;
+	long value;
+	int ret;
+
+	ret = kstrtol_from_user(user_buf, count, 10, &value);
+	if (ret < 0) {
+		wl1271_warning("illegal value in dynamic_ps");
+		return -EINVAL;
+	}
+
+	mutex_lock(&wl->mutex);
+	ieee80211_set_dyn_ps_timeout(wl->vif, value);
+	mutex_unlock(&wl->mutex);
+
+	return count;
+}
+
+static const struct file_operations dynamic_ps_timeout_ops = {
+	.write = dynamic_ps_timeout_write,
+	.open = wl1271_open_file_generic,
+	.llseek = default_llseek,
+};
+
 static ssize_t driver_state_read(struct file *file, char __user *user_buf,
 				 size_t count, loff_t *ppos)
 {
@@ -769,6 +796,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl,
 
 	DEBUGFS_ADD(gpio_power, rootdir);
 	DEBUGFS_ADD(start_recovery, rootdir);
+	DEBUGFS_ADD(dynamic_ps_timeout, rootdir);
 	DEBUGFS_ADD(driver_state, rootdir);
 	DEBUGFS_ADD(dtim_interval, rootdir);
 	DEBUGFS_ADD(beacon_interval, rootdir);
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-22  5:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-18 12:09 [PATCH 1/2] wl12xx: add dynamic_ps_timeout debugfs entry Eliad Peller
2011-09-18 12:09 ` [PATCH 2/2] wl12xx: handle CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID Eliad Peller
2011-09-19  5:21   ` Luciano Coelho
2011-09-19  7:07     ` Eliad Peller
2011-09-19  5:07 ` [PATCH 1/2] wl12xx: add dynamic_ps_timeout debugfs entry Luciano Coelho
2011-09-19  5:11 ` Luciano Coelho
2011-09-22  5:33 ` Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).