aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-11-21 07:43:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-21 14:16:03 -0500
commitc0b74876ee4873dc89d80b59f5e890a1d0a87be1 (patch)
tree089c65ca89e03a436ab48ff518a4a261f60bfe16 /drivers/net/wireless/ath/ath9k/debug.c
parent78ef731ce549dd9baf6eba8cf52f61727613690a (diff)
ath9k: Add a debugfs file to dump queue statistics
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.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, 53 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index f9df82bdd213..086dee841622 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -558,6 +558,50 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
558 return retval; 558 return retval;
559} 559}
560 560
561static ssize_t read_file_queues(struct file *file, char __user *user_buf,
562 size_t count, loff_t *ppos)
563{
564 struct ath_softc *sc = file->private_data;
565 struct ath_txq *txq;
566 char *buf;
567 unsigned int len = 0, size = 1024;
568 ssize_t retval = 0;
569 int i;
570 char *qname[4] = {"VO", "VI", "BE", "BK"};
571
572 buf = kzalloc(size, GFP_KERNEL);
573 if (buf == NULL)
574 return -ENOMEM;
575
576 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
577 txq = sc->tx.txq_map[i];
578 len += snprintf(buf + len, size - len, "(%s): ", qname[i]);
579
580 ath_txq_lock(sc, txq);
581
582 len += snprintf(buf + len, size - len, "%s: %d ",
583 "qnum", txq->axq_qnum);
584 len += snprintf(buf + len, size - len, "%s: %2d ",
585 "qdepth", txq->axq_depth);
586 len += snprintf(buf + len, size - len, "%s: %2d ",
587 "ampdu-depth", txq->axq_ampdu_depth);
588 len += snprintf(buf + len, size - len, "%s: %3d ",
589 "pending", txq->pending_frames);
590 len += snprintf(buf + len, size - len, "%s: %d\n",
591 "stopped", txq->stopped);
592
593 ath_txq_unlock(sc, txq);
594 }
595
596 if (len > size)
597 len = size;
598
599 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
600 kfree(buf);
601
602 return retval;
603}
604
561static ssize_t read_file_stations(struct file *file, char __user *user_buf, 605static ssize_t read_file_stations(struct file *file, char __user *user_buf,
562 size_t count, loff_t *ppos) 606 size_t count, loff_t *ppos)
563{ 607{
@@ -828,6 +872,13 @@ static const struct file_operations fops_xmit = {
828 .llseek = default_llseek, 872 .llseek = default_llseek,
829}; 873};
830 874
875static const struct file_operations fops_queues = {
876 .read = read_file_queues,
877 .open = simple_open,
878 .owner = THIS_MODULE,
879 .llseek = default_llseek,
880};
881
831static const struct file_operations fops_stations = { 882static const struct file_operations fops_stations = {
832 .read = read_file_stations, 883 .read = read_file_stations,
833 .open = simple_open, 884 .open = simple_open,
@@ -1553,6 +1604,8 @@ int ath9k_init_debug(struct ath_hw *ah)
1553 &fops_interrupt); 1604 &fops_interrupt);
1554 debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, 1605 debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc,
1555 &fops_xmit); 1606 &fops_xmit);
1607 debugfs_create_file("queues", S_IRUSR, sc->debug.debugfs_phy, sc,
1608 &fops_queues);
1556 debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1609 debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
1557 &sc->tx.txq_max_pending[IEEE80211_AC_BK]); 1610 &sc->tx.txq_max_pending[IEEE80211_AC_BK]);
1558 debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1611 debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,