aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authoralex.bluesman.smirnov@gmail.com <alex.bluesman.smirnov@gmail.com>2012-05-15 16:50:27 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-16 15:17:08 -0400
commit90c049b2c6ae26d1a4d526d660a976620eaa554a (patch)
treef13681c6d06def2dceb6dabfa1821eb153ce00f1 /net/ieee802154
parentef2486f5538b886ad4f0d1ac0857b518291b48f7 (diff)
ieee802154: interface type to be added
This stack implementation distinguishes several types of slave interfaces. Another parameter to 'add_iface_' function is added to clarify the interface type is going to be registered. Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/nl-phy.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 3bdc4303c339..eed291626da6 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -179,6 +179,7 @@ static int ieee802154_add_iface(struct sk_buff *skb,
179 const char *devname; 179 const char *devname;
180 int rc = -ENOBUFS; 180 int rc = -ENOBUFS;
181 struct net_device *dev; 181 struct net_device *dev;
182 int type = __IEEE802154_DEV_INVALID;
182 183
183 pr_debug("%s\n", __func__); 184 pr_debug("%s\n", __func__);
184 185
@@ -221,7 +222,13 @@ static int ieee802154_add_iface(struct sk_buff *skb,
221 goto nla_put_failure; 222 goto nla_put_failure;
222 } 223 }
223 224
224 dev = phy->add_iface(phy, devname); 225 if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) {
226 type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]);
227 if (type >= __IEEE802154_DEV_MAX)
228 return -EINVAL;
229 }
230
231 dev = phy->add_iface(phy, devname, type);
225 if (IS_ERR(dev)) { 232 if (IS_ERR(dev)) {
226 rc = PTR_ERR(dev); 233 rc = PTR_ERR(dev);
227 goto nla_put_failure; 234 goto nla_put_failure;