diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-07-09 08:40:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-14 14:30:07 -0400 |
commit | 75636525fbfa78fa33fd754c89785cfde750acd3 (patch) | |
tree | 2c614681382a53bec50248c621ba4c8bb07ce670 /net/mac80211/debugfs_netdev.c | |
parent | 3e122be089e6fb8d3f322416da4cdbb80ce12927 (diff) |
mac80211: revamp virtual interface handling
This patch revamps the virtual interface handling and makes the
code much easier to follow. Fewer functions, better names, less
spaghetti code.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 4aa6621f9970..475f89a8aee1 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -476,12 +476,12 @@ static void del_mesh_config(struct ieee80211_sub_if_data *sdata) | |||
476 | } | 476 | } |
477 | #endif | 477 | #endif |
478 | 478 | ||
479 | static void del_files(struct ieee80211_sub_if_data *sdata, int type) | 479 | static void del_files(struct ieee80211_sub_if_data *sdata) |
480 | { | 480 | { |
481 | if (!sdata->debugfsdir) | 481 | if (!sdata->debugfsdir) |
482 | return; | 482 | return; |
483 | 483 | ||
484 | switch (type) { | 484 | switch (sdata->vif.type) { |
485 | case IEEE80211_IF_TYPE_MESH_POINT: | 485 | case IEEE80211_IF_TYPE_MESH_POINT: |
486 | #ifdef CONFIG_MAC80211_MESH | 486 | #ifdef CONFIG_MAC80211_MESH |
487 | del_mesh_stats(sdata); | 487 | del_mesh_stats(sdata); |
@@ -521,22 +521,16 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata) | |||
521 | sprintf(buf, "netdev:%s", sdata->dev->name); | 521 | sprintf(buf, "netdev:%s", sdata->dev->name); |
522 | sdata->debugfsdir = debugfs_create_dir(buf, | 522 | sdata->debugfsdir = debugfs_create_dir(buf, |
523 | sdata->local->hw.wiphy->debugfsdir); | 523 | sdata->local->hw.wiphy->debugfsdir); |
524 | add_files(sdata); | ||
524 | } | 525 | } |
525 | 526 | ||
526 | void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) | 527 | void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) |
527 | { | 528 | { |
528 | del_files(sdata, sdata->vif.type); | 529 | del_files(sdata); |
529 | debugfs_remove(sdata->debugfsdir); | 530 | debugfs_remove(sdata->debugfsdir); |
530 | sdata->debugfsdir = NULL; | 531 | sdata->debugfsdir = NULL; |
531 | } | 532 | } |
532 | 533 | ||
533 | void ieee80211_debugfs_change_if_type(struct ieee80211_sub_if_data *sdata, | ||
534 | int oldtype) | ||
535 | { | ||
536 | del_files(sdata, oldtype); | ||
537 | add_files(sdata); | ||
538 | } | ||
539 | |||
540 | static int netdev_notify(struct notifier_block *nb, | 534 | static int netdev_notify(struct notifier_block *nb, |
541 | unsigned long state, | 535 | unsigned long state, |
542 | void *ndev) | 536 | void *ndev) |