提交 592dfbfc 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

mac820154: move interface unregistration into iface

This patch move the iface unregistration into iface.c file to have
a behaviour which is similar like mac80211. Also iface handling should
be inside iface.c file only.
Signed-off-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 4e790226
无相关合并请求
...@@ -172,5 +172,6 @@ void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata); ...@@ -172,5 +172,6 @@ void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata);
struct net_device * struct net_device *
ieee802154_if_add(struct ieee802154_local *local, const char *name, ieee802154_if_add(struct ieee802154_local *local, const char *name,
struct wpan_dev **new_wpan_dev, int type); struct wpan_dev **new_wpan_dev, int type);
void ieee802154_remove_interfaces(struct ieee802154_local *local);
#endif /* __IEEE802154_I_H */ #endif /* __IEEE802154_I_H */
...@@ -535,3 +535,16 @@ void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata) ...@@ -535,3 +535,16 @@ void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata)
synchronize_rcu(); synchronize_rcu();
unregister_netdevice(sdata->dev); unregister_netdevice(sdata->dev);
} }
void ieee802154_remove_interfaces(struct ieee802154_local *local)
{
struct ieee802154_sub_if_data *sdata, *next;
list_for_each_entry_safe(sdata, next, &local->interfaces, list) {
mutex_lock(&sdata->local->iflist_mtx);
list_del(&sdata->list);
mutex_unlock(&sdata->local->iflist_mtx);
unregister_netdevice(sdata->dev);
}
}
...@@ -165,7 +165,6 @@ EXPORT_SYMBOL(ieee802154_register_hw); ...@@ -165,7 +165,6 @@ EXPORT_SYMBOL(ieee802154_register_hw);
void ieee802154_unregister_hw(struct ieee802154_hw *hw) void ieee802154_unregister_hw(struct ieee802154_hw *hw)
{ {
struct ieee802154_local *local = hw_to_local(hw); struct ieee802154_local *local = hw_to_local(hw);
struct ieee802154_sub_if_data *sdata, *next;
tasklet_kill(&local->tasklet); tasklet_kill(&local->tasklet);
flush_workqueue(local->workqueue); flush_workqueue(local->workqueue);
...@@ -173,13 +172,7 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw) ...@@ -173,13 +172,7 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw)
rtnl_lock(); rtnl_lock();
list_for_each_entry_safe(sdata, next, &local->interfaces, list) { ieee802154_remove_interfaces(local);
mutex_lock(&sdata->local->iflist_mtx);
list_del(&sdata->list);
mutex_unlock(&sdata->local->iflist_mtx);
unregister_netdevice(sdata->dev);
}
rtnl_unlock(); rtnl_unlock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部