ieee802154: add iftypes capability

This patch adds capability flags for supported interface types.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
This commit is contained in:
Alexander Aring 2015-05-17 21:44:47 +02:00 • committed by Marcel Holtmann
commit 65318680c9
3 changed files with 9 additions and 2 deletions

View file

@ -579,7 +579,8 @@ static int nl802154_new_interface(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NL802154_ATTR_IFTYPE]) {
type = nla_get_u32(info->attrs[NL802154_ATTR_IFTYPE]);
if (type > NL802154_IFTYPE_MAX)
if (type > NL802154_IFTYPE_MAX ||
!(rdev->wpan_phy.supported.iftypes & BIT(type)))
return -EINVAL;
}