Lines Matching defs:rdev
32 #include "rdev-ops.h"
34 static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
69 struct cfg80211_registered_device *rdev;
89 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
92 if (wiphy_net(&rdev->wiphy) != netns)
95 if (have_wdev_id && rdev->wiphy_idx != wiphy_idx)
98 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
122 struct cfg80211_registered_device *rdev = NULL, *tmp;
133 rdev = cfg80211_rdev_by_wiphy_idx(
154 if (rdev && tmp != rdev)
156 rdev = tmp;
176 if (rdev && tmp != rdev)
179 rdev = tmp;
183 if (!rdev)
186 if (netns != wiphy_net(&rdev->wiphy))
189 return rdev;
887 struct cfg80211_registered_device **rdev,
914 *rdev = wiphy_to_rdev((*wdev)->wiphy);
916 cb->args[0] = (*rdev)->wiphy_idx + 1;
925 *rdev = wiphy_to_rdev(wiphy);
928 list_for_each_entry(tmp, &(*rdev)->wiphy.wdev_list, list) {
1314 nl80211_parse_connkeys(struct cfg80211_registered_device *rdev,
1364 err = cfg80211_validate_key_settings(rdev, &parse.p,
1533 static int nl80211_send_wowlan_tcp_caps(struct cfg80211_registered_device *rdev,
1536 const struct wiphy_wowlan_tcp_support *tcp = rdev->wiphy.wowlan->tcp;
1575 struct cfg80211_registered_device *rdev,
1580 if (!rdev->wiphy.wowlan)
1588 if (((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_ANY) &&
1590 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_DISCONNECT) &&
1592 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_MAGIC_PKT) &&
1594 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY) &&
1596 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
1598 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ) &&
1600 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_4WAY_HANDSHAKE) &&
1602 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_RFKILL_RELEASE) &&
1606 if (rdev->wiphy.wowlan->n_patterns) {
1608 .max_patterns = rdev->wiphy.wowlan->n_patterns,
1609 .min_pattern_len = rdev->wiphy.wowlan->pattern_min_len,
1610 .max_pattern_len = rdev->wiphy.wowlan->pattern_max_len,
1611 .max_pkt_offset = rdev->wiphy.wowlan->max_pkt_offset,
1619 if ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_NET_DETECT) &&
1621 rdev->wiphy.wowlan->max_nd_match_sets))
1624 if (large && nl80211_send_wowlan_tcp_caps(rdev, msg))
1634 struct cfg80211_registered_device *rdev)
1638 if (!rdev->wiphy.coalesce)
1641 rule.max_rules = rdev->wiphy.coalesce->n_rules;
1642 rule.max_delay = rdev->wiphy.coalesce->max_delay;
1643 rule.pat.max_patterns = rdev->wiphy.coalesce->n_patterns;
1644 rule.pat.min_pattern_len = rdev->wiphy.coalesce->pattern_min_len;
1645 rule.pat.max_pattern_len = rdev->wiphy.coalesce->pattern_max_len;
1646 rule.pat.max_pkt_offset = rdev->wiphy.coalesce->max_pkt_offset;
1844 if (rdev->ops->op) { \
1851 static int nl80211_add_commands_unsplit(struct cfg80211_registered_device *rdev,
1878 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL)
1883 if (rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK) {
1888 if (rdev->ops->set_monitor_channel || rdev->ops->start_ap ||
1889 rdev->ops->join_mesh) {
1895 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) {
1899 if (rdev->wiphy.max_sched_scan_reqs)
1903 if (rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS) {
1914 if (rdev->ops->connect || rdev->ops->auth) {
1920 if (rdev->ops->disconnect || rdev->ops->deauth) {
1980 static int nl80211_send_pmsr_capa(struct cfg80211_registered_device *rdev,
1983 const struct cfg80211_pmsr_capabilities *cap = rdev->wiphy.pmsr_capa;
2023 nl80211_put_iftype_akm_suites(struct cfg80211_registered_device *rdev,
2030 if (!rdev->wiphy.num_iftype_akm_suites ||
2031 !rdev->wiphy.iftype_akm_suites)
2038 for (i = 0; i < rdev->wiphy.num_iftype_akm_suites; i++) {
2043 iftype_akms = &rdev->wiphy.iftype_akm_suites[i];
2063 nl80211_put_tid_config_support(struct cfg80211_registered_device *rdev,
2068 if (!rdev->wiphy.tid_config_support.vif &&
2069 !rdev->wiphy.tid_config_support.peer)
2076 if (rdev->wiphy.tid_config_support.vif &&
2078 rdev->wiphy.tid_config_support.vif,
2082 if (rdev->wiphy.tid_config_support.peer &&
2084 rdev->wiphy.tid_config_support.peer,
2090 rdev->wiphy.tid_config_support.max_retry))
2093 rdev->wiphy.tid_config_support.max_retry))
2111 static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
2124 rdev->wiphy.mgmt_stypes;
2134 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
2136 wiphy_name(&rdev->wiphy)) ||
2147 rdev->wiphy.retry_short) ||
2149 rdev->wiphy.retry_long) ||
2151 rdev->wiphy.frag_threshold) ||
2153 rdev->wiphy.rts_threshold) ||
2155 rdev->wiphy.coverage_class) ||
2157 rdev->wiphy.max_scan_ssids) ||
2159 rdev->wiphy.max_sched_scan_ssids) ||
2161 rdev->wiphy.max_scan_ie_len) ||
2163 rdev->wiphy.max_sched_scan_ie_len) ||
2165 rdev->wiphy.max_match_sets))
2168 if ((rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN) &&
2171 if ((rdev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) &&
2174 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
2177 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) &&
2180 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) &&
2183 if ((rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
2192 sizeof(u32) * rdev->wiphy.n_cipher_suites,
2193 rdev->wiphy.cipher_suites))
2197 rdev->wiphy.max_num_pmkids))
2200 if ((rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) &&
2205 rdev->wiphy.available_antennas_tx) ||
2207 rdev->wiphy.available_antennas_rx))
2210 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) &&
2212 rdev->wiphy.probe_resp_offload))
2215 if ((rdev->wiphy.available_antennas_tx ||
2216 rdev->wiphy.available_antennas_rx) &&
2217 rdev->ops->get_antenna) {
2221 res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
2239 rdev->wiphy.interface_modes))
2259 sband = rdev->wiphy.bands[band];
2295 msg, &rdev->wiphy, chan,
2338 i = nl80211_add_commands_unsplit(rdev, msg);
2344 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
2347 if (rdev->wiphy.features &
2362 if (rdev->ops->remain_on_channel &&
2363 (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) &&
2366 rdev->wiphy.max_remain_on_channel_duration))
2369 if ((rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX) &&
2379 if (nl80211_send_wowlan(msg, rdev, state->split))
2390 rdev->wiphy.software_iftypes))
2393 if (nl80211_put_iface_combinations(&rdev->wiphy, msg,
2402 if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) &&
2404 rdev->wiphy.ap_sme_capa))
2407 features = rdev->wiphy.features;
2418 if (rdev->wiphy.ht_capa_mod_mask &&
2420 sizeof(*rdev->wiphy.ht_capa_mod_mask),
2421 rdev->wiphy.ht_capa_mod_mask))
2424 if (rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME &&
2425 rdev->wiphy.max_acl_mac_addrs &&
2427 rdev->wiphy.max_acl_mac_addrs))
2450 rdev->wiphy.max_sched_scan_plans) ||
2452 rdev->wiphy.max_sched_scan_plan_interval) ||
2454 rdev->wiphy.max_sched_scan_plan_iterations))
2457 if (rdev->wiphy.extended_capabilities &&
2459 rdev->wiphy.extended_capabilities_len,
2460 rdev->wiphy.extended_capabilities) ||
2462 rdev->wiphy.extended_capabilities_len,
2463 rdev->wiphy.extended_capabilities_mask)))
2466 if (rdev->wiphy.vht_capa_mod_mask &&
2468 sizeof(*rdev->wiphy.vht_capa_mod_mask),
2469 rdev->wiphy.vht_capa_mod_mask))
2473 rdev->wiphy.perm_addr))
2476 if (!is_zero_ether_addr(rdev->wiphy.addr_mask) &&
2478 rdev->wiphy.addr_mask))
2481 if (rdev->wiphy.n_addresses > 1) {
2488 for (i = 0; i < rdev->wiphy.n_addresses; i++)
2490 rdev->wiphy.addresses[i].addr))
2499 if (nl80211_send_coalesce(msg, rdev))
2502 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
2507 if (rdev->wiphy.max_ap_assoc_sta &&
2509 rdev->wiphy.max_ap_assoc_sta))
2515 if (rdev->wiphy.n_vendor_commands) {
2524 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
2525 info = &rdev->wiphy.vendor_commands[i].info;
2532 if (rdev->wiphy.n_vendor_events) {
2541 for (i = 0; i < rdev->wiphy.n_vendor_events; i++) {
2542 info = &rdev->wiphy.vendor_events[i];
2551 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH &&
2553 rdev->wiphy.max_num_csa_counters))
2556 if (rdev->wiphy.regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED &&
2560 if (rdev->wiphy.max_sched_scan_reqs &&
2562 rdev->wiphy.max_sched_scan_reqs))
2566 sizeof(rdev->wiphy.ext_features),
2567 rdev->wiphy.ext_features))
2570 if (rdev->wiphy.bss_select_support) {
2572 u32 bss_select_support = rdev->wiphy.bss_select_support;
2593 if (rdev->wiphy.num_iftype_ext_capab &&
2594 rdev->wiphy.iftype_ext_capab) {
2603 i < rdev->wiphy.num_iftype_ext_capab; i++) {
2606 capab = &rdev->wiphy.iftype_ext_capab[i];
2626 if (i < rdev->wiphy.num_iftype_ext_capab) {
2633 rdev->wiphy.nan_supported_bands))
2636 if (wiphy_ext_feature_isset(&rdev->wiphy,
2641 res = rdev_get_txq_stats(rdev, NULL, &txqstats);
2648 rdev->wiphy.txq_limit))
2651 rdev->wiphy.txq_memory_limit))
2654 rdev->wiphy.txq_quantum))
2661 if (nl80211_send_pmsr_capa(rdev, msg))
2667 if (rdev->wiphy.akm_suites &&
2669 sizeof(u32) * rdev->wiphy.n_akm_suites,
2670 rdev->wiphy.akm_suites))
2673 if (nl80211_put_iftype_akm_suites(rdev, msg))
2676 if (nl80211_put_tid_config_support(rdev, msg))
2719 struct cfg80211_registered_device *rdev;
2728 rdev = wiphy_to_rdev(
2730 state->filter_wiphy = rdev->wiphy_idx;
2744 struct cfg80211_registered_device *rdev;
2763 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
2764 if (!net_eq(wiphy_net(&rdev->wiphy), sock_net(skb->sk)))
2769 state->filter_wiphy != rdev->wiphy_idx)
2773 ret = nl80211_send_wiphy(rdev, NL80211_CMD_NEW_WIPHY,
2822 struct cfg80211_registered_device *rdev = info->user_ptr[0];
2829 if (nl80211_send_wiphy(rdev, NL80211_CMD_NEW_WIPHY, msg,
2893 int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
2911 chandef->chan = ieee80211_get_channel_khz(&rdev->wiphy, control_freq);
3002 if (!cfg80211_chandef_usable(&rdev->wiphy, chandef,
3010 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ)) {
3018 static int __nl80211_set_channel(struct cfg80211_registered_device *rdev,
3034 result = nl80211_parse_chandef(rdev, info, &chandef);
3041 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &chandef,
3047 if (!dev || !rdev->ops->set_ap_chanwidth ||
3048 !(rdev->wiphy.features &
3059 result = rdev_set_ap_chanwidth(rdev, dev, &chandef);
3067 result = cfg80211_set_mesh_channel(rdev, wdev, &chandef);
3070 result = cfg80211_set_monitor_channel(rdev, &chandef);
3081 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3084 return __nl80211_set_channel(rdev, netdev, info);
3089 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3100 if (!rdev->ops->set_wds_peer)
3107 return rdev_set_wds_peer(rdev, dev, bssid);
3112 struct cfg80211_registered_device *rdev;
3140 rdev = wiphy_to_rdev(netdev->ieee80211_ptr->wiphy);
3146 rdev = __cfg80211_rdev_from_attrs(genl_info_net(info),
3148 if (IS_ERR(rdev))
3149 return PTR_ERR(rdev);
3157 * end workaround code, by now the rdev is available
3163 rdev, nla_data(info->attrs[NL80211_ATTR_WIPHY_NAME]));
3172 if (!rdev->ops->set_txq_params)
3199 result = rdev_set_txq_params(rdev, netdev,
3208 rdev,
3220 if (!(rdev->wiphy.features & NL80211_FEATURE_VIF_TXPOWER))
3223 if (!rdev->ops->set_tx_power)
3238 result = rdev_set_tx_power(rdev, txp_wdev, type, mbm);
3247 if ((!rdev->wiphy.available_antennas_tx &&
3248 !rdev->wiphy.available_antennas_rx) ||
3249 !rdev->ops->set_antenna)
3257 if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
3258 (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx)))
3261 tx_ant = tx_ant & rdev->wiphy.available_antennas_tx;
3262 rx_ant = rx_ant & rdev->wiphy.available_antennas_rx;
3264 result = rdev_set_antenna(rdev, tx_ant, rx_ant);
3319 if (!(rdev->wiphy.features & NL80211_FEATURE_ACKTO_ESTIMATION))
3326 if (!wiphy_ext_feature_isset(&rdev->wiphy,
3335 if (!wiphy_ext_feature_isset(&rdev->wiphy,
3344 if (!wiphy_ext_feature_isset(&rdev->wiphy,
3358 if (!rdev->ops->set_wiphy_params)
3361 old_retry_short = rdev->wiphy.retry_short;
3362 old_retry_long = rdev->wiphy.retry_long;
3363 old_frag_threshold = rdev->wiphy.frag_threshold;
3364 old_rts_threshold = rdev->wiphy.rts_threshold;
3365 old_coverage_class = rdev->wiphy.coverage_class;
3366 old_txq_limit = rdev->wiphy.txq_limit;
3367 old_txq_memory_limit = rdev->wiphy.txq_memory_limit;
3368 old_txq_quantum = rdev->wiphy.txq_quantum;
3371 rdev->wiphy.retry_short = retry_short;
3373 rdev->wiphy.retry_long = retry_long;
3375 rdev->wiphy.frag_threshold = frag_threshold;
3377 rdev->wiphy.rts_threshold = rts_threshold;
3379 rdev->wiphy.coverage_class = coverage_class;
3381 rdev->wiphy.txq_limit = txq_limit;
3383 rdev->wiphy.txq_memory_limit = txq_memory_limit;
3385 rdev->wiphy.txq_quantum = txq_quantum;
3387 result = rdev_set_wiphy_params(rdev, changed);
3389 rdev->wiphy.retry_short = old_retry_short;
3390 rdev->wiphy.retry_long = old_retry_long;
3391 rdev->wiphy.frag_threshold = old_frag_threshold;
3392 rdev->wiphy.rts_threshold = old_rts_threshold;
3393 rdev->wiphy.coverage_class = old_coverage_class;
3394 rdev->wiphy.txq_limit = old_txq_limit;
3395 rdev->wiphy.txq_memory_limit = old_txq_memory_limit;
3396 rdev->wiphy.txq_quantum = old_txq_quantum;
3437 struct cfg80211_registered_device *rdev,
3457 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
3463 rdev->devlist_generation ^
3468 if (rdev->ops->get_channel) {
3472 ret = rdev_get_channel(rdev, wdev, &chandef);
3479 if (rdev->ops->get_tx_power) {
3482 ret = rdev_get_tx_power(rdev, wdev, &dbm);
3518 if (rdev->ops->get_txq_stats) {
3520 int ret = rdev_get_txq_stats(rdev, wdev, &txqstats);
3547 struct cfg80211_registered_device *rdev;
3575 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
3576 if (!net_eq(wiphy_net(&rdev->wiphy), sock_net(skb->sk)))
3583 if (filter_wiphy >= 0 && filter_wiphy != rdev->wiphy_idx)
3588 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
3595 rdev, wdev,
3618 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3626 rdev, wdev, NL80211_CMD_NEW_INTERFACE) < 0) {
3665 static int nl80211_parse_mon_options(struct cfg80211_registered_device *rdev,
3686 !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
3696 if (!wiphy_ext_feature_isset(&rdev->wiphy, cap_flag))
3717 if (!wiphy_ext_feature_isset(&rdev->wiphy, cap_flag))
3728 static int nl80211_valid_4addr(struct cfg80211_registered_device *rdev,
3740 if (rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP)
3744 if (rdev->wiphy.flags & WIPHY_FLAG_4ADDR_STATION)
3756 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3796 err = nl80211_valid_4addr(rdev, dev, params.use_4addr, ntype);
3803 err = nl80211_parse_mon_options(rdev, ntype, info, ¶ms);
3810 err = cfg80211_change_iface(rdev, dev, ntype, ¶ms);
3820 nl80211_notify_iface(rdev, wdev, NL80211_CMD_SET_INTERFACE);
3828 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3836 cfg80211_destroy_ifaces(rdev);
3846 if (!rdev->ops->add_virtual_intf)
3850 rdev->wiphy.features & NL80211_FEATURE_MAC_ON_CREATE) &&
3860 err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type);
3865 if (!cfg80211_iftype_allowed(&rdev->wiphy, type, params.use_4addr, 0))
3868 err = nl80211_parse_mon_options(rdev, type, info, ¶ms);
3876 wdev = rdev_add_virtual_intf(rdev,
3910 cfg80211_register_wdev(rdev, wdev);
3917 rdev, wdev, NL80211_CMD_NEW_INTERFACE) < 0) {
3927 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3930 if (!rdev->ops->del_virtual_intf)
3943 return rdev_del_virtual_intf(rdev, wdev);
3948 struct cfg80211_registered_device *rdev = info->user_ptr[0];
3955 if (!rdev->ops->set_noack_map)
3960 return rdev_set_noack_map(rdev, dev, noack_map);
4012 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4025 if (wiphy_ext_feature_isset(&rdev->wiphy,
4031 wiphy_ext_feature_isset(&rdev->wiphy,
4057 if (!rdev->ops->get_key)
4060 if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
4082 err = rdev_get_key(rdev, dev, key_idx, pairwise, mac_addr, &cookie,
4103 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4125 if (!rdev->ops->set_default_key) {
4134 err = rdev_set_default_key(rdev, dev, key.idx,
4149 if (!rdev->ops->set_default_mgmt_key) {
4158 err = rdev_set_default_mgmt_key(rdev, dev, key.idx);
4171 if (!rdev->ops->set_default_beacon_key) {
4180 err = rdev_set_default_beacon_key(rdev, dev, key.idx);
4184 wiphy_ext_feature_isset(&rdev->wiphy,
4196 err = rdev_add_key(rdev, dev, key.idx,
4210 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4246 if (!rdev->ops->add_key)
4249 if (cfg80211_validate_key_settings(rdev, &key.p, key.idx,
4261 err = rdev_add_key(rdev, dev, key.idx,
4274 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4299 if (!cfg80211_valid_key_idx(rdev, key.idx,
4303 if (!rdev->ops->del_key)
4310 !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
4314 err = rdev_del_key(rdev, dev, key.idx,
4398 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4410 acl = parse_acl_data(&rdev->wiphy, info);
4414 err = rdev_set_mac_acl(rdev, dev, acl);
4623 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4635 sband = rdev->wiphy.bands[i];
4675 sband = rdev->wiphy.bands[band];
4730 if (!(rdev->wiphy.bands[band]->ht_cap.ht_supported ||
4731 rdev->wiphy.bands[band]->vht_cap.vht_supported ||
4756 static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev,
4797 !wiphy_ext_feature_isset(&rdev->wiphy,
4801 !wiphy_ext_feature_isset(&rdev->wiphy,
4805 !wiphy_ext_feature_isset(&rdev->wiphy,
4812 static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev,
4873 wiphy_ext_feature_isset(&rdev->wiphy,
4963 static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev,
4971 if (!wiphy_ext_feature_isset(&rdev->wiphy,
4994 nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev,
5003 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5073 static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev,
5079 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
5095 static bool nl80211_valid_auth_type(struct cfg80211_registered_device *rdev,
5104 if (!(rdev->wiphy.features & NL80211_FEATURE_SAE) &&
5107 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5115 if (!(rdev->wiphy.features & NL80211_FEATURE_SAE) &&
5116 !wiphy_ext_feature_isset(&rdev->wiphy,
5126 &rdev->wiphy,
5132 if (!wiphy_ext_feature_isset(&rdev->wiphy,
5149 struct cfg80211_registered_device *rdev = info->user_ptr[0];
5159 if (!rdev->ops->start_ap)
5173 err = nl80211_parse_beacon(rdev, info->attrs, ¶ms.beacon);
5182 err = cfg80211_validate_beacon_int(rdev, dev->ieee80211_ptr->iftype,
5211 if (!nl80211_valid_auth_type(rdev, params.auth_type,
5217 err = nl80211_crypto_settings(rdev, info, ¶ms.crypto,
5223 if (!(rdev->wiphy.features & NL80211_FEATURE_INACTIVITY_TIMER))
5235 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_CTWIN))
5247 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_OPPPS))
5252 err = nl80211_parse_chandef(rdev, info, ¶ms.chandef);
5257 } else if (!nl80211_get_ap_channel(rdev, ¶ms))
5260 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, ¶ms.chandef,
5272 err = validate_beacon_tx_rate(rdev, params.chandef.chan->band,
5285 if (!(rdev->wiphy.features &
5290 if (!(rdev->wiphy.features &
5302 if (params.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ])
5306 params.acl = parse_acl_data(&rdev->wiphy, info);
5331 err = nl80211_parse_fils_discovery(rdev,
5340 rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
5352 err = rdev_start_ap(rdev, dev, ¶ms);
5373 struct cfg80211_registered_device *rdev = info->user_ptr[0];
5383 if (!rdev->ops->change_beacon)
5389 err = nl80211_parse_beacon(rdev, info->attrs, ¶ms);
5394 err = rdev_change_beacon(rdev, dev, ¶ms);
5402 struct cfg80211_registered_device *rdev = info->user_ptr[0];
5405 return cfg80211_stop_ap(rdev, dev, false);
5607 struct cfg80211_registered_device *rdev,
5667 if (wiphy_ext_feature_isset(&rdev->wiphy,
5671 switch (rdev->wiphy.signal_type) {
5747 if (wiphy_ext_feature_isset(&rdev->wiphy,
5824 struct cfg80211_registered_device *rdev;
5831 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
5840 if (!rdev->ops->dump_station) {
5847 err = rdev_dump_station(rdev, wdev->netdev, sta_idx,
5857 rdev, wdev->netdev, mac_addr,
5875 struct cfg80211_registered_device *rdev = info->user_ptr[0];
5889 if (!rdev->ops->get_station)
5892 err = rdev_get_station(rdev, dev, mac_addr, &sinfo);
5904 rdev, dev, mac_addr, &sinfo) < 0) {
6068 struct cfg80211_registered_device *rdev)
6081 if (!v->ieee80211_ptr || v->ieee80211_ptr->wiphy != &rdev->wiphy) {
6201 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6205 if (!rdev->ops->set_tx_power ||
6206 !wiphy_ext_feature_isset(&rdev->wiphy,
6230 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6238 if (!rdev->ops->change_station)
6324 !wiphy_ext_feature_isset(&rdev->wiphy,
6337 params.vlan = get_vlan(info, rdev);
6356 err = rdev_change_station(rdev, dev, mac_addr, ¶ms);
6367 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6377 if (!rdev->ops->add_station)
6468 !wiphy_ext_feature_isset(&rdev->wiphy,
6513 if (!(rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) ||
6525 if (!(rdev->wiphy.features &
6546 params.vlan = get_vlan(info, rdev);
6576 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS))
6579 if (!(rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP))
6593 err = rdev_add_station(rdev, dev, mac_addr, ¶ms);
6602 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6620 if (wiphy_ext_feature_isset(&rdev->wiphy,
6628 if (!rdev->ops->del_station)
6652 return rdev_del_station(rdev, dev, ¶ms);
6719 struct cfg80211_registered_device *rdev;
6727 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
6731 if (!rdev->ops->dump_mpath) {
6742 err = rdev_dump_mpath(rdev, wdev->netdev, path_idx, dst,
6768 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6783 if (!rdev->ops->get_mpath)
6789 err = rdev_get_mpath(rdev, dev, dst, next_hop, &pinfo);
6808 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6822 if (!rdev->ops->change_mpath)
6828 return rdev_change_mpath(rdev, dev, dst, next_hop);
6833 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6847 if (!rdev->ops->add_mpath)
6853 return rdev_add_mpath(rdev, dev, dst, next_hop);
6858 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6865 if (!rdev->ops->del_mpath)
6871 return rdev_del_mpath(rdev, dev, dst);
6876 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6891 if (!rdev->ops->get_mpp)
6897 err = rdev_get_mpp(rdev, dev, dst, mpp, &pinfo);
6918 struct cfg80211_registered_device *rdev;
6926 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
6930 if (!rdev->ops->dump_mpp) {
6941 err = rdev_dump_mpp(rdev, wdev->netdev, path_idx, dst,
6967 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7010 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_CTWIN))
7022 !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_OPPPS))
7026 if (!rdev->ops->change_bss)
7034 err = rdev_change_bss(rdev, dev, ¶ms);
7093 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7105 if (!rdev->ops->get_mesh_config)
7113 err = rdev_get_mesh_config(rdev, dev, &cur_params);
7419 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7452 !(rdev->wiphy.features & NL80211_FEATURE_USERSPACE_MPM))
7473 struct cfg80211_registered_device *rdev = info->user_ptr[0];
7483 if (!rdev->ops->update_mesh_config)
7495 err = rdev_update_mesh_config(rdev, dev, mask, &cfg);
7566 struct cfg80211_registered_device *rdev;
7583 rdev = cfg80211_get_dev_from_info(genl_info_net(info), info);
7584 if (IS_ERR(rdev)) {
7586 return PTR_ERR(rdev);
7589 wiphy = &rdev->wiphy;
7671 struct cfg80211_registered_device *rdev;
7686 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
7687 regdom = get_wiphy_regdom(&rdev->wiphy);
7695 NLM_F_MULTI, &rdev->wiphy, regdom);
8070 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8080 wiphy = &rdev->wiphy;
8085 if (!rdev->ops->scan)
8088 if (rdev->scan_req || rdev->scan_msg)
8301 request->wiphy = &rdev->wiphy;
8304 rdev->scan_req = request;
8305 err = cfg80211_scan(rdev);
8310 nl80211_send_scan_start(rdev, wdev);
8317 rdev->scan_req = NULL;
8325 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8328 if (!rdev->ops->abort_scan)
8331 if (rdev->scan_msg)
8334 if (!rdev->scan_req)
8337 rdev_abort_scan(rdev, wdev);
8809 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8816 if (!rdev->wiphy.max_sched_scan_reqs || !rdev->ops->sched_scan_start)
8820 err = cfg80211_sched_scan_req_possible(rdev, want_multi);
8824 sched_scan_req = nl80211_parse_sched_scan(&rdev->wiphy, wdev,
8826 rdev->wiphy.max_match_sets);
8835 if (want_multi && rdev->wiphy.max_sched_scan_reqs > 1)
8836 sched_scan_req->reqid = cfg80211_assign_cookie(rdev);
8838 err = rdev_sched_scan_start(rdev, dev, sched_scan_req);
8843 sched_scan_req->wiphy = &rdev->wiphy;
8848 cfg80211_add_sched_scan_req(rdev, sched_scan_req);
8863 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8866 if (!rdev->wiphy.max_sched_scan_reqs || !rdev->ops->sched_scan_stop)
8871 return __cfg80211_stop_sched_scan(rdev, cookie, false);
8874 req = list_first_or_null_rcu(&rdev->sched_scan_req_list,
8882 return cfg80211_stop_sched_scan_req(rdev, req, false);
8888 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8901 err = nl80211_parse_chandef(rdev, info, &chandef);
8925 if (!rdev->ops->start_radar_detection)
8928 cac_time_ms = cfg80211_chandef_dfs_cac_time(&rdev->wiphy, &chandef);
8932 err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms);
8945 struct cfg80211_registered_device *rdev = info->user_ptr[0];
8960 err = nl80211_parse_chandef(rdev, info, &chandef);
8986 cfg80211_sched_dfs_chan_update(rdev);
8988 rdev->radar_chandef = chandef;
8991 queue_work(cfg80211_wq, &rdev->propagate_radar_detect_wk);
8998 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9012 if (!rdev->ops->channel_switch ||
9013 !(rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH))
9066 err = nl80211_parse_beacon(rdev, info->attrs, ¶ms.beacon_after);
9076 err = nl80211_parse_beacon(rdev, csa_attrs, ¶ms.beacon_csa);
9088 if (rdev->wiphy.max_num_csa_counters &&
9090 rdev->wiphy.max_num_csa_counters))
9113 if (rdev->wiphy.max_num_csa_counters &&
9115 rdev->wiphy.max_num_csa_counters))
9135 err = nl80211_parse_chandef(rdev, info, ¶ms.chandef);
9139 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, ¶ms.chandef,
9161 err = rdev_channel_switch(rdev, dev, ¶ms);
9169 struct cfg80211_registered_device *rdev,
9187 if (nla_put_u32(msg, NL80211_ATTR_GENERATION, rdev->bss_generation))
9263 switch (rdev->wiphy.signal_type) {
9308 struct cfg80211_registered_device *rdev;
9315 err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
9322 spin_lock_bh(&rdev->bss_lock);
9331 cfg80211_bss_expire(rdev);
9333 cb->seq = rdev->bss_generation;
9335 list_for_each_entry(scan, &rdev->bss_list, list) {
9340 rdev, wdev, scan) < 0) {
9346 spin_unlock_bh(&rdev->bss_lock);
9438 struct cfg80211_registered_device *rdev;
9449 res = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
9461 if (!rdev->ops->dump_survey) {
9467 res = rdev_dump_survey(rdev, wdev->netdev, survey_idx, &survey);
9506 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9553 for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
9554 if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
9563 if (!rdev->ops->auth)
9576 chan = nl80211_get_valid_chan(&rdev->wiphy, freq);
9589 if (!nl80211_valid_auth_type(rdev, auth_type, NL80211_CMD_AUTHENTICATE))
9619 err = cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid,
9627 static int validate_pae_over_nl80211(struct cfg80211_registered_device *rdev,
9635 if (!rdev->ops->tx_control_port ||
9636 !wiphy_ext_feature_isset(&rdev->wiphy,
9643 static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
9658 if (!(rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) &&
9667 int r = validate_pae_over_nl80211(rdev, info);
9696 &rdev->wiphy,
9704 if (!cfg80211_supported_cipher_suite(&rdev->wiphy,
9736 if (!wiphy_ext_feature_isset(&rdev->wiphy,
9738 !wiphy_ext_feature_isset(&rdev->wiphy,
9745 if (!wiphy_ext_feature_isset(&rdev->wiphy,
9747 !wiphy_ext_feature_isset(&rdev->wiphy,
9761 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9778 if (!rdev->ops->assoc)
9791 chan = nl80211_get_valid_chan(&rdev->wiphy, freq);
9848 if (!((rdev->wiphy.features &
9850 (rdev->wiphy.features & NL80211_FEATURE_QUIET)) &&
9851 !wiphy_ext_feature_isset(&rdev->wiphy,
9882 err = nl80211_crypto_settings(rdev, info, &req.crypto, 1);
9886 err = cfg80211_mlme_assoc(rdev, dev, chan, bssid,
9904 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9921 if (!rdev->ops->deauth)
9944 err = cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason_code,
9952 struct cfg80211_registered_device *rdev = info->user_ptr[0];
9969 if (!rdev->ops->disassoc)
9992 err = cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason_code,
9999 nl80211_parse_mcast_rate(struct cfg80211_registered_device *rdev,
10003 struct wiphy *wiphy = &rdev->wiphy;
10028 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10047 err = cfg80211_validate_beacon_int(rdev, NL80211_IFTYPE_ADHOC,
10052 if (!rdev->ops->join_ibss)
10058 wiphy = &rdev->wiphy;
10074 err = nl80211_parse_chandef(rdev, info, &ibss.chandef);
10078 if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef,
10089 if (!(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
10095 if (!(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
10097 if (!wiphy_ext_feature_isset(&rdev->wiphy,
10136 !nl80211_parse_mcast_rate(rdev, ibss.mcast_rate,
10143 connkeys = nl80211_parse_connkeys(rdev, info, &no_ht);
10158 int r = validate_pae_over_nl80211(rdev, info);
10172 err = __cfg80211_join_ibss(rdev, dev, &ibss, connkeys);
10184 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10187 if (!rdev->ops->leave_ibss)
10193 return cfg80211_leave_ibss(rdev, dev, false);
10198 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10209 if (!rdev->ops->set_mcast_rate)
10218 if (!nl80211_parse_mcast_rate(rdev, mcast_rate, nla_rate))
10221 err = rdev_set_mcast_rate(rdev, dev, mcast_rate);
10227 __cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
10248 if (nla_put_u32(skb, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
10274 ((void **)skb->cb)[0] = rdev;
10293 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
10313 return __cfg80211_alloc_vendor_skb(rdev, wdev, approxlen, portid, 0,
10320 struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0];
10333 genlmsg_unicast(wiphy_net(&rdev->wiphy), skb,
10339 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
10348 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10353 if (!rdev->ops->testmode_cmd)
10361 } else if (wdev->wiphy != &rdev->wiphy) {
10368 rdev->cur_cmd_info = info;
10369 err = rdev_testmode_cmd(rdev, wdev,
10372 rdev->cur_cmd_info = NULL;
10380 struct cfg80211_registered_device *rdev;
10396 rdev = cfg80211_rdev_by_wiphy_idx(phy_idx);
10397 if (!rdev) {
10416 rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf);
10417 if (IS_ERR(rdev)) {
10418 err = PTR_ERR(rdev);
10421 phy_idx = rdev->wiphy_idx;
10432 if (!rdev->ops->testmode_dump) {
10456 err = rdev_testmode_dump(rdev, skb, cb, data, data_len);
10482 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10499 if (!nl80211_valid_auth_type(rdev, connect.auth_type,
10508 !wiphy_ext_feature_isset(&rdev->wiphy,
10513 err = nl80211_crypto_settings(rdev, info, &connect.crypto,
10522 wiphy = &rdev->wiphy;
10547 !wiphy_ext_feature_isset(&rdev->wiphy,
10587 connkeys = nl80211_parse_connkeys(rdev, info, NULL);
10629 if (!((rdev->wiphy.features &
10631 (rdev->wiphy.features & NL80211_FEATURE_QUIET)) &&
10632 !wiphy_ext_feature_isset(&rdev->wiphy,
10641 if (connect.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ]) {
10661 if (wiphy_ext_feature_isset(&rdev->wiphy,
10702 err = cfg80211_connect(rdev, dev, &connect, connkeys,
10725 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10733 if (!rdev->ops->update_connect_params)
10742 fils_sk_offload = wiphy_ext_feature_isset(&rdev->wiphy,
10780 if (!nl80211_valid_auth_type(rdev, auth_type,
10796 ret = rdev_update_connect_params(rdev, dev, &connect, changed);
10804 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10826 ret = cfg80211_disconnect(rdev, dev, reason, true);
10833 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10855 if (!net_eq(wiphy_net(&rdev->wiphy), net))
10856 err = cfg80211_switch_netns(rdev, net);
10864 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10907 wiphy_ext_feature_isset(&rdev->wiphy,
10913 rdev_ops = rdev->ops->set_pmksa;
10916 rdev_ops = rdev->ops->del_pmksa;
10926 return rdev_ops(&rdev->wiphy, dev, &pmksa);
10931 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10938 if (!rdev->ops->flush_pmksa)
10941 return rdev_flush_pmksa(rdev, dev);
10946 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10954 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) ||
10955 !rdev->ops->tdls_mgmt)
10974 return rdev_tdls_mgmt(rdev, dev, peer, action_code,
10983 struct cfg80211_registered_device *rdev = info->user_ptr[0];
10988 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) ||
10989 !rdev->ops->tdls_oper)
10999 return rdev_tdls_oper(rdev, dev, peer, operation);
11005 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11021 if (!rdev->ops->remain_on_channel ||
11022 !(rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL))
11030 duration > rdev->wiphy.max_remain_on_channel_duration)
11033 err = nl80211_parse_chandef(rdev, info, &chandef);
11060 err = rdev_remain_on_channel(rdev, wdev, chandef.chan,
11084 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11091 if (!rdev->ops->cancel_remain_on_channel)
11096 return rdev_cancel_remain_on_channel(rdev, wdev, cookie);
11103 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11108 if (!rdev->ops->set_bitrate_mask)
11118 err = rdev_set_bitrate_mask(rdev, dev, NULL, &mask);
11126 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11152 if (!rdev->ops->mgmt_tx)
11156 !wiphy_ext_feature_isset(&rdev->wiphy,
11172 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11187 if (!rdev->ops->mgmt_tx)
11208 if (!(rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX))
11217 params.wait > rdev->wiphy.max_remain_on_channel_duration)
11223 if (params.offchan && !(rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX))
11233 err = nl80211_parse_chandef(rdev, info, &chandef);
11283 err = cfg80211_mlme_mgmt_tx(rdev, wdev, ¶ms, &cookie);
11307 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11314 if (!rdev->ops->mgmt_tx_cancel_wait)
11333 return rdev_mgmt_tx_cancel_wait(rdev, wdev, cookie);
11338 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11352 if (!rdev->ops->set_power_mgmt)
11360 err = rdev_set_power_mgmt(rdev, dev, state, wdev->ps_timeout);
11368 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11378 if (!rdev->ops->set_power_mgmt)
11424 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11431 if (!rdev->ops->set_cqm_txe_config)
11438 return rdev_set_cqm_txe_config(rdev, dev, rate, pkts, intvl);
11441 static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev,
11452 return rdev_set_cqm_rssi_range_config(rdev, dev, 0, 0);
11461 rdev->ops->get_station) {
11467 err = rdev_get_station(rdev, dev, mac_addr, &sinfo);
11501 return rdev_set_cqm_rssi_range_config(rdev, dev, low, high);
11508 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11530 if (n_thresholds <= 1 && rdev->ops->set_cqm_rssi_config) {
11532 return rdev_set_cqm_rssi_config(rdev, dev, 0, 0);
11534 return rdev_set_cqm_rssi_config(rdev, dev,
11538 if (!wiphy_ext_feature_isset(&rdev->wiphy,
11564 err = cfg80211_cqm_rssi_update(rdev, dev);
11617 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11622 err = nl80211_parse_chandef(rdev, info, &setup.chandef);
11626 return cfg80211_join_ocb(rdev, dev, &setup);
11631 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11634 return cfg80211_leave_ocb(rdev, dev);
11639 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11664 !nl80211_parse_mcast_rate(rdev, setup.mcast_rate,
11672 err = cfg80211_validate_beacon_int(rdev,
11697 err = nl80211_parse_chandef(rdev, info, &setup.chandef);
11714 sband = rdev->wiphy.bands[setup.chandef.chan->band];
11733 err = validate_beacon_tx_rate(rdev, setup.chandef.chan->band,
11743 int r = validate_pae_over_nl80211(rdev, info);
11752 err = __cfg80211_join_mesh(rdev, dev, &setup, &cfg);
11762 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11765 return cfg80211_leave_mesh(rdev, dev);
11770 struct cfg80211_registered_device *rdev)
11772 struct cfg80211_wowlan *wowlan = rdev->wiphy.wowlan_config;
11938 struct cfg80211_registered_device *rdev = info->user_ptr[0];
11943 if (!rdev->wiphy.wowlan)
11946 if (rdev->wiphy.wowlan_config && rdev->wiphy.wowlan_config->tcp) {
11948 size += rdev->wiphy.wowlan_config->tcp->tokens_size +
11949 rdev->wiphy.wowlan_config->tcp->payload_len +
11950 rdev->wiphy.wowlan_config->tcp->wake_len +
11951 rdev->wiphy.wowlan_config->tcp->wake_len / 8;
11963 if (rdev->wiphy.wowlan_config) {
11971 if ((rdev->wiphy.wowlan_config->any &&
11973 (rdev->wiphy.wowlan_config->disconnect &&
11975 (rdev->wiphy.wowlan_config->magic_pkt &&
11977 (rdev->wiphy.wowlan_config->gtk_rekey_failure &&
11979 (rdev->wiphy.wowlan_config->eap_identity_req &&
11981 (rdev->wiphy.wowlan_config->four_way_handshake &&
11983 (rdev->wiphy.wowlan_config->rfkill_release &&
11987 if (nl80211_send_wowlan_patterns(msg, rdev))
11991 rdev->wiphy.wowlan_config->tcp))
11996 rdev->wiphy.wowlan_config->nd_config))
12010 static int nl80211_parse_wowlan_tcp(struct cfg80211_registered_device *rdev,
12022 if (!rdev->wiphy.wowlan->tcp)
12041 if (data_size > rdev->wiphy.wowlan->tcp->data_payload_max)
12045 rdev->wiphy.wowlan->tcp->data_interval_max ||
12050 if (wake_size > rdev->wiphy.wowlan->tcp->wake_payload_max)
12065 if (!rdev->wiphy.wowlan->tcp->tok)
12067 if (tok->len > rdev->wiphy.wowlan->tcp->tok->max_len)
12069 if (tok->len < rdev->wiphy.wowlan->tcp->tok->min_len)
12071 if (tokens_size > rdev->wiphy.wowlan->tcp->tok->bufsize)
12079 if (!rdev->wiphy.wowlan->tcp->seq)
12105 err = __sock_create(wiphy_net(&rdev->wiphy), PF_INET, SOCK_STREAM,
12154 static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev,
12176 trig->nd_config = nl80211_parse_sched_scan(&rdev->wiphy, NULL, tb,
12189 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12193 const struct wiphy_wowlan_support *wowlan = rdev->wiphy.wowlan;
12195 bool prev_enabled = rdev->wiphy.wowlan_config;
12202 cfg80211_rdev_free_wowlan(rdev);
12203 rdev->wiphy.wowlan_config = NULL;
12341 rdev, tb[NL80211_WOWLAN_TRIG_TCP_CONNECTION],
12350 rdev, wowlan, tb[NL80211_WOWLAN_TRIG_NET_DETECT],
12372 cfg80211_rdev_free_wowlan(rdev);
12373 rdev->wiphy.wowlan_config = ntrig;
12376 if (rdev->ops->set_wakeup &&
12377 prev_enabled != !!rdev->wiphy.wowlan_config)
12378 rdev_set_wakeup(rdev, rdev->wiphy.wowlan_config);
12394 struct cfg80211_registered_device *rdev)
12400 if (!rdev->coalesce->n_rules)
12407 for (i = 0; i < rdev->coalesce->n_rules; i++) {
12412 rule = &rdev->coalesce->rules[i];
12451 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12455 if (!rdev->wiphy.coalesce)
12467 if (rdev->coalesce && nl80211_send_coalesce_rules(msg, rdev))
12478 void cfg80211_rdev_free_coalesce(struct cfg80211_registered_device *rdev)
12480 struct cfg80211_coalesce *coalesce = rdev->coalesce;
12495 rdev->coalesce = NULL;
12498 static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev,
12503 const struct wiphy_coalesce_support *coalesce = rdev->wiphy.coalesce;
12591 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12592 const struct wiphy_coalesce_support *coalesce = rdev->wiphy.coalesce;
12599 if (!rdev->wiphy.coalesce || !rdev->ops->set_coalesce)
12603 cfg80211_rdev_free_coalesce(rdev);
12604 rdev_set_coalesce(rdev, NULL);
12624 err = nl80211_parse_coalesce_rule(rdev, rule,
12632 err = rdev_set_coalesce(rdev, &new_coalesce);
12641 cfg80211_rdev_free_coalesce(rdev);
12642 rdev->coalesce = n_coalesce;
12661 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12681 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK &&
12685 !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK &&
12703 if (!rdev->ops->set_rekey_data) {
12708 err = rdev_set_rekey_data(rdev, dev, &rekey_data);
12734 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12750 if (!rdev->ops->probe_client)
12766 err = rdev_probe_client(rdev, dev, addr, &cookie);
12787 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12791 if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS))
12799 spin_lock_bh(&rdev->beacon_registrations_lock);
12800 list_for_each_entry(reg, &rdev->beacon_registrations, list) {
12808 list_add(&nreg->list, &rdev->beacon_registrations);
12810 spin_unlock_bh(&rdev->beacon_registrations_lock);
12814 spin_unlock_bh(&rdev->beacon_registrations_lock);
12821 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12825 if (!rdev->ops->start_p2p_device)
12834 if (rfkill_blocked(rdev->rfkill))
12837 err = rdev_start_p2p_device(rdev, wdev);
12842 rdev->opencount++;
12849 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12855 if (!rdev->ops->stop_p2p_device)
12858 cfg80211_stop_p2p_device(rdev, wdev);
12865 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12876 if (rfkill_blocked(rdev->rfkill))
12897 err = rdev_start_nan(rdev, wdev, &conf);
12902 rdev->opencount++;
12909 struct cfg80211_registered_device *rdev = info->user_ptr[0];
12915 cfg80211_stop_nan(rdev, wdev);
12986 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13014 func->cookie = cfg80211_assign_cookie(rdev);
13190 err = rdev_add_nan_func(rdev, wdev, func);
13224 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13239 rdev_del_nan_func(rdev, wdev, cookie);
13247 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13283 return rdev_nan_change_conf(rdev, wdev, &conf, changed);
13290 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
13308 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
13353 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
13356 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg,
13372 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
13390 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
13413 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy),
13416 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg,
13455 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13459 if (!rdev->ops->update_ft_ies)
13471 return rdev_update_ft_ies(rdev, dev, &ft_params);
13477 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13483 if (!rdev->ops->crit_proto_start)
13486 if (WARN_ON(!rdev->ops->crit_proto_stop))
13489 if (rdev->crit_proto_nlportid)
13506 ret = rdev_crit_proto_start(rdev, wdev, proto, duration);
13508 rdev->crit_proto_nlportid = info->snd_portid;
13516 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13519 if (!rdev->ops->crit_proto_stop)
13522 if (rdev->crit_proto_nlportid) {
13523 rdev->crit_proto_nlportid = 0;
13524 rdev_crit_proto_stop(rdev, wdev);
13553 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13559 if (!rdev->wiphy.vendor_commands)
13567 } else if (wdev->wiphy != &rdev->wiphy) {
13577 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
13582 vcmd = &rdev->wiphy.vendor_commands[i];
13617 rdev->cur_cmd_info = info;
13618 err = vcmd->doit(&rdev->wiphy, wdev, data, len);
13619 rdev->cur_cmd_info = NULL;
13628 struct cfg80211_registered_device **rdev,
13646 *rdev = wiphy_to_rdev(wiphy);
13683 *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf);
13684 if (IS_ERR(*rdev)) {
13685 err = PTR_ERR(*rdev);
13692 for (i = 0; i < (*rdev)->wiphy.n_vendor_commands; i++) {
13695 vcmd = &(*rdev)->wiphy.vendor_commands[i];
13719 &(*rdev)->wiphy.vendor_commands[vcmd_idx],
13727 cb->args[0] = (*rdev)->wiphy_idx + 1;
13744 struct cfg80211_registered_device *rdev;
13754 err = nl80211_prepare_vendor_dump(skb, cb, &rdev, &wdev);
13761 vcmd = &rdev->wiphy.vendor_commands[vcmd_idx];
13790 if (nla_put_u32(skb, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
13805 err = vcmd->dumpit(&rdev->wiphy, wdev, skb, data, data_len,
13831 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
13833 if (WARN_ON(!rdev->cur_cmd_info))
13836 return __cfg80211_alloc_vendor_skb(rdev, NULL, approxlen,
13837 rdev->cur_cmd_info->snd_portid,
13838 rdev->cur_cmd_info->snd_seq,
13845 struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0];
13852 if (WARN_ON(!rdev->cur_cmd_info)) {
13859 return genlmsg_reply(skb, rdev->cur_cmd_info);
13865 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
13867 if (WARN_ON(!rdev->cur_cmd_info))
13870 return rdev->cur_cmd_info->snd_portid;
13877 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13883 if (!rdev->ops->set_qos_map)
13917 ret = rdev_set_qos_map(rdev, dev, qos_map);
13926 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13934 if (!(rdev->wiphy.features & NL80211_FEATURE_SUPPORTS_WMM_ADMISSION))
13975 err = rdev_add_tx_ts(rdev, dev, tsid, peer, up, admitted_time);
13984 struct cfg80211_registered_device *rdev = info->user_ptr[0];
13998 err = rdev_del_tx_ts(rdev, dev, tsid, peer);
14007 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14015 if (!rdev->ops->tdls_channel_switch ||
14016 !(rdev->wiphy.features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH))
14031 err = nl80211_parse_chandef(rdev, info, &chandef);
14046 if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &chandef,
14058 err = rdev_tdls_channel_switch(rdev, dev, addr, oper_class, &chandef);
14067 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14072 if (!rdev->ops->tdls_channel_switch ||
14073 !rdev->ops->tdls_cancel_channel_switch ||
14074 !(rdev->wiphy.features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH))
14091 rdev_tdls_cancel_channel_switch(rdev, dev, addr);
14100 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14106 if (!rdev->ops->set_multicast_to_unicast)
14116 return rdev_set_multicast_to_unicast(rdev, dev, enabled);
14121 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14131 if (!wiphy_ext_feature_isset(&rdev->wiphy,
14162 ret = rdev_set_pmk(rdev, dev, &pmk_conf);
14170 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14180 if (!wiphy_ext_feature_isset(&rdev->wiphy,
14189 ret = rdev_del_pmk(rdev, dev, aa);
14197 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14201 if (!rdev->ops->external_auth)
14234 return rdev_external_auth(rdev, dev, ¶ms);
14240 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14251 if (!wiphy_ext_feature_isset(&rdev->wiphy,
14255 if (!rdev->ops->tx_control_port)
14293 err = rdev_tx_control_port(rdev, dev, buf, len,
14307 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14319 err = rdev_get_ftm_responder_stats(rdev, dev, &ftm_stats);
14377 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14381 if (!rdev->ops->update_owe_info)
14397 return rdev_update_owe_info(rdev, dev, &owe_info);
14402 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14411 if (!rdev->ops->probe_mesh_link || !rdev->ops->get_station)
14434 err = rdev_get_station(rdev, dev, dest, &sinfo);
14440 return rdev_probe_mesh_link(rdev, dev, dest, buf, len);
14443 static int parse_tid_conf(struct cfg80211_registered_device *rdev,
14460 if (rdev->ops->reset_tid_config) {
14461 err = rdev_reset_tid_config(rdev, dev, peer,
14481 if (tid_conf->retry_short > rdev->wiphy.max_data_retry_count)
14490 if (tid_conf->retry_long > rdev->wiphy.max_data_retry_count)
14530 mask = rdev->wiphy.tid_config_support.peer;
14532 mask = rdev->wiphy.tid_config_support.vif;
14545 struct cfg80211_registered_device *rdev = info->user_ptr[0];
14557 if (!rdev->ops->set_tid_config)
14582 ret = parse_tid_conf(rdev, attrs, dev,
14591 ret = rdev_set_tid_config(rdev, dev, tid_config);
14613 struct cfg80211_registered_device *rdev;
14622 rdev = cfg80211_get_dev_from_info(genl_info_net(info), info);
14623 if (IS_ERR(rdev)) {
14626 return PTR_ERR(rdev);
14628 info->user_ptr[0] = rdev;
14642 rdev = wiphy_to_rdev(wdev->wiphy);
14666 info->user_ptr[0] = rdev;
15585 void nl80211_notify_wiphy(struct cfg80211_registered_device *rdev,
15598 if (nl80211_send_wiphy(rdev, cmd, msg, 0, 0, 0, &state) < 0) {
15603 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
15607 void nl80211_notify_iface(struct cfg80211_registered_device *rdev,
15617 if (nl80211_send_iface(msg, 0, 0, 0, rdev, wdev, cmd) < 0) {
15622 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
15627 struct cfg80211_registered_device *rdev)
15629 struct cfg80211_scan_request *req = rdev->scan_req;
15676 info = rdev->int_scan_req ? &rdev->int_scan_req->info :
15677 &rdev->scan_req->info;
15691 struct cfg80211_registered_device *rdev,
15702 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
15710 nl80211_add_scan_req(msg, rdev);
15745 void nl80211_send_scan_start(struct cfg80211_registered_device *rdev,
15754 if (nl80211_prep_scan_msg(msg, rdev, wdev, 0, 0, 0,
15760 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
15764 struct sk_buff *nl80211_build_scan_msg(struct cfg80211_registered_device *rdev,
15773 if (nl80211_prep_scan_msg(msg, rdev, wdev, 0, 0, 0,
15784 void nl80211_send_scan_msg(struct cfg80211_registered_device *rdev,
15790 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
15892 static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
15912 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
15934 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
15942 void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
15946 nl80211_send_mlme_event(rdev, netdev, buf, len,
15950 void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
15955 nl80211_send_mlme_event(rdev, netdev, buf, len,
15960 void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
15964 nl80211_send_mlme_event(rdev, netdev, buf, len,
15968 void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
15972 nl80211_send_mlme_event(rdev, netdev, buf, len,
15981 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16003 nl80211_send_mlme_event(rdev, dev, buf, len, cmd, GFP_ATOMIC, -1,
16008 static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
16025 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16033 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16041 void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
16045 nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_AUTHENTICATE,
16049 void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
16053 nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_ASSOCIATE,
16057 void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
16077 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16108 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16116 void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
16136 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16159 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16167 void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
16183 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16190 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16198 void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
16215 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16226 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16234 void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
16251 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16258 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16271 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
16290 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16301 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16310 void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
16328 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16339 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16404 int cmd, struct cfg80211_registered_device *rdev,
16422 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16440 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16453 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16457 rdev, wdev, cookie, chan,
16467 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16471 rdev, wdev, cookie, chan, 0, gfp);
16480 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16484 rdev, wdev, cookie, chan, 0, gfp);
16492 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16502 rdev, dev, mac_addr, sinfo) < 0) {
16507 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16516 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16532 rdev, dev, mac_addr, sinfo) < 0) {
16537 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16547 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16568 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16581 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
16599 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16605 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
16655 int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
16674 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16690 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
16702 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
16722 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16735 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16765 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
16788 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16805 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
16828 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
16843 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
16854 cb[2] = rdev;
16865 struct cfg80211_registered_device *rdev = cb[2];
16872 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
16882 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
16893 cfg80211_cqm_rssi_update(rdev, dev);
16988 static void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
17006 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17023 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17036 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17039 nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp);
17044 nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev,
17062 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17080 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17093 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17096 nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp);
17100 static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev,
17132 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17145 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17159 cfg80211_sched_dfs_chan_update(rdev);
17161 nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,
17172 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17176 nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,
17182 nl80211_radar_notify(struct cfg80211_registered_device *rdev,
17200 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
17221 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17235 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
17251 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx))
17274 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17289 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
17306 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17318 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17330 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17337 spin_lock_bh(&rdev->beacon_registrations_lock);
17338 list_for_each_entry(reg, &rdev->beacon_registrations, list) {
17341 spin_unlock_bh(&rdev->beacon_registrations_lock);
17349 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17362 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, reg->nlportid);
17364 spin_unlock_bh(&rdev->beacon_registrations_lock);
17368 spin_unlock_bh(&rdev->beacon_registrations_lock);
17437 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
17455 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17538 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17553 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
17570 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17580 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17594 struct cfg80211_registered_device *rdev;
17603 list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) {
17607 &rdev->sched_scan_req_list,
17611 schedule_work(&rdev->sched_scan_stop_wk);
17615 list_for_each_entry_rcu(wdev, &rdev->wiphy.wdev_list, list) {
17620 schedule_work(&rdev->destroy_work);
17628 spin_lock_bh(&rdev->beacon_registrations_lock);
17629 list_for_each_entry_safe(reg, tmp, &rdev->beacon_registrations,
17637 spin_unlock_bh(&rdev->beacon_registrations_lock);
17658 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17676 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17691 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
17701 struct cfg80211_registered_device *rdev;
17706 rdev = wiphy_to_rdev(wdev->wiphy);
17707 if (!rdev->crit_proto_nlportid)
17710 nlportid = rdev->crit_proto_nlportid;
17711 rdev->crit_proto_nlportid = 0;
17721 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17728 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
17739 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17751 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17771 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
17786 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17797 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg,
17812 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
17826 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
17837 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,