diff options
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 65 |
1 files changed, 28 insertions, 37 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index e763f1529ddb..76839d4dfaac 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -30,7 +30,6 @@ static ssize_t sta_ ##name## _read(struct file *file, \ | |||
30 | } | 30 | } |
31 | #define STA_READ_D(name, field) STA_READ(name, 20, field, "%d\n") | 31 | #define STA_READ_D(name, field) STA_READ(name, 20, field, "%d\n") |
32 | #define STA_READ_U(name, field) STA_READ(name, 20, field, "%u\n") | 32 | #define STA_READ_U(name, field) STA_READ(name, 20, field, "%u\n") |
33 | #define STA_READ_LU(name, field) STA_READ(name, 20, field, "%lu\n") | ||
34 | #define STA_READ_S(name, field) STA_READ(name, 20, field, "%s\n") | 33 | #define STA_READ_S(name, field) STA_READ(name, 20, field, "%s\n") |
35 | 34 | ||
36 | #define STA_OPS(name) \ | 35 | #define STA_OPS(name) \ |
@@ -52,19 +51,7 @@ static const struct file_operations sta_ ##name## _ops = { \ | |||
52 | 51 | ||
53 | STA_FILE(aid, sta.aid, D); | 52 | STA_FILE(aid, sta.aid, D); |
54 | STA_FILE(dev, sdata->name, S); | 53 | STA_FILE(dev, sdata->name, S); |
55 | STA_FILE(rx_packets, rx_packets, LU); | ||
56 | STA_FILE(tx_packets, tx_packets, LU); | ||
57 | STA_FILE(rx_bytes, rx_bytes, LU); | ||
58 | STA_FILE(tx_bytes, tx_bytes, LU); | ||
59 | STA_FILE(rx_duplicates, num_duplicates, LU); | ||
60 | STA_FILE(rx_fragments, rx_fragments, LU); | ||
61 | STA_FILE(rx_dropped, rx_dropped, LU); | ||
62 | STA_FILE(tx_fragments, tx_fragments, LU); | ||
63 | STA_FILE(tx_filtered, tx_filtered_count, LU); | ||
64 | STA_FILE(tx_retry_failed, tx_retry_failed, LU); | ||
65 | STA_FILE(tx_retry_count, tx_retry_count, LU); | ||
66 | STA_FILE(last_signal, last_signal, D); | 54 | STA_FILE(last_signal, last_signal, D); |
67 | STA_FILE(wep_weak_iv_count, wep_weak_iv_count, LU); | ||
68 | 55 | ||
69 | static ssize_t sta_flags_read(struct file *file, char __user *userbuf, | 56 | static ssize_t sta_flags_read(struct file *file, char __user *userbuf, |
70 | size_t count, loff_t *ppos) | 57 | size_t count, loff_t *ppos) |
@@ -134,28 +121,25 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, | |||
134 | p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n", | 121 | p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n", |
135 | sta->ampdu_mlme.dialog_token_allocator + 1); | 122 | sta->ampdu_mlme.dialog_token_allocator + 1); |
136 | p += scnprintf(p, sizeof(buf) + buf - p, | 123 | p += scnprintf(p, sizeof(buf) + buf - p, |
137 | "TID\t\tRX active\tDTKN\tSSN\t\tTX\tDTKN\tSSN\tpending\n"); | 124 | "TID\t\tRX active\tDTKN\tSSN\t\tTX\tDTKN\tpending\n"); |
138 | for (i = 0; i < STA_TID_NUM; i++) { | 125 | for (i = 0; i < STA_TID_NUM; i++) { |
139 | p += scnprintf(p, sizeof(buf) + buf - p, "%02d", i); | 126 | p += scnprintf(p, sizeof(buf) + buf - p, "%02d", i); |
140 | p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", | 127 | p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", |
141 | sta->ampdu_mlme.tid_active_rx[i]); | 128 | !!sta->ampdu_mlme.tid_rx[i]); |
142 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", | 129 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", |
143 | sta->ampdu_mlme.tid_active_rx[i] ? | 130 | sta->ampdu_mlme.tid_rx[i] ? |
144 | sta->ampdu_mlme.tid_rx[i]->dialog_token : 0); | 131 | sta->ampdu_mlme.tid_rx[i]->dialog_token : 0); |
145 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x", | 132 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x", |
146 | sta->ampdu_mlme.tid_active_rx[i] ? | 133 | sta->ampdu_mlme.tid_rx[i] ? |
147 | sta->ampdu_mlme.tid_rx[i]->ssn : 0); | 134 | sta->ampdu_mlme.tid_rx[i]->ssn : 0); |
148 | 135 | ||
149 | p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", | 136 | p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", |
150 | sta->ampdu_mlme.tid_state_tx[i]); | 137 | !!sta->ampdu_mlme.tid_tx[i]); |
151 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", | 138 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", |
152 | sta->ampdu_mlme.tid_state_tx[i] ? | 139 | sta->ampdu_mlme.tid_tx[i] ? |
153 | sta->ampdu_mlme.tid_tx[i]->dialog_token : 0); | 140 | sta->ampdu_mlme.tid_tx[i]->dialog_token : 0); |
154 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x", | ||
155 | sta->ampdu_mlme.tid_state_tx[i] ? | ||
156 | sta->ampdu_mlme.tid_tx[i]->ssn : 0); | ||
157 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%03d", | 141 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%03d", |
158 | sta->ampdu_mlme.tid_state_tx[i] ? | 142 | sta->ampdu_mlme.tid_tx[i] ? |
159 | skb_queue_len(&sta->ampdu_mlme.tid_tx[i]->pending) : 0); | 143 | skb_queue_len(&sta->ampdu_mlme.tid_tx[i]->pending) : 0); |
160 | p += scnprintf(p, sizeof(buf) + buf - p, "\n"); | 144 | p += scnprintf(p, sizeof(buf) + buf - p, "\n"); |
161 | } | 145 | } |
@@ -210,8 +194,7 @@ static ssize_t sta_agg_status_write(struct file *file, const char __user *userbu | |||
210 | if (start) | 194 | if (start) |
211 | ret = ieee80211_start_tx_ba_session(&sta->sta, tid); | 195 | ret = ieee80211_start_tx_ba_session(&sta->sta, tid); |
212 | else | 196 | else |
213 | ret = ieee80211_stop_tx_ba_session(&sta->sta, tid, | 197 | ret = ieee80211_stop_tx_ba_session(&sta->sta, tid); |
214 | WLAN_BACK_RECIPIENT); | ||
215 | } else { | 198 | } else { |
216 | __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT, 3); | 199 | __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT, 3); |
217 | ret = 0; | 200 | ret = 0; |
@@ -307,6 +290,13 @@ STA_OPS(ht_capa); | |||
307 | debugfs_create_file(#name, 0400, \ | 290 | debugfs_create_file(#name, 0400, \ |
308 | sta->debugfs.dir, sta, &sta_ ##name## _ops); | 291 | sta->debugfs.dir, sta, &sta_ ##name## _ops); |
309 | 292 | ||
293 | #define DEBUGFS_ADD_COUNTER(name, field) \ | ||
294 | if (sizeof(sta->field) == sizeof(u32)) \ | ||
295 | debugfs_create_u32(#name, 0400, sta->debugfs.dir, \ | ||
296 | (u32 *) &sta->field); \ | ||
297 | else \ | ||
298 | debugfs_create_u64(#name, 0400, sta->debugfs.dir, \ | ||
299 | (u64 *) &sta->field); | ||
310 | 300 | ||
311 | void ieee80211_sta_debugfs_add(struct sta_info *sta) | 301 | void ieee80211_sta_debugfs_add(struct sta_info *sta) |
312 | { | 302 | { |
@@ -339,20 +329,21 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
339 | DEBUGFS_ADD(last_seq_ctrl); | 329 | DEBUGFS_ADD(last_seq_ctrl); |
340 | DEBUGFS_ADD(agg_status); | 330 | DEBUGFS_ADD(agg_status); |
341 | DEBUGFS_ADD(dev); | 331 | DEBUGFS_ADD(dev); |
342 | DEBUGFS_ADD(rx_packets); | ||
343 | DEBUGFS_ADD(tx_packets); | ||
344 | DEBUGFS_ADD(rx_bytes); | ||
345 | DEBUGFS_ADD(tx_bytes); | ||
346 | DEBUGFS_ADD(rx_duplicates); | ||
347 | DEBUGFS_ADD(rx_fragments); | ||
348 | DEBUGFS_ADD(rx_dropped); | ||
349 | DEBUGFS_ADD(tx_fragments); | ||
350 | DEBUGFS_ADD(tx_filtered); | ||
351 | DEBUGFS_ADD(tx_retry_failed); | ||
352 | DEBUGFS_ADD(tx_retry_count); | ||
353 | DEBUGFS_ADD(last_signal); | 332 | DEBUGFS_ADD(last_signal); |
354 | DEBUGFS_ADD(wep_weak_iv_count); | ||
355 | DEBUGFS_ADD(ht_capa); | 333 | DEBUGFS_ADD(ht_capa); |
334 | |||
335 | DEBUGFS_ADD_COUNTER(rx_packets, rx_packets); | ||
336 | DEBUGFS_ADD_COUNTER(tx_packets, tx_packets); | ||
337 | DEBUGFS_ADD_COUNTER(rx_bytes, rx_bytes); | ||
338 | DEBUGFS_ADD_COUNTER(tx_bytes, tx_bytes); | ||
339 | DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates); | ||
340 | DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments); | ||
341 | DEBUGFS_ADD_COUNTER(rx_dropped, rx_dropped); | ||
342 | DEBUGFS_ADD_COUNTER(tx_fragments, tx_fragments); | ||
343 | DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count); | ||
344 | DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed); | ||
345 | DEBUGFS_ADD_COUNTER(tx_retry_count, tx_retry_count); | ||
346 | DEBUGFS_ADD_COUNTER(wep_weak_iv_count, wep_weak_iv_count); | ||
356 | } | 347 | } |
357 | 348 | ||
358 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) | 349 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) |