diff options
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
| -rw-r--r-- | net/mac80211/debugfs_netdev.c | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 6d5aec9418ee..cbde5cc49a40 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
| 12 | #include <linux/if.h> | 12 | #include <linux/if.h> |
| 13 | #include <linux/if_ether.h> | ||
| 13 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
| 14 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
| 15 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
| @@ -167,7 +168,29 @@ IEEE80211_IF_FILE(rc_rateidx_mcs_mask_5ghz, | |||
| 167 | 168 | ||
| 168 | IEEE80211_IF_FILE(flags, flags, HEX); | 169 | IEEE80211_IF_FILE(flags, flags, HEX); |
| 169 | IEEE80211_IF_FILE(state, state, LHEX); | 170 | IEEE80211_IF_FILE(state, state, LHEX); |
| 170 | IEEE80211_IF_FILE(channel_type, vif.bss_conf.channel_type, DEC); | 171 | IEEE80211_IF_FILE(txpower, vif.bss_conf.txpower, DEC); |
| 172 | IEEE80211_IF_FILE(ap_power_level, ap_power_level, DEC); | ||
| 173 | IEEE80211_IF_FILE(user_power_level, user_power_level, DEC); | ||
| 174 | |||
| 175 | static ssize_t | ||
| 176 | ieee80211_if_fmt_hw_queues(const struct ieee80211_sub_if_data *sdata, | ||
| 177 | char *buf, int buflen) | ||
| 178 | { | ||
| 179 | int len; | ||
| 180 | |||
| 181 | len = scnprintf(buf, buflen, "AC queues: VO:%d VI:%d BE:%d BK:%d\n", | ||
| 182 | sdata->vif.hw_queue[IEEE80211_AC_VO], | ||
| 183 | sdata->vif.hw_queue[IEEE80211_AC_VI], | ||
| 184 | sdata->vif.hw_queue[IEEE80211_AC_BE], | ||
| 185 | sdata->vif.hw_queue[IEEE80211_AC_BK]); | ||
| 186 | |||
| 187 | if (sdata->vif.type == NL80211_IFTYPE_AP) | ||
| 188 | len += scnprintf(buf + len, buflen - len, "cab queue: %d\n", | ||
| 189 | sdata->vif.cab_queue); | ||
| 190 | |||
| 191 | return len; | ||
| 192 | } | ||
| 193 | __IEEE80211_IF_FILE(hw_queues, NULL); | ||
| 171 | 194 | ||
| 172 | /* STA attributes */ | 195 | /* STA attributes */ |
| 173 | IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC); | 196 | IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC); |
| @@ -217,7 +240,7 @@ static ssize_t ieee80211_if_fmt_smps(const struct ieee80211_sub_if_data *sdata, | |||
| 217 | 240 | ||
| 218 | return snprintf(buf, buflen, "request: %s\nused: %s\n", | 241 | return snprintf(buf, buflen, "request: %s\nused: %s\n", |
| 219 | smps_modes[sdata->u.mgd.req_smps], | 242 | smps_modes[sdata->u.mgd.req_smps], |
| 220 | smps_modes[sdata->u.mgd.ap_smps]); | 243 | smps_modes[sdata->smps_mode]); |
| 221 | } | 244 | } |
| 222 | 245 | ||
| 223 | static ssize_t ieee80211_if_parse_smps(struct ieee80211_sub_if_data *sdata, | 246 | static ssize_t ieee80211_if_parse_smps(struct ieee80211_sub_if_data *sdata, |
| @@ -245,27 +268,6 @@ static ssize_t ieee80211_if_fmt_tkip_mic_test( | |||
| 245 | return -EOPNOTSUPP; | 268 | return -EOPNOTSUPP; |
| 246 | } | 269 | } |
| 247 | 270 | ||
| 248 | static int hwaddr_aton(const char *txt, u8 *addr) | ||
| 249 | { | ||
| 250 | int i; | ||
| 251 | |||
| 252 | for (i = 0; i < ETH_ALEN; i++) { | ||
| 253 | int a, b; | ||
| 254 | |||
| 255 | a = hex_to_bin(*txt++); | ||
| 256 | if (a < 0) | ||
| 257 | return -1; | ||
| 258 | b = hex_to_bin(*txt++); | ||
| 259 | if (b < 0) | ||
| 260 | return -1; | ||
| 261 | *addr++ = (a << 4) | b; | ||
| 262 | if (i < 5 && *txt++ != ':') | ||
| 263 | return -1; | ||
| 264 | } | ||
| 265 | |||
| 266 | return 0; | ||
| 267 | } | ||
| 268 | |||
| 269 | static ssize_t ieee80211_if_parse_tkip_mic_test( | 271 | static ssize_t ieee80211_if_parse_tkip_mic_test( |
| 270 | struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) | 272 | struct ieee80211_sub_if_data *sdata, const char *buf, int buflen) |
| 271 | { | 273 | { |
| @@ -275,13 +277,7 @@ static ssize_t ieee80211_if_parse_tkip_mic_test( | |||
| 275 | struct ieee80211_hdr *hdr; | 277 | struct ieee80211_hdr *hdr; |
| 276 | __le16 fc; | 278 | __le16 fc; |
| 277 | 279 | ||
| 278 | /* | 280 | if (!mac_pton(buf, addr)) |
| 279 | * Assume colon-delimited MAC address with possible white space | ||
| 280 | * following. | ||
| 281 | */ | ||
| 282 | if (buflen < 3 * ETH_ALEN - 1) | ||
| 283 | return -EINVAL; | ||
| 284 | if (hwaddr_aton(buf, addr) < 0) | ||
| 285 | return -EINVAL; | 281 | return -EINVAL; |
| 286 | 282 | ||
| 287 | if (!ieee80211_sdata_running(sdata)) | 283 | if (!ieee80211_sdata_running(sdata)) |
| @@ -307,13 +303,16 @@ static ssize_t ieee80211_if_parse_tkip_mic_test( | |||
| 307 | case NL80211_IFTYPE_STATION: | 303 | case NL80211_IFTYPE_STATION: |
| 308 | fc |= cpu_to_le16(IEEE80211_FCTL_TODS); | 304 | fc |= cpu_to_le16(IEEE80211_FCTL_TODS); |
| 309 | /* BSSID SA DA */ | 305 | /* BSSID SA DA */ |
| 310 | if (sdata->vif.bss_conf.bssid == NULL) { | 306 | mutex_lock(&sdata->u.mgd.mtx); |
| 307 | if (!sdata->u.mgd.associated) { | ||
| 308 | mutex_unlock(&sdata->u.mgd.mtx); | ||
| 311 | dev_kfree_skb(skb); | 309 | dev_kfree_skb(skb); |
| 312 | return -ENOTCONN; | 310 | return -ENOTCONN; |
| 313 | } | 311 | } |
| 314 | memcpy(hdr->addr1, sdata->vif.bss_conf.bssid, ETH_ALEN); | 312 | memcpy(hdr->addr1, sdata->u.mgd.associated->bssid, ETH_ALEN); |
| 315 | memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); | 313 | memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); |
| 316 | memcpy(hdr->addr3, addr, ETH_ALEN); | 314 | memcpy(hdr->addr3, addr, ETH_ALEN); |
| 315 | mutex_unlock(&sdata->u.mgd.mtx); | ||
| 317 | break; | 316 | break; |
| 318 | default: | 317 | default: |
| 319 | dev_kfree_skb(skb); | 318 | dev_kfree_skb(skb); |
| @@ -395,14 +394,14 @@ __IEEE80211_IF_FILE_W(uapsd_max_sp_len); | |||
| 395 | 394 | ||
| 396 | /* AP attributes */ | 395 | /* AP attributes */ |
| 397 | IEEE80211_IF_FILE(num_mcast_sta, u.ap.num_mcast_sta, ATOMIC); | 396 | IEEE80211_IF_FILE(num_mcast_sta, u.ap.num_mcast_sta, ATOMIC); |
| 398 | IEEE80211_IF_FILE(num_sta_ps, u.ap.num_sta_ps, ATOMIC); | 397 | IEEE80211_IF_FILE(num_sta_ps, u.ap.ps.num_sta_ps, ATOMIC); |
| 399 | IEEE80211_IF_FILE(dtim_count, u.ap.dtim_count, DEC); | 398 | IEEE80211_IF_FILE(dtim_count, u.ap.ps.dtim_count, DEC); |
| 400 | 399 | ||
| 401 | static ssize_t ieee80211_if_fmt_num_buffered_multicast( | 400 | static ssize_t ieee80211_if_fmt_num_buffered_multicast( |
| 402 | const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) | 401 | const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) |
| 403 | { | 402 | { |
| 404 | return scnprintf(buf, buflen, "%u\n", | 403 | return scnprintf(buf, buflen, "%u\n", |
| 405 | skb_queue_len(&sdata->u.ap.ps_bc_buf)); | 404 | skb_queue_len(&sdata->u.ap.ps.bc_buf)); |
| 406 | } | 405 | } |
| 407 | __IEEE80211_IF_FILE(num_buffered_multicast, NULL); | 406 | __IEEE80211_IF_FILE(num_buffered_multicast, NULL); |
| 408 | 407 | ||
| @@ -443,7 +442,7 @@ static ssize_t ieee80211_if_parse_tsf( | |||
| 443 | } | 442 | } |
| 444 | ret = kstrtoull(buf, 10, &tsf); | 443 | ret = kstrtoull(buf, 10, &tsf); |
| 445 | if (ret < 0) | 444 | if (ret < 0) |
| 446 | return -EINVAL; | 445 | return ret; |
| 447 | if (tsf_is_delta) | 446 | if (tsf_is_delta) |
| 448 | tsf = drv_get_tsf(local, sdata) + tsf_is_delta * tsf; | 447 | tsf = drv_get_tsf(local, sdata) + tsf_is_delta * tsf; |
| 449 | if (local->ops->set_tsf) { | 448 | if (local->ops->set_tsf) { |
| @@ -471,7 +470,7 @@ IEEE80211_IF_FILE(dropped_frames_congestion, | |||
| 471 | u.mesh.mshstats.dropped_frames_congestion, DEC); | 470 | u.mesh.mshstats.dropped_frames_congestion, DEC); |
| 472 | IEEE80211_IF_FILE(dropped_frames_no_route, | 471 | IEEE80211_IF_FILE(dropped_frames_no_route, |
| 473 | u.mesh.mshstats.dropped_frames_no_route, DEC); | 472 | u.mesh.mshstats.dropped_frames_no_route, DEC); |
| 474 | IEEE80211_IF_FILE(estab_plinks, u.mesh.mshstats.estab_plinks, ATOMIC); | 473 | IEEE80211_IF_FILE(estab_plinks, u.mesh.estab_plinks, ATOMIC); |
| 475 | 474 | ||
| 476 | /* Mesh parameters */ | 475 | /* Mesh parameters */ |
| 477 | IEEE80211_IF_FILE(dot11MeshMaxRetries, | 476 | IEEE80211_IF_FILE(dot11MeshMaxRetries, |
| @@ -531,6 +530,7 @@ static void add_common_files(struct ieee80211_sub_if_data *sdata) | |||
| 531 | DEBUGFS_ADD(rc_rateidx_mask_5ghz); | 530 | DEBUGFS_ADD(rc_rateidx_mask_5ghz); |
| 532 | DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz); | 531 | DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz); |
| 533 | DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz); | 532 | DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz); |
| 533 | DEBUGFS_ADD(hw_queues); | ||
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | static void add_sta_files(struct ieee80211_sub_if_data *sdata) | 536 | static void add_sta_files(struct ieee80211_sub_if_data *sdata) |
| @@ -631,7 +631,9 @@ static void add_files(struct ieee80211_sub_if_data *sdata) | |||
| 631 | 631 | ||
| 632 | DEBUGFS_ADD(flags); | 632 | DEBUGFS_ADD(flags); |
| 633 | DEBUGFS_ADD(state); | 633 | DEBUGFS_ADD(state); |
| 634 | DEBUGFS_ADD(channel_type); | 634 | DEBUGFS_ADD(txpower); |
| 635 | DEBUGFS_ADD(user_power_level); | ||
| 636 | DEBUGFS_ADD(ap_power_level); | ||
| 635 | 637 | ||
| 636 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) | 638 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) |
| 637 | add_common_files(sdata); | 639 | add_common_files(sdata); |
