From d5ae67bacd9654b0e26b9f248249e9ee1b6e338b Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Wed, 5 Nov 2014 20:51:17 +0100 Subject: ieee802154: rework interface registration This patch meld mac802154_netdev_register into ieee802154_if_add function. Also we have now only one alloc_netdev call with one interface setup routine "ieee802154_if_setup" instead two different one for each interface type. This patch checks via runtime the interface type and do different handling now. Additional we add the wpan_dev struct in ieee802154_sub_if_data and set the new ieee802154_ptr while netdev registration. This behaviour is very similar the mac80211 netdev registration functionality. Signed-off-by: Alexander Aring Signed-off-by: Marcel Holtmann --- net/mac802154/cfg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'net/mac802154/cfg.c') diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c index 0a08f66512b3..d2c4e8f89720 100644 --- a/net/mac802154/cfg.c +++ b/net/mac802154/cfg.c @@ -13,6 +13,7 @@ * Based on: net/mac80211/cfg.c */ +#include #include #include "ieee802154_i.h" @@ -23,8 +24,13 @@ ieee802154_add_iface_deprecated(struct wpan_phy *wpan_phy, const char *name, int type) { struct ieee802154_local *local = wpan_phy_priv(wpan_phy); + struct net_device *dev; - return ieee802154_if_add(local, name, NULL, type); + rtnl_lock(); + dev = ieee802154_if_add(local, name, NULL, type); + rtnl_unlock(); + + return dev; } static void ieee802154_del_iface_deprecated(struct wpan_phy *wpan_phy, -- cgit v1.2.3-59-g8ed1b