aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-02-16 01:21:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:05:42 -0500
commitf8b815dc0e0942c45919d814e319c14c1221fa81 (patch)
tree887ba028b29f88d5c4b20a603218a92edb2dae4d
parent6bcf6f647b456dc037238137c0db2917e5d8c525 (diff)
ath9k: Add a debugfs file to display reset statistics
Location: <debugfs_path>/ieee80211/phy#/ath9k/reset Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index b2c60690255a..fe1f55f7c292 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -750,6 +750,38 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
750 return retval; 750 return retval;
751} 751}
752 752
753static ssize_t read_file_reset(struct file *file, char __user *user_buf,
754 size_t count, loff_t *ppos)
755{
756 struct ath_softc *sc = file->private_data;
757 char buf[512];
758 unsigned int len = 0;
759
760 len += snprintf(buf + len, sizeof(buf) - len,
761 "%17s: %2d\n", "Baseband Hang",
762 sc->debug.stats.reset[RESET_TYPE_BB_HANG]);
763 len += snprintf(buf + len, sizeof(buf) - len,
764 "%17s: %2d\n", "Baseband Watchdog",
765 sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG]);
766 len += snprintf(buf + len, sizeof(buf) - len,
767 "%17s: %2d\n", "Fatal HW Error",
768 sc->debug.stats.reset[RESET_TYPE_FATAL_INT]);
769 len += snprintf(buf + len, sizeof(buf) - len,
770 "%17s: %2d\n", "TX HW error",
771 sc->debug.stats.reset[RESET_TYPE_TX_ERROR]);
772 len += snprintf(buf + len, sizeof(buf) - len,
773 "%17s: %2d\n", "TX Path Hang",
774 sc->debug.stats.reset[RESET_TYPE_TX_HANG]);
775 len += snprintf(buf + len, sizeof(buf) - len,
776 "%17s: %2d\n", "PLL RX Hang",
777 sc->debug.stats.reset[RESET_TYPE_PLL_HANG]);
778
779 if (len > sizeof(buf))
780 len = sizeof(buf);
781
782 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
783}
784
753void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, 785void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
754 struct ath_tx_status *ts, struct ath_txq *txq, 786 struct ath_tx_status *ts, struct ath_txq *txq,
755 unsigned int flags) 787 unsigned int flags)
@@ -837,6 +869,13 @@ static const struct file_operations fops_misc = {
837 .llseek = default_llseek, 869 .llseek = default_llseek,
838}; 870};
839 871
872static const struct file_operations fops_reset = {
873 .read = read_file_reset,
874 .open = ath9k_debugfs_open,
875 .owner = THIS_MODULE,
876 .llseek = default_llseek,
877};
878
840static ssize_t read_file_recv(struct file *file, char __user *user_buf, 879static ssize_t read_file_recv(struct file *file, char __user *user_buf,
841 size_t count, loff_t *ppos) 880 size_t count, loff_t *ppos)
842{ 881{
@@ -1549,6 +1588,8 @@ int ath9k_init_debug(struct ath_hw *ah)
1549 &fops_stations); 1588 &fops_stations);
1550 debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, 1589 debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc,
1551 &fops_misc); 1590 &fops_misc);
1591 debugfs_create_file("reset", S_IRUSR, sc->debug.debugfs_phy, sc,
1592 &fops_reset);
1552 debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc, 1593 debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc,
1553 &fops_recv); 1594 &fops_recv);
1554 debugfs_create_file("rx_chainmask", S_IRUSR | S_IWUSR, 1595 debugfs_create_file("rx_chainmask", S_IRUSR | S_IWUSR,