diff options
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 33a2e892115b..3f41608c8081 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -57,7 +57,6 @@ STA_FILE(tx_filtered, tx_filtered_count, LU); | |||
57 | STA_FILE(tx_retry_failed, tx_retry_failed, LU); | 57 | STA_FILE(tx_retry_failed, tx_retry_failed, LU); |
58 | STA_FILE(tx_retry_count, tx_retry_count, LU); | 58 | STA_FILE(tx_retry_count, tx_retry_count, LU); |
59 | STA_FILE(last_signal, last_signal, D); | 59 | STA_FILE(last_signal, last_signal, D); |
60 | STA_FILE(last_qual, last_qual, D); | ||
61 | STA_FILE(last_noise, last_noise, D); | 60 | STA_FILE(last_noise, last_noise, D); |
62 | STA_FILE(wep_weak_iv_count, wep_weak_iv_count, LU); | 61 | STA_FILE(wep_weak_iv_count, wep_weak_iv_count, LU); |
63 | 62 | ||
@@ -67,10 +66,11 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf, | |||
67 | char buf[100]; | 66 | char buf[100]; |
68 | struct sta_info *sta = file->private_data; | 67 | struct sta_info *sta = file->private_data; |
69 | u32 staflags = get_sta_flags(sta); | 68 | u32 staflags = get_sta_flags(sta); |
70 | int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s", | 69 | int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s", |
71 | staflags & WLAN_STA_AUTH ? "AUTH\n" : "", | 70 | staflags & WLAN_STA_AUTH ? "AUTH\n" : "", |
72 | staflags & WLAN_STA_ASSOC ? "ASSOC\n" : "", | 71 | staflags & WLAN_STA_ASSOC ? "ASSOC\n" : "", |
73 | staflags & WLAN_STA_PS ? "PS\n" : "", | 72 | staflags & WLAN_STA_PS_STA ? "PS (sta)\n" : "", |
73 | staflags & WLAN_STA_PS_DRIVER ? "PS (driver)\n" : "", | ||
74 | staflags & WLAN_STA_AUTHORIZED ? "AUTHORIZED\n" : "", | 74 | staflags & WLAN_STA_AUTHORIZED ? "AUTHORIZED\n" : "", |
75 | staflags & WLAN_STA_SHORT_PREAMBLE ? "SHORT PREAMBLE\n" : "", | 75 | staflags & WLAN_STA_SHORT_PREAMBLE ? "SHORT PREAMBLE\n" : "", |
76 | staflags & WLAN_STA_WME ? "WME\n" : "", | 76 | staflags & WLAN_STA_WME ? "WME\n" : "", |
@@ -157,14 +157,38 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, | |||
157 | } | 157 | } |
158 | STA_OPS(agg_status); | 158 | STA_OPS(agg_status); |
159 | 159 | ||
160 | static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, | ||
161 | size_t count, loff_t *ppos) | ||
162 | { | ||
163 | char buf[200], *p = buf; | ||
164 | int i; | ||
165 | struct sta_info *sta = file->private_data; | ||
166 | struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap; | ||
167 | |||
168 | p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n", | ||
169 | htc->ht_supported ? "" : "not "); | ||
170 | if (htc->ht_supported) { | ||
171 | p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.2x\n", htc->cap); | ||
172 | p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n", | ||
173 | htc->ampdu_factor, htc->ampdu_density); | ||
174 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:"); | ||
175 | for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) | ||
176 | p += scnprintf(p, sizeof(buf)+buf-p, " %.2x", | ||
177 | htc->mcs.rx_mask[i]); | ||
178 | p += scnprintf(p, sizeof(buf)+buf-p, "\nMCS rx highest: %d\n", | ||
179 | le16_to_cpu(htc->mcs.rx_highest)); | ||
180 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n", | ||
181 | htc->mcs.tx_params); | ||
182 | } | ||
183 | |||
184 | return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); | ||
185 | } | ||
186 | STA_OPS(ht_capa); | ||
187 | |||
160 | #define DEBUGFS_ADD(name) \ | 188 | #define DEBUGFS_ADD(name) \ |
161 | sta->debugfs.name = debugfs_create_file(#name, 0400, \ | 189 | debugfs_create_file(#name, 0400, \ |
162 | sta->debugfs.dir, sta, &sta_ ##name## _ops); | 190 | sta->debugfs.dir, sta, &sta_ ##name## _ops); |
163 | 191 | ||
164 | #define DEBUGFS_DEL(name) \ | ||
165 | debugfs_remove(sta->debugfs.name);\ | ||
166 | sta->debugfs.name = NULL; | ||
167 | |||
168 | 192 | ||
169 | void ieee80211_sta_debugfs_add(struct sta_info *sta) | 193 | void ieee80211_sta_debugfs_add(struct sta_info *sta) |
170 | { | 194 | { |
@@ -209,36 +233,13 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
209 | DEBUGFS_ADD(tx_retry_failed); | 233 | DEBUGFS_ADD(tx_retry_failed); |
210 | DEBUGFS_ADD(tx_retry_count); | 234 | DEBUGFS_ADD(tx_retry_count); |
211 | DEBUGFS_ADD(last_signal); | 235 | DEBUGFS_ADD(last_signal); |
212 | DEBUGFS_ADD(last_qual); | ||
213 | DEBUGFS_ADD(last_noise); | 236 | DEBUGFS_ADD(last_noise); |
214 | DEBUGFS_ADD(wep_weak_iv_count); | 237 | DEBUGFS_ADD(wep_weak_iv_count); |
238 | DEBUGFS_ADD(ht_capa); | ||
215 | } | 239 | } |
216 | 240 | ||
217 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) | 241 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) |
218 | { | 242 | { |
219 | DEBUGFS_DEL(flags); | 243 | debugfs_remove_recursive(sta->debugfs.dir); |
220 | DEBUGFS_DEL(num_ps_buf_frames); | ||
221 | DEBUGFS_DEL(inactive_ms); | ||
222 | DEBUGFS_DEL(last_seq_ctrl); | ||
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); | ||
241 | |||
242 | debugfs_remove(sta->debugfs.dir); | ||
243 | sta->debugfs.dir = NULL; | 244 | sta->debugfs.dir = NULL; |
244 | } | 245 | } |