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>
This commit is contained in:
Alexander Aring 2014-11-05 20:51:19 +01:00 коммит произвёл Marcel Holtmann
Родитель bd28a11f25
Коммит e4962a1443
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -126,6 +126,7 @@ EXPORT_SYMBOL(ieee802154_free_hw);
int ieee802154_register_hw(struct ieee802154_hw *hw) int ieee802154_register_hw(struct ieee802154_hw *hw)
{ {
struct ieee802154_local *local = hw_to_local(hw); struct ieee802154_local *local = hw_to_local(hw);
struct net_device *dev;
int rc = -ENOSYS; int rc = -ENOSYS;
local->workqueue = local->workqueue =
@ -141,6 +142,17 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
if (rc < 0) if (rc < 0)
goto out_wq; 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; return 0;
out_wq: out_wq: