static void ieee802154_del_iface_deprecated(struct wpan_phy *wpan_phy,
struct net_device *dev)
{
- mac802154_del_iface(wpan_phy, dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
+
+ ieee802154_if_remove(sdata);
}
const struct cfg802154_ops mac802154_config_ops = {
struct net_device *
mac802154_add_iface(struct wpan_phy *phy, const char *name, int type);
-void mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev);
+void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata);
#endif /* __IEEE802154_I_H */
sdata->promisuous_mode = true;
}
+
+void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata)
+{
+ ASSERT_RTNL();
+
+ mutex_lock(&sdata->local->iflist_mtx);
+ list_del_rcu(&sdata->list);
+ mutex_unlock(&sdata->local->iflist_mtx);
+
+ synchronize_rcu();
+ unregister_netdevice(sdata->dev);
+}
return 0;
}
-void mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev)
-{
- struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
-
- ASSERT_RTNL();
-
- BUG_ON(sdata->local->phy != phy);
-
- mutex_lock(&sdata->local->iflist_mtx);
- list_del_rcu(&sdata->list);
- mutex_unlock(&sdata->local->iflist_mtx);
-
- synchronize_rcu();
- unregister_netdevice(sdata->dev);
-}
-
struct net_device *
mac802154_add_iface(struct wpan_phy *phy, const char *name, int type)
{