diff options
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 64 |
1 files changed, 59 insertions, 5 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 3f41608c8081..0d4a759ba72c 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -44,7 +44,7 @@ static const struct file_operations sta_ ##name## _ops = { \ | |||
44 | STA_OPS(name) | 44 | STA_OPS(name) |
45 | 45 | ||
46 | STA_FILE(aid, sta.aid, D); | 46 | STA_FILE(aid, sta.aid, D); |
47 | STA_FILE(dev, sdata->dev->name, S); | 47 | STA_FILE(dev, sdata->name, S); |
48 | STA_FILE(rx_packets, rx_packets, LU); | 48 | STA_FILE(rx_packets, rx_packets, LU); |
49 | STA_FILE(tx_packets, tx_packets, LU); | 49 | STA_FILE(tx_packets, tx_packets, LU); |
50 | STA_FILE(rx_bytes, rx_bytes, LU); | 50 | STA_FILE(rx_bytes, rx_bytes, LU); |
@@ -160,7 +160,12 @@ STA_OPS(agg_status); | |||
160 | static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, | 160 | static 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; |
@@ -168,15 +173,64 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, | |||
168 | p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n", | 173 | p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n", |
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: %#.2x\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:"); |
221 | |||
175 | for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) | 222 | for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) |
176 | p += scnprintf(p, sizeof(buf)+buf-p, " %.2x", | 223 | p += scnprintf(p, sizeof(buf)+buf-p, " %.2x", |
177 | htc->mcs.rx_mask[i]); | 224 | htc->mcs.rx_mask[i]); |
178 | p += scnprintf(p, sizeof(buf)+buf-p, "\nMCS rx highest: %d\n", | 225 | p += scnprintf(p, sizeof(buf)+buf-p, "\n"); |
179 | le16_to_cpu(htc->mcs.rx_highest)); | 226 | |
227 | /* If not set this is meaningless */ | ||
228 | if (le16_to_cpu(htc->mcs.rx_highest)) { | ||
229 | p += scnprintf(p, sizeof(buf)+buf-p, | ||
230 | "MCS rx highest: %d Mbps\n", | ||
231 | le16_to_cpu(htc->mcs.rx_highest)); | ||
232 | } | ||
233 | |||
180 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n", | 234 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n", |
181 | htc->mcs.tx_params); | 235 | htc->mcs.tx_params); |
182 | } | 236 | } |