aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-12-07 14:54:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-22 13:56:00 -0500
commit7db94e210351e8578d4a98fed3edd4df5f10ae9d (patch)
treefdef27e3c61a13548bb9f27f44e6f12fa9af501f
parentcb136f54ee11f9ead716b5ad0b10fa1c1b05271d (diff)
mac80211: parse the HT capabilities info through debugfs
When debugging you want to be lazy and not have to parse bits yourself so let mac80211 debugfs do the parsing for you. This is what I get against my WRT610N: root@tux:~# cat /sys/kernel/debug/ieee80211/phy0/stations/00\:22\:6b\:aa\:bb\:01/ht_capa ht supported cap: 0x000e HT20/HT40 SM Power Save disabled No RX STBC Max AMSDU length: 7935 bytes No DSSS/CCK HT40 ampdu factor/density: 2/6 MCS mask: ff ff 00 00 00 00 00 00 00 00 MCS rx highest: 0 MCS tx params: 0 Cc: johannes@sipsolutions.net Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/debugfs_sta.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 9a1d1e40eca8..c833b6ce9902 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -160,7 +160,12 @@ STA_OPS(agg_status);
160static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, 160static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
161 size_t count, loff_t *ppos) 161 size_t count, loff_t *ppos)
162{ 162{
163 char buf[200], *p = buf; 163#define PRINT_HT_CAP(_cond, _str) \
164 do { \
165 if (_cond) \
166 p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \
167 } while (0)
168 char buf[1024], *p = buf;
164 int i; 169 int i;
165 struct sta_info *sta = file->private_data; 170 struct sta_info *sta = file->private_data;
166 struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap; 171 struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap;
@@ -169,6 +174,47 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
169 htc->ht_supported ? "" : "not "); 174 htc->ht_supported ? "" : "not ");
170 if (htc->ht_supported) { 175 if (htc->ht_supported) {
171 p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.4x\n", htc->cap); 176 p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.4x\n", htc->cap);
177
178 PRINT_HT_CAP((htc->cap & BIT(0)), "RX LDCP");
179 PRINT_HT_CAP((htc->cap & BIT(1)), "HT20/HT40");
180 PRINT_HT_CAP(!(htc->cap & BIT(1)), "HT20");
181
182 PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 0, "Static SM Power Save");
183 PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 1, "Dynamic SM Power Save");
184 PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 3, "SM Power Save disabled");
185
186 PRINT_HT_CAP((htc->cap & BIT(4)), "RX Greenfield");
187 PRINT_HT_CAP((htc->cap & BIT(5)), "RX HT20 SGI");
188 PRINT_HT_CAP((htc->cap & BIT(6)), "RX HT40 SGI");
189 PRINT_HT_CAP((htc->cap & BIT(7)), "TX STBC");
190
191 PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 0, "No RX STBC");
192 PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 1, "RX STBC 1-stream");
193 PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 2, "RX STBC 2-streams");
194 PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 3, "RX STBC 3-streams");
195
196 PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack");
197
198 PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: "
199 "3839 bytes");
200 PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: "
201 "7935 bytes");
202
203 /*
204 * For beacons and probe response this would mean the BSS
205 * does or does not allow the usage of DSSS/CCK HT40.
206 * Otherwise it means the STA does or does not use
207 * DSSS/CCK HT40.
208 */
209 PRINT_HT_CAP((htc->cap & BIT(12)), "DSSS/CCK HT40");
210 PRINT_HT_CAP(!(htc->cap & BIT(12)), "No DSSS/CCK HT40");
211
212 /* BIT(13) is reserved */
213
214 PRINT_HT_CAP((htc->cap & BIT(14)), "40 MHz Intolerant");
215
216 PRINT_HT_CAP((htc->cap & BIT(15)), "L-SIG TXOP protection");
217
172 p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n", 218 p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n",
173 htc->ampdu_factor, htc->ampdu_density); 219 htc->ampdu_factor, htc->ampdu_density);
174 p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:"); 220 p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:");