Lines Matching refs:attrs

149 	if (info->attrs[IEEE802154_ATTR_DEV_NAME]) {  in ieee802154_nl_get_dev()
152 nla_strscpy(name, info->attrs[IEEE802154_ATTR_DEV_NAME], in ieee802154_nl_get_dev()
155 } else if (info->attrs[IEEE802154_ATTR_DEV_INDEX]) { in ieee802154_nl_get_dev()
157 nla_get_u32(info->attrs[IEEE802154_ATTR_DEV_INDEX])); in ieee802154_nl_get_dev()
180 if (!info->attrs[IEEE802154_ATTR_CHANNEL] || in ieee802154_associate_req()
181 !info->attrs[IEEE802154_ATTR_COORD_PAN_ID] || in ieee802154_associate_req()
182 (!info->attrs[IEEE802154_ATTR_COORD_HW_ADDR] && in ieee802154_associate_req()
183 !info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR]) || in ieee802154_associate_req()
184 !info->attrs[IEEE802154_ATTR_CAPABILITY]) in ieee802154_associate_req()
193 if (info->attrs[IEEE802154_ATTR_COORD_HW_ADDR]) { in ieee802154_associate_req()
196 info->attrs[IEEE802154_ATTR_COORD_HW_ADDR]); in ieee802154_associate_req()
200 info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR]); in ieee802154_associate_req()
203 info->attrs[IEEE802154_ATTR_COORD_PAN_ID]); in ieee802154_associate_req()
205 if (info->attrs[IEEE802154_ATTR_PAGE]) in ieee802154_associate_req()
206 page = nla_get_u8(info->attrs[IEEE802154_ATTR_PAGE]); in ieee802154_associate_req()
211 nla_get_u8(info->attrs[IEEE802154_ATTR_CHANNEL]), in ieee802154_associate_req()
213 nla_get_u8(info->attrs[IEEE802154_ATTR_CAPABILITY])); in ieee802154_associate_req()
226 if (!info->attrs[IEEE802154_ATTR_STATUS] || in ieee802154_associate_resp()
227 !info->attrs[IEEE802154_ATTR_DEST_HW_ADDR] || in ieee802154_associate_resp()
228 !info->attrs[IEEE802154_ATTR_DEST_SHORT_ADDR]) in ieee802154_associate_resp()
239 info->attrs[IEEE802154_ATTR_DEST_HW_ADDR]); in ieee802154_associate_resp()
245 nla_get_shortaddr(info->attrs[IEEE802154_ATTR_DEST_SHORT_ADDR]), in ieee802154_associate_resp()
246 nla_get_u8(info->attrs[IEEE802154_ATTR_STATUS])); in ieee802154_associate_resp()
259 if ((!info->attrs[IEEE802154_ATTR_DEST_HW_ADDR] && in ieee802154_disassociate_req()
260 !info->attrs[IEEE802154_ATTR_DEST_SHORT_ADDR]) || in ieee802154_disassociate_req()
261 !info->attrs[IEEE802154_ATTR_REASON]) in ieee802154_disassociate_req()
270 if (info->attrs[IEEE802154_ATTR_DEST_HW_ADDR]) { in ieee802154_disassociate_req()
273 info->attrs[IEEE802154_ATTR_DEST_HW_ADDR]); in ieee802154_disassociate_req()
277 info->attrs[IEEE802154_ATTR_DEST_SHORT_ADDR]); in ieee802154_disassociate_req()
284 nla_get_u8(info->attrs[IEEE802154_ATTR_REASON])); in ieee802154_disassociate_req()
305 if (!info->attrs[IEEE802154_ATTR_COORD_PAN_ID] || in ieee802154_start_req()
306 !info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR] || in ieee802154_start_req()
307 !info->attrs[IEEE802154_ATTR_CHANNEL] || in ieee802154_start_req()
308 !info->attrs[IEEE802154_ATTR_BCN_ORD] || in ieee802154_start_req()
309 !info->attrs[IEEE802154_ATTR_SF_ORD] || in ieee802154_start_req()
310 !info->attrs[IEEE802154_ATTR_PAN_COORD] || in ieee802154_start_req()
311 !info->attrs[IEEE802154_ATTR_BAT_EXT] || in ieee802154_start_req()
312 !info->attrs[IEEE802154_ATTR_COORD_REALIGN] in ieee802154_start_req()
330 info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR]); in ieee802154_start_req()
332 info->attrs[IEEE802154_ATTR_COORD_PAN_ID]); in ieee802154_start_req()
334 channel = nla_get_u8(info->attrs[IEEE802154_ATTR_CHANNEL]); in ieee802154_start_req()
335 bcn_ord = nla_get_u8(info->attrs[IEEE802154_ATTR_BCN_ORD]); in ieee802154_start_req()
336 sf_ord = nla_get_u8(info->attrs[IEEE802154_ATTR_SF_ORD]); in ieee802154_start_req()
337 pan_coord = nla_get_u8(info->attrs[IEEE802154_ATTR_PAN_COORD]); in ieee802154_start_req()
338 blx = nla_get_u8(info->attrs[IEEE802154_ATTR_BAT_EXT]); in ieee802154_start_req()
339 coord_realign = nla_get_u8(info->attrs[IEEE802154_ATTR_COORD_REALIGN]); in ieee802154_start_req()
341 if (info->attrs[IEEE802154_ATTR_PAGE]) in ieee802154_start_req()
342 page = nla_get_u8(info->attrs[IEEE802154_ATTR_PAGE]); in ieee802154_start_req()
376 if (!info->attrs[IEEE802154_ATTR_SCAN_TYPE] || in ieee802154_scan_req()
377 !info->attrs[IEEE802154_ATTR_CHANNELS] || in ieee802154_scan_req()
378 !info->attrs[IEEE802154_ATTR_DURATION]) in ieee802154_scan_req()
387 type = nla_get_u8(info->attrs[IEEE802154_ATTR_SCAN_TYPE]); in ieee802154_scan_req()
388 channels = nla_get_u32(info->attrs[IEEE802154_ATTR_CHANNELS]); in ieee802154_scan_req()
389 duration = nla_get_u8(info->attrs[IEEE802154_ATTR_DURATION]); in ieee802154_scan_req()
391 if (info->attrs[IEEE802154_ATTR_PAGE]) in ieee802154_scan_req()
392 page = nla_get_u8(info->attrs[IEEE802154_ATTR_PAGE]); in ieee802154_scan_req()
490 if (!info->attrs[IEEE802154_ATTR_LBT_ENABLED] && in ieee802154_set_macparams()
491 !info->attrs[IEEE802154_ATTR_CCA_MODE] && in ieee802154_set_macparams()
492 !info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL] && in ieee802154_set_macparams()
493 !info->attrs[IEEE802154_ATTR_CSMA_RETRIES] && in ieee802154_set_macparams()
494 !info->attrs[IEEE802154_ATTR_CSMA_MIN_BE] && in ieee802154_set_macparams()
495 !info->attrs[IEEE802154_ATTR_CSMA_MAX_BE] && in ieee802154_set_macparams()
496 !info->attrs[IEEE802154_ATTR_FRAME_RETRIES]) in ieee802154_set_macparams()
505 if (info->attrs[IEEE802154_ATTR_TXPOWER]) in ieee802154_set_macparams()
506 params.transmit_power = nla_get_s8(info->attrs[IEEE802154_ATTR_TXPOWER]) * 100; in ieee802154_set_macparams()
508 if (info->attrs[IEEE802154_ATTR_LBT_ENABLED]) in ieee802154_set_macparams()
509 params.lbt = nla_get_u8(info->attrs[IEEE802154_ATTR_LBT_ENABLED]); in ieee802154_set_macparams()
511 if (info->attrs[IEEE802154_ATTR_CCA_MODE]) in ieee802154_set_macparams()
512 params.cca.mode = nla_get_u8(info->attrs[IEEE802154_ATTR_CCA_MODE]); in ieee802154_set_macparams()
514 if (info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL]) in ieee802154_set_macparams()
515 params.cca_ed_level = nla_get_s32(info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL]) * 100; in ieee802154_set_macparams()
517 if (info->attrs[IEEE802154_ATTR_CSMA_RETRIES]) in ieee802154_set_macparams()
518 params.csma_retries = nla_get_u8(info->attrs[IEEE802154_ATTR_CSMA_RETRIES]); in ieee802154_set_macparams()
520 if (info->attrs[IEEE802154_ATTR_CSMA_MIN_BE]) in ieee802154_set_macparams()
521 params.min_be = nla_get_u8(info->attrs[IEEE802154_ATTR_CSMA_MIN_BE]); in ieee802154_set_macparams()
523 if (info->attrs[IEEE802154_ATTR_CSMA_MAX_BE]) in ieee802154_set_macparams()
524 params.max_be = nla_get_u8(info->attrs[IEEE802154_ATTR_CSMA_MAX_BE]); in ieee802154_set_macparams()
526 if (info->attrs[IEEE802154_ATTR_FRAME_RETRIES]) in ieee802154_set_macparams()
527 params.frame_retries = nla_get_s8(info->attrs[IEEE802154_ATTR_FRAME_RETRIES]); in ieee802154_set_macparams()
548 if (!info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE]) in ieee802154_llsec_parse_key_id()
551 desc->mode = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE]); in ieee802154_llsec_parse_key_id()
554 if (!info->attrs[IEEE802154_ATTR_PAN_ID]) in ieee802154_llsec_parse_key_id()
557 desc->device_addr.pan_id = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_PAN_ID]); in ieee802154_llsec_parse_key_id()
559 if (info->attrs[IEEE802154_ATTR_SHORT_ADDR]) { in ieee802154_llsec_parse_key_id()
561 desc->device_addr.short_addr = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_SHORT_ADDR]); in ieee802154_llsec_parse_key_id()
563 if (!info->attrs[IEEE802154_ATTR_HW_ADDR]) in ieee802154_llsec_parse_key_id()
567 desc->device_addr.extended_addr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); in ieee802154_llsec_parse_key_id()
572 !info->attrs[IEEE802154_ATTR_LLSEC_KEY_ID]) in ieee802154_llsec_parse_key_id()
576 !info->attrs[IEEE802154_ATTR_LLSEC_KEY_SOURCE_SHORT]) in ieee802154_llsec_parse_key_id()
580 !info->attrs[IEEE802154_ATTR_LLSEC_KEY_SOURCE_EXTENDED]) in ieee802154_llsec_parse_key_id()
584 desc->id = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_KEY_ID]); in ieee802154_llsec_parse_key_id()
589 u32 source = nla_get_u32(info->attrs[IEEE802154_ATTR_LLSEC_KEY_SOURCE_SHORT]); in ieee802154_llsec_parse_key_id()
595 desc->extended_source = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_LLSEC_KEY_SOURCE_EXTENDED]); in ieee802154_llsec_parse_key_id()
712 if (!info->attrs[IEEE802154_ATTR_LLSEC_ENABLED] && in ieee802154_llsec_setparams()
713 !info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE] && in ieee802154_llsec_setparams()
714 !info->attrs[IEEE802154_ATTR_LLSEC_SECLEVEL]) in ieee802154_llsec_setparams()
723 if (info->attrs[IEEE802154_ATTR_LLSEC_SECLEVEL] && in ieee802154_llsec_setparams()
724 nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_SECLEVEL]) > 7) in ieee802154_llsec_setparams()
727 if (info->attrs[IEEE802154_ATTR_LLSEC_ENABLED]) { in ieee802154_llsec_setparams()
728 params.enabled = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_ENABLED]); in ieee802154_llsec_setparams()
732 if (info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE]) { in ieee802154_llsec_setparams()
739 if (info->attrs[IEEE802154_ATTR_LLSEC_SECLEVEL]) { in ieee802154_llsec_setparams()
740 params.out_level = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_SECLEVEL]); in ieee802154_llsec_setparams()
744 if (info->attrs[IEEE802154_ATTR_LLSEC_FRAME_COUNTER]) { in ieee802154_llsec_setparams()
745 u32 fc = nla_get_u32(info->attrs[IEEE802154_ATTR_LLSEC_FRAME_COUNTER]); in ieee802154_llsec_setparams()
842 if (!info->attrs[IEEE802154_ATTR_LLSEC_KEY_USAGE_FRAME_TYPES] || in ieee802154_llsec_parse_key()
843 !info->attrs[IEEE802154_ATTR_LLSEC_KEY_BYTES]) in ieee802154_llsec_parse_key()
846 frames = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_KEY_USAGE_FRAME_TYPES]); in ieee802154_llsec_parse_key()
848 !info->attrs[IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS]) in ieee802154_llsec_parse_key()
851 if (info->attrs[IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS]) { in ieee802154_llsec_parse_key()
853 info->attrs[IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS], in ieee802154_llsec_parse_key()
866 nla_memcpy(key->key, info->attrs[IEEE802154_ATTR_LLSEC_KEY_BYTES], in ieee802154_llsec_parse_key()
983 if (!info->attrs[IEEE802154_ATTR_LLSEC_FRAME_COUNTER] || in llsec_parse_dev()
984 !info->attrs[IEEE802154_ATTR_HW_ADDR] || in llsec_parse_dev()
985 !info->attrs[IEEE802154_ATTR_LLSEC_DEV_OVERRIDE] || in llsec_parse_dev()
986 !info->attrs[IEEE802154_ATTR_LLSEC_DEV_KEY_MODE] || in llsec_parse_dev()
987 (!!info->attrs[IEEE802154_ATTR_PAN_ID] != in llsec_parse_dev()
988 !!info->attrs[IEEE802154_ATTR_SHORT_ADDR])) in llsec_parse_dev()
991 if (info->attrs[IEEE802154_ATTR_PAN_ID]) { in llsec_parse_dev()
992 dev->pan_id = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_PAN_ID]); in llsec_parse_dev()
993 dev->short_addr = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_SHORT_ADDR]); in llsec_parse_dev()
998 dev->hwaddr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); in llsec_parse_dev()
999 dev->frame_counter = nla_get_u32(info->attrs[IEEE802154_ATTR_LLSEC_FRAME_COUNTER]); in llsec_parse_dev()
1000 dev->seclevel_exempt = !!nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_DEV_OVERRIDE]); in llsec_parse_dev()
1001 dev->key_mode = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_DEV_KEY_MODE]); in llsec_parse_dev()
1034 if (!info->attrs[IEEE802154_ATTR_HW_ADDR]) in llsec_del_dev()
1037 devaddr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); in llsec_del_dev()
1114 if (!info->attrs[IEEE802154_ATTR_LLSEC_FRAME_COUNTER] || in llsec_add_devkey()
1115 !info->attrs[IEEE802154_ATTR_HW_ADDR] || in llsec_add_devkey()
1119 devaddr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); in llsec_add_devkey()
1120 key.frame_counter = nla_get_u32(info->attrs[IEEE802154_ATTR_LLSEC_FRAME_COUNTER]); in llsec_add_devkey()
1140 if (!info->attrs[IEEE802154_ATTR_HW_ADDR] || in llsec_del_devkey()
1144 devaddr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); in llsec_del_devkey()
1229 if (!info->attrs[IEEE802154_ATTR_LLSEC_FRAME_TYPE] || in llsec_parse_seclevel()
1230 !info->attrs[IEEE802154_ATTR_LLSEC_SECLEVELS] || in llsec_parse_seclevel()
1231 !info->attrs[IEEE802154_ATTR_LLSEC_DEV_OVERRIDE]) in llsec_parse_seclevel()
1234 sl->frame_type = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_FRAME_TYPE]); in llsec_parse_seclevel()
1236 if (!info->attrs[IEEE802154_ATTR_LLSEC_CMD_FRAME_ID]) in llsec_parse_seclevel()
1239 sl->cmd_frame_id = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_CMD_FRAME_ID]); in llsec_parse_seclevel()
1242 sl->sec_levels = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_SECLEVELS]); in llsec_parse_seclevel()
1243 sl->device_override = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_DEV_OVERRIDE]); in llsec_parse_seclevel()