Lines Matching refs:rdev
41 struct cfg802154_registered_device *rdev; in __cfg802154_wpan_dev_from_attrs() local
61 list_for_each_entry(rdev, &cfg802154_rdev_list, list) { in __cfg802154_wpan_dev_from_attrs()
64 if (wpan_phy_net(&rdev->wpan_phy) != netns) in __cfg802154_wpan_dev_from_attrs()
67 if (have_wpan_dev_id && rdev->wpan_phy_idx != wpan_phy_idx) in __cfg802154_wpan_dev_from_attrs()
70 list_for_each_entry(wpan_dev, &rdev->wpan_dev_list, list) { in __cfg802154_wpan_dev_from_attrs()
96 struct cfg802154_registered_device *rdev = NULL, *tmp; in __cfg802154_rdev_from_attrs() local
107 rdev = cfg802154_rdev_by_wpan_phy_idx( in __cfg802154_rdev_from_attrs()
128 if (rdev && tmp != rdev) in __cfg802154_rdev_from_attrs()
130 rdev = tmp; in __cfg802154_rdev_from_attrs()
150 if (rdev && tmp != rdev) in __cfg802154_rdev_from_attrs()
153 rdev = tmp; in __cfg802154_rdev_from_attrs()
157 if (!rdev) in __cfg802154_rdev_from_attrs()
160 if (netns != wpan_phy_net(&rdev->wpan_phy)) in __cfg802154_rdev_from_attrs()
163 return rdev; in __cfg802154_rdev_from_attrs()
255 struct cfg802154_registered_device **rdev, in nl802154_prepare_wpan_dev_dump() argument
270 *rdev = wpan_phy_to_rdev((*wpan_dev)->wpan_phy); in nl802154_prepare_wpan_dev_dump()
272 cb->args[0] = (*rdev)->wpan_phy_idx + 1; in nl802154_prepare_wpan_dev_dump()
283 *rdev = wpan_phy_to_rdev(wpan_phy); in nl802154_prepare_wpan_dev_dump()
286 list_for_each_entry(tmp, &(*rdev)->wpan_dev_list, list) { in nl802154_prepare_wpan_dev_dump()
306 nl802154_finish_wpan_dev_dump(struct cfg802154_registered_device *rdev) in nl802154_finish_wpan_dev_dump() argument
343 nl802154_send_wpan_phy_channels(struct cfg802154_registered_device *rdev, in nl802154_send_wpan_phy_channels() argument
355 rdev->wpan_phy.supported.channels[page])) in nl802154_send_wpan_phy_channels()
365 struct cfg802154_registered_device *rdev) in nl802154_put_capabilities() argument
367 const struct wpan_phy_supported *caps = &rdev->wpan_phy.supported; in nl802154_put_capabilities()
388 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_ED_LEVEL) { in nl802154_put_capabilities()
404 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_TXPOWER) { in nl802154_put_capabilities()
420 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_MODE) { in nl802154_put_capabilities()
450 static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev, in nl802154_send_wpan_phy() argument
463 if (nla_put_u32(msg, NL802154_ATTR_WPAN_PHY, rdev->wpan_phy_idx) || in nl802154_send_wpan_phy()
465 wpan_phy_name(&rdev->wpan_phy)) || in nl802154_send_wpan_phy()
477 rdev->wpan_phy.current_page) || in nl802154_send_wpan_phy()
479 rdev->wpan_phy.current_channel)) in nl802154_send_wpan_phy()
485 if (nl802154_send_wpan_phy_channels(rdev, msg)) in nl802154_send_wpan_phy()
489 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_MODE) { in nl802154_send_wpan_phy()
491 rdev->wpan_phy.cca.mode)) in nl802154_send_wpan_phy()
494 if (rdev->wpan_phy.cca.mode == NL802154_CCA_ENERGY_CARRIER) { in nl802154_send_wpan_phy()
496 rdev->wpan_phy.cca.opt)) in nl802154_send_wpan_phy()
501 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_TXPOWER) { in nl802154_send_wpan_phy()
503 rdev->wpan_phy.transmit_power)) in nl802154_send_wpan_phy()
507 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_ED_LEVEL) { in nl802154_send_wpan_phy()
509 rdev->wpan_phy.cca_ed_level)) in nl802154_send_wpan_phy()
513 if (nl802154_put_capabilities(msg, rdev)) in nl802154_send_wpan_phy()
523 if (rdev->ops->op) { \ in nl802154_send_wpan_phy()
541 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_TXPOWER) in nl802154_send_wpan_phy()
544 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_ED_LEVEL) in nl802154_send_wpan_phy()
547 if (rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_MODE) in nl802154_send_wpan_phy()
581 struct cfg802154_registered_device *rdev; in nl802154_dump_wpan_phy_parse() local
588 rdev = wpan_phy_to_rdev( in nl802154_dump_wpan_phy_parse()
590 state->filter_wpan_phy = rdev->wpan_phy_idx; in nl802154_dump_wpan_phy_parse()
602 struct cfg802154_registered_device *rdev; in nl802154_dump_wpan_phy() local
621 list_for_each_entry(rdev, &cfg802154_rdev_list, list) { in nl802154_dump_wpan_phy()
622 if (!net_eq(wpan_phy_net(&rdev->wpan_phy), sock_net(skb->sk))) in nl802154_dump_wpan_phy()
627 state->filter_wpan_phy != rdev->wpan_phy_idx) in nl802154_dump_wpan_phy()
630 ret = nl802154_send_wpan_phy(rdev, in nl802154_dump_wpan_phy()
663 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_get_wpan_phy() local
669 if (nl802154_send_wpan_phy(rdev, NL802154_CMD_NEW_WPAN_PHY, msg, in nl802154_get_wpan_phy()
757 struct cfg802154_registered_device *rdev, in nl802154_get_llsec_params() argument
764 ret = rdev_get_llsec_params(rdev, wpan_dev, ¶ms); in nl802154_get_llsec_params()
790 struct cfg802154_registered_device *rdev, in nl802154_send_iface() argument
806 if (nla_put_u32(msg, NL802154_ATTR_WPAN_PHY, rdev->wpan_phy_idx) || in nl802154_send_iface()
811 rdev->devlist_generation ^ in nl802154_send_iface()
845 if (nl802154_get_llsec_params(msg, rdev, wpan_dev) < 0) in nl802154_send_iface()
866 struct cfg802154_registered_device *rdev; in nl802154_dump_interface() local
870 list_for_each_entry(rdev, &cfg802154_rdev_list, list) { in nl802154_dump_interface()
871 if (!net_eq(wpan_phy_net(&rdev->wpan_phy), sock_net(skb->sk))) in nl802154_dump_interface()
879 list_for_each_entry(wpan_dev, &rdev->wpan_dev_list, list) { in nl802154_dump_interface()
886 rdev, wpan_dev) < 0) { in nl802154_dump_interface()
906 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_get_interface() local
914 rdev, wdev) < 0) { in nl802154_get_interface()
924 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_new_interface() local
938 !(rdev->wpan_phy.supported.iftypes & BIT(type))) in nl802154_new_interface()
945 if (!rdev->ops->add_virtual_intf) in nl802154_new_interface()
948 return rdev_add_virtual_intf(rdev, in nl802154_new_interface()
955 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_del_interface() local
958 if (!rdev->ops->del_virtual_intf) in nl802154_del_interface()
970 return rdev_del_virtual_intf(rdev, wpan_dev); in nl802154_del_interface()
975 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_channel() local
986 if (!ieee802154_chan_is_valid(&rdev->wpan_phy, page, channel)) in nl802154_set_channel()
989 return rdev_set_channel(rdev, page, channel); in nl802154_set_channel()
994 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_cca_mode() local
997 if (!(rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_MODE)) in nl802154_set_cca_mode()
1007 !(rdev->wpan_phy.supported.cca_modes & BIT(cca.mode))) in nl802154_set_cca_mode()
1016 !(rdev->wpan_phy.supported.cca_opts & BIT(cca.opt))) in nl802154_set_cca_mode()
1020 return rdev_set_cca_mode(rdev, &cca); in nl802154_set_cca_mode()
1025 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_cca_ed_level() local
1029 if (!(rdev->wpan_phy.flags & WPAN_PHY_FLAG_CCA_ED_LEVEL)) in nl802154_set_cca_ed_level()
1037 for (i = 0; i < rdev->wpan_phy.supported.cca_ed_levels_size; i++) { in nl802154_set_cca_ed_level()
1038 if (ed_level == rdev->wpan_phy.supported.cca_ed_levels[i]) in nl802154_set_cca_ed_level()
1039 return rdev_set_cca_ed_level(rdev, ed_level); in nl802154_set_cca_ed_level()
1047 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_tx_power() local
1051 if (!(rdev->wpan_phy.flags & WPAN_PHY_FLAG_TXPOWER)) in nl802154_set_tx_power()
1059 for (i = 0; i < rdev->wpan_phy.supported.tx_powers_size; i++) { in nl802154_set_tx_power()
1060 if (power == rdev->wpan_phy.supported.tx_powers[i]) in nl802154_set_tx_power()
1061 return rdev_set_tx_power(rdev, power); in nl802154_set_tx_power()
1069 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_pan_id() local
1100 return rdev_set_pan_id(rdev, wpan_dev, pan_id); in nl802154_set_pan_id()
1105 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_short_addr() local
1141 return rdev_set_short_addr(rdev, wpan_dev, short_addr); in nl802154_set_short_addr()
1147 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_backoff_exponent() local
1164 if (min_be < rdev->wpan_phy.supported.min_minbe || in nl802154_set_backoff_exponent()
1165 min_be > rdev->wpan_phy.supported.max_minbe || in nl802154_set_backoff_exponent()
1166 max_be < rdev->wpan_phy.supported.min_maxbe || in nl802154_set_backoff_exponent()
1167 max_be > rdev->wpan_phy.supported.max_maxbe || in nl802154_set_backoff_exponent()
1171 return rdev_set_backoff_exponent(rdev, wpan_dev, min_be, max_be); in nl802154_set_backoff_exponent()
1177 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_max_csma_backoffs() local
1193 if (max_csma_backoffs < rdev->wpan_phy.supported.min_csma_backoffs || in nl802154_set_max_csma_backoffs()
1194 max_csma_backoffs > rdev->wpan_phy.supported.max_csma_backoffs) in nl802154_set_max_csma_backoffs()
1197 return rdev_set_max_csma_backoffs(rdev, wpan_dev, max_csma_backoffs); in nl802154_set_max_csma_backoffs()
1203 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_max_frame_retries() local
1218 if (max_frame_retries < rdev->wpan_phy.supported.min_frame_retries || in nl802154_set_max_frame_retries()
1219 max_frame_retries > rdev->wpan_phy.supported.max_frame_retries) in nl802154_set_max_frame_retries()
1222 return rdev_set_max_frame_retries(rdev, wpan_dev, max_frame_retries); in nl802154_set_max_frame_retries()
1227 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_lbt_mode() local
1243 if (!wpan_phy_supported_bool(mode, rdev->wpan_phy.supported.lbt)) in nl802154_set_lbt_mode()
1246 return rdev_set_lbt_mode(rdev, wpan_dev, mode); in nl802154_set_lbt_mode()
1252 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_ackreq_default() local
1268 return rdev_set_ackreq_default(rdev, wpan_dev, ackreq); in nl802154_set_ackreq_default()
1273 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_wpan_phy_netns() local
1295 if (!net_eq(wpan_phy_net(&rdev->wpan_phy), net)) in nl802154_wpan_phy_netns()
1296 err = cfg802154_switch_netns(rdev, net); in nl802154_wpan_phy_netns()
1303 struct cfg802154_registered_device *rdev, in nl802154_prep_scan_event_msg() argument
1315 if (nla_put_u32(msg, NL802154_ATTR_WPAN_PHY, rdev->wpan_phy_idx)) in nl802154_prep_scan_event_msg()
1379 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(wpan_phy); in nl802154_scan_event() local
1387 ret = nl802154_prep_scan_event_msg(msg, rdev, wpan_dev, 0, 0, 0, in nl802154_scan_event()
1402 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_trigger_scan() local
1405 struct wpan_phy *wpan_phy = &rdev->wpan_phy; in nl802154_trigger_scan()
1462 err = rdev_trigger_scan(rdev, request); in nl802154_trigger_scan()
1477 struct cfg802154_registered_device *rdev, in nl802154_prep_scan_msg() argument
1487 if (nla_put_u32(msg, NL802154_ATTR_WPAN_PHY, rdev->wpan_phy_idx)) in nl802154_prep_scan_msg()
1512 static int nl802154_send_scan_msg(struct cfg802154_registered_device *rdev, in nl802154_send_scan_msg() argument
1522 ret = nl802154_prep_scan_msg(msg, rdev, wpan_dev, 0, 0, 0, cmd, arg); in nl802154_send_scan_msg()
1529 wpan_phy_net(&rdev->wpan_phy), msg, 0, in nl802154_send_scan_msg()
1535 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(wpan_phy); in nl802154_scan_started() local
1539 err = nl802154_send_scan_msg(rdev, wpan_dev, NL802154_CMD_TRIGGER_SCAN, 0); in nl802154_scan_started()
1550 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(wpan_phy); in nl802154_scan_done() local
1554 err = nl802154_send_scan_msg(rdev, wpan_dev, NL802154_CMD_SCAN_DONE, reason); in nl802154_scan_done()
1564 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_abort_scan() local
1569 return rdev_abort_scan(rdev, wpan_dev); in nl802154_abort_scan()
1575 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_send_beacons() local
1578 struct wpan_phy *wpan_phy = &rdev->wpan_phy; in nl802154_send_beacons()
1610 err = rdev_send_beacons(rdev, request); in nl802154_send_beacons()
1633 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_stop_beacons() local
1638 return rdev_stop_beacons(rdev, wpan_dev); in nl802154_stop_beacons()
1743 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_set_llsec_params() local
1786 return rdev_set_llsec_params(rdev, wpan_dev, ¶ms, changed); in nl802154_set_llsec_params()
1791 struct cfg802154_registered_device *rdev, in nl802154_send_key() argument
1849 struct cfg802154_registered_device *rdev = NULL; in nl802154_dump_llsec_key() local
1855 err = nl802154_prepare_wpan_dev_dump(skb, cb, &rdev, &wpan_dev); in nl802154_dump_llsec_key()
1869 rdev_lock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_key()
1870 rdev_get_llsec_table(rdev, wpan_dev, &table); in nl802154_dump_llsec_key()
1880 rdev, wpan_dev->netdev, key) < 0) { in nl802154_dump_llsec_key()
1883 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_key()
1891 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_key()
1894 nl802154_finish_wpan_dev_dump(rdev); in nl802154_dump_llsec_key()
1910 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_add_llsec_key() local
1959 return rdev_add_llsec_key(rdev, wpan_dev, &id, &key); in nl802154_add_llsec_key()
1964 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_del_llsec_key() local
1980 return rdev_del_llsec_key(rdev, wpan_dev, &id); in nl802154_del_llsec_key()
1985 struct cfg802154_registered_device *rdev, in nl802154_send_device() argument
2028 struct cfg802154_registered_device *rdev = NULL; in nl802154_dump_llsec_dev() local
2034 err = nl802154_prepare_wpan_dev_dump(skb, cb, &rdev, &wpan_dev); in nl802154_dump_llsec_dev()
2048 rdev_lock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_dev()
2049 rdev_get_llsec_table(rdev, wpan_dev, &table); in nl802154_dump_llsec_dev()
2059 rdev, wpan_dev->netdev, dev) < 0) { in nl802154_dump_llsec_dev()
2062 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_dev()
2070 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_dev()
2073 nl802154_finish_wpan_dev_dump(rdev); in nl802154_dump_llsec_dev()
2124 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_add_llsec_dev() local
2136 return rdev_add_device(rdev, wpan_dev, &dev_desc); in nl802154_add_llsec_dev()
2141 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_del_llsec_dev() local
2158 return rdev_del_device(rdev, wpan_dev, extended_addr); in nl802154_del_llsec_dev()
2163 struct cfg802154_registered_device *rdev, in nl802154_send_devkey() argument
2208 struct cfg802154_registered_device *rdev = NULL; in nl802154_dump_llsec_devkey() local
2215 err = nl802154_prepare_wpan_dev_dump(skb, cb, &rdev, &wpan_dev); in nl802154_dump_llsec_devkey()
2229 rdev_lock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_devkey()
2230 rdev_get_llsec_table(rdev, wpan_dev, &table); in nl802154_dump_llsec_devkey()
2243 NLM_F_MULTI, rdev, in nl802154_dump_llsec_devkey()
2249 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_devkey()
2258 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_devkey()
2261 nl802154_finish_wpan_dev_dump(rdev); in nl802154_dump_llsec_devkey()
2274 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_add_llsec_devkey() local
2303 return rdev_add_devkey(rdev, wpan_dev, extended_addr, &key); in nl802154_add_llsec_devkey()
2308 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_del_llsec_devkey() local
2334 return rdev_del_devkey(rdev, wpan_dev, extended_addr, &key); in nl802154_del_llsec_devkey()
2339 struct cfg802154_registered_device *rdev, in nl802154_send_seclevel() argument
2382 struct cfg802154_registered_device *rdev = NULL; in nl802154_dump_llsec_seclevel() local
2388 err = nl802154_prepare_wpan_dev_dump(skb, cb, &rdev, &wpan_dev); in nl802154_dump_llsec_seclevel()
2402 rdev_lock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_seclevel()
2403 rdev_get_llsec_table(rdev, wpan_dev, &table); in nl802154_dump_llsec_seclevel()
2413 rdev, wpan_dev->netdev, sl) < 0) { in nl802154_dump_llsec_seclevel()
2416 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_seclevel()
2424 rdev_unlock_llsec_table(rdev, wpan_dev); in nl802154_dump_llsec_seclevel()
2427 nl802154_finish_wpan_dev_dump(rdev); in nl802154_dump_llsec_seclevel()
2476 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_add_llsec_seclevel() local
2488 return rdev_add_seclevel(rdev, wpan_dev, &sl); in nl802154_add_llsec_seclevel()
2494 struct cfg802154_registered_device *rdev = info->user_ptr[0]; in nl802154_del_llsec_seclevel() local
2506 return rdev_del_seclevel(rdev, wpan_dev, &sl); in nl802154_del_llsec_seclevel()
2520 struct cfg802154_registered_device *rdev; in nl802154_pre_doit() local
2529 rdev = cfg802154_get_dev_from_info(genl_info_net(info), info); in nl802154_pre_doit()
2530 if (IS_ERR(rdev)) { in nl802154_pre_doit()
2533 return PTR_ERR(rdev); in nl802154_pre_doit()
2535 info->user_ptr[0] = rdev; in nl802154_pre_doit()
2548 rdev = wpan_phy_to_rdev(wpan_dev->wpan_phy); in nl802154_pre_doit()
2573 info->user_ptr[0] = rdev; in nl802154_pre_doit()