summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/debug.c
diff options
context:
space:
mode:
authorAlina Friedrichsen <x-alina@gmx.net>2009-01-23 05:39:13 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:21 -0500
commit8cab7581dba90b0519e25784e08feb5dedde737f (patch)
tree6ce5687004bf964e020203b0d24c241a505678b7 /drivers/net/wireless/ath5k/debug.c
parentae54c985cc7daa502da6e7eb3b223a30fbbf4cfb (diff)
ath5k: Read and write the TSF via debugfs
This patch updates the ath5k specific entry in the debugfs to read and reset the TSF value, to allowing write it, too. This makes debugging the IBSS handling of wifi drivers _much_ easier. Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/debug.c')
-rw-r--r--drivers/net/wireless/ath5k/debug.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c
index d281b6e3862..129b72684da 100644
--- a/drivers/net/wireless/ath5k/debug.c
+++ b/drivers/net/wireless/ath5k/debug.c
@@ -210,15 +210,22 @@ static ssize_t write_file_tsf(struct file *file,
size_t count, loff_t *ppos)
{
struct ath5k_softc *sc = file->private_data;
- char buf[20];
+ char buf[21];
+ unsigned long long tsf;
- if (copy_from_user(buf, userbuf, min(count, sizeof(buf))))
+ if (copy_from_user(buf, userbuf, min(count, sizeof(buf) - 1)))
return -EFAULT;
+ buf[sizeof(buf) - 1] = '\0';
if (strncmp(buf, "reset", 5) == 0) {
ath5k_hw_reset_tsf(sc->ah);
printk(KERN_INFO "debugfs reset TSF\n");
+ } else {
+ tsf = simple_strtoul(buf, NULL, 0);
+ ath5k_hw_set_tsf64(sc->ah, tsf);
+ printk(KERN_INFO "debugfs set TSF to %#018llx\n", tsf);
}
+
return count;
}