aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee802154/netlink.c')
-rw-r--r--net/ieee802154/netlink.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c
index cd0567f06716..2106ecbf0308 100644
--- a/net/ieee802154/netlink.c
+++ b/net/ieee802154/netlink.c
@@ -232,7 +232,7 @@ nla_put_failure:
232EXPORT_SYMBOL(ieee802154_nl_beacon_indic); 232EXPORT_SYMBOL(ieee802154_nl_beacon_indic);
233 233
234int ieee802154_nl_scan_confirm(struct net_device *dev, 234int ieee802154_nl_scan_confirm(struct net_device *dev,
235 u8 status, u8 scan_type, u32 unscanned, 235 u8 status, u8 scan_type, u32 unscanned, u8 page,
236 u8 *edl/* , struct list_head *pan_desc_list */) 236 u8 *edl/* , struct list_head *pan_desc_list */)
237{ 237{
238 struct sk_buff *msg; 238 struct sk_buff *msg;
@@ -251,6 +251,7 @@ int ieee802154_nl_scan_confirm(struct net_device *dev,
251 NLA_PUT_U8(msg, IEEE802154_ATTR_STATUS, status); 251 NLA_PUT_U8(msg, IEEE802154_ATTR_STATUS, status);
252 NLA_PUT_U8(msg, IEEE802154_ATTR_SCAN_TYPE, scan_type); 252 NLA_PUT_U8(msg, IEEE802154_ATTR_SCAN_TYPE, scan_type);
253 NLA_PUT_U32(msg, IEEE802154_ATTR_CHANNELS, unscanned); 253 NLA_PUT_U32(msg, IEEE802154_ATTR_CHANNELS, unscanned);
254 NLA_PUT_U8(msg, IEEE802154_ATTR_PAGE, page);
254 255
255 if (edl) 256 if (edl)
256 NLA_PUT(msg, IEEE802154_ATTR_ED_LIST, 27, edl); 257 NLA_PUT(msg, IEEE802154_ATTR_ED_LIST, 27, edl);
@@ -349,6 +350,7 @@ static int ieee802154_associate_req(struct sk_buff *skb,
349{ 350{
350 struct net_device *dev; 351 struct net_device *dev;
351 struct ieee802154_addr addr; 352 struct ieee802154_addr addr;
353 u8 page;
352 int ret = -EINVAL; 354 int ret = -EINVAL;
353 355
354 if (!info->attrs[IEEE802154_ATTR_CHANNEL] || 356 if (!info->attrs[IEEE802154_ATTR_CHANNEL] ||
@@ -374,8 +376,14 @@ static int ieee802154_associate_req(struct sk_buff *skb,
374 } 376 }
375 addr.pan_id = nla_get_u16(info->attrs[IEEE802154_ATTR_COORD_PAN_ID]); 377 addr.pan_id = nla_get_u16(info->attrs[IEEE802154_ATTR_COORD_PAN_ID]);
376 378
379 if (info->attrs[IEEE802154_ATTR_PAGE])
380 page = nla_get_u8(info->attrs[IEEE802154_ATTR_PAGE]);
381 else
382 page = 0;
383
377 ret = ieee802154_mlme_ops(dev)->assoc_req(dev, &addr, 384 ret = ieee802154_mlme_ops(dev)->assoc_req(dev, &addr,
378 nla_get_u8(info->attrs[IEEE802154_ATTR_CHANNEL]), 385 nla_get_u8(info->attrs[IEEE802154_ATTR_CHANNEL]),
386 page,
379 nla_get_u8(info->attrs[IEEE802154_ATTR_CAPABILITY])); 387 nla_get_u8(info->attrs[IEEE802154_ATTR_CAPABILITY]));
380 388
381 dev_put(dev); 389 dev_put(dev);
@@ -458,6 +466,7 @@ static int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info)
458 struct ieee802154_addr addr; 466 struct ieee802154_addr addr;
459 467
460 u8 channel, bcn_ord, sf_ord; 468 u8 channel, bcn_ord, sf_ord;
469 u8 page;
461 int pan_coord, blx, coord_realign; 470 int pan_coord, blx, coord_realign;
462 int ret; 471 int ret;
463 472
@@ -488,13 +497,19 @@ static int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info)
488 blx = nla_get_u8(info->attrs[IEEE802154_ATTR_BAT_EXT]); 497 blx = nla_get_u8(info->attrs[IEEE802154_ATTR_BAT_EXT]);
489 coord_realign = nla_get_u8(info->attrs[IEEE802154_ATTR_COORD_REALIGN]); 498 coord_realign = nla_get_u8(info->attrs[IEEE802154_ATTR_COORD_REALIGN]);
490 499
500 if (info->attrs[IEEE802154_ATTR_PAGE])
501 page = nla_get_u8(info->attrs[IEEE802154_ATTR_PAGE]);
502 else
503 page = 0;
504
505
491 if (addr.short_addr == IEEE802154_ADDR_BROADCAST) { 506 if (addr.short_addr == IEEE802154_ADDR_BROADCAST) {
492 ieee802154_nl_start_confirm(dev, IEEE802154_NO_SHORT_ADDRESS); 507 ieee802154_nl_start_confirm(dev, IEEE802154_NO_SHORT_ADDRESS);
493 dev_put(dev); 508 dev_put(dev);
494 return -EINVAL; 509 return -EINVAL;
495 } 510 }
496 511
497 ret = ieee802154_mlme_ops(dev)->start_req(dev, &addr, channel, 512 ret = ieee802154_mlme_ops(dev)->start_req(dev, &addr, channel, page,
498 bcn_ord, sf_ord, pan_coord, blx, coord_realign); 513 bcn_ord, sf_ord, pan_coord, blx, coord_realign);
499 514
500 dev_put(dev); 515 dev_put(dev);
@@ -508,6 +523,7 @@ static int ieee802154_scan_req(struct sk_buff *skb, struct genl_info *info)
508 u8 type; 523 u8 type;
509 u32 channels; 524 u32 channels;
510 u8 duration; 525 u8 duration;
526 u8 page;
511 527
512 if (!info->attrs[IEEE802154_ATTR_SCAN_TYPE] || 528 if (!info->attrs[IEEE802154_ATTR_SCAN_TYPE] ||
513 !info->attrs[IEEE802154_ATTR_CHANNELS] || 529 !info->attrs[IEEE802154_ATTR_CHANNELS] ||
@@ -522,7 +538,13 @@ static int ieee802154_scan_req(struct sk_buff *skb, struct genl_info *info)
522 channels = nla_get_u32(info->attrs[IEEE802154_ATTR_CHANNELS]); 538 channels = nla_get_u32(info->attrs[IEEE802154_ATTR_CHANNELS]);
523 duration = nla_get_u8(info->attrs[IEEE802154_ATTR_DURATION]); 539 duration = nla_get_u8(info->attrs[IEEE802154_ATTR_DURATION]);
524 540
525 ret = ieee802154_mlme_ops(dev)->scan_req(dev, type, channels, 541 if (info->attrs[IEEE802154_ATTR_PAGE])
542 page = nla_get_u8(info->attrs[IEEE802154_ATTR_PAGE]);
543 else
544 page = 0;
545
546
547 ret = ieee802154_mlme_ops(dev)->scan_req(dev, type, channels, page,
526 duration); 548 duration);
527 549
528 dev_put(dev); 550 dev_put(dev);