diff options
author | Alina Friedrichsen <x-alina@gmx.net> | 2009-01-24 01:09:59 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:46 -0500 |
commit | 3b5d665b51cda73ef1a774b515afd879a38e3674 (patch) | |
tree | 68d71f6ac09f638b65ca1e256a17dfdb6c5b12b4 /drivers/net/wireless/ath5k/debug.c | |
parent | 3978e5bce63484789891c67413372da3915bcbd6 (diff) |
mac80211: Generic TSF debugging
This patch enables low-level driver independent debugging of the TSF and remove the driver specific things of ath5k and ath9k from the debugfs.
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.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 129b72684daf..413ed689cd5f 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -193,50 +193,6 @@ static const struct file_operations fops_registers = { | |||
193 | }; | 193 | }; |
194 | 194 | ||
195 | 195 | ||
196 | /* debugfs: TSF */ | ||
197 | |||
198 | static ssize_t read_file_tsf(struct file *file, char __user *user_buf, | ||
199 | size_t count, loff_t *ppos) | ||
200 | { | ||
201 | struct ath5k_softc *sc = file->private_data; | ||
202 | char buf[100]; | ||
203 | snprintf(buf, sizeof(buf), "0x%016llx\n", | ||
204 | (unsigned long long)ath5k_hw_get_tsf64(sc->ah)); | ||
205 | return simple_read_from_buffer(user_buf, count, ppos, buf, 19); | ||
206 | } | ||
207 | |||
208 | static ssize_t write_file_tsf(struct file *file, | ||
209 | const char __user *userbuf, | ||
210 | size_t count, loff_t *ppos) | ||
211 | { | ||
212 | struct ath5k_softc *sc = file->private_data; | ||
213 | char buf[21]; | ||
214 | unsigned long long tsf; | ||
215 | |||
216 | if (copy_from_user(buf, userbuf, min(count, sizeof(buf) - 1))) | ||
217 | return -EFAULT; | ||
218 | buf[sizeof(buf) - 1] = '\0'; | ||
219 | |||
220 | if (strncmp(buf, "reset", 5) == 0) { | ||
221 | ath5k_hw_reset_tsf(sc->ah); | ||
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); | ||
227 | } | ||
228 | |||
229 | return count; | ||
230 | } | ||
231 | |||
232 | static const struct file_operations fops_tsf = { | ||
233 | .read = read_file_tsf, | ||
234 | .write = write_file_tsf, | ||
235 | .open = ath5k_debugfs_open, | ||
236 | .owner = THIS_MODULE, | ||
237 | }; | ||
238 | |||
239 | |||
240 | /* debugfs: beacons */ | 196 | /* debugfs: beacons */ |
241 | 197 | ||
242 | static ssize_t read_file_beacon(struct file *file, char __user *user_buf, | 198 | static ssize_t read_file_beacon(struct file *file, char __user *user_buf, |
@@ -430,9 +386,6 @@ ath5k_debug_init_device(struct ath5k_softc *sc) | |||
430 | sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO, | 386 | sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO, |
431 | sc->debug.debugfs_phydir, sc, &fops_registers); | 387 | sc->debug.debugfs_phydir, sc, &fops_registers); |
432 | 388 | ||
433 | sc->debug.debugfs_tsf = debugfs_create_file("tsf", S_IWUSR | S_IRUGO, | ||
434 | sc->debug.debugfs_phydir, sc, &fops_tsf); | ||
435 | |||
436 | sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO, | 389 | sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO, |
437 | sc->debug.debugfs_phydir, sc, &fops_beacon); | 390 | sc->debug.debugfs_phydir, sc, &fops_beacon); |
438 | 391 | ||
@@ -451,7 +404,6 @@ ath5k_debug_finish_device(struct ath5k_softc *sc) | |||
451 | { | 404 | { |
452 | debugfs_remove(sc->debug.debugfs_debug); | 405 | debugfs_remove(sc->debug.debugfs_debug); |
453 | debugfs_remove(sc->debug.debugfs_registers); | 406 | debugfs_remove(sc->debug.debugfs_registers); |
454 | debugfs_remove(sc->debug.debugfs_tsf); | ||
455 | debugfs_remove(sc->debug.debugfs_beacon); | 407 | debugfs_remove(sc->debug.debugfs_beacon); |
456 | debugfs_remove(sc->debug.debugfs_reset); | 408 | debugfs_remove(sc->debug.debugfs_reset); |
457 | debugfs_remove(sc->debug.debugfs_phydir); | 409 | debugfs_remove(sc->debug.debugfs_phydir); |