summaryrefslogtreecommitdiffstats
path: root/net/mac802154/main.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-05 20:51:19 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-11-05 21:53:04 +0100
commite4962a14435e15c0c070e8aa1b010454c9292c02 (patch)
tree8bdd00b996a72f57f4e35fbbc079f20c7f87f8c2 /net/mac802154/main.c
parentbd28a11f25f2c2a563620e7be588dc4dd8a91396 (diff)
downloadlinux-e4962a14435e15c0c070e8aa1b010454c9292c02.tar.gz
linux-e4962a14435e15c0c070e8aa1b010454c9292c02.tar.bz2
linux-e4962a14435e15c0c070e8aa1b010454c9292c02.zip
mac802154: add default interface registration
This patch adds a default interface registration for a wpan interface type. Currently the 802.15.4 subsystem need to call userspace tools to add an interface. This patch is like mac80211 handling for registration a station interface type by default. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/main.c')
-rw-r--r--net/mac802154/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index a371eb5fa053..7d0ff7fd2cd4 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -126,6 +126,7 @@ EXPORT_SYMBOL(ieee802154_free_hw);
int ieee802154_register_hw(struct ieee802154_hw *hw)
{
struct ieee802154_local *local = hw_to_local(hw);
+ struct net_device *dev;
int rc = -ENOSYS;
local->workqueue =
@@ -141,6 +142,17 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
if (rc < 0)
goto out_wq;
+ rtnl_lock();
+
+ dev = ieee802154_if_add(local, "wpan%d", NULL, IEEE802154_DEV_WPAN);
+ if (IS_ERR(dev)) {
+ rtnl_unlock();
+ rc = PTR_ERR(dev);
+ goto out_wq;
+ }
+
+ rtnl_unlock();
+
return 0;
out_wq: