diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index d65a896a421d..74a4570dc87f 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -488,6 +488,8 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf, | |||
488 | size_t count, loff_t *ppos) | 488 | size_t count, loff_t *ppos) |
489 | { | 489 | { |
490 | struct ath_softc *sc = file->private_data; | 490 | struct ath_softc *sc = file->private_data; |
491 | struct ath_wiphy *aphy = sc->pri_wiphy; | ||
492 | struct ieee80211_channel *chan = aphy->hw->conf.channel; | ||
491 | char buf[512]; | 493 | char buf[512]; |
492 | unsigned int len = 0; | 494 | unsigned int len = 0; |
493 | int i; | 495 | int i; |
@@ -498,7 +500,8 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf, | |||
498 | "primary: %s (%s chan=%d ht=%d)\n", | 500 | "primary: %s (%s chan=%d ht=%d)\n", |
499 | wiphy_name(sc->pri_wiphy->hw->wiphy), | 501 | wiphy_name(sc->pri_wiphy->hw->wiphy), |
500 | ath_wiphy_state_str(sc->pri_wiphy->state), | 502 | ath_wiphy_state_str(sc->pri_wiphy->state), |
501 | sc->pri_wiphy->chan_idx, sc->pri_wiphy->chan_is_ht); | 503 | ieee80211_frequency_to_channel(chan->center_freq), |
504 | aphy->chan_is_ht); | ||
502 | 505 | ||
503 | put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr); | 506 | 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); | 507 | put_unaligned_le16(REG_READ_D(sc->sc_ah, AR_STA_ID1) & 0xffff, addr + 4); |
@@ -545,11 +548,13 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf, | |||
545 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; | 548 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; |
546 | if (aphy == NULL) | 549 | if (aphy == NULL) |
547 | continue; | 550 | continue; |
551 | chan = aphy->hw->conf.channel; | ||
548 | len += snprintf(buf + len, sizeof(buf) - len, | 552 | len += snprintf(buf + len, sizeof(buf) - len, |
549 | "secondary: %s (%s chan=%d ht=%d)\n", | 553 | "secondary: %s (%s chan=%d ht=%d)\n", |
550 | wiphy_name(aphy->hw->wiphy), | 554 | wiphy_name(aphy->hw->wiphy), |
551 | ath_wiphy_state_str(aphy->state), | 555 | ath_wiphy_state_str(aphy->state), |
552 | aphy->chan_idx, aphy->chan_is_ht); | 556 | ieee80211_frequency_to_channel(chan->center_freq), |
557 | aphy->chan_is_ht); | ||
553 | } | 558 | } |
554 | if (len > sizeof(buf)) | 559 | if (len > sizeof(buf)) |
555 | len = sizeof(buf); | 560 | len = sizeof(buf); |
@@ -696,6 +701,8 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | |||
696 | PR("DESC CFG Error: ", desc_cfg_err); | 701 | PR("DESC CFG Error: ", desc_cfg_err); |
697 | PR("DATA Underrun: ", data_underrun); | 702 | PR("DATA Underrun: ", data_underrun); |
698 | PR("DELIM Underrun: ", delim_underrun); | 703 | PR("DELIM Underrun: ", delim_underrun); |
704 | PR("TX-Pkts-All: ", tx_pkts_all); | ||
705 | PR("TX-Bytes-All: ", tx_bytes_all); | ||
699 | 706 | ||
700 | if (len > size) | 707 | if (len > size) |
701 | len = size; | 708 | len = size; |
@@ -709,6 +716,9 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | |||
709 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq, | 716 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq, |
710 | struct ath_buf *bf, struct ath_tx_status *ts) | 717 | struct ath_buf *bf, struct ath_tx_status *ts) |
711 | { | 718 | { |
719 | TX_STAT_INC(txq->axq_qnum, tx_pkts_all); | ||
720 | sc->debug.stats.txstats[txq->axq_qnum].tx_bytes_all += bf->bf_mpdu->len; | ||
721 | |||
712 | if (bf_isampdu(bf)) { | 722 | if (bf_isampdu(bf)) { |
713 | if (bf_isxretried(bf)) | 723 | if (bf_isxretried(bf)) |
714 | TX_STAT_INC(txq->axq_qnum, a_xretries); | 724 | TX_STAT_INC(txq->axq_qnum, a_xretries); |
@@ -803,6 +813,13 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
803 | PHY_ERR("HT-LENGTH", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); | 813 | PHY_ERR("HT-LENGTH", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); |
804 | PHY_ERR("HT-RATE", ATH9K_PHYERR_HT_RATE_ILLEGAL); | 814 | PHY_ERR("HT-RATE", ATH9K_PHYERR_HT_RATE_ILLEGAL); |
805 | 815 | ||
816 | len += snprintf(buf + len, size - len, | ||
817 | "%18s : %10u\n", "RX-Pkts-All", | ||
818 | sc->debug.stats.rxstats.rx_pkts_all); | ||
819 | len += snprintf(buf + len, size - len, | ||
820 | "%18s : %10u\n", "RX-Bytes-All", | ||
821 | sc->debug.stats.rxstats.rx_bytes_all); | ||
822 | |||
806 | if (len > size) | 823 | if (len > size) |
807 | len = size; | 824 | len = size; |
808 | 825 | ||
@@ -821,6 +838,9 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) | |||
821 | 838 | ||
822 | u32 phyerr; | 839 | u32 phyerr; |
823 | 840 | ||
841 | RX_STAT_INC(rx_pkts_all); | ||
842 | sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen; | ||
843 | |||
824 | if (rs->rs_status & ATH9K_RXERR_CRC) | 844 | if (rs->rs_status & ATH9K_RXERR_CRC) |
825 | RX_STAT_INC(crc_err); | 845 | RX_STAT_INC(crc_err); |
826 | if (rs->rs_status & ATH9K_RXERR_DECRYPT) | 846 | if (rs->rs_status & ATH9K_RXERR_DECRYPT) |