diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 53 |
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 | ||
561 | static 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 | |||
561 | static ssize_t read_file_stations(struct file *file, char __user *user_buf, | 605 | static 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 | ||
875 | static 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 | |||
831 | static const struct file_operations fops_stations = { | 882 | static 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, |