aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2010-09-14 15:46:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-16 15:45:50 -0400
commit3905751243fd84340e027672d2f603e9009d490e (patch)
tree2397fe5c3c8b21fdacc367ef1589959058fab6ca /drivers/net/wireless/ath/ath9k/debug.c
parentcfda669519241fccd5aa66c5a12bdae3dd04d5cd (diff)
ath9k: Print rxfilter in debugfs.
Print raw and decoded rxfilter in debufs 'wiphy' file. Also, move variable-length printouts to bottom of file to make bounds checking easier. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c53
1 files changed, 43 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 54aae931424e..d65a896a421d 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -492,12 +492,55 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
492 unsigned int len = 0; 492 unsigned int len = 0;
493 int i; 493 int i;
494 u8 addr[ETH_ALEN]; 494 u8 addr[ETH_ALEN];
495 u32 tmp;
495 496
496 len += snprintf(buf + len, sizeof(buf) - len, 497 len += snprintf(buf + len, sizeof(buf) - len,
497 "primary: %s (%s chan=%d ht=%d)\n", 498 "primary: %s (%s chan=%d ht=%d)\n",
498 wiphy_name(sc->pri_wiphy->hw->wiphy), 499 wiphy_name(sc->pri_wiphy->hw->wiphy),
499 ath_wiphy_state_str(sc->pri_wiphy->state), 500 ath_wiphy_state_str(sc->pri_wiphy->state),
500 sc->pri_wiphy->chan_idx, sc->pri_wiphy->chan_is_ht); 501 sc->pri_wiphy->chan_idx, sc->pri_wiphy->chan_is_ht);
502
503 put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr);
504 put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4);
505 len += snprintf(buf + len, sizeof(buf) - len,
506 "addr: %pM\n", addr);
507 put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_BSSMSKL), addr);
508 put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_BSSMSKU) & 0xffff, addr + 4);
509 len += snprintf(buf + len, sizeof(buf) - len,
510 "addrmask: %pM\n", addr);
511 tmp = ath9k_hw_getrxfilter(sc->sc_ah);
512 len += snprintf(buf + len, sizeof(buf) - len,
513 "rfilt: 0x%x", tmp);
514 if (tmp & ATH9K_RX_FILTER_UCAST)
515 len += snprintf(buf + len, sizeof(buf) - len, " UCAST");
516 if (tmp & ATH9K_RX_FILTER_MCAST)
517 len += snprintf(buf + len, sizeof(buf) - len, " MCAST");
518 if (tmp & ATH9K_RX_FILTER_BCAST)
519 len += snprintf(buf + len, sizeof(buf) - len, " BCAST");
520 if (tmp & ATH9K_RX_FILTER_CONTROL)
521 len += snprintf(buf + len, sizeof(buf) - len, " CONTROL");
522 if (tmp & ATH9K_RX_FILTER_BEACON)
523 len += snprintf(buf + len, sizeof(buf) - len, " BEACON");
524 if (tmp & ATH9K_RX_FILTER_PROM)
525 len += snprintf(buf + len, sizeof(buf) - len, " PROM");
526 if (tmp & ATH9K_RX_FILTER_PROBEREQ)
527 len += snprintf(buf + len, sizeof(buf) - len, " PROBEREQ");
528 if (tmp & ATH9K_RX_FILTER_PHYERR)
529 len += snprintf(buf + len, sizeof(buf) - len, " PHYERR");
530 if (tmp & ATH9K_RX_FILTER_MYBEACON)
531 len += snprintf(buf + len, sizeof(buf) - len, " MYBEACON");
532 if (tmp & ATH9K_RX_FILTER_COMP_BAR)
533 len += snprintf(buf + len, sizeof(buf) - len, " COMP_BAR");
534 if (tmp & ATH9K_RX_FILTER_PSPOLL)
535 len += snprintf(buf + len, sizeof(buf) - len, " PSPOLL");
536 if (tmp & ATH9K_RX_FILTER_PHYRADAR)
537 len += snprintf(buf + len, sizeof(buf) - len, " PHYRADAR");
538 if (tmp & ATH9K_RX_FILTER_MCAST_BCAST_ALL)
539 len += snprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL\n");
540 else
541 len += snprintf(buf + len, sizeof(buf) - len, "\n");
542
543 /* Put variable-length stuff down here, and check for overflows. */
501 for (i = 0; i < sc->num_sec_wiphy; i++) { 544 for (i = 0; i < sc->num_sec_wiphy; i++) {
502 struct ath_wiphy *aphy = sc->sec_wiphy[i]; 545 struct ath_wiphy *aphy = sc->sec_wiphy[i];
503 if (aphy == NULL) 546 if (aphy == NULL)
@@ -508,16 +551,6 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
508 ath_wiphy_state_str(aphy->state), 551 ath_wiphy_state_str(aphy->state),
509 aphy->chan_idx, aphy->chan_is_ht); 552 aphy->chan_idx, aphy->chan_is_ht);
510 } 553 }
511
512 put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr);
513 put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4);
514 len += snprintf(buf + len, sizeof(buf) - len,
515 "addr: %pM\n", addr);
516 put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_BSSMSKL), addr);
517 put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_BSSMSKU) & 0xffff, addr + 4);
518 len += snprintf(buf + len, sizeof(buf) - len,
519 "addrmask: %pM\n", addr);
520
521 if (len > sizeof(buf)) 554 if (len > sizeof(buf))
522 len = sizeof(buf); 555 len = sizeof(buf);
523 556