diff options
author | Bruno Randolf <br1@einfach.org> | 2010-09-16 22:36:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-21 11:05:09 -0400 |
commit | cfddc11c429a655e418ffc111372cc69dee6a1a5 (patch) | |
tree | 5e6490aa9accb4e713d4c102f38d34023136cecc /drivers/net/wireless | |
parent | 925e0b061300c94912be36eac16f0b44249a1add (diff) |
ath5k: Fix queue debug file
Take txq lock in debug file and fix reporting of used buffers.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/debug.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index 1b7c6d7fde93..b2c610ba8b7e 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c | |||
@@ -763,7 +763,7 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf, | |||
763 | 763 | ||
764 | struct ath5k_txq *txq; | 764 | struct ath5k_txq *txq; |
765 | struct ath5k_buf *bf, *bf0; | 765 | struct ath5k_buf *bf, *bf0; |
766 | int i, n = 0; | 766 | int i, n; |
767 | 767 | ||
768 | len += snprintf(buf+len, sizeof(buf)-len, | 768 | len += snprintf(buf+len, sizeof(buf)-len, |
769 | "available txbuffers: %d\n", sc->txbuf_len); | 769 | "available txbuffers: %d\n", sc->txbuf_len); |
@@ -777,9 +777,14 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf, | |||
777 | if (!txq->setup) | 777 | if (!txq->setup) |
778 | continue; | 778 | continue; |
779 | 779 | ||
780 | n = 0; | ||
781 | spin_lock_bh(&txq->lock); | ||
780 | list_for_each_entry_safe(bf, bf0, &txq->q, list) | 782 | list_for_each_entry_safe(bf, bf0, &txq->q, list) |
781 | n++; | 783 | n++; |
782 | len += snprintf(buf+len, sizeof(buf)-len, " len: %d\n", n); | 784 | spin_unlock_bh(&txq->lock); |
785 | |||
786 | len += snprintf(buf+len, sizeof(buf)-len, | ||
787 | " len: %d bufs: %d\n", txq->txq_len, n); | ||
783 | } | 788 | } |
784 | 789 | ||
785 | if (len > sizeof(buf)) | 790 | if (len > sizeof(buf)) |