Lines Matching defs:rdev

32 #include "rdev-ops.h"
34 static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
67 __cfg80211_wdev_from_attrs(struct cfg80211_registered_device *rdev,
87 if (rdev) {
90 lockdep_assert_held(&rdev->wiphy.mtx);
92 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
109 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
112 if (wiphy_net(&rdev->wiphy) != netns)
115 if (have_wdev_id && rdev->wiphy_idx != wiphy_idx)
118 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
142 struct cfg80211_registered_device *rdev = NULL, *tmp;
153 rdev = cfg80211_rdev_by_wiphy_idx(
174 if (rdev && tmp != rdev)
176 rdev = tmp;
196 if (rdev && tmp != rdev)
199 rdev = tmp;
203 if (!rdev)
206 if (netns != wiphy_net(&rdev->wiphy))
209 return rdev;
982 struct cfg80211_registered_device **rdev,
1016 *rdev = wiphy_to_rdev((*wdev)->wiphy);
1017 mutex_lock(&(*rdev)->wiphy.mtx);
1020 cb->args[0] = (*rdev)->wiphy_idx + 1;
1033 *rdev = wiphy_to_rdev(wiphy);
1036 list_for_each_entry(tmp, &(*rdev)->wiphy.wdev_list, list) {
1047 mutex_lock(&(*rdev)->wiphy.mtx);
1463 nl80211_parse_connkeys(struct cfg80211_registered_device *rdev,
1513 err = cfg80211_validate_key_settings(rdev, &parse.p,
1689 static int nl80211_send_wowlan_tcp_caps(struct cfg80211_registered_device *rdev,
1692 const struct wiphy_wowlan_tcp_support *tcp = rdev->wiphy.wowlan->tcp;
1731 struct cfg80211_registered_device *rdev,
1736 if (!rdev->wiphy.wowlan)
1744 if (((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_ANY) &&
1746 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_DISCONNECT) &&
1748 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_MAGIC_PKT) &&
1750 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY) &&
1752 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
1754 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ) &&
1756 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_4WAY_HANDSHAKE) &&
1758 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_RFKILL_RELEASE) &&
1762 if (rdev->wiphy.wowlan->n_patterns) {
1764 .max_patterns = rdev->wiphy.wowlan->n_patterns,
1765 .min_pattern_len = rdev->wiphy.wowlan->pattern_min_len,
1766 .max_pattern_len = rdev->wiphy.wowlan->pattern_max_len,
1767 .max_pkt_offset = rdev->wiphy.wowlan->max_pkt_offset,
1775 if ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_NET_DETECT) &&
1777 rdev->wiphy.wowlan->max_nd_match_sets))
1780 if (large && nl80211_send_wowlan_tcp_caps(rdev, msg))
1790 struct cfg80211_registered_device *rdev)
1794 if (!rdev->wiphy.coalesce)
1797 rule.max_rules = rdev->wiphy.coalesce->n_rules;
1798 rule.max_delay = rdev->wiphy.coalesce->max_delay;
1799 rule.pat.max_patterns = rdev->wiphy.coalesce->n_patterns;
1800 rule.pat.min_pattern_len = rdev->wiphy.coalesce->pattern_min_len;
1801 rule.pat.max_pattern_len = rdev->wiphy.coalesce->pattern_max_len;
1802 rule.pat.max_pkt_offset = rdev->wiphy.coalesce->max_pkt_offset;
2047 if (rdev->ops->op) { \
2054 static int nl80211_add_commands_unsplit(struct cfg80211_registered_device *rdev,
2081 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL)
2086 if (rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK) {
2091 if (rdev->ops->set_monitor_channel || rdev->ops->start_ap ||
2092 rdev->ops->join_mesh) {
2097 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) {
2101 if (rdev->wiphy.max_sched_scan_reqs)
2105 if (rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS) {
2116 if (rdev->ops->connect || rdev->ops->auth) {
2122 if (rdev->ops->disconnect || rdev->ops->deauth) {
2182 static int nl80211_send_pmsr_capa(struct cfg80211_registered_device *rdev,
2185 const struct cfg80211_pmsr_capabilities *cap = rdev->wiphy.pmsr_capa;
2225 nl80211_put_iftype_akm_suites(struct cfg80211_registered_device *rdev,
2232 if (!rdev->wiphy.num_iftype_akm_suites ||
2233 !rdev->wiphy.iftype_akm_suites)
2240 for (i = 0; i < rdev->wiphy.num_iftype_akm_suites; i++) {
2245 iftype_akms = &rdev->wiphy.iftype_akm_suites[i];
2265 nl80211_put_tid_config_support(struct cfg80211_registered_device *rdev,
2270 if (!rdev->wiphy.tid_config_support.vif &&
2271 !rdev->wiphy.tid_config_support.peer)
2278 if (rdev->wiphy.tid_config_support.vif &&
2280 rdev->wiphy.tid_config_support.vif,
2284 if (rdev->wiphy.tid_config_support.peer &&
2286 rdev->wiphy.tid_config_support.peer,
2292 rdev->wiphy.tid_config_support.max_retry))
2295 rdev->wiphy.tid_config_support.max_retry))
2307 nl80211_put_sar_specs(struct cfg80211_registered_device *rdev,
2314 if (!rdev->wiphy.sar_capa)
2317 num_freq_ranges = rdev->wiphy.sar_capa->num_freq_ranges;
2323 if (nla_put_u32(msg, NL80211_SAR_ATTR_TYPE, rdev->wiphy.sar_capa->type))
2337 rdev->wiphy.sar_capa->freq_ranges[i].start_freq))
2341 rdev->wiphy.sar_capa->freq_ranges[i].end_freq))
2392 static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2405 rdev->wiphy.mgmt_stypes;
2415 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
2417 wiphy_name(&rdev->wiphy)) ||
2428 rdev->wiphy.retry_short) ||
2430 rdev->wiphy.retry_long) ||
2432 rdev->wiphy.frag_threshold) ||
2434 rdev->wiphy.rts_threshold) ||
2436 rdev->wiphy.coverage_class) ||
2438 rdev->wiphy.max_scan_ssids) ||
2440 rdev->wiphy.max_sched_scan_ssids) ||
2442 rdev->wiphy.max_scan_ie_len) ||
2444 rdev->wiphy.max_sched_scan_ie_len) ||
2446 rdev->wiphy.max_match_sets))
2449 if ((rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN) &&
2452 if ((rdev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) &&
2455 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
2458 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) &&
2461 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) &&
2464 if ((rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
2473 sizeof(u32) * rdev->wiphy.n_cipher_suites,
2474 rdev->wiphy.cipher_suites))
2478 rdev->wiphy.max_num_pmkids))
2481 if ((rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) &&
2486 rdev->wiphy.available_antennas_tx) ||
2488 rdev->wiphy.available_antennas_rx))
2491 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) &&
2493 rdev->wiphy.probe_resp_offload))
2496 if ((rdev->wiphy.available_antennas_tx ||
2497 rdev->wiphy.available_antennas_rx) &&
2498 rdev->ops->get_antenna) {
2502 res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
2520 rdev->wiphy.interface_modes))
2543 sband = rdev->wiphy.bands[band];
2579 msg, &rdev->wiphy, chan,
2622 i = nl80211_add_commands_unsplit(rdev, msg);
2628 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
2631 if (rdev->wiphy.features &
2637 if (rdev->wiphy.sar_capa)
2648 if (rdev->ops->remain_on_channel &&
2649 (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) &&
2652 rdev->wiphy.max_remain_on_channel_duration))
2655 if ((rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX) &&
2665 if (nl80211_send_wowlan(msg, rdev, state->split))
2676 rdev->wiphy.software_iftypes))
2679 if (nl80211_put_iface_combinations(&rdev->wiphy, msg,
2688 if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) &&
2690 rdev->wiphy.ap_sme_capa))
2693 features = rdev->wiphy.features;
2704 if (rdev->wiphy.ht_capa_mod_mask &&
2706 sizeof(*rdev->wiphy.ht_capa_mod_mask),
2707 rdev->wiphy.ht_capa_mod_mask))
2710 if (rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME &&
2711 rdev->wiphy.max_acl_mac_addrs &&
2713 rdev->wiphy.max_acl_mac_addrs))
2736 rdev->wiphy.max_sched_scan_plans) ||
2738 rdev->wiphy.max_sched_scan_plan_interval) ||
2740 rdev->wiphy.max_sched_scan_plan_iterations))
2743 if (rdev->wiphy.extended_capabilities &&
2745 rdev->wiphy.extended_capabilities_len,
2746 rdev->wiphy.extended_capabilities) ||
2748 rdev->wiphy.extended_capabilities_len,
2749 rdev->wiphy.extended_capabilities_mask)))
2752 if (rdev->wiphy.vht_capa_mod_mask &&
2754 sizeof(*rdev->wiphy.vht_capa_mod_mask),
2755 rdev->wiphy.vht_capa_mod_mask))
2759 rdev->wiphy.perm_addr))
2762 if (!is_zero_ether_addr(rdev->wiphy.addr_mask) &&
2764 rdev->wiphy.addr_mask))
2767 if (rdev->wiphy.n_addresses > 1) {
2774 for (i = 0; i < rdev->wiphy.n_addresses; i++)
2776 rdev->wiphy.addresses[i].addr))
2785 if (nl80211_send_coalesce(msg, rdev))
2788 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
2793 if (rdev->wiphy.max_ap_assoc_sta &&
2795 rdev->wiphy.max_ap_assoc_sta))
2801 if (rdev->wiphy.n_vendor_commands) {
2810 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
2811 info = &rdev->wiphy.vendor_commands[i].info;
2818 if (rdev->wiphy.n_vendor_events) {
2827 for (i = 0; i < rdev->wiphy.n_vendor_events; i++) {
2828 info = &rdev->wiphy.vendor_events[i];
2837 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH &&
2839 rdev->wiphy.max_num_csa_counters))
2842 if (rdev->wiphy.regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED &&
2846 if (rdev->wiphy.max_sched_scan_reqs &&
2848 rdev->wiphy.max_sched_scan_reqs))
2852 sizeof(rdev->wiphy.ext_features),
2853 rdev->wiphy.ext_features))
2856 if (rdev->wiphy.bss_select_support) {
2858 u32 bss_select_support = rdev->wiphy.bss_select_support;
2879 if (rdev->wiphy.num_iftype_ext_capab &&
2880 rdev->wiphy.iftype_ext_capab) {
2889 i < rdev->wiphy.num_iftype_ext_capab; i++) {
2892 capab = &rdev->wiphy.iftype_ext_capab[i];
2907 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO &&
2921 if (i < rdev->wiphy.num_iftype_ext_capab) {
2928 rdev->wiphy.nan_supported_bands))
2931 if (wiphy_ext_feature_isset(&rdev->wiphy,
2936 res = rdev_get_txq_stats(rdev, NULL, &txqstats);
2943 rdev->wiphy.txq_limit))
2946 rdev->wiphy.txq_memory_limit))
2949 rdev->wiphy.txq_quantum))
2956 if (nl80211_send_pmsr_capa(rdev, msg))
2962 if (rdev->wiphy.akm_suites &&
2964 sizeof(u32) * rdev->wiphy.n_akm_suites,
2965 rdev->wiphy.akm_suites))
2968 if (nl80211_put_iftype_akm_suites(rdev, msg))
2971 if (nl80211_put_tid_config_support(rdev, msg))
2976 if (nl80211_put_sar_specs(rdev, msg))
2979 if (nl80211_put_mbssid_support(&rdev->wiphy, msg))
2983 rdev->wiphy.max_num_akm_suites))
2986 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO)
2989 if (rdev->wiphy.hw_timestamp_max_peers &&
2991 rdev->wiphy.hw_timestamp_max_peers))
3034 struct cfg80211_registered_device *rdev;
3043 rdev = wiphy_to_rdev(
3045 state->filter_wiphy = rdev->wiphy_idx;
3059 struct cfg80211_registered_device *rdev;
3078 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
3079 if (!net_eq(wiphy_net(&rdev->wiphy), sock_net(skb->sk)))
3084 state->filter_wiphy != rdev->wiphy_idx)
3086 wiphy_lock(&rdev->wiphy);
3089 ret = nl80211_send_wiphy(rdev, NL80211_CMD_NEW_WIPHY,
3113 wiphy_unlock(&rdev->wiphy);
3121 wiphy_unlock(&rdev->wiphy);
3140 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3147 if (nl80211_send_wiphy(rdev, NL80211_CMD_NEW_WIPHY, msg,
3211 static int nl80211_parse_punct_bitmap(struct cfg80211_registered_device *rdev,
3216 if (!wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_PUNCT))
3226 int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
3247 chandef->chan = ieee80211_get_channel_khz(&rdev->wiphy, control_freq);
3338 if (!cfg80211_chandef_usable(&rdev->wiphy, chandef,
3346 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ)) {
3354 static int __nl80211_set_channel(struct cfg80211_registered_device *rdev,
3378 result = nl80211_parse_chandef(rdev, info, &chandef);
3385 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &chandef,
3391 if (!dev || !rdev->ops->set_ap_chanwidth ||
3392 !(rdev->wiphy.features &
3401 result = rdev_set_ap_chanwidth(rdev, dev, link_id,
3411 return cfg80211_set_mesh_channel(rdev, wdev, &chandef);
3413 return cfg80211_set_monitor_channel(rdev, &chandef);
3423 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3429 ret = __nl80211_set_channel(rdev, netdev, info, link_id);
3437 struct cfg80211_registered_device *rdev = NULL;
3464 rdev = wiphy_to_rdev(netdev->ieee80211_ptr->wiphy);
3470 rdev = __cfg80211_rdev_from_attrs(genl_info_net(info),
3472 if (IS_ERR(rdev)) {
3474 return PTR_ERR(rdev);
3482 wiphy_lock(&rdev->wiphy);
3485 * end workaround code, by now the rdev is available
3491 rdev, nla_data(info->attrs[NL80211_ATTR_WIPHY_NAME]));
3501 if (!rdev->ops->set_txq_params) {
3548 result = rdev_set_txq_params(rdev, netdev,
3562 rdev,
3567 result = __nl80211_set_channel(rdev, netdev, info, link_id);
3579 if (!(rdev->wiphy.features & NL80211_FEATURE_VIF_TXPOWER))
3582 if (!rdev->ops->set_tx_power) {
3601 result = rdev_set_tx_power(rdev, txp_wdev, type, mbm);
3610 if ((!rdev->wiphy.available_antennas_tx &&
3611 !rdev->wiphy.available_antennas_rx) ||
3612 !rdev->ops->set_antenna) {
3622 if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
3623 (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx))) {
3628 tx_ant = tx_ant & rdev->wiphy.available_antennas_tx;
3629 rx_ant = rx_ant & rdev->wiphy.available_antennas_rx;
3631 result = rdev_set_antenna(rdev, tx_ant, rx_ant);
3690 if (!(rdev->wiphy.features & NL80211_FEATURE_ACKTO_ESTIMATION)) {
3699 if (!wiphy_ext_feature_isset(&rdev->wiphy,
3710 if (!wiphy_ext_feature_isset(&rdev->wiphy,
3721 if (!wiphy_ext_feature_isset(&rdev->wiphy,
3737 if (!rdev->ops->set_wiphy_params) {
3742 old_retry_short = rdev->wiphy.retry_short;
3743 old_retry_long = rdev->wiphy.retry_long;
3744 old_frag_threshold = rdev->wiphy.frag_threshold;
3745 old_rts_threshold = rdev->wiphy.rts_threshold;
3746 old_coverage_class = rdev->wiphy.coverage_class;
3747 old_txq_limit = rdev->wiphy.txq_limit;
3748 old_txq_memory_limit = rdev->wiphy.txq_memory_limit;
3749 old_txq_quantum = rdev->wiphy.txq_quantum;
3752 rdev->wiphy.retry_short = retry_short;
3754 rdev->wiphy.retry_long = retry_long;
3756 rdev->wiphy.frag_threshold = frag_threshold;
3758 rdev->wiphy.rts_threshold = rts_threshold;
3760 rdev->wiphy.coverage_class = coverage_class;
3762 rdev->wiphy.txq_limit = txq_limit;
3764 rdev->wiphy.txq_memory_limit = txq_memory_limit;
3766 rdev->wiphy.txq_quantum = txq_quantum;
3768 result = rdev_set_wiphy_params(rdev, changed);
3770 rdev->wiphy.retry_short = old_retry_short;
3771 rdev->wiphy.retry_long = old_retry_long;
3772 rdev->wiphy.frag_threshold = old_frag_threshold;
3773 rdev->wiphy.rts_threshold = old_rts_threshold;
3774 rdev->wiphy.coverage_class = old_coverage_class;
3775 rdev->wiphy.txq_limit = old_txq_limit;
3776 rdev->wiphy.txq_memory_limit = old_txq_memory_limit;
3777 rdev->wiphy.txq_quantum = old_txq_quantum;
3785 wiphy_unlock(&rdev->wiphy);
3823 struct cfg80211_registered_device *rdev,
3843 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
3849 rdev->devlist_generation ^
3854 if (rdev->ops->get_channel && !wdev->valid_links) {
3858 ret = rdev_get_channel(rdev, wdev, 0, &chandef);
3863 if (rdev->ops->get_tx_power) {
3866 ret = rdev_get_tx_power(rdev, wdev, &dbm);
3901 if (rdev->ops->get_txq_stats) {
3903 int ret = rdev_get_txq_stats(rdev, wdev, &txqstats);
3933 ret = rdev_get_channel(rdev, wdev, link_id, &chandef);
3960 struct cfg80211_registered_device *rdev;
3988 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
3989 if (!net_eq(wiphy_net(&rdev->wiphy), sock_net(skb->sk)))
3996 if (filter_wiphy >= 0 && filter_wiphy != rdev->wiphy_idx)
4001 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
4008 rdev, wdev,
4032 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4040 rdev, wdev, NL80211_CMD_NEW_INTERFACE) < 0) {
4079 static int nl80211_parse_mon_options(struct cfg80211_registered_device *rdev,
4100 !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
4110 if (!wiphy_ext_feature_isset(&rdev->wiphy, cap_flag))
4131 if (!wiphy_ext_feature_isset(&rdev->wiphy, cap_flag))
4142 static int nl80211_valid_4addr(struct cfg80211_registered_device *rdev,
4154 if (rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP)
4158 if (rdev->wiphy.flags & WIPHY_FLAG_4ADDR_STATION)
4170 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4211 err = nl80211_valid_4addr(rdev, dev, params.use_4addr, ntype);
4218 err = nl80211_parse_mon_options(rdev, ntype, info, &params);
4225 err = cfg80211_change_iface(rdev, dev, ntype, &params);
4235 nl80211_notify_iface(rdev, wdev, NL80211_CMD_SET_INTERFACE);
4243 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4258 if (!rdev->ops->add_virtual_intf)
4262 rdev->wiphy.features & NL80211_FEATURE_MAC_ON_CREATE) &&
4272 err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type);
4277 if (!cfg80211_iftype_allowed(&rdev->wiphy, type, params.use_4addr, 0))
4280 err = nl80211_parse_mon_options(rdev, type, info, &params);
4288 wdev = rdev_add_virtual_intf(rdev,
4323 cfg80211_register_wdev(rdev, wdev);
4330 rdev, wdev, NL80211_CMD_NEW_INTERFACE) < 0) {
4340 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4344 cfg80211_destroy_ifaces(rdev);
4346 wiphy_lock(&rdev->wiphy);
4348 wiphy_unlock(&rdev->wiphy);
4355 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4358 if (!rdev->ops->del_virtual_intf)
4363 * reach 0, and thus the rdev cannot be deleted.
4370 mutex_unlock(&rdev->wiphy.mtx);
4384 mutex_lock(&rdev->wiphy.mtx);
4386 return cfg80211_remove_virtual_intf(rdev, wdev);
4391 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4398 if (!rdev->ops->set_noack_map)
4403 return rdev_set_noack_map(rdev, dev, noack_map);
4487 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4502 if (wiphy_ext_feature_isset(&rdev->wiphy,
4508 wiphy_ext_feature_isset(&rdev->wiphy,
4534 if (!rdev->ops->get_key)
4537 if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
4563 err = rdev_get_key(rdev, dev, link_id, key_idx, pairwise, mac_addr,
4584 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4608 if (!rdev->ops->set_default_key) {
4621 err = rdev_set_default_key(rdev, dev, link_id, key.idx,
4636 if (!rdev->ops->set_default_mgmt_key) {
4649 err = rdev_set_default_mgmt_key(rdev, dev, link_id, key.idx);
4662 if (!rdev->ops->set_default_beacon_key) {
4675 err = rdev_set_default_beacon_key(rdev, dev, link_id, key.idx);
4679 wiphy_ext_feature_isset(&rdev->wiphy,
4695 err = rdev_add_key(rdev, dev, link_id, key.idx,
4709 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4747 if (!rdev->ops->add_key)
4750 if (cfg80211_validate_key_settings(rdev, &key.p, key.idx,
4767 err = rdev_add_key(rdev, dev, link_id, key.idx,
4780 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4807 if (!cfg80211_valid_key_idx(rdev, key.idx,
4811 if (!rdev->ops->del_key)
4818 !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
4826 err = rdev_del_key(rdev, dev, link_id, key.idx,
4909 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4921 acl = parse_acl_data(&rdev->wiphy, info);
4925 err = rdev_set_mac_acl(rdev, dev, acl);
5148 struct cfg80211_registered_device *rdev = info->user_ptr[0];
5163 sband = rdev->wiphy.bands[i];
5203 sband = rdev->wiphy.bands[band];
5262 if (!(rdev->wiphy.bands[band]->ht_cap.ht_supported ||
5263 rdev->wiphy.bands[band]->vht_cap.vht_supported ||
5288 static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
5343 !wiphy_ext_feature_isset(&rdev->wiphy,
5347 !wiphy_ext_feature_isset(&rdev->wiphy,
5351 !wiphy_ext_feature_isset(&rdev->wiphy,
5355 !wiphy_ext_feature_isset(&rdev->wiphy,
5511 static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev,
5575 wiphy_ext_feature_isset(&rdev->wiphy,
5604 nl80211_parse_mbssid_elems(&rdev->wiphy,
5614 nl80211_parse_rnr_elems(&rdev->wiphy,
5675 static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev,
5683 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5706 nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev,
5715 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5807 static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev,
5812 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
5827 static bool nl80211_valid_auth_type(struct cfg80211_registered_device *rdev,
5836 if (!(rdev->wiphy.features & NL80211_FEATURE_SAE) &&
5839 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5847 if (!(rdev->wiphy.features & NL80211_FEATURE_SAE) &&
5848 !wiphy_ext_feature_isset(&rdev->wiphy,
5858 &rdev->wiphy,
5864 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5883 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
5895 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
5932 struct cfg80211_registered_device *rdev = info->user_ptr[0];
5943 if (!rdev->ops->start_ap)
5959 err = nl80211_parse_beacon(rdev, info->attrs, &params->beacon,
5969 err = cfg80211_validate_beacon_int(rdev, dev->ieee80211_ptr->iftype,
6012 if (!nl80211_valid_auth_type(rdev, params->auth_type,
6020 err = nl80211_crypto_settings(rdev, info, &params->crypto,
6026 if (!(rdev->wiphy.features & NL80211_FEATURE_INACTIVITY_TIMER)) {
6042 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_CTWIN)) {
6058 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_OPPPS)) {
6065 err = nl80211_parse_chandef(rdev, info, &params->chandef);
6074 } else if (!nl80211_get_ap_channel(rdev, params)) {
6080 err = nl80211_parse_punct_bitmap(rdev, info,
6087 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params->chandef,
6103 err = validate_beacon_tx_rate(rdev, params->chandef.chan->band,
6116 if (!(rdev->wiphy.features &
6123 if (!(rdev->wiphy.features &
6138 if (params->pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ]) {
6144 params->acl = parse_acl_data(&rdev->wiphy, info);
6164 err = nl80211_parse_fils_discovery(rdev,
6173 rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
6180 err = nl80211_parse_mbssid_config(&rdev->wiphy, dev,
6218 err = rdev_start_ap(rdev, dev, params);
6248 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6259 if (!rdev->ops->change_beacon)
6265 err = nl80211_parse_beacon(rdev, info->attrs, &params, info->extack);
6270 err = rdev_change_beacon(rdev, dev, &params);
6281 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6285 return cfg80211_stop_ap(rdev, dev, link_id, false);
6529 struct cfg80211_registered_device *rdev,
6589 if (wiphy_ext_feature_isset(&rdev->wiphy,
6593 switch (rdev->wiphy.signal_type) {
6669 if (wiphy_ext_feature_isset(&rdev->wiphy,
6762 struct cfg80211_registered_device *rdev;
6768 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, NULL);
6772 __acquire(&rdev->wiphy.mtx);
6779 if (!rdev->ops->dump_station) {
6786 err = rdev_dump_station(rdev, wdev->netdev, sta_idx,
6796 rdev, wdev->netdev, mac_addr,
6807 wiphy_unlock(&rdev->wiphy);
6814 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6828 if (!rdev->ops->get_station)
6831 err = rdev_get_station(rdev, dev, mac_addr, &sinfo);
6843 rdev, dev, mac_addr, &sinfo) < 0) {
7009 struct cfg80211_registered_device *rdev)
7022 if (!v->ieee80211_ptr || v->ieee80211_ptr->wiphy != &rdev->wiphy) {
7150 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7154 if (!rdev->ops->set_tx_power ||
7155 !wiphy_ext_feature_isset(&rdev->wiphy,
7181 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7189 if (!rdev->ops->change_station)
7296 !wiphy_ext_feature_isset(&rdev->wiphy,
7311 params.vlan = get_vlan(info, rdev);
7331 err = rdev_change_station(rdev, dev, mac_addr, &params);
7342 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7353 if (!rdev->ops->add_station)
7470 !wiphy_ext_feature_isset(&rdev->wiphy,
7520 if (!(rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) ||
7532 if (!(rdev->wiphy.features &
7553 params.vlan = get_vlan(info, rdev);
7583 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS))
7586 if (!(rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP))
7616 err = rdev_add_station(rdev, dev, mac_addr, &params);
7625 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7644 if (wiphy_ext_feature_isset(&rdev->wiphy,
7652 if (!rdev->ops->del_station)
7677 ret = rdev_del_station(rdev, dev, &params);
7747 struct cfg80211_registered_device *rdev;
7754 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, NULL);
7758 __acquire(&rdev->wiphy.mtx);
7760 if (!rdev->ops->dump_mpath) {
7771 err = rdev_dump_mpath(rdev, wdev->netdev, path_idx, dst,
7791 wiphy_unlock(&rdev->wiphy);
7797 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7812 if (!rdev->ops->get_mpath)
7818 err = rdev_get_mpath(rdev, dev, dst, next_hop, &pinfo);
7837 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7851 if (!rdev->ops->change_mpath)
7857 return rdev_change_mpath(rdev, dev, dst, next_hop);
7862 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7876 if (!rdev->ops->add_mpath)
7882 return rdev_add_mpath(rdev, dev, dst, next_hop);
7887 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7894 if (!rdev->ops->del_mpath)
7900 return rdev_del_mpath(rdev, dev, dst);
7905 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7920 if (!rdev->ops->get_mpp)
7926 err = rdev_get_mpp(rdev, dev, dst, mpp, &pinfo);
7947 struct cfg80211_registered_device *rdev;
7954 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, NULL);
7958 __acquire(&rdev->wiphy.mtx);
7960 if (!rdev->ops->dump_mpp) {
7971 err = rdev_dump_mpp(rdev, wdev->netdev, path_idx, dst,
7991 wiphy_unlock(&rdev->wiphy);
7997 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8041 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_CTWIN))
8053 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_OPPPS))
8057 if (!rdev->ops->change_bss)
8065 err = rdev_change_bss(rdev, dev, &params);
8124 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8136 if (!rdev->ops->get_mesh_config)
8144 err = rdev_get_mesh_config(rdev, dev, &cur_params);
8450 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8483 !(rdev->wiphy.features & NL80211_FEATURE_USERSPACE_MPM))
8504 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8514 if (!rdev->ops->update_mesh_config)
8526 err = rdev_update_mesh_config(rdev, dev, mask, &cfg);
8597 struct cfg80211_registered_device *rdev;
8617 rdev = cfg80211_get_dev_from_info(genl_info_net(info), info);
8618 if (IS_ERR(rdev)) {
8619 err = PTR_ERR(rdev);
8623 wiphy = &rdev->wiphy;
8710 struct cfg80211_registered_device *rdev;
8725 list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) {
8726 regdom = get_wiphy_regdom(&rdev->wiphy);
8734 NLM_F_MULTI, &rdev->wiphy, regdom);
9147 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9157 wiphy = &rdev->wiphy;
9162 if (!rdev->ops->scan)
9165 if (rdev->scan_req || rdev->scan_msg)
9369 request->wiphy = &rdev->wiphy;
9372 rdev->scan_req = request;
9373 err = cfg80211_scan(rdev);
9378 nl80211_send_scan_start(rdev, wdev);
9384 rdev->scan_req = NULL;
9392 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9395 if (!rdev->ops->abort_scan)
9398 if (rdev->scan_msg)
9401 if (!rdev->scan_req)
9404 rdev_abort_scan(rdev, wdev);
9878 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9885 if (!rdev->wiphy.max_sched_scan_reqs || !rdev->ops->sched_scan_start)
9889 err = cfg80211_sched_scan_req_possible(rdev, want_multi);
9893 sched_scan_req = nl80211_parse_sched_scan(&rdev->wiphy, wdev,
9895 rdev->wiphy.max_match_sets);
9904 if (want_multi && rdev->wiphy.max_sched_scan_reqs > 1)
9905 sched_scan_req->reqid = cfg80211_assign_cookie(rdev);
9907 err = rdev_sched_scan_start(rdev, dev, sched_scan_req);
9912 sched_scan_req->wiphy = &rdev->wiphy;
9917 cfg80211_add_sched_scan_req(rdev, sched_scan_req);
9932 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9935 if (!rdev->wiphy.max_sched_scan_reqs || !rdev->ops->sched_scan_stop)
9940 return __cfg80211_stop_sched_scan(rdev, cookie, false);
9943 req = list_first_or_null_rcu(&rdev->sched_scan_req_list,
9951 return cfg80211_stop_sched_scan_req(rdev, req, false);
9957 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9966 flush_delayed_work(&rdev->dfs_update_channels_wk);
9974 err = nl80211_parse_chandef(rdev, info, &chandef);
9993 err = cfg80211_start_background_radar_detection(rdev, wdev,
10014 if (!rdev->ops->start_radar_detection) {
10019 cac_time_ms = cfg80211_chandef_dfs_cac_time(&rdev->wiphy, &chandef);
10023 err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms);
10039 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10054 err = nl80211_parse_chandef(rdev, info, &chandef);
10080 cfg80211_sched_dfs_chan_update(rdev);
10082 rdev->radar_chandef = chandef;
10085 queue_work(cfg80211_wq, &rdev->propagate_radar_detect_wk);
10092 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10104 if (!rdev->ops->channel_switch ||
10105 !(rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH))
10158 err = nl80211_parse_beacon(rdev, info->attrs, &params.beacon_after,
10176 err = nl80211_parse_beacon(rdev, csa_attrs, &params.beacon_csa,
10193 if (rdev->wiphy.max_num_csa_counters &&
10195 rdev->wiphy.max_num_csa_counters)) {
10226 if (rdev->wiphy.max_num_csa_counters &&
10228 rdev->wiphy.max_num_csa_counters)) {
10254 err = nl80211_parse_chandef(rdev, info, &params.chandef);
10258 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params.chandef,
10283 err = nl80211_parse_punct_bitmap(rdev, info,
10291 err = rdev_channel_switch(rdev, dev, &params);
10305 struct cfg80211_registered_device *rdev,
10324 if (nla_put_u32(msg, NL80211_ATTR_GENERATION, rdev->bss_generation))
10400 switch (rdev->wiphy.signal_type) {
10452 struct cfg80211_registered_device *rdev;
10458 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, NULL);
10462 __acquire(&rdev->wiphy.mtx);
10465 spin_lock_bh(&rdev->bss_lock);
10474 cfg80211_bss_expire(rdev);
10476 cb->seq = rdev->bss_generation;
10478 list_for_each_entry(scan, &rdev->bss_list, list) {
10483 rdev, wdev, scan) < 0) {
10489 spin_unlock_bh(&rdev->bss_lock);
10493 wiphy_unlock(&rdev->wiphy);
10581 struct cfg80211_registered_device *rdev;
10591 res = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, attrbuf);
10597 __acquire(&rdev->wiphy.mtx);
10607 if (!rdev->ops->dump_survey) {
10614 res = rdev_dump_survey(rdev, wdev->netdev, survey_idx, &survey);
10641 wiphy_unlock(&rdev->wiphy);
10654 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10702 for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
10703 if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
10712 if (!rdev->ops->auth)
10725 chan = nl80211_get_valid_chan(&rdev->wiphy, freq);
10738 if (!nl80211_valid_auth_type(rdev, auth_type, NL80211_CMD_AUTHENTICATE))
10773 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO))
10782 req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
10789 err = cfg80211_mlme_auth(rdev, dev, &req);
10792 cfg80211_put_bss(&rdev->wiphy, req.bss);
10797 static int validate_pae_over_nl80211(struct cfg80211_registered_device *rdev,
10805 if (!rdev->ops->tx_control_port ||
10806 !wiphy_ext_feature_isset(&rdev->wiphy,
10813 static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
10828 if (!(rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) &&
10837 int r = validate_pae_over_nl80211(rdev, info);
10866 &rdev->wiphy,
10874 if (!cfg80211_supported_cipher_suite(&rdev->wiphy,
10897 if (settings->n_akm_suites > rdev->wiphy.max_num_akm_suites)
10906 if (!wiphy_ext_feature_isset(&rdev->wiphy,
10908 !wiphy_ext_feature_isset(&rdev->wiphy,
10915 if (!wiphy_ext_feature_isset(&rdev->wiphy,
10917 !wiphy_ext_feature_isset(&rdev->wiphy,
10935 static struct cfg80211_bss *nl80211_assoc_bss(struct cfg80211_registered_device *rdev,
10953 chan = nl80211_get_valid_chan(&rdev->wiphy, freq);
10957 bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid,
10969 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10984 if (!rdev->ops->assoc)
11057 if (!((rdev->wiphy.features &
11059 (rdev->wiphy.features & NL80211_FEATURE_QUIET)) &&
11060 !wiphy_ext_feature_isset(&rdev->wiphy,
11101 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO))
11136 nl80211_assoc_bss(rdev, ssid, ssid_len, attrs);
11197 req.bss = nl80211_assoc_bss(rdev, ssid, ssid_len, info->attrs);
11203 err = nl80211_crypto_settings(rdev, info, &req.crypto, 1);
11207 err = cfg80211_mlme_assoc(rdev, dev, &req);
11221 cfg80211_put_bss(&rdev->wiphy, req.links[link_id].bss);
11222 cfg80211_put_bss(&rdev->wiphy, req.bss);
11230 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11247 if (!rdev->ops->deauth)
11270 err = cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason_code,
11278 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11295 if (!rdev->ops->disassoc)
11318 err = cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason_code,
11325 nl80211_parse_mcast_rate(struct cfg80211_registered_device *rdev,
11329 struct wiphy *wiphy = &rdev->wiphy;
11354 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11373 err = cfg80211_validate_beacon_int(rdev, NL80211_IFTYPE_ADHOC,
11378 if (!rdev->ops->join_ibss)
11384 wiphy = &rdev->wiphy;
11400 err = nl80211_parse_chandef(rdev, info, &ibss.chandef);
11404 if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef,
11415 if (!(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
11421 if (!(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
11423 if (!wiphy_ext_feature_isset(&rdev->wiphy,
11464 !nl80211_parse_mcast_rate(rdev, ibss.mcast_rate,
11471 connkeys = nl80211_parse_connkeys(rdev, info, &no_ht);
11486 int r = validate_pae_over_nl80211(rdev, info);
11500 err = __cfg80211_join_ibss(rdev, dev, &ibss, connkeys);
11512 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11515 if (!rdev->ops->leave_ibss)
11521 return cfg80211_leave_ibss(rdev, dev, false);
11526 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11536 if (!rdev->ops->set_mcast_rate)
11545 if (!nl80211_parse_mcast_rate(rdev, mcast_rate, nla_rate))
11548 return rdev_set_mcast_rate(rdev, dev, mcast_rate);
11552 __cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
11573 if (nla_put_u32(skb, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
11599 ((void **)skb->cb)[0] = rdev;
11618 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
11638 return __cfg80211_alloc_vendor_skb(rdev, wdev, approxlen, portid, 0,
11645 struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0];
11658 genlmsg_unicast(wiphy_net(&rdev->wiphy), skb,
11664 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
11673 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11677 lockdep_assert_held(&rdev->wiphy.mtx);
11679 wdev = __cfg80211_wdev_from_attrs(rdev, genl_info_net(info),
11682 if (!rdev->ops->testmode_cmd)
11690 } else if (wdev->wiphy != &rdev->wiphy) {
11697 rdev->cur_cmd_info = info;
11698 err = rdev_testmode_cmd(rdev, wdev,
11701 rdev->cur_cmd_info = NULL;
11709 struct cfg80211_registered_device *rdev;
11725 rdev = cfg80211_rdev_by_wiphy_idx(phy_idx);
11726 if (!rdev) {
11745 rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf);
11746 if (IS_ERR(rdev)) {
11747 err = PTR_ERR(rdev);
11750 phy_idx = rdev->wiphy_idx;
11761 if (!rdev->ops->testmode_dump) {
11785 err = rdev_testmode_dump(rdev, skb, cb, data, data_len);
11811 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11828 if (!nl80211_valid_auth_type(rdev, connect.auth_type,
11837 !wiphy_ext_feature_isset(&rdev->wiphy,
11842 err = nl80211_crypto_settings(rdev, info, &connect.crypto,
11851 wiphy = &rdev->wiphy;
11876 !wiphy_ext_feature_isset(&rdev->wiphy,
11916 connkeys = nl80211_parse_connkeys(rdev, info, NULL);
11964 if (!((rdev->wiphy.features &
11966 (rdev->wiphy.features & NL80211_FEATURE_QUIET)) &&
11967 !wiphy_ext_feature_isset(&rdev->wiphy,
11976 if (connect.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ]) {
11996 if (wiphy_ext_feature_isset(&rdev->wiphy,
12040 err = cfg80211_connect(rdev, dev, &connect, connkeys,
12063 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12071 if (!rdev->ops->update_connect_params)
12080 fils_sk_offload = wiphy_ext_feature_isset(&rdev->wiphy,
12118 if (!nl80211_valid_auth_type(rdev, auth_type,
12134 ret = rdev_update_connect_params(rdev, dev, &connect, changed);
12142 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12164 ret = cfg80211_disconnect(rdev, dev, reason, true);
12171 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12193 if (!net_eq(wiphy_net(&rdev->wiphy), net))
12194 err = cfg80211_switch_netns(rdev, net);
12202 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12245 wiphy_ext_feature_isset(&rdev->wiphy,
12251 rdev_ops = rdev->ops->set_pmksa;
12254 rdev_ops = rdev->ops->del_pmksa;
12264 return rdev_ops(&rdev->wiphy, dev, &pmksa);
12269 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12276 if (!rdev->ops->flush_pmksa)
12279 return rdev_flush_pmksa(rdev, dev);
12284 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12293 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) ||
12294 !rdev->ops->tdls_mgmt)
12314 return rdev_tdls_mgmt(rdev, dev, peer, link_id, action_code,
12323 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12328 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) ||
12329 !rdev->ops->tdls_oper)
12339 return rdev_tdls_oper(rdev, dev, peer, operation);
12345 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12361 if (!rdev->ops->remain_on_channel ||
12362 !(rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL))
12370 duration > rdev->wiphy.max_remain_on_channel_duration)
12373 err = nl80211_parse_chandef(rdev, info, &chandef);
12412 err = rdev_remain_on_channel(rdev, wdev, chandef.chan,
12436 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12443 if (!rdev->ops->cancel_remain_on_channel)
12448 return rdev_cancel_remain_on_channel(rdev, wdev, cookie);
12456 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12461 if (!rdev->ops->set_bitrate_mask)
12471 err = rdev_set_bitrate_mask(rdev, dev, link_id, NULL, &mask);
12479 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12509 if (!rdev->ops->mgmt_tx)
12513 !wiphy_ext_feature_isset(&rdev->wiphy,
12529 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12544 if (!rdev->ops->mgmt_tx)
12570 if (!(rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX))
12579 params.wait > rdev->wiphy.max_remain_on_channel_duration)
12585 if (params.offchan && !(rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX))
12595 err = nl80211_parse_chandef(rdev, info, &chandef);
12658 err = cfg80211_mlme_mgmt_tx(rdev, wdev, &params, &cookie);
12682 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12689 if (!rdev->ops->mgmt_tx_cancel_wait)
12712 return rdev_mgmt_tx_cancel_wait(rdev, wdev, cookie);
12717 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12731 if (!rdev->ops->set_power_mgmt)
12739 err = rdev_set_power_mgmt(rdev, dev, state, wdev->ps_timeout);
12747 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12757 if (!rdev->ops->set_power_mgmt)
12803 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12810 if (!rdev->ops->set_cqm_txe_config)
12817 return rdev_set_cqm_txe_config(rdev, dev, rate, pkts, intvl);
12820 static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev,
12838 rdev->ops->get_station) {
12844 err = rdev_get_station(rdev, dev, mac_addr, &sinfo);
12878 return rdev_set_cqm_rssi_range_config(rdev, dev, low, high);
12885 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12918 if (!wiphy_ext_feature_isset(&rdev->wiphy,
12920 !rdev->ops->set_cqm_rssi_range_config) {
12925 if (!rdev->ops->set_cqm_rssi_config) {
12946 !rdev->ops->set_cqm_rssi_config;
12951 err = cfg80211_cqm_rssi_update(rdev, dev, cqm_config);
12953 err = rdev_set_cqm_rssi_config(rdev, dev,
12960 err = rdev_set_cqm_rssi_range_config(rdev, dev, 0, 0);
12962 err = rdev_set_cqm_rssi_config(rdev, dev, 0, 0);
13022 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13027 err = nl80211_parse_chandef(rdev, info, &setup.chandef);
13031 return cfg80211_join_ocb(rdev, dev, &setup);
13036 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13039 return cfg80211_leave_ocb(rdev, dev);
13044 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13069 !nl80211_parse_mcast_rate(rdev, setup.mcast_rate,
13077 err = cfg80211_validate_beacon_int(rdev,
13102 err = nl80211_parse_chandef(rdev, info, &setup.chandef);
13119 sband = rdev->wiphy.bands[setup.chandef.chan->band];
13138 err = validate_beacon_tx_rate(rdev, setup.chandef.chan->band,
13148 int r = validate_pae_over_nl80211(rdev, info);
13157 err = __cfg80211_join_mesh(rdev, dev, &setup, &cfg);
13167 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13170 return cfg80211_leave_mesh(rdev, dev);
13175 struct cfg80211_registered_device *rdev)
13177 struct cfg80211_wowlan *wowlan = rdev->wiphy.wowlan_config;
13343 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13348 if (!rdev->wiphy.wowlan)
13351 if (rdev->wiphy.wowlan_config && rdev->wiphy.wowlan_config->tcp) {
13353 size += rdev->wiphy.wowlan_config->tcp->tokens_size +
13354 rdev->wiphy.wowlan_config->tcp->payload_len +
13355 rdev->wiphy.wowlan_config->tcp->wake_len +
13356 rdev->wiphy.wowlan_config->tcp->wake_len / 8;
13368 if (rdev->wiphy.wowlan_config) {
13376 if ((rdev->wiphy.wowlan_config->any &&
13378 (rdev->wiphy.wowlan_config->disconnect &&
13380 (rdev->wiphy.wowlan_config->magic_pkt &&
13382 (rdev->wiphy.wowlan_config->gtk_rekey_failure &&
13384 (rdev->wiphy.wowlan_config->eap_identity_req &&
13386 (rdev->wiphy.wowlan_config->four_way_handshake &&
13388 (rdev->wiphy.wowlan_config->rfkill_release &&
13392 if (nl80211_send_wowlan_patterns(msg, rdev))
13396 rdev->wiphy.wowlan_config->tcp))
13401 rdev->wiphy.wowlan_config->nd_config))
13415 static int nl80211_parse_wowlan_tcp(struct cfg80211_registered_device *rdev,
13427 if (!rdev->wiphy.wowlan->tcp)
13446 if (data_size > rdev->wiphy.wowlan->tcp->data_payload_max)
13450 rdev->wiphy.wowlan->tcp->data_interval_max ||
13455 if (wake_size > rdev->wiphy.wowlan->tcp->wake_payload_max)
13470 if (!rdev->wiphy.wowlan->tcp->tok)
13472 if (tok->len > rdev->wiphy.wowlan->tcp->tok->max_len)
13474 if (tok->len < rdev->wiphy.wowlan->tcp->tok->min_len)
13476 if (tokens_size > rdev->wiphy.wowlan->tcp->tok->bufsize)
13484 if (!rdev->wiphy.wowlan->tcp->seq)
13510 err = __sock_create(wiphy_net(&rdev->wiphy), PF_INET, SOCK_STREAM,
13561 static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev,
13583 trig->nd_config = nl80211_parse_sched_scan(&rdev->wiphy, NULL, tb,
13596 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13600 const struct wiphy_wowlan_support *wowlan = rdev->wiphy.wowlan;
13602 bool prev_enabled = rdev->wiphy.wowlan_config;
13609 cfg80211_rdev_free_wowlan(rdev);
13610 rdev->wiphy.wowlan_config = NULL;
13748 rdev, tb[NL80211_WOWLAN_TRIG_TCP_CONNECTION],
13757 rdev, wowlan, tb[NL80211_WOWLAN_TRIG_NET_DETECT],
13779 cfg80211_rdev_free_wowlan(rdev);
13780 rdev->wiphy.wowlan_config = ntrig;
13783 if (rdev->ops->set_wakeup &&
13784 prev_enabled != !!rdev->wiphy.wowlan_config)
13785 rdev_set_wakeup(rdev, rdev->wiphy.wowlan_config);
13801 struct cfg80211_registered_device *rdev)
13807 if (!rdev->coalesce->n_rules)
13814 for (i = 0; i < rdev->coalesce->n_rules; i++) {
13819 rule = &rdev->coalesce->rules[i];
13858 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13862 if (!rdev->wiphy.coalesce)
13874 if (rdev->coalesce && nl80211_send_coalesce_rules(msg, rdev))
13885 void cfg80211_rdev_free_coalesce(struct cfg80211_registered_device *rdev)
13887 struct cfg80211_coalesce *coalesce = rdev->coalesce;
13902 rdev->coalesce = NULL;
13905 static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev,
13910 const struct wiphy_coalesce_support *coalesce = rdev->wiphy.coalesce;
13998 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13999 const struct wiphy_coalesce_support *coalesce = rdev->wiphy.coalesce;
14006 if (!rdev->wiphy.coalesce || !rdev->ops->set_coalesce)
14010 cfg80211_rdev_free_coalesce(rdev);
14011 rdev_set_coalesce(rdev, NULL);
14031 err = nl80211_parse_coalesce_rule(rdev, rule,
14039 err = rdev_set_coalesce(rdev, &new_coalesce);
14048 cfg80211_rdev_free_coalesce(rdev);
14049 rdev->coalesce = n_coalesce;
14066 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14086 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK &&
14090 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK &&
14092 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_EXT_KCK_32 &&
14110 if (!rdev->ops->set_rekey_data) {
14115 err = rdev_set_rekey_data(rdev, dev, &rekey_data);
14141 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14157 if (!rdev->ops->probe_client)
14173 err = rdev_probe_client(rdev, dev, addr, &cookie);
14194 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14198 if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS))
14206 spin_lock_bh(&rdev->beacon_registrations_lock);
14207 list_for_each_entry(reg, &rdev->beacon_registrations, list) {
14215 list_add(&nreg->list, &rdev->beacon_registrations);
14217 spin_unlock_bh(&rdev->beacon_registrations_lock);
14221 spin_unlock_bh(&rdev->beacon_registrations_lock);
14228 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14232 if (!rdev->ops->start_p2p_device)
14241 if (rfkill_blocked(rdev->wiphy.rfkill))
14244 err = rdev_start_p2p_device(rdev, wdev);
14249 rdev->opencount++;
14256 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14262 if (!rdev->ops->stop_p2p_device)
14265 cfg80211_stop_p2p_device(rdev, wdev);
14272 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14283 if (rfkill_blocked(rdev->wiphy.rfkill))
14304 err = rdev_start_nan(rdev, wdev, &conf);
14309 rdev->opencount++;
14316 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14322 cfg80211_stop_nan(rdev, wdev);
14393 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14421 func->cookie = cfg80211_assign_cookie(rdev);
14597 err = rdev_add_nan_func(rdev, wdev, func);
14631 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14646 rdev_del_nan_func(rdev, wdev, cookie);
14654 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14690 return rdev_nan_change_conf(rdev, wdev, &conf, changed);
14697 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
14715 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
14760 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
14763 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg,
14779 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
14797 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
14820 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
14823 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg,
14862 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14866 if (!rdev->ops->update_ft_ies)
14878 return rdev_update_ft_ies(rdev, dev, &ft_params);
14884 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14890 if (!rdev->ops->crit_proto_start)
14893 if (WARN_ON(!rdev->ops->crit_proto_stop))
14896 if (rdev->crit_proto_nlportid)
14913 ret = rdev_crit_proto_start(rdev, wdev, proto, duration);
14915 rdev->crit_proto_nlportid = info->snd_portid;
14923 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14926 if (!rdev->ops->crit_proto_stop)
14929 if (rdev->crit_proto_nlportid) {
14930 rdev->crit_proto_nlportid = 0;
14931 rdev_crit_proto_stop(rdev, wdev);
14960 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14962 __cfg80211_wdev_from_attrs(rdev, genl_info_net(info),
14967 if (!rdev->wiphy.vendor_commands)
14975 } else if (wdev->wiphy != &rdev->wiphy) {
14985 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
14990 vcmd = &rdev->wiphy.vendor_commands[i];
15025 rdev->cur_cmd_info = info;
15026 err = vcmd->doit(&rdev->wiphy, wdev, data, len);
15027 rdev->cur_cmd_info = NULL;
15036 struct cfg80211_registered_device **rdev,
15054 *rdev = wiphy_to_rdev(wiphy);
15091 *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf);
15092 if (IS_ERR(*rdev)) {
15093 err = PTR_ERR(*rdev);
15100 for (i = 0; i < (*rdev)->wiphy.n_vendor_commands; i++) {
15103 vcmd = &(*rdev)->wiphy.vendor_commands[i];
15127 &(*rdev)->wiphy.vendor_commands[vcmd_idx],
15135 cb->args[0] = (*rdev)->wiphy_idx + 1;
15152 struct cfg80211_registered_device *rdev;
15162 err = nl80211_prepare_vendor_dump(skb, cb, &rdev, &wdev);
15169 vcmd = &rdev->wiphy.vendor_commands[vcmd_idx];
15198 if (nla_put_u32(skb, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
15213 err = vcmd->dumpit(&rdev->wiphy, wdev, skb, data, data_len,
15239 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
15241 if (WARN_ON(!rdev->cur_cmd_info))
15244 return __cfg80211_alloc_vendor_skb(rdev, NULL, approxlen,
15245 rdev->cur_cmd_info->snd_portid,
15246 rdev->cur_cmd_info->snd_seq,
15253 struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0];
15260 if (WARN_ON(!rdev->cur_cmd_info)) {
15267 return genlmsg_reply(skb, rdev->cur_cmd_info);
15273 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
15275 if (WARN_ON(!rdev->cur_cmd_info))
15278 return rdev->cur_cmd_info->snd_portid;
15285 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15291 if (!rdev->ops->set_qos_map)
15325 ret = rdev_set_qos_map(rdev, dev, qos_map);
15334 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15342 if (!(rdev->wiphy.features & NL80211_FEATURE_SUPPORTS_WMM_ADMISSION))
15383 err = rdev_add_tx_ts(rdev, dev, tsid, peer, up, admitted_time);
15392 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15406 err = rdev_del_tx_ts(rdev, dev, tsid, peer);
15415 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15423 if (!rdev->ops->tdls_channel_switch ||
15424 !(rdev->wiphy.features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH))
15439 err = nl80211_parse_chandef(rdev, info, &chandef);
15454 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &chandef,
15466 err = rdev_tdls_channel_switch(rdev, dev, addr, oper_class, &chandef);
15475 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15480 if (!rdev->ops->tdls_channel_switch ||
15481 !rdev->ops->tdls_cancel_channel_switch ||
15482 !(rdev->wiphy.features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH))
15499 rdev_tdls_cancel_channel_switch(rdev, dev, addr);
15508 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15514 if (!rdev->ops->set_multicast_to_unicast)
15524 return rdev_set_multicast_to_unicast(rdev, dev, enabled);
15529 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15539 if (!wiphy_ext_feature_isset(&rdev->wiphy,
15570 ret = rdev_set_pmk(rdev, dev, &pmk_conf);
15578 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15588 if (!wiphy_ext_feature_isset(&rdev->wiphy,
15597 ret = rdev_del_pmk(rdev, dev, aa);
15605 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15609 if (!rdev->ops->external_auth)
15642 return rdev_external_auth(rdev, dev, &params);
15648 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15660 if (!wiphy_ext_feature_isset(&rdev->wiphy,
15664 if (!rdev->ops->tx_control_port)
15708 err = rdev_tx_control_port(rdev, dev, buf, len,
15722 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15736 err = rdev_get_ftm_responder_stats(rdev, dev, &ftm_stats);
15794 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15798 if (!rdev->ops->update_owe_info)
15814 return rdev_update_owe_info(rdev, dev, &owe_info);
15819 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15828 if (!rdev->ops->probe_mesh_link || !rdev->ops->get_station)
15851 err = rdev_get_station(rdev, dev, dest, &sinfo);
15857 return rdev_probe_mesh_link(rdev, dev, dest, buf, len);
15860 static int parse_tid_conf(struct cfg80211_registered_device *rdev,
15878 if (rdev->ops->reset_tid_config) {
15879 err = rdev_reset_tid_config(rdev, dev, peer,
15899 if (tid_conf->retry_short > rdev->wiphy.max_data_retry_count)
15908 if (tid_conf->retry_long > rdev->wiphy.max_data_retry_count)
15949 mask = rdev->wiphy.tid_config_support.peer;
15951 mask = rdev->wiphy.tid_config_support.vif;
15964 struct cfg80211_registered_device *rdev = info->user_ptr[0];
15977 if (!rdev->ops->set_tid_config)
16004 ret = parse_tid_conf(rdev, attrs, dev,
16013 ret = rdev_set_tid_config(rdev, dev, tid_config);
16023 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16031 if (!rdev->ops->color_change)
16034 if (!wiphy_ext_feature_isset(&rdev->wiphy,
16049 err = nl80211_parse_beacon(rdev, info->attrs, &params.beacon_next,
16064 err = nl80211_parse_beacon(rdev, tb, &params.beacon_color_change,
16115 err = rdev_color_change(rdev, dev, &params);
16130 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16147 return rdev_set_fils_aad(rdev, dev, &fils_aad);
16152 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16177 ret = rdev_add_intf_link(rdev, wdev, link_id);
16216 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16220 if ((add && !rdev->ops->add_link_station) ||
16221 (!add && !rdev->ops->mod_link_station))
16298 err = rdev_add_link_station(rdev, dev, &params);
16300 err = rdev_mod_link_station(rdev, dev, &params);
16322 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16326 if (!rdev->ops->del_link_station)
16337 ret = rdev_del_link_station(rdev, dev, &params);
16346 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16350 if (!rdev->wiphy.hw_timestamp_max_peers)
16354 rdev->wiphy.hw_timestamp_max_peers != CFG80211_HW_TIMESTAMP_ALL_PEERS)
16363 return rdev_set_hw_timestamp(rdev, dev, &hwts);
16458 struct cfg80211_registered_device *rdev = NULL;
16471 rdev = cfg80211_get_dev_from_info(genl_info_net(info), info);
16472 if (IS_ERR(rdev)) {
16473 err = PTR_ERR(rdev);
16476 info->user_ptr[0] = rdev;
16488 rdev = wiphy_to_rdev(wdev->wiphy);
16507 info->user_ptr[0] = rdev;
16541 if (rdev && !(internal_flags & NL80211_FLAG_NO_WIPHY_MTX)) {
16542 wiphy_lock(&rdev->wiphy);
16544 __release(&rdev->wiphy.mtx);
16574 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16577 __acquire(&rdev->wiphy.mtx);
16578 wiphy_unlock(&rdev->wiphy);
16596 static int nl80211_set_sar_sub_specs(struct cfg80211_registered_device *rdev,
16612 if (range_index >= rdev->wiphy.sar_capa->num_freq_ranges)
16631 struct cfg80211_registered_device *rdev = info->user_ptr[0];
16640 if (!rdev->wiphy.sar_capa || !rdev->ops->set_sar_specs)
16654 if (type != rdev->wiphy.sar_capa->type)
16661 if (specs > rdev->wiphy.sar_capa->num_freq_ranges)
16676 if (nl80211_set_sar_sub_specs(rdev, sar_spec,
16691 rdev->cur_cmd_info = info;
16692 err = rdev_set_sar_specs(rdev, sar_spec);
16693 rdev->cur_cmd_info = NULL;
17571 void nl80211_notify_wiphy(struct cfg80211_registered_device *rdev,
17584 if (nl80211_send_wiphy(rdev, cmd, msg, 0, 0, 0, &state) < 0) {
17589 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17593 void nl80211_notify_iface(struct cfg80211_registered_device *rdev,
17603 if (nl80211_send_iface(msg, 0, 0, 0, rdev, wdev, cmd) < 0) {
17608 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17613 struct cfg80211_registered_device *rdev)
17615 struct cfg80211_scan_request *req = rdev->scan_req;
17662 info = rdev->int_scan_req ? &rdev->int_scan_req->info :
17663 &rdev->scan_req->info;
17677 struct cfg80211_registered_device *rdev,
17688 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17696 nl80211_add_scan_req(msg, rdev);
17731 void nl80211_send_scan_start(struct cfg80211_registered_device *rdev,
17740 if (nl80211_prep_scan_msg(msg, rdev, wdev, 0, 0, 0,
17746 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17750 struct sk_buff *nl80211_build_scan_msg(struct cfg80211_registered_device *rdev,
17759 if (nl80211_prep_scan_msg(msg, rdev, wdev, 0, 0, 0,
17770 void nl80211_send_scan_msg(struct cfg80211_registered_device *rdev,
17776 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17878 static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
17898 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17923 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17931 void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
17935 nl80211_send_mlme_event(rdev, netdev, buf, len,
17940 void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
17944 nl80211_send_mlme_event(rdev, netdev, data->buf, data->len,
17950 void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
17954 nl80211_send_mlme_event(rdev, netdev, buf, len,
17959 void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
17963 nl80211_send_mlme_event(rdev, netdev, buf, len,
17973 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17995 nl80211_send_mlme_event(rdev, dev, buf, len, cmd, GFP_ATOMIC, -1,
18000 static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
18017 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18025 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18033 void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
18037 nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_AUTHENTICATE,
18041 void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
18045 nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_ASSOCIATE,
18049 void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
18089 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18154 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18162 void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
18203 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18258 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18266 void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
18283 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18295 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18303 void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
18320 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18331 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18343 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18373 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18400 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18409 void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
18426 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18433 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18446 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
18465 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18476 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18485 void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
18503 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18514 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18579 int cmd, struct cfg80211_registered_device *rdev,
18597 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18615 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18628 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18644 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18652 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18666 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18670 rdev, wdev, cookie, chan,
18680 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18684 rdev, wdev, cookie, chan, 0, gfp);
18693 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18697 rdev, wdev, cookie, chan, 0, gfp);
18705 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18715 rdev, dev, mac_addr, sinfo) < 0) {
18720 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18729 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18745 rdev, dev, mac_addr, sinfo) < 0) {
18750 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18760 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18781 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
18794 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
18812 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18818 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
18868 int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
18886 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18912 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
18924 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
18946 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
18965 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19003 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
19026 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19045 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
19069 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
19084 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19095 cb[2] = rdev;
19106 struct cfg80211_registered_device *rdev = cb[2];
19113 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19145 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19158 cfg80211_cqm_rssi_update(rdev, wdev->netdev, cqm_config);
19253 static void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
19271 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19288 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19301 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19304 nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp);
19309 nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev,
19327 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19345 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19358 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19361 nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp);
19365 static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev,
19410 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19424 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19454 cfg80211_sched_dfs_chan_update(rdev);
19456 nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL,
19469 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19478 nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL,
19490 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19520 return genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
19530 nl80211_radar_notify(struct cfg80211_registered_device *rdev,
19548 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
19569 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19583 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
19599 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
19622 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19637 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
19654 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19666 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19678 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
19685 spin_lock_bh(&rdev->beacon_registrations_lock);
19686 list_for_each_entry(reg, &rdev->beacon_registrations, list) {
19689 spin_unlock_bh(&rdev->beacon_registrations_lock);
19697 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19710 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, reg->nlportid);
19712 spin_unlock_bh(&rdev->beacon_registrations_lock);
19716 spin_unlock_bh(&rdev->beacon_registrations_lock);
19785 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
19803 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19886 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19901 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
19918 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
19928 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
19942 struct cfg80211_registered_device *rdev;
19951 list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) {
19955 &rdev->sched_scan_req_list,
19959 wiphy_work_queue(&rdev->wiphy,
19960 &rdev->sched_scan_stop_wk);
19964 list_for_each_entry_rcu(wdev, &rdev->wiphy.wdev_list, list) {
19969 schedule_work(&rdev->destroy_work);
19977 spin_lock_bh(&rdev->beacon_registrations_lock);
19978 list_for_each_entry_safe(reg, tmp, &rdev->beacon_registrations,
19986 spin_unlock_bh(&rdev->beacon_registrations_lock);
20007 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
20025 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
20040 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
20050 struct cfg80211_registered_device *rdev;
20055 rdev = wiphy_to_rdev(wdev->wiphy);
20056 if (!rdev->crit_proto_nlportid)
20059 nlportid = rdev->crit_proto_nlportid;
20060 rdev->crit_proto_nlportid = 0;
20070 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
20077 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
20088 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
20100 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
20122 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
20137 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
20150 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg,
20165 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
20179 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
20201 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,