Commit 94c514fe authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by John W. Linville

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: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ad128860
...@@ -1031,6 +1031,18 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, ...@@ -1031,6 +1031,18 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
ieee80211_debugfs_add_netdev(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, static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata,
enum nl80211_iftype type) enum nl80211_iftype type)
{ {
...@@ -1364,8 +1376,8 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata) ...@@ -1364,8 +1376,8 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata)
list_del_rcu(&sdata->list); list_del_rcu(&sdata->list);
mutex_unlock(&sdata->local->iflist_mtx); mutex_unlock(&sdata->local->iflist_mtx);
if (ieee80211_vif_is_mesh(&sdata->vif)) /* clean up type-dependent data */
mesh_path_flush_by_iface(sdata); ieee80211_clean_sdata(sdata);
synchronize_rcu(); synchronize_rcu();
unregister_netdevice(sdata->dev); unregister_netdevice(sdata->dev);
...@@ -1386,8 +1398,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) ...@@ -1386,8 +1398,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
list_del(&sdata->list); list_del(&sdata->list);
if (ieee80211_vif_is_mesh(&sdata->vif)) ieee80211_clean_sdata(sdata);
mesh_path_flush_by_iface(sdata);
unregister_netdevice_queue(sdata->dev, &unreg_list); unregister_netdevice_queue(sdata->dev, &unreg_list);
} }
......
...@@ -304,7 +304,6 @@ void mesh_pathtbl_unregister(void); ...@@ -304,7 +304,6 @@ void mesh_pathtbl_unregister(void);
int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata); int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata);
void mesh_path_timer(unsigned long data); void mesh_path_timer(unsigned long data);
void mesh_path_flush_by_nexthop(struct sta_info *sta); void mesh_path_flush_by_nexthop(struct sta_info *sta);
void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
void mesh_path_discard_frame(struct sk_buff *skb, void mesh_path_discard_frame(struct sk_buff *skb,
struct ieee80211_sub_if_data *sdata); struct ieee80211_sub_if_data *sdata);
void mesh_path_quiesce(struct ieee80211_sub_if_data *sdata); void mesh_path_quiesce(struct ieee80211_sub_if_data *sdata);
...@@ -345,6 +344,7 @@ void ieee80211_mesh_quiesce(struct ieee80211_sub_if_data *sdata); ...@@ -345,6 +344,7 @@ void ieee80211_mesh_quiesce(struct ieee80211_sub_if_data *sdata);
void ieee80211_mesh_restart(struct ieee80211_sub_if_data *sdata); void ieee80211_mesh_restart(struct ieee80211_sub_if_data *sdata);
void mesh_plink_quiesce(struct sta_info *sta); void mesh_plink_quiesce(struct sta_info *sta);
void mesh_plink_restart(struct sta_info *sta); void mesh_plink_restart(struct sta_info *sta);
void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata); void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata);
#else #else
#define mesh_allocated 0 #define mesh_allocated 0
...@@ -358,6 +358,8 @@ static inline void mesh_plink_quiesce(struct sta_info *sta) {} ...@@ -358,6 +358,8 @@ static inline void mesh_plink_quiesce(struct sta_info *sta) {}
static inline void mesh_plink_restart(struct sta_info *sta) {} static inline void mesh_plink_restart(struct sta_info *sta) {}
static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata) static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
{ return false; } { return false; }
static inline void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)
{}
#endif #endif
#endif /* IEEE80211S_H */ #endif /* IEEE80211S_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment