diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-14 11:37:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-15 15:05:57 -0400 |
commit | db2e6bd4e966a36c6b2f1921feb3537e8254415c (patch) | |
tree | 65e36578e232897b5cf5158d6fd450a86b5efa15 /net/mac80211/debugfs.c | |
parent | 3b319aae4244f9b4758212605f67cf63207a4fa1 (diff) |
mac80211: add queue debugfs file
I suspect that some driver bugs can cause queues to be
stopped while they shouldn't be, but it's hard to find
out whether that is the case or not without having any
visible information about the queues. This adds a file
to debugfs that allows us to see the queues' statuses.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs.c')
-rw-r--r-- | net/mac80211/debugfs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 11c72311f35b..6c439cd5ccea 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -163,6 +163,29 @@ static const struct file_operations noack_ops = { | |||
163 | .open = mac80211_open_file_generic | 163 | .open = mac80211_open_file_generic |
164 | }; | 164 | }; |
165 | 165 | ||
166 | static ssize_t queues_read(struct file *file, char __user *user_buf, | ||
167 | size_t count, loff_t *ppos) | ||
168 | { | ||
169 | struct ieee80211_local *local = file->private_data; | ||
170 | unsigned long flags; | ||
171 | char buf[IEEE80211_MAX_QUEUES * 20]; | ||
172 | int q, res = 0; | ||
173 | |||
174 | spin_lock_irqsave(&local->queue_stop_reason_lock, flags); | ||
175 | for (q = 0; q < local->hw.queues; q++) | ||
176 | res += sprintf(buf + res, "%02d: %#.8lx/%d\n", q, | ||
177 | local->queue_stop_reasons[q], | ||
178 | __netif_subqueue_stopped(local->mdev, q)); | ||
179 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | ||
180 | |||
181 | return simple_read_from_buffer(user_buf, count, ppos, buf, res); | ||
182 | } | ||
183 | |||
184 | static const struct file_operations queues_ops = { | ||
185 | .read = queues_read, | ||
186 | .open = mac80211_open_file_generic | ||
187 | }; | ||
188 | |||
166 | /* statistics stuff */ | 189 | /* statistics stuff */ |
167 | 190 | ||
168 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ | 191 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ |
@@ -298,6 +321,7 @@ void debugfs_hw_add(struct ieee80211_local *local) | |||
298 | DEBUGFS_ADD(total_ps_buffered); | 321 | DEBUGFS_ADD(total_ps_buffered); |
299 | DEBUGFS_ADD(wep_iv); | 322 | DEBUGFS_ADD(wep_iv); |
300 | DEBUGFS_ADD(tsf); | 323 | DEBUGFS_ADD(tsf); |
324 | DEBUGFS_ADD(queues); | ||
301 | DEBUGFS_ADD_MODE(reset, 0200); | 325 | DEBUGFS_ADD_MODE(reset, 0200); |
302 | DEBUGFS_ADD(noack); | 326 | DEBUGFS_ADD(noack); |
303 | 327 | ||
@@ -350,6 +374,7 @@ void debugfs_hw_del(struct ieee80211_local *local) | |||
350 | DEBUGFS_DEL(total_ps_buffered); | 374 | DEBUGFS_DEL(total_ps_buffered); |
351 | DEBUGFS_DEL(wep_iv); | 375 | DEBUGFS_DEL(wep_iv); |
352 | DEBUGFS_DEL(tsf); | 376 | DEBUGFS_DEL(tsf); |
377 | DEBUGFS_DEL(queues); | ||
353 | DEBUGFS_DEL(reset); | 378 | DEBUGFS_DEL(reset); |
354 | DEBUGFS_DEL(noack); | 379 | DEBUGFS_DEL(noack); |
355 | 380 | ||