diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-04-24 11:18:28 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-24 18:56:10 (GMT) |
commit | 94c514fe240fc0dd02187b78facefde8b6744634 (patch) | |
tree | d61b01327c2264e4b4e002180076135f98d40533 /net/mac80211/iface.c | |
parent | ad12886091cbc955dafd6cb91de2411b3ff36b39 (diff) | |
download | linux-94c514fe240fc0dd02187b78facefde8b6744634.tar.xz |
mac80211: Adds clean sdata helper
Adds hepler to clean sdata ieee80211_clean_sdata similar way as
ieee80211_setup_sdata is implemented. The function will be used by other
interfaces later.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 23d1da3..ba86978 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1031,6 +1031,18 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, ieee80211_debugfs_add_netdev(sdata); } +static void ieee80211_clean_sdata(struct ieee80211_sub_if_data *sdata) +{ + switch (sdata->vif.type) { + case NL80211_IFTYPE_MESH_POINT: + mesh_path_flush_by_iface(sdata); + break; + + default: + break; + } +} + static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata, enum nl80211_iftype type) { @@ -1364,8 +1376,8 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata) list_del_rcu(&sdata->list); mutex_unlock(&sdata->local->iflist_mtx); - if (ieee80211_vif_is_mesh(&sdata->vif)) - mesh_path_flush_by_iface(sdata); + /* clean up type-dependent data */ + ieee80211_clean_sdata(sdata); synchronize_rcu(); unregister_netdevice(sdata->dev); @@ -1386,8 +1398,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { list_del(&sdata->list); - if (ieee80211_vif_is_mesh(&sdata->vif)) - mesh_path_flush_by_iface(sdata); + ieee80211_clean_sdata(sdata); unregister_netdevice_queue(sdata->dev, &unreg_list); } |