aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-05 14:51:19 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-05 15:53:04 -0500
commite4962a14435e15c0c070e8aa1b010454c9292c02 (patch)
tree8bdd00b996a72f57f4e35fbbc079f20c7f87f8c2 /net/mac802154
parentbd28a11f25f2c2a563620e7be588dc4dd8a91396 (diff)
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')
-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);
126int ieee802154_register_hw(struct ieee802154_hw *hw) 126int ieee802154_register_hw(struct ieee802154_hw *hw)
127{ 127{
128 struct ieee802154_local *local = hw_to_local(hw); 128 struct ieee802154_local *local = hw_to_local(hw);
129 struct net_device *dev;
129 int rc = -ENOSYS; 130 int rc = -ENOSYS;
130 131
131 local->workqueue = 132 local->workqueue =
@@ -141,6 +142,17 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
141 if (rc < 0) 142 if (rc < 0)
142 goto out_wq; 143 goto out_wq;
143 144
145 rtnl_lock();
146
147 dev = ieee802154_if_add(local, "wpan%d", NULL, IEEE802154_DEV_WPAN);
148 if (IS_ERR(dev)) {
149 rtnl_unlock();
150 rc = PTR_ERR(dev);
151 goto out_wq;
152 }
153
154 rtnl_unlock();
155
144 return 0; 156 return 0;
145 157
146out_wq: 158out_wq: