aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-04-24 07:18:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-24 14:56:10 -0400
commit94c514fe240fc0dd02187b78facefde8b6744634 (patch)
treed61b01327c2264e4b4e002180076135f98d40533 /net/mac80211
parentad12886091cbc955dafd6cb91de2411b3ff36b39 (diff)
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')
-rw-r--r--net/mac80211/iface.c19
-rw-r--r--net/mac80211/mesh.h4
2 files changed, 18 insertions, 5 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 23d1da376eb3..ba86978dd561 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,
1031 ieee80211_debugfs_add_netdev(sdata); 1031 ieee80211_debugfs_add_netdev(sdata);
1032} 1032}
1033 1033
1034static void ieee80211_clean_sdata(struct ieee80211_sub_if_data *sdata)
1035{
1036 switch (sdata->vif.type) {
1037 case NL80211_IFTYPE_MESH_POINT:
1038 mesh_path_flush_by_iface(sdata);
1039 break;
1040
1041 default:
1042 break;
1043 }
1044}
1045
1034static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata, 1046static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata,
1035 enum nl80211_iftype type) 1047 enum nl80211_iftype type)
1036{ 1048{
@@ -1364,8 +1376,8 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata)
1364 list_del_rcu(&sdata->list); 1376 list_del_rcu(&sdata->list);
1365 mutex_unlock(&sdata->local->iflist_mtx); 1377 mutex_unlock(&sdata->local->iflist_mtx);
1366 1378
1367 if (ieee80211_vif_is_mesh(&sdata->vif)) 1379 /* clean up type-dependent data */
1368 mesh_path_flush_by_iface(sdata); 1380 ieee80211_clean_sdata(sdata);
1369 1381
1370 synchronize_rcu(); 1382 synchronize_rcu();
1371 unregister_netdevice(sdata->dev); 1383 unregister_netdevice(sdata->dev);
@@ -1386,8 +1398,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
1386 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { 1398 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
1387 list_del(&sdata->list); 1399 list_del(&sdata->list);
1388 1400
1389 if (ieee80211_vif_is_mesh(&sdata->vif)) 1401 ieee80211_clean_sdata(sdata);
1390 mesh_path_flush_by_iface(sdata);
1391 1402
1392 unregister_netdevice_queue(sdata->dev, &unreg_list); 1403 unregister_netdevice_queue(sdata->dev, &unreg_list);
1393 } 1404 }
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 345f0e7d518e..e3642756f8f4 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -304,7 +304,6 @@ void mesh_pathtbl_unregister(void);
304int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata); 304int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata);
305void mesh_path_timer(unsigned long data); 305void mesh_path_timer(unsigned long data);
306void mesh_path_flush_by_nexthop(struct sta_info *sta); 306void mesh_path_flush_by_nexthop(struct sta_info *sta);
307void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
308void mesh_path_discard_frame(struct sk_buff *skb, 307void mesh_path_discard_frame(struct sk_buff *skb,
309 struct ieee80211_sub_if_data *sdata); 308 struct ieee80211_sub_if_data *sdata);
310void mesh_path_quiesce(struct ieee80211_sub_if_data *sdata); 309void mesh_path_quiesce(struct ieee80211_sub_if_data *sdata);
@@ -345,6 +344,7 @@ void ieee80211_mesh_quiesce(struct ieee80211_sub_if_data *sdata);
345void ieee80211_mesh_restart(struct ieee80211_sub_if_data *sdata); 344void ieee80211_mesh_restart(struct ieee80211_sub_if_data *sdata);
346void mesh_plink_quiesce(struct sta_info *sta); 345void mesh_plink_quiesce(struct sta_info *sta);
347void mesh_plink_restart(struct sta_info *sta); 346void mesh_plink_restart(struct sta_info *sta);
347void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
348void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata); 348void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata);
349#else 349#else
350#define mesh_allocated 0 350#define mesh_allocated 0
@@ -358,6 +358,8 @@ static inline void mesh_plink_quiesce(struct sta_info *sta) {}
358static inline void mesh_plink_restart(struct sta_info *sta) {} 358static inline void mesh_plink_restart(struct sta_info *sta) {}
359static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata) 359static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
360{ return false; } 360{ return false; }
361static inline void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)
362{}
361#endif 363#endif
362 364
363#endif /* IEEE80211S_H */ 365#endif /* IEEE80211S_H */