aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/debug.c
diff options
context:
space:
mode:
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 d281b6e38629..129b72684daf 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,
210 size_t count, loff_t *ppos) 210 size_t count, loff_t *ppos)
211{ 211{
212 struct ath5k_softc *sc = file->private_data; 212 struct ath5k_softc *sc = file->private_data;
213 char buf[20]; 213 char buf[21];
214 unsigned long long tsf;
214 215
215 if (copy_from_user(buf, userbuf, min(count, sizeof(buf)))) 216 if (copy_from_user(buf, userbuf, min(count, sizeof(buf) - 1)))
216 return -EFAULT; 217 return -EFAULT;
218 buf[sizeof(buf) - 1] = '\0';
217 219
218 if (strncmp(buf, "reset", 5) == 0) { 220 if (strncmp(buf, "reset", 5) == 0) {
219 ath5k_hw_reset_tsf(sc->ah); 221 ath5k_hw_reset_tsf(sc->ah);
220 printk(KERN_INFO "debugfs reset TSF\n"); 222 printk(KERN_INFO "debugfs reset TSF\n");
223 } else {
224 tsf = simple_strtoul(buf, NULL, 0);
225 ath5k_hw_set_tsf64(sc->ah, tsf);
226 printk(KERN_INFO "debugfs set TSF to %#018llx\n", tsf);
221 } 227 }
228
222 return count; 229 return count;
223} 230}
224 231