summaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-17 08:20:53 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-11-17 09:49:17 +0100
commitb821ecd4c8a0b3b1fc1bdd191bb7d555d818cafe (patch)
treec8f3ac6ef58c923437e200b7d96b6c7987576dd7 /net/mac802154
parentieee802154: setting extended address while iface add (diff)
downloadlinux-b821ecd4c8a0b3b1fc1bdd191bb7d555d818cafe.tar.xz
linux-b821ecd4c8a0b3b1fc1bdd191bb7d555d818cafe.zip
ieee802154: add del interface command
This patch adds support for deleting a wpan interface via nl802154. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/cfg.c9
-rw-r--r--net/mac802154/ieee802154_i.h6
2 files changed, 15 insertions, 0 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index 568d712bfc8c..7def2625eaca 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -58,6 +58,14 @@ ieee802154_add_iface(struct wpan_phy *phy, const char *name,
}
static int
+ieee802154_del_iface(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev)
+{
+ ieee802154_if_remove(IEEE802154_WPAN_DEV_TO_SUB_IF(wpan_dev));
+
+ return 0;
+}
+
+static int
ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel)
{
struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
@@ -191,6 +199,7 @@ const struct cfg802154_ops mac802154_config_ops = {
.add_virtual_intf_deprecated = ieee802154_add_iface_deprecated,
.del_virtual_intf_deprecated = ieee802154_del_iface_deprecated,
.add_virtual_intf = ieee802154_add_iface,
+ .del_virtual_intf = ieee802154_del_iface,
.set_channel = ieee802154_set_channel,
.set_pan_id = ieee802154_set_pan_id,
.set_short_addr = ieee802154_set_short_addr,
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index cc691637d24b..bebd70ffc7a3 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -115,6 +115,12 @@ IEEE802154_DEV_TO_SUB_IF(const struct net_device *dev)
return netdev_priv(dev);
}
+static inline struct ieee802154_sub_if_data *
+IEEE802154_WPAN_DEV_TO_SUB_IF(struct wpan_dev *wpan_dev)
+{
+ return container_of(wpan_dev, struct ieee802154_sub_if_data, wpan_dev);
+}
+
static inline bool
ieee802154_sdata_running(struct ieee802154_sub_if_data *sdata)
{