diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-11-19 08:26:11 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-19 11:09:08 -0500 |
commit | 64491f0ec8b653560a030022dccfce67ad353d81 (patch) | |
tree | cae81fcb3ee62062eb6f327827c8da90cef853c5 /net/mac80211/debugfs_sta.c | |
parent | a58ce43f2fb17b728395ff530f019ca53c80145f (diff) |
mac80211: add per-station HT capability file
This is sometimes useful to debug HT issues
as it shows what exactly the stack thinks
the peer supports.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index f043c29070d7..3f41608c8081 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -157,6 +157,34 @@ 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 | 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); |
@@ -207,6 +235,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
207 | DEBUGFS_ADD(last_signal); | 235 | DEBUGFS_ADD(last_signal); |
208 | DEBUGFS_ADD(last_noise); | 236 | DEBUGFS_ADD(last_noise); |
209 | DEBUGFS_ADD(wep_weak_iv_count); | 237 | DEBUGFS_ADD(wep_weak_iv_count); |
238 | DEBUGFS_ADD(ht_capa); | ||
210 | } | 239 | } |
211 | 240 | ||
212 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) | 241 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) |