diff options
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
| -rw-r--r-- | net/mac80211/debugfs_sta.c | 88 |
1 files changed, 72 insertions, 16 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 3f41608c8081..d92800bb2d2f 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); |
| @@ -120,36 +120,38 @@ STA_OPS(last_seq_ctrl); | |||
| 120 | static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, | 120 | static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, |
| 121 | size_t count, loff_t *ppos) | 121 | size_t count, loff_t *ppos) |
| 122 | { | 122 | { |
| 123 | char buf[30 + STA_TID_NUM * 70], *p = buf; | 123 | char buf[64 + STA_TID_NUM * 40], *p = buf; |
| 124 | int i; | 124 | int i; |
| 125 | struct sta_info *sta = file->private_data; | 125 | struct sta_info *sta = file->private_data; |
| 126 | 126 | ||
| 127 | spin_lock_bh(&sta->lock); | 127 | spin_lock_bh(&sta->lock); |
| 128 | p += scnprintf(p, sizeof(buf)+buf-p, "next dialog_token is %#02x\n", | 128 | p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n", |
| 129 | sta->ampdu_mlme.dialog_token_allocator + 1); | 129 | sta->ampdu_mlme.dialog_token_allocator + 1); |
| 130 | p += scnprintf(p, sizeof(buf) + buf - p, | ||
| 131 | "TID\t\tRX\tDTKN\tSSN\t\tTX\tDTKN\tSSN\tpending\n"); | ||
| 130 | for (i = 0; i < STA_TID_NUM; i++) { | 132 | for (i = 0; i < STA_TID_NUM; i++) { |
| 131 | p += scnprintf(p, sizeof(buf)+buf-p, "TID %02d:", i); | 133 | p += scnprintf(p, sizeof(buf) + buf - p, "%02d", i); |
| 132 | p += scnprintf(p, sizeof(buf)+buf-p, " RX=%x", | 134 | p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", |
| 133 | sta->ampdu_mlme.tid_state_rx[i]); | 135 | sta->ampdu_mlme.tid_state_rx[i]); |
| 134 | p += scnprintf(p, sizeof(buf)+buf-p, "/DTKN=%#.2x", | 136 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", |
| 135 | sta->ampdu_mlme.tid_state_rx[i] ? | 137 | sta->ampdu_mlme.tid_state_rx[i] ? |
| 136 | sta->ampdu_mlme.tid_rx[i]->dialog_token : 0); | 138 | sta->ampdu_mlme.tid_rx[i]->dialog_token : 0); |
| 137 | p += scnprintf(p, sizeof(buf)+buf-p, "/SSN=%#.3x", | 139 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x", |
| 138 | sta->ampdu_mlme.tid_state_rx[i] ? | 140 | sta->ampdu_mlme.tid_state_rx[i] ? |
| 139 | sta->ampdu_mlme.tid_rx[i]->ssn : 0); | 141 | sta->ampdu_mlme.tid_rx[i]->ssn : 0); |
| 140 | 142 | ||
| 141 | p += scnprintf(p, sizeof(buf)+buf-p, " TX=%x", | 143 | p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", |
| 142 | sta->ampdu_mlme.tid_state_tx[i]); | 144 | sta->ampdu_mlme.tid_state_tx[i]); |
| 143 | p += scnprintf(p, sizeof(buf)+buf-p, "/DTKN=%#.2x", | 145 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", |
| 144 | sta->ampdu_mlme.tid_state_tx[i] ? | 146 | sta->ampdu_mlme.tid_state_tx[i] ? |
| 145 | sta->ampdu_mlme.tid_tx[i]->dialog_token : 0); | 147 | sta->ampdu_mlme.tid_tx[i]->dialog_token : 0); |
| 146 | p += scnprintf(p, sizeof(buf)+buf-p, "/SSN=%#.3x", | 148 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x", |
| 147 | sta->ampdu_mlme.tid_state_tx[i] ? | 149 | sta->ampdu_mlme.tid_state_tx[i] ? |
| 148 | sta->ampdu_mlme.tid_tx[i]->ssn : 0); | 150 | sta->ampdu_mlme.tid_tx[i]->ssn : 0); |
| 149 | p += scnprintf(p, sizeof(buf)+buf-p, "/pending=%03d", | 151 | p += scnprintf(p, sizeof(buf) + buf - p, "\t%03d", |
| 150 | sta->ampdu_mlme.tid_state_tx[i] ? | 152 | sta->ampdu_mlme.tid_state_tx[i] ? |
| 151 | skb_queue_len(&sta->ampdu_mlme.tid_tx[i]->pending) : 0); | 153 | skb_queue_len(&sta->ampdu_mlme.tid_tx[i]->pending) : 0); |
| 152 | p += scnprintf(p, sizeof(buf)+buf-p, "\n"); | 154 | p += scnprintf(p, sizeof(buf) + buf - p, "\n"); |
| 153 | } | 155 | } |
| 154 | spin_unlock_bh(&sta->lock); | 156 | spin_unlock_bh(&sta->lock); |
| 155 | 157 | ||
| @@ -160,7 +162,12 @@ STA_OPS(agg_status); | |||
| 160 | static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, | 162 | static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, |
| 161 | size_t count, loff_t *ppos) | 163 | size_t count, loff_t *ppos) |
| 162 | { | 164 | { |
| 163 | char buf[200], *p = buf; | 165 | #define PRINT_HT_CAP(_cond, _str) \ |
| 166 | do { \ | ||
| 167 | if (_cond) \ | ||
| 168 | p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \ | ||
| 169 | } while (0) | ||
| 170 | char buf[512], *p = buf; | ||
| 164 | int i; | 171 | int i; |
| 165 | struct sta_info *sta = file->private_data; | 172 | struct sta_info *sta = file->private_data; |
| 166 | struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap; | 173 | struct ieee80211_sta_ht_cap *htc = &sta->sta.ht_cap; |
| @@ -168,15 +175,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", | 175 | p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n", |
| 169 | htc->ht_supported ? "" : "not "); | 176 | htc->ht_supported ? "" : "not "); |
| 170 | if (htc->ht_supported) { | 177 | if (htc->ht_supported) { |
| 171 | p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.2x\n", htc->cap); | 178 | p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.4x\n", htc->cap); |
| 179 | |||
| 180 | PRINT_HT_CAP((htc->cap & BIT(0)), "RX LDCP"); | ||
| 181 | PRINT_HT_CAP((htc->cap & BIT(1)), "HT20/HT40"); | ||
| 182 | PRINT_HT_CAP(!(htc->cap & BIT(1)), "HT20"); | ||
| 183 | |||
| 184 | PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 0, "Static SM Power Save"); | ||
| 185 | PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 1, "Dynamic SM Power Save"); | ||
| 186 | PRINT_HT_CAP(((htc->cap >> 2) & 0x3) == 3, "SM Power Save disabled"); | ||
| 187 | |||
| 188 | PRINT_HT_CAP((htc->cap & BIT(4)), "RX Greenfield"); | ||
| 189 | PRINT_HT_CAP((htc->cap & BIT(5)), "RX HT20 SGI"); | ||
| 190 | PRINT_HT_CAP((htc->cap & BIT(6)), "RX HT40 SGI"); | ||
| 191 | PRINT_HT_CAP((htc->cap & BIT(7)), "TX STBC"); | ||
| 192 | |||
| 193 | PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 0, "No RX STBC"); | ||
| 194 | PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 1, "RX STBC 1-stream"); | ||
| 195 | PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 2, "RX STBC 2-streams"); | ||
| 196 | PRINT_HT_CAP(((htc->cap >> 8) & 0x3) == 3, "RX STBC 3-streams"); | ||
| 197 | |||
| 198 | PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack"); | ||
| 199 | |||
| 200 | PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: " | ||
| 201 | "3839 bytes"); | ||
| 202 | PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: " | ||
| 203 | "7935 bytes"); | ||
| 204 | |||
| 205 | /* | ||
| 206 | * For beacons and probe response this would mean the BSS | ||
| 207 | * does or does not allow the usage of DSSS/CCK HT40. | ||
| 208 | * Otherwise it means the STA does or does not use | ||
| 209 | * DSSS/CCK HT40. | ||
| 210 | */ | ||
| 211 | PRINT_HT_CAP((htc->cap & BIT(12)), "DSSS/CCK HT40"); | ||
| 212 | PRINT_HT_CAP(!(htc->cap & BIT(12)), "No DSSS/CCK HT40"); | ||
| 213 | |||
| 214 | /* BIT(13) is reserved */ | ||
| 215 | |||
| 216 | PRINT_HT_CAP((htc->cap & BIT(14)), "40 MHz Intolerant"); | ||
| 217 | |||
| 218 | PRINT_HT_CAP((htc->cap & BIT(15)), "L-SIG TXOP protection"); | ||
| 219 | |||
| 172 | p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n", | 220 | p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n", |
| 173 | htc->ampdu_factor, htc->ampdu_density); | 221 | htc->ampdu_factor, htc->ampdu_density); |
| 174 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:"); | 222 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:"); |
| 223 | |||
| 175 | for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) | 224 | for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) |
| 176 | p += scnprintf(p, sizeof(buf)+buf-p, " %.2x", | 225 | p += scnprintf(p, sizeof(buf)+buf-p, " %.2x", |
| 177 | htc->mcs.rx_mask[i]); | 226 | htc->mcs.rx_mask[i]); |
| 178 | p += scnprintf(p, sizeof(buf)+buf-p, "\nMCS rx highest: %d\n", | 227 | p += scnprintf(p, sizeof(buf)+buf-p, "\n"); |
| 179 | le16_to_cpu(htc->mcs.rx_highest)); | 228 | |
| 229 | /* If not set this is meaningless */ | ||
| 230 | if (le16_to_cpu(htc->mcs.rx_highest)) { | ||
| 231 | p += scnprintf(p, sizeof(buf)+buf-p, | ||
| 232 | "MCS rx highest: %d Mbps\n", | ||
| 233 | le16_to_cpu(htc->mcs.rx_highest)); | ||
| 234 | } | ||
| 235 | |||
| 180 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n", | 236 | p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n", |
| 181 | htc->mcs.tx_params); | 237 | htc->mcs.tx_params); |
| 182 | } | 238 | } |
