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>
This commit is contained in:

committed by
John W. Linville

parent
3978e5bce6
commit
3b5d665b51
@@ -193,50 +193,6 @@ static const struct file_operations fops_registers = {
|
||||
};
|
||||
|
||||
|
||||
/* debugfs: TSF */
|
||||
|
||||
static ssize_t read_file_tsf(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct ath5k_softc *sc = file->private_data;
|
||||
char buf[100];
|
||||
snprintf(buf, sizeof(buf), "0x%016llx\n",
|
||||
(unsigned long long)ath5k_hw_get_tsf64(sc->ah));
|
||||
return simple_read_from_buffer(user_buf, count, ppos, buf, 19);
|
||||
}
|
||||
|
||||
static ssize_t write_file_tsf(struct file *file,
|
||||
const char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct ath5k_softc *sc = file->private_data;
|
||||
char buf[21];
|
||||
unsigned long long tsf;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static const struct file_operations fops_tsf = {
|
||||
.read = read_file_tsf,
|
||||
.write = write_file_tsf,
|
||||
.open = ath5k_debugfs_open,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
/* debugfs: beacons */
|
||||
|
||||
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)
|
||||
sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO,
|
||||
sc->debug.debugfs_phydir, sc, &fops_registers);
|
||||
|
||||
sc->debug.debugfs_tsf = debugfs_create_file("tsf", S_IWUSR | S_IRUGO,
|
||||
sc->debug.debugfs_phydir, sc, &fops_tsf);
|
||||
|
||||
sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO,
|
||||
sc->debug.debugfs_phydir, sc, &fops_beacon);
|
||||
|
||||
@@ -451,7 +404,6 @@ ath5k_debug_finish_device(struct ath5k_softc *sc)
|
||||
{
|
||||
debugfs_remove(sc->debug.debugfs_debug);
|
||||
debugfs_remove(sc->debug.debugfs_registers);
|
||||
debugfs_remove(sc->debug.debugfs_tsf);
|
||||
debugfs_remove(sc->debug.debugfs_beacon);
|
||||
debugfs_remove(sc->debug.debugfs_reset);
|
||||
debugfs_remove(sc->debug.debugfs_phydir);
|
||||
|
Reference in New Issue
Block a user