diff options
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index b2089b2da48a..475f89a8aee1 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -156,6 +156,8 @@ static const struct file_operations name##_ops = { \ | |||
156 | 156 | ||
157 | /* common attributes */ | 157 | /* common attributes */ |
158 | IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC); | 158 | IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC); |
159 | IEEE80211_IF_FILE(force_unicast_rateidx, force_unicast_rateidx, DEC); | ||
160 | IEEE80211_IF_FILE(max_ratectrl_rateidx, max_ratectrl_rateidx, DEC); | ||
159 | 161 | ||
160 | /* STA/IBSS attributes */ | 162 | /* STA/IBSS attributes */ |
161 | IEEE80211_IF_FILE(state, u.sta.state, DEC); | 163 | IEEE80211_IF_FILE(state, u.sta.state, DEC); |
@@ -191,8 +193,6 @@ __IEEE80211_IF_FILE(flags); | |||
191 | IEEE80211_IF_FILE(num_sta_ps, u.ap.num_sta_ps, ATOMIC); | 193 | IEEE80211_IF_FILE(num_sta_ps, u.ap.num_sta_ps, ATOMIC); |
192 | IEEE80211_IF_FILE(dtim_count, u.ap.dtim_count, DEC); | 194 | IEEE80211_IF_FILE(dtim_count, u.ap.dtim_count, DEC); |
193 | IEEE80211_IF_FILE(num_beacons, u.ap.num_beacons, DEC); | 195 | IEEE80211_IF_FILE(num_beacons, u.ap.num_beacons, DEC); |
194 | IEEE80211_IF_FILE(force_unicast_rateidx, u.ap.force_unicast_rateidx, DEC); | ||
195 | IEEE80211_IF_FILE(max_ratectrl_rateidx, u.ap.max_ratectrl_rateidx, DEC); | ||
196 | 196 | ||
197 | static ssize_t ieee80211_if_fmt_num_buffered_multicast( | 197 | static ssize_t ieee80211_if_fmt_num_buffered_multicast( |
198 | const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) | 198 | const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) |
@@ -248,6 +248,9 @@ IEEE80211_IF_WFILE(min_discovery_timeout, | |||
248 | static void add_sta_files(struct ieee80211_sub_if_data *sdata) | 248 | static void add_sta_files(struct ieee80211_sub_if_data *sdata) |
249 | { | 249 | { |
250 | DEBUGFS_ADD(drop_unencrypted, sta); | 250 | DEBUGFS_ADD(drop_unencrypted, sta); |
251 | DEBUGFS_ADD(force_unicast_rateidx, ap); | ||
252 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | ||
253 | |||
251 | DEBUGFS_ADD(state, sta); | 254 | DEBUGFS_ADD(state, sta); |
252 | DEBUGFS_ADD(bssid, sta); | 255 | DEBUGFS_ADD(bssid, sta); |
253 | DEBUGFS_ADD(prev_bssid, sta); | 256 | DEBUGFS_ADD(prev_bssid, sta); |
@@ -268,23 +271,29 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata) | |||
268 | static void add_ap_files(struct ieee80211_sub_if_data *sdata) | 271 | static void add_ap_files(struct ieee80211_sub_if_data *sdata) |
269 | { | 272 | { |
270 | DEBUGFS_ADD(drop_unencrypted, ap); | 273 | DEBUGFS_ADD(drop_unencrypted, ap); |
274 | DEBUGFS_ADD(force_unicast_rateidx, ap); | ||
275 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | ||
276 | |||
271 | DEBUGFS_ADD(num_sta_ps, ap); | 277 | DEBUGFS_ADD(num_sta_ps, ap); |
272 | DEBUGFS_ADD(dtim_count, ap); | 278 | DEBUGFS_ADD(dtim_count, ap); |
273 | DEBUGFS_ADD(num_beacons, ap); | 279 | DEBUGFS_ADD(num_beacons, ap); |
274 | DEBUGFS_ADD(force_unicast_rateidx, ap); | ||
275 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | ||
276 | DEBUGFS_ADD(num_buffered_multicast, ap); | 280 | DEBUGFS_ADD(num_buffered_multicast, ap); |
277 | } | 281 | } |
278 | 282 | ||
279 | static void add_wds_files(struct ieee80211_sub_if_data *sdata) | 283 | static void add_wds_files(struct ieee80211_sub_if_data *sdata) |
280 | { | 284 | { |
281 | DEBUGFS_ADD(drop_unencrypted, wds); | 285 | DEBUGFS_ADD(drop_unencrypted, wds); |
286 | DEBUGFS_ADD(force_unicast_rateidx, ap); | ||
287 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | ||
288 | |||
282 | DEBUGFS_ADD(peer, wds); | 289 | DEBUGFS_ADD(peer, wds); |
283 | } | 290 | } |
284 | 291 | ||
285 | static void add_vlan_files(struct ieee80211_sub_if_data *sdata) | 292 | static void add_vlan_files(struct ieee80211_sub_if_data *sdata) |
286 | { | 293 | { |
287 | DEBUGFS_ADD(drop_unencrypted, vlan); | 294 | DEBUGFS_ADD(drop_unencrypted, vlan); |
295 | DEBUGFS_ADD(force_unicast_rateidx, ap); | ||
296 | DEBUGFS_ADD(max_ratectrl_rateidx, ap); | ||
288 | } | 297 | } |
289 | 298 | ||
290 | static void add_monitor_files(struct ieee80211_sub_if_data *sdata) | 299 | static void add_monitor_files(struct ieee80211_sub_if_data *sdata) |
@@ -372,6 +381,9 @@ static void add_files(struct ieee80211_sub_if_data *sdata) | |||
372 | static void del_sta_files(struct ieee80211_sub_if_data *sdata) | 381 | static void del_sta_files(struct ieee80211_sub_if_data *sdata) |
373 | { | 382 | { |
374 | DEBUGFS_DEL(drop_unencrypted, sta); | 383 | DEBUGFS_DEL(drop_unencrypted, sta); |
384 | DEBUGFS_DEL(force_unicast_rateidx, ap); | ||
385 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | ||
386 | |||
375 | DEBUGFS_DEL(state, sta); | 387 | DEBUGFS_DEL(state, sta); |
376 | DEBUGFS_DEL(bssid, sta); | 388 | DEBUGFS_DEL(bssid, sta); |
377 | DEBUGFS_DEL(prev_bssid, sta); | 389 | DEBUGFS_DEL(prev_bssid, sta); |
@@ -392,23 +404,29 @@ static void del_sta_files(struct ieee80211_sub_if_data *sdata) | |||
392 | static void del_ap_files(struct ieee80211_sub_if_data *sdata) | 404 | static void del_ap_files(struct ieee80211_sub_if_data *sdata) |
393 | { | 405 | { |
394 | DEBUGFS_DEL(drop_unencrypted, ap); | 406 | DEBUGFS_DEL(drop_unencrypted, ap); |
407 | DEBUGFS_DEL(force_unicast_rateidx, ap); | ||
408 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | ||
409 | |||
395 | DEBUGFS_DEL(num_sta_ps, ap); | 410 | DEBUGFS_DEL(num_sta_ps, ap); |
396 | DEBUGFS_DEL(dtim_count, ap); | 411 | DEBUGFS_DEL(dtim_count, ap); |
397 | DEBUGFS_DEL(num_beacons, ap); | 412 | DEBUGFS_DEL(num_beacons, ap); |
398 | DEBUGFS_DEL(force_unicast_rateidx, ap); | ||
399 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | ||
400 | DEBUGFS_DEL(num_buffered_multicast, ap); | 413 | DEBUGFS_DEL(num_buffered_multicast, ap); |
401 | } | 414 | } |
402 | 415 | ||
403 | static void del_wds_files(struct ieee80211_sub_if_data *sdata) | 416 | static void del_wds_files(struct ieee80211_sub_if_data *sdata) |
404 | { | 417 | { |
405 | DEBUGFS_DEL(drop_unencrypted, wds); | 418 | DEBUGFS_DEL(drop_unencrypted, wds); |
419 | DEBUGFS_DEL(force_unicast_rateidx, ap); | ||
420 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | ||
421 | |||
406 | DEBUGFS_DEL(peer, wds); | 422 | DEBUGFS_DEL(peer, wds); |
407 | } | 423 | } |
408 | 424 | ||
409 | static void del_vlan_files(struct ieee80211_sub_if_data *sdata) | 425 | static void del_vlan_files(struct ieee80211_sub_if_data *sdata) |
410 | { | 426 | { |
411 | DEBUGFS_DEL(drop_unencrypted, vlan); | 427 | DEBUGFS_DEL(drop_unencrypted, vlan); |
428 | DEBUGFS_DEL(force_unicast_rateidx, ap); | ||
429 | DEBUGFS_DEL(max_ratectrl_rateidx, ap); | ||
412 | } | 430 | } |
413 | 431 | ||
414 | static void del_monitor_files(struct ieee80211_sub_if_data *sdata) | 432 | static void del_monitor_files(struct ieee80211_sub_if_data *sdata) |
@@ -458,12 +476,12 @@ static void del_mesh_config(struct ieee80211_sub_if_data *sdata) | |||
458 | } | 476 | } |
459 | #endif | 477 | #endif |
460 | 478 | ||
461 | static void del_files(struct ieee80211_sub_if_data *sdata, int type) | 479 | static void del_files(struct ieee80211_sub_if_data *sdata) |
462 | { | 480 | { |
463 | if (!sdata->debugfsdir) | 481 | if (!sdata->debugfsdir) |
464 | return; | 482 | return; |
465 | 483 | ||
466 | switch (type) { | 484 | switch (sdata->vif.type) { |
467 | case IEEE80211_IF_TYPE_MESH_POINT: | 485 | case IEEE80211_IF_TYPE_MESH_POINT: |
468 | #ifdef CONFIG_MAC80211_MESH | 486 | #ifdef CONFIG_MAC80211_MESH |
469 | del_mesh_stats(sdata); | 487 | del_mesh_stats(sdata); |
@@ -503,29 +521,23 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata) | |||
503 | sprintf(buf, "netdev:%s", sdata->dev->name); | 521 | sprintf(buf, "netdev:%s", sdata->dev->name); |
504 | sdata->debugfsdir = debugfs_create_dir(buf, | 522 | sdata->debugfsdir = debugfs_create_dir(buf, |
505 | sdata->local->hw.wiphy->debugfsdir); | 523 | sdata->local->hw.wiphy->debugfsdir); |
524 | add_files(sdata); | ||
506 | } | 525 | } |
507 | 526 | ||
508 | void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) | 527 | void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) |
509 | { | 528 | { |
510 | del_files(sdata, sdata->vif.type); | 529 | del_files(sdata); |
511 | debugfs_remove(sdata->debugfsdir); | 530 | debugfs_remove(sdata->debugfsdir); |
512 | sdata->debugfsdir = NULL; | 531 | sdata->debugfsdir = NULL; |
513 | } | 532 | } |
514 | 533 | ||
515 | void ieee80211_debugfs_change_if_type(struct ieee80211_sub_if_data *sdata, | ||
516 | int oldtype) | ||
517 | { | ||
518 | del_files(sdata, oldtype); | ||
519 | add_files(sdata); | ||
520 | } | ||
521 | |||
522 | static int netdev_notify(struct notifier_block *nb, | 534 | static int netdev_notify(struct notifier_block *nb, |
523 | unsigned long state, | 535 | unsigned long state, |
524 | void *ndev) | 536 | void *ndev) |
525 | { | 537 | { |
526 | struct net_device *dev = ndev; | 538 | struct net_device *dev = ndev; |
527 | struct dentry *dir; | 539 | struct dentry *dir; |
528 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 540 | struct ieee80211_sub_if_data *sdata; |
529 | char buf[10+IFNAMSIZ]; | 541 | char buf[10+IFNAMSIZ]; |
530 | 542 | ||
531 | if (state != NETDEV_CHANGENAME) | 543 | if (state != NETDEV_CHANGENAME) |
@@ -537,6 +549,8 @@ static int netdev_notify(struct notifier_block *nb, | |||
537 | if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) | 549 | if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) |
538 | return 0; | 550 | return 0; |
539 | 551 | ||
552 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
553 | |||
540 | sprintf(buf, "netdev:%s", dev->name); | 554 | sprintf(buf, "netdev:%s", dev->name); |
541 | dir = sdata->debugfsdir; | 555 | dir = sdata->debugfsdir; |
542 | if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf)) | 556 | if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf)) |