aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-17 02:20:54 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-17 03:49:17 -0500
commitcb41c8dd01d74d091618f72e28f0282f064a9f0a (patch)
treeb81251728589e0f91f90f17fde0799687b3841e8 /net/ieee802154
parentb821ecd4c8a0b3b1fc1bdd191bb7d555d818cafe (diff)
ieee802154: rename and move WPAN_NUM_ defines
This patch moves the 802.15.4 constraints WPAN_NUM_ defines into "net/ieee802154.h" which should contain all necessary 802.15.4 related information. Also rename these defines to a common name which is IEEE802154_MAX_CHANNEL and IEEE802154_MAX_PAGE. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/nl802154.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 6b9bc93944a6..b82b01669a67 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -245,7 +245,7 @@ nl802154_send_wpan_phy_channels(struct cfg802154_registered_device *rdev,
245 if (!nl_page) 245 if (!nl_page)
246 return -ENOBUFS; 246 return -ENOBUFS;
247 247
248 for (page = 0; page < WPAN_NUM_PAGES; page++) { 248 for (page = 0; page <= IEEE802154_MAX_PAGE; page++) {
249 if (nla_put_u32(msg, NL802154_ATTR_SUPPORTED_CHANNEL, 249 if (nla_put_u32(msg, NL802154_ATTR_SUPPORTED_CHANNEL,
250 rdev->wpan_phy.channels_supported[page])) 250 rdev->wpan_phy.channels_supported[page]))
251 return -ENOBUFS; 251 return -ENOBUFS;
@@ -616,7 +616,7 @@ static int nl802154_set_channel(struct sk_buff *skb, struct genl_info *info)
616 channel = nla_get_u8(info->attrs[NL802154_ATTR_CHANNEL]); 616 channel = nla_get_u8(info->attrs[NL802154_ATTR_CHANNEL]);
617 617
618 /* check 802.15.4 constraints */ 618 /* check 802.15.4 constraints */
619 if (page >= WPAN_NUM_PAGES || channel >= WPAN_NUM_CHANNELS) 619 if (page > IEEE802154_MAX_PAGE || channel > IEEE802154_MAX_CHANNEL)
620 return -EINVAL; 620 return -EINVAL;
621 621
622 return rdev_set_channel(rdev, page, channel); 622 return rdev_set_channel(rdev, page, channel);