diff options
author | Ben Greear <greearb@candelatech.com> | 2010-09-21 20:03:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-27 15:57:36 -0400 |
commit | 87fd2e6c90acb45a5741207fc953190596f93841 (patch) | |
tree | 766d1ebdee86186004563553f6780f3f4f1b6d62 /drivers | |
parent | 9cf13668a5f8165a81349defc5f82c57a4a8279b (diff) |
ath5k: Add bssid mask and rxfilter to debugfs.
Helps with debugging virtual interfaces.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/debug.c | 58 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/debug.h | 1 |
2 files changed, 59 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index 6583a82a0783..0f06e8490314 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c | |||
@@ -483,6 +483,59 @@ static const struct file_operations fops_antenna = { | |||
483 | .owner = THIS_MODULE, | 483 | .owner = THIS_MODULE, |
484 | }; | 484 | }; |
485 | 485 | ||
486 | /* debugfs: misc */ | ||
487 | |||
488 | static ssize_t read_file_misc(struct file *file, char __user *user_buf, | ||
489 | size_t count, loff_t *ppos) | ||
490 | { | ||
491 | struct ath5k_softc *sc = file->private_data; | ||
492 | char buf[700]; | ||
493 | unsigned int len = 0; | ||
494 | u32 filt = ath5k_hw_get_rx_filter(sc->ah); | ||
495 | |||
496 | len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n", | ||
497 | sc->bssidmask); | ||
498 | len += snprintf(buf+len, sizeof(buf)-len, "filter-flags: 0x%x ", | ||
499 | filt); | ||
500 | if (filt & AR5K_RX_FILTER_UCAST) | ||
501 | len += snprintf(buf+len, sizeof(buf)-len, " UCAST"); | ||
502 | if (filt & AR5K_RX_FILTER_MCAST) | ||
503 | len += snprintf(buf+len, sizeof(buf)-len, " MCAST"); | ||
504 | if (filt & AR5K_RX_FILTER_BCAST) | ||
505 | len += snprintf(buf+len, sizeof(buf)-len, " BCAST"); | ||
506 | if (filt & AR5K_RX_FILTER_CONTROL) | ||
507 | len += snprintf(buf+len, sizeof(buf)-len, " CONTROL"); | ||
508 | if (filt & AR5K_RX_FILTER_BEACON) | ||
509 | len += snprintf(buf+len, sizeof(buf)-len, " BEACON"); | ||
510 | if (filt & AR5K_RX_FILTER_PROM) | ||
511 | len += snprintf(buf+len, sizeof(buf)-len, " PROM"); | ||
512 | if (filt & AR5K_RX_FILTER_XRPOLL) | ||
513 | len += snprintf(buf+len, sizeof(buf)-len, " XRPOLL"); | ||
514 | if (filt & AR5K_RX_FILTER_PROBEREQ) | ||
515 | len += snprintf(buf+len, sizeof(buf)-len, " PROBEREQ"); | ||
516 | if (filt & AR5K_RX_FILTER_PHYERR_5212) | ||
517 | len += snprintf(buf+len, sizeof(buf)-len, " PHYERR-5212"); | ||
518 | if (filt & AR5K_RX_FILTER_RADARERR_5212) | ||
519 | len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5212"); | ||
520 | if (filt & AR5K_RX_FILTER_PHYERR_5211) | ||
521 | snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211"); | ||
522 | if (filt & AR5K_RX_FILTER_RADARERR_5211) | ||
523 | len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n"); | ||
524 | else | ||
525 | len += snprintf(buf+len, sizeof(buf)-len, "\n"); | ||
526 | |||
527 | if (len > sizeof(buf)) | ||
528 | len = sizeof(buf); | ||
529 | |||
530 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
531 | } | ||
532 | |||
533 | static const struct file_operations fops_misc = { | ||
534 | .read = read_file_misc, | ||
535 | .open = ath5k_debugfs_open, | ||
536 | .owner = THIS_MODULE, | ||
537 | }; | ||
538 | |||
486 | 539 | ||
487 | /* debugfs: frameerrors */ | 540 | /* debugfs: frameerrors */ |
488 | 541 | ||
@@ -856,6 +909,10 @@ ath5k_debug_init_device(struct ath5k_softc *sc) | |||
856 | S_IWUSR | S_IRUSR, | 909 | S_IWUSR | S_IRUSR, |
857 | sc->debug.debugfs_phydir, sc, &fops_antenna); | 910 | sc->debug.debugfs_phydir, sc, &fops_antenna); |
858 | 911 | ||
912 | sc->debug.debugfs_misc = debugfs_create_file("misc", | ||
913 | S_IRUSR, | ||
914 | sc->debug.debugfs_phydir, sc, &fops_misc); | ||
915 | |||
859 | sc->debug.debugfs_frameerrors = debugfs_create_file("frameerrors", | 916 | sc->debug.debugfs_frameerrors = debugfs_create_file("frameerrors", |
860 | S_IWUSR | S_IRUSR, | 917 | S_IWUSR | S_IRUSR, |
861 | sc->debug.debugfs_phydir, sc, | 918 | sc->debug.debugfs_phydir, sc, |
@@ -886,6 +943,7 @@ ath5k_debug_finish_device(struct ath5k_softc *sc) | |||
886 | debugfs_remove(sc->debug.debugfs_beacon); | 943 | debugfs_remove(sc->debug.debugfs_beacon); |
887 | debugfs_remove(sc->debug.debugfs_reset); | 944 | debugfs_remove(sc->debug.debugfs_reset); |
888 | debugfs_remove(sc->debug.debugfs_antenna); | 945 | debugfs_remove(sc->debug.debugfs_antenna); |
946 | debugfs_remove(sc->debug.debugfs_misc); | ||
889 | debugfs_remove(sc->debug.debugfs_frameerrors); | 947 | debugfs_remove(sc->debug.debugfs_frameerrors); |
890 | debugfs_remove(sc->debug.debugfs_ani); | 948 | debugfs_remove(sc->debug.debugfs_ani); |
891 | debugfs_remove(sc->debug.debugfs_queue); | 949 | debugfs_remove(sc->debug.debugfs_queue); |
diff --git a/drivers/net/wireless/ath/ath5k/debug.h b/drivers/net/wireless/ath/ath5k/debug.h index 9b22722a95f0..4f078b134015 100644 --- a/drivers/net/wireless/ath/ath5k/debug.h +++ b/drivers/net/wireless/ath/ath5k/debug.h | |||
@@ -75,6 +75,7 @@ struct ath5k_dbg_info { | |||
75 | struct dentry *debugfs_beacon; | 75 | struct dentry *debugfs_beacon; |
76 | struct dentry *debugfs_reset; | 76 | struct dentry *debugfs_reset; |
77 | struct dentry *debugfs_antenna; | 77 | struct dentry *debugfs_antenna; |
78 | struct dentry *debugfs_misc; | ||
78 | struct dentry *debugfs_frameerrors; | 79 | struct dentry *debugfs_frameerrors; |
79 | struct dentry *debugfs_ani; | 80 | struct dentry *debugfs_ani; |
80 | struct dentry *debugfs_queue; | 81 | struct dentry *debugfs_queue; |