diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-17 11:28:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 14:57:54 -0400 |
commit | 386aa23dd5f94b810210b9f849807946a5100b57 (patch) | |
tree | a098184eef6203e84739780c08614cb55796a9c7 /net | |
parent | f1d58c2521eb160178b2151d6326d8dc5d7c8560 (diff) |
mac80211: improve per-sta debugfs
We had code for a number of files, that we didn't publish
in debugfs, fix that. Also make the agg_status file layout
more readable and add more information to it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 98 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 17 |
2 files changed, 79 insertions, 36 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 90230c718b5b..33a2e892115b 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -120,45 +120,38 @@ STA_OPS(last_seq_ctrl); | |||
120 | static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, | 120 | static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, |
121 | size_t count, loff_t *ppos) | 121 | size_t count, loff_t *ppos) |
122 | { | 122 | { |
123 | char buf[768], *p = buf; | 123 | char buf[30 + STA_TID_NUM * 70], *p = buf; |
124 | int i; | 124 | int i; |
125 | struct sta_info *sta = file->private_data; | 125 | struct sta_info *sta = file->private_data; |
126 | p += scnprintf(p, sizeof(buf)+buf-p, "Agg state for STA is:\n"); | ||
127 | p += scnprintf(p, sizeof(buf)+buf-p, " STA next dialog_token is %d \n " | ||
128 | "TIDs info is: \n TID :", | ||
129 | (sta->ampdu_mlme.dialog_token_allocator + 1)); | ||
130 | for (i = 0; i < STA_TID_NUM; i++) | ||
131 | p += scnprintf(p, sizeof(buf)+buf-p, "%5d", i); | ||
132 | |||
133 | p += scnprintf(p, sizeof(buf)+buf-p, "\n RX :"); | ||
134 | for (i = 0; i < STA_TID_NUM; i++) | ||
135 | p += scnprintf(p, sizeof(buf)+buf-p, "%5d", | ||
136 | sta->ampdu_mlme.tid_state_rx[i]); | ||
137 | |||
138 | p += scnprintf(p, sizeof(buf)+buf-p, "\n DTKN:"); | ||
139 | for (i = 0; i < STA_TID_NUM; i++) | ||
140 | p += scnprintf(p, sizeof(buf)+buf-p, "%5d", | ||
141 | sta->ampdu_mlme.tid_state_rx[i] ? | ||
142 | sta->ampdu_mlme.tid_rx[i]->dialog_token : 0); | ||
143 | |||
144 | p += scnprintf(p, sizeof(buf)+buf-p, "\n TX :"); | ||
145 | for (i = 0; i < STA_TID_NUM; i++) | ||
146 | p += scnprintf(p, sizeof(buf)+buf-p, "%5d", | ||
147 | sta->ampdu_mlme.tid_state_tx[i]); | ||
148 | |||
149 | p += scnprintf(p, sizeof(buf)+buf-p, "\n DTKN:"); | ||
150 | for (i = 0; i < STA_TID_NUM; i++) | ||
151 | p += scnprintf(p, sizeof(buf)+buf-p, "%5d", | ||
152 | sta->ampdu_mlme.tid_state_tx[i] ? | ||
153 | sta->ampdu_mlme.tid_tx[i]->dialog_token : 0); | ||
154 | |||
155 | p += scnprintf(p, sizeof(buf)+buf-p, "\n SSN :"); | ||
156 | for (i = 0; i < STA_TID_NUM; i++) | ||
157 | p += scnprintf(p, sizeof(buf)+buf-p, "%5d", | ||
158 | sta->ampdu_mlme.tid_state_tx[i] ? | ||
159 | sta->ampdu_mlme.tid_tx[i]->ssn : 0); | ||
160 | 126 | ||
161 | p += scnprintf(p, sizeof(buf)+buf-p, "\n"); | 127 | spin_lock_bh(&sta->lock); |
128 | p += scnprintf(p, sizeof(buf)+buf-p, "next dialog_token is %#02x\n", | ||
129 | sta->ampdu_mlme.dialog_token_allocator + 1); | ||
130 | for (i = 0; i < STA_TID_NUM; i++) { | ||
131 | p += scnprintf(p, sizeof(buf)+buf-p, "TID %02d:", i); | ||
132 | p += scnprintf(p, sizeof(buf)+buf-p, " RX=%x", | ||
133 | sta->ampdu_mlme.tid_state_rx[i]); | ||
134 | p += scnprintf(p, sizeof(buf)+buf-p, "/DTKN=%#.2x", | ||
135 | sta->ampdu_mlme.tid_state_rx[i] ? | ||
136 | sta->ampdu_mlme.tid_rx[i]->dialog_token : 0); | ||
137 | p += scnprintf(p, sizeof(buf)+buf-p, "/SSN=%#.3x", | ||
138 | sta->ampdu_mlme.tid_state_rx[i] ? | ||
139 | sta->ampdu_mlme.tid_rx[i]->ssn : 0); | ||
140 | |||
141 | p += scnprintf(p, sizeof(buf)+buf-p, " TX=%x", | ||
142 | sta->ampdu_mlme.tid_state_tx[i]); | ||
143 | p += scnprintf(p, sizeof(buf)+buf-p, "/DTKN=%#.2x", | ||
144 | sta->ampdu_mlme.tid_state_tx[i] ? | ||
145 | sta->ampdu_mlme.tid_tx[i]->dialog_token : 0); | ||
146 | p += scnprintf(p, sizeof(buf)+buf-p, "/SSN=%#.3x", | ||
147 | sta->ampdu_mlme.tid_state_tx[i] ? | ||
148 | sta->ampdu_mlme.tid_tx[i]->ssn : 0); | ||
149 | p += scnprintf(p, sizeof(buf)+buf-p, "/pending=%03d", | ||
150 | sta->ampdu_mlme.tid_state_tx[i] ? | ||
151 | skb_queue_len(&sta->ampdu_mlme.tid_tx[i]->pending) : 0); | ||
152 | p += scnprintf(p, sizeof(buf)+buf-p, "\n"); | ||
153 | } | ||
154 | spin_unlock_bh(&sta->lock); | ||
162 | 155 | ||
163 | return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); | 156 | return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); |
164 | } | 157 | } |
@@ -203,6 +196,22 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
203 | DEBUGFS_ADD(inactive_ms); | 196 | DEBUGFS_ADD(inactive_ms); |
204 | DEBUGFS_ADD(last_seq_ctrl); | 197 | DEBUGFS_ADD(last_seq_ctrl); |
205 | DEBUGFS_ADD(agg_status); | 198 | DEBUGFS_ADD(agg_status); |
199 | DEBUGFS_ADD(dev); | ||
200 | DEBUGFS_ADD(rx_packets); | ||
201 | DEBUGFS_ADD(tx_packets); | ||
202 | DEBUGFS_ADD(rx_bytes); | ||
203 | DEBUGFS_ADD(tx_bytes); | ||
204 | DEBUGFS_ADD(rx_duplicates); | ||
205 | DEBUGFS_ADD(rx_fragments); | ||
206 | DEBUGFS_ADD(rx_dropped); | ||
207 | DEBUGFS_ADD(tx_fragments); | ||
208 | DEBUGFS_ADD(tx_filtered); | ||
209 | DEBUGFS_ADD(tx_retry_failed); | ||
210 | DEBUGFS_ADD(tx_retry_count); | ||
211 | DEBUGFS_ADD(last_signal); | ||
212 | DEBUGFS_ADD(last_qual); | ||
213 | DEBUGFS_ADD(last_noise); | ||
214 | DEBUGFS_ADD(wep_weak_iv_count); | ||
206 | } | 215 | } |
207 | 216 | ||
208 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) | 217 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) |
@@ -212,6 +221,23 @@ void ieee80211_sta_debugfs_remove(struct sta_info *sta) | |||
212 | DEBUGFS_DEL(inactive_ms); | 221 | DEBUGFS_DEL(inactive_ms); |
213 | DEBUGFS_DEL(last_seq_ctrl); | 222 | DEBUGFS_DEL(last_seq_ctrl); |
214 | DEBUGFS_DEL(agg_status); | 223 | DEBUGFS_DEL(agg_status); |
224 | DEBUGFS_DEL(aid); | ||
225 | DEBUGFS_DEL(dev); | ||
226 | DEBUGFS_DEL(rx_packets); | ||
227 | DEBUGFS_DEL(tx_packets); | ||
228 | DEBUGFS_DEL(rx_bytes); | ||
229 | DEBUGFS_DEL(tx_bytes); | ||
230 | DEBUGFS_DEL(rx_duplicates); | ||
231 | DEBUGFS_DEL(rx_fragments); | ||
232 | DEBUGFS_DEL(rx_dropped); | ||
233 | DEBUGFS_DEL(tx_fragments); | ||
234 | DEBUGFS_DEL(tx_filtered); | ||
235 | DEBUGFS_DEL(tx_retry_failed); | ||
236 | DEBUGFS_DEL(tx_retry_count); | ||
237 | DEBUGFS_DEL(last_signal); | ||
238 | DEBUGFS_DEL(last_qual); | ||
239 | DEBUGFS_DEL(last_noise); | ||
240 | DEBUGFS_DEL(wep_weak_iv_count); | ||
215 | 241 | ||
216 | debugfs_remove(sta->debugfs.dir); | 242 | debugfs_remove(sta->debugfs.dir); |
217 | sta->debugfs.dir = NULL; | 243 | sta->debugfs.dir = NULL; |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 49a1a1f76511..4ecf10a9bd00 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -308,6 +308,23 @@ struct sta_info { | |||
308 | struct dentry *inactive_ms; | 308 | struct dentry *inactive_ms; |
309 | struct dentry *last_seq_ctrl; | 309 | struct dentry *last_seq_ctrl; |
310 | struct dentry *agg_status; | 310 | struct dentry *agg_status; |
311 | struct dentry *aid; | ||
312 | struct dentry *dev; | ||
313 | struct dentry *rx_packets; | ||
314 | struct dentry *tx_packets; | ||
315 | struct dentry *rx_bytes; | ||
316 | struct dentry *tx_bytes; | ||
317 | struct dentry *rx_duplicates; | ||
318 | struct dentry *rx_fragments; | ||
319 | struct dentry *rx_dropped; | ||
320 | struct dentry *tx_fragments; | ||
321 | struct dentry *tx_filtered; | ||
322 | struct dentry *tx_retry_failed; | ||
323 | struct dentry *tx_retry_count; | ||
324 | struct dentry *last_signal; | ||
325 | struct dentry *last_qual; | ||
326 | struct dentry *last_noise; | ||
327 | struct dentry *wep_weak_iv_count; | ||
311 | bool add_has_run; | 328 | bool add_has_run; |
312 | } debugfs; | 329 | } debugfs; |
313 | #endif | 330 | #endif |