• Home
  • Raw
  • Download

Lines Matching refs:wiphy

73 int get_wiphy_idx(struct wiphy *wiphy)  in get_wiphy_idx()  argument
75 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in get_wiphy_idx()
80 struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx) in wiphy_idx_to_wiphy()
89 return &rdev->wiphy; in wiphy_idx_to_wiphy()
120 if (strcmp(newname, wiphy_name(&rdev2->wiphy)) == 0) in cfg80211_dev_check_name()
132 lockdep_assert_wiphy(&rdev->wiphy); in cfg80211_dev_rename()
135 if (strcmp(newname, wiphy_name(&rdev->wiphy)) == 0) in cfg80211_dev_rename()
142 result = device_rename(&rdev->wiphy.dev, newname); in cfg80211_dev_rename()
146 if (!IS_ERR_OR_NULL(rdev->wiphy.debugfsdir)) in cfg80211_dev_rename()
147 debugfs_rename(rdev->wiphy.debugfsdir->d_parent, in cfg80211_dev_rename()
148 rdev->wiphy.debugfsdir, in cfg80211_dev_rename()
149 rdev->wiphy.debugfsdir->d_parent, newname); in cfg80211_dev_rename()
162 if (!(rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK)) in cfg80211_switch_netns()
165 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
177 net = wiphy_net(&rdev->wiphy); in cfg80211_switch_netns()
180 &rdev->wiphy.wdev_list, in cfg80211_switch_netns()
194 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
200 wiphy_lock(&rdev->wiphy); in cfg80211_switch_netns()
203 wiphy_net_set(&rdev->wiphy, net); in cfg80211_switch_netns()
205 err = device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev)); in cfg80211_switch_netns()
209 wiphy_unlock(&rdev->wiphy); in cfg80211_switch_netns()
211 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
224 wiphy_lock(&rdev->wiphy); in cfg80211_rfkill_poll()
226 wiphy_unlock(&rdev->wiphy); in cfg80211_rfkill_poll()
232 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_p2p_device()
257 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_nan()
271 void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy) in cfg80211_shutdown_all_interfaces() argument
273 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_shutdown_all_interfaces()
278 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_shutdown_all_interfaces()
286 wiphy_lock(wiphy); in cfg80211_shutdown_all_interfaces()
299 wiphy_unlock(wiphy); in cfg80211_shutdown_all_interfaces()
312 cfg80211_shutdown_all_interfaces(&rdev->wiphy); in cfg80211_rfkill_set_block()
334 wiphy_lock(&rdev->wiphy); in cfg80211_event_work()
336 wiphy_unlock(&rdev->wiphy); in cfg80211_event_work()
345 list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) { in cfg80211_destroy_ifaces()
350 wiphy_lock(&rdev->wiphy); in cfg80211_destroy_ifaces()
353 wiphy_unlock(&rdev->wiphy); in cfg80211_destroy_ifaces()
370 static void cfg80211_sched_scan_stop_wk(struct wiphy *wiphy, in cfg80211_sched_scan_stop_wk() argument
394 regulatory_propagate_dfs_state(&rdev->wiphy, &rdev->radar_chandef, in cfg80211_propagate_radar_detect_wk()
410 regulatory_propagate_dfs_state(&rdev->wiphy, &rdev->cac_done_chandef, in cfg80211_propagate_cac_done_wk()
424 wiphy_lock(&rdev->wiphy); in cfg80211_wiphy_work()
437 wk->func(&rdev->wiphy, wk); in cfg80211_wiphy_work()
442 wiphy_unlock(&rdev->wiphy); in cfg80211_wiphy_work()
447 struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, in wiphy_new_nm()
504 rv = dev_set_name(&rdev->wiphy.dev, "%s", requested_name); in wiphy_new_nm()
518 rv = dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx); in wiphy_new_nm()
525 mutex_init(&rdev->wiphy.mtx); in wiphy_new_nm()
526 INIT_LIST_HEAD(&rdev->wiphy.wdev_list); in wiphy_new_nm()
536 rdev->wiphy.wext = &cfg80211_wext_handler; in wiphy_new_nm()
539 device_initialize(&rdev->wiphy.dev); in wiphy_new_nm()
540 rdev->wiphy.dev.class = &ieee80211_class; in wiphy_new_nm()
541 rdev->wiphy.dev.platform_data = rdev; in wiphy_new_nm()
542 device_enable_async_suspend(&rdev->wiphy.dev); in wiphy_new_nm()
555 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in wiphy_new_nm()
558 wiphy_net_set(&rdev->wiphy, &init_net); in wiphy_new_nm()
561 rdev->wiphy.rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), in wiphy_new_nm()
562 &rdev->wiphy.dev, RFKILL_TYPE_WLAN, in wiphy_new_nm()
565 if (!rdev->wiphy.rfkill) { in wiphy_new_nm()
566 wiphy_free(&rdev->wiphy); in wiphy_new_nm()
588 rdev->wiphy.retry_short = 7; in wiphy_new_nm()
589 rdev->wiphy.retry_long = 4; in wiphy_new_nm()
590 rdev->wiphy.frag_threshold = (u32) -1; in wiphy_new_nm()
591 rdev->wiphy.rts_threshold = (u32) -1; in wiphy_new_nm()
592 rdev->wiphy.coverage_class = 0; in wiphy_new_nm()
594 rdev->wiphy.max_num_csa_counters = 1; in wiphy_new_nm()
596 rdev->wiphy.max_sched_scan_plans = 1; in wiphy_new_nm()
597 rdev->wiphy.max_sched_scan_plan_interval = U32_MAX; in wiphy_new_nm()
599 return &rdev->wiphy; in wiphy_new_nm()
603 static int wiphy_verify_combinations(struct wiphy *wiphy) in wiphy_verify_combinations() argument
608 for (i = 0; i < wiphy->n_iface_combinations; i++) { in wiphy_verify_combinations()
612 c = &wiphy->iface_combinations[i]; in wiphy_verify_combinations()
645 if (WARN_ON(wiphy->software_iftypes & types)) in wiphy_verify_combinations()
678 if (WARN_ON((wiphy->interface_modes & types) != types)) in wiphy_verify_combinations()
693 int wiphy_register(struct wiphy *wiphy) in wiphy_register() argument
695 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_register()
701 u16 ifmodes = wiphy->interface_modes; in wiphy_register()
704 if (WARN_ON(wiphy->wowlan && in wiphy_register()
705 (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && in wiphy_register()
706 !(wiphy->wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY))) in wiphy_register()
708 if (WARN_ON(wiphy->wowlan && in wiphy_register()
709 !wiphy->wowlan->flags && !wiphy->wowlan->n_patterns && in wiphy_register()
710 !wiphy->wowlan->tcp)) in wiphy_register()
713 if (WARN_ON((wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) && in wiphy_register()
718 if (WARN_ON((wiphy->interface_modes & BIT(NL80211_IFTYPE_NAN)) && in wiphy_register()
721 !(wiphy->nan_supported_bands & BIT(NL80211_BAND_2GHZ))))) in wiphy_register()
724 if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS))) in wiphy_register()
727 if (WARN_ON(wiphy->pmsr_capa && !wiphy->pmsr_capa->ftm.supported)) in wiphy_register()
730 if (wiphy->pmsr_capa && wiphy->pmsr_capa->ftm.supported) { in wiphy_register()
731 if (WARN_ON(!wiphy->pmsr_capa->ftm.asap && in wiphy_register()
732 !wiphy->pmsr_capa->ftm.non_asap)) in wiphy_register()
734 if (WARN_ON(!wiphy->pmsr_capa->ftm.preambles || in wiphy_register()
735 !wiphy->pmsr_capa->ftm.bandwidths)) in wiphy_register()
737 if (WARN_ON(wiphy->pmsr_capa->ftm.preambles & in wiphy_register()
744 if (WARN_ON((wiphy->pmsr_capa->ftm.trigger_based || in wiphy_register()
745 wiphy->pmsr_capa->ftm.non_trigger_based) && in wiphy_register()
746 !(wiphy->pmsr_capa->ftm.preambles & in wiphy_register()
749 if (WARN_ON(wiphy->pmsr_capa->ftm.bandwidths & in wiphy_register()
761 if (WARN_ON((wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) && in wiphy_register()
762 (wiphy->regulatory_flags & in wiphy_register()
769 if (WARN_ON(wiphy->coalesce && in wiphy_register()
770 (!wiphy->coalesce->n_rules || in wiphy_register()
771 !wiphy->coalesce->n_patterns) && in wiphy_register()
772 (!wiphy->coalesce->pattern_min_len || in wiphy_register()
773 wiphy->coalesce->pattern_min_len > in wiphy_register()
774 wiphy->coalesce->pattern_max_len))) in wiphy_register()
777 if (WARN_ON(wiphy->ap_sme_capa && in wiphy_register()
778 !(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME))) in wiphy_register()
781 if (WARN_ON(wiphy->addresses && !wiphy->n_addresses)) in wiphy_register()
784 if (WARN_ON(wiphy->addresses && in wiphy_register()
785 !is_zero_ether_addr(wiphy->perm_addr) && in wiphy_register()
786 memcmp(wiphy->perm_addr, wiphy->addresses[0].addr, in wiphy_register()
790 if (WARN_ON(wiphy->max_acl_mac_addrs && in wiphy_register()
791 (!(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME) || in wiphy_register()
798 if (WARN_ON(wiphy->bss_select_support && in wiphy_register()
799 (wiphy->bss_select_support & ~(BIT(__NL80211_BSS_SELECT_ATTR_AFTER_LAST) - 2)))) in wiphy_register()
802 if (WARN_ON(wiphy_ext_feature_isset(&rdev->wiphy, in wiphy_register()
807 if (WARN_ON(!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) && in wiphy_register()
811 if (wiphy->addresses) in wiphy_register()
812 memcpy(wiphy->perm_addr, wiphy->addresses[0].addr, ETH_ALEN); in wiphy_register()
817 if (WARN_ON(ifmodes != wiphy->interface_modes)) in wiphy_register()
818 wiphy->interface_modes = ifmodes; in wiphy_register()
820 res = wiphy_verify_combinations(wiphy); in wiphy_register()
829 sband = wiphy->bands[band]; in wiphy_register()
932 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) { in wiphy_register()
938 if (WARN_ON(!rdev->wiphy.vendor_commands[i].policy)) in wiphy_register()
940 if (WARN_ON(!rdev->wiphy.vendor_commands[i].doit && in wiphy_register()
941 !rdev->wiphy.vendor_commands[i].dumpit)) in wiphy_register()
946 if (WARN_ON(rdev->wiphy.wowlan && rdev->wiphy.wowlan->n_patterns && in wiphy_register()
947 (!rdev->wiphy.wowlan->pattern_min_len || in wiphy_register()
948 rdev->wiphy.wowlan->pattern_min_len > in wiphy_register()
949 rdev->wiphy.wowlan->pattern_max_len))) in wiphy_register()
953 if (!wiphy->max_num_akm_suites) in wiphy_register()
954 wiphy->max_num_akm_suites = NL80211_MAX_NR_AKM_SUITES; in wiphy_register()
955 else if (wiphy->max_num_akm_suites < NL80211_MAX_NR_AKM_SUITES || in wiphy_register()
956 wiphy->max_num_akm_suites > CFG80211_MAX_NUM_AKM_SUITES) in wiphy_register()
960 ieee80211_set_bitrate_flags(wiphy); in wiphy_register()
962 rdev->wiphy.features |= NL80211_FEATURE_SCAN_FLUSH; in wiphy_register()
965 wiphy_lock(&rdev->wiphy); in wiphy_register()
966 res = device_add(&rdev->wiphy.dev); in wiphy_register()
968 wiphy_unlock(&rdev->wiphy); in wiphy_register()
977 rdev->wiphy.debugfsdir = debugfs_create_dir(wiphy_name(&rdev->wiphy), in wiphy_register()
982 wiphy_unlock(&rdev->wiphy); in wiphy_register()
985 wiphy_regulatory_register(wiphy); in wiphy_register()
987 if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { in wiphy_register()
990 request.wiphy_idx = get_wiphy_idx(wiphy); in wiphy_register()
1001 if (wiphy->extended_capabilities_len && in wiphy_register()
1002 wiphy->num_iftype_ext_capab && in wiphy_register()
1003 wiphy->iftype_ext_capab) { in wiphy_register()
1007 capab = wiphy->iftype_ext_capab; in wiphy_register()
1008 for (j = 0; j < wiphy->extended_capabilities_len; j++) { in wiphy_register()
1014 for (i = 1; i < wiphy->num_iftype_ext_capab; i++) { in wiphy_register()
1022 if (WARN_ON(wiphy->extended_capabilities[j] & in wiphy_register()
1028 rdev->wiphy.registered = true; in wiphy_register()
1031 res = rfkill_register(rdev->wiphy.rfkill); in wiphy_register()
1033 rfkill_destroy(rdev->wiphy.rfkill); in wiphy_register()
1034 rdev->wiphy.rfkill = NULL; in wiphy_register()
1035 wiphy_unregister(&rdev->wiphy); in wiphy_register()
1043 void wiphy_rfkill_start_polling(struct wiphy *wiphy) in wiphy_rfkill_start_polling() argument
1045 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_start_polling()
1050 rfkill_resume_polling(wiphy->rfkill); in wiphy_rfkill_start_polling()
1060 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_process_wiphy_works()
1071 wk->func(&rdev->wiphy, wk); in cfg80211_process_wiphy_works()
1084 void wiphy_unregister(struct wiphy *wiphy) in wiphy_unregister() argument
1086 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_unregister()
1090 wiphy_lock(&rdev->wiphy); in wiphy_unregister()
1092 wiphy_unlock(&rdev->wiphy); in wiphy_unregister()
1095 if (rdev->wiphy.rfkill) in wiphy_unregister()
1096 rfkill_unregister(rdev->wiphy.rfkill); in wiphy_unregister()
1099 wiphy_lock(&rdev->wiphy); in wiphy_unregister()
1101 rdev->wiphy.registered = false; in wiphy_unregister()
1103 WARN_ON(!list_empty(&rdev->wiphy.wdev_list)); in wiphy_unregister()
1109 debugfs_remove_recursive(rdev->wiphy.debugfsdir); in wiphy_unregister()
1117 wiphy_regulatory_deregister(wiphy); in wiphy_unregister()
1120 device_del(&rdev->wiphy.dev); in wiphy_unregister()
1123 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup) in wiphy_unregister()
1129 wiphy_unlock(&rdev->wiphy); in wiphy_unregister()
1154 rfkill_destroy(rdev->wiphy.rfkill); in cfg80211_dev_free()
1160 cfg80211_put_bss(&rdev->wiphy, &scan->pub); in cfg80211_dev_free()
1161 mutex_destroy(&rdev->wiphy.mtx); in cfg80211_dev_free()
1170 kfree(rcu_dereference_raw(rdev->wiphy.regd)); in cfg80211_dev_free()
1175 void wiphy_free(struct wiphy *wiphy) in wiphy_free() argument
1177 put_device(&wiphy->dev); in wiphy_free()
1181 void wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked, in wiphy_rfkill_set_hw_state_reason() argument
1184 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_set_hw_state_reason()
1186 if (rfkill_set_hw_state_reason(wiphy->rfkill, blocked, reason)) in wiphy_rfkill_set_hw_state_reason()
1194 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in _cfg80211_unregister_wdev()
1199 lockdep_assert_held(&rdev->wiphy.mtx); in _cfg80211_unregister_wdev()
1232 wiphy_work_cancel(wdev->wiphy, &wdev->cqm_rssi_work); in _cfg80211_unregister_wdev()
1252 cfg80211_put_bss(wdev->wiphy, &curbss->pub); in _cfg80211_unregister_wdev()
1274 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_update_iface_num()
1287 lockdep_assert_held(&rdev->wiphy.mtx); in __cfg80211_leave()
1349 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
1352 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_stop_iface()
1356 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
1389 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_init_wdev()
1408 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_wdev()
1419 list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list); in cfg80211_register_wdev()
1424 sysfs_create_link(&wdev->netdev->dev.kobj, &rdev->wiphy.dev.kobj, in cfg80211_register_wdev()
1442 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_register_netdevice()
1444 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_netdevice()
1474 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
1489 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1491 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1500 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1502 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1506 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1509 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1515 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1532 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1536 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1583 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1586 if (!cfg80211_iftype_allowed(wdev->wiphy, wdev->iftype, in cfg80211_netdev_notifier_call()
1590 if (rfkill_blocked(rdev->wiphy.rfkill)) in cfg80211_netdev_notifier_call()
1612 if (net_eq(wiphy_net(&rdev->wiphy), net)) in cfg80211_pernet_exit()
1622 void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work) in wiphy_work_queue() argument
1624 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_work_queue()
1636 void wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *work) in wiphy_work_cancel() argument
1638 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_work_cancel()
1641 lockdep_assert_held(&wiphy->mtx); in wiphy_work_cancel()
1650 void wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *work) in wiphy_work_flush() argument
1652 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_work_flush()
1669 wiphy_work_queue(dwork->wiphy, &dwork->work); in wiphy_delayed_work_timer()
1673 void wiphy_delayed_work_queue(struct wiphy *wiphy, in wiphy_delayed_work_queue() argument
1679 wiphy_work_queue(wiphy, &dwork->work); in wiphy_delayed_work_queue()
1683 dwork->wiphy = wiphy; in wiphy_delayed_work_queue()
1688 void wiphy_delayed_work_cancel(struct wiphy *wiphy, in wiphy_delayed_work_cancel() argument
1691 lockdep_assert_held(&wiphy->mtx); in wiphy_delayed_work_cancel()
1694 wiphy_work_cancel(wiphy, &dwork->work); in wiphy_delayed_work_cancel()
1698 void wiphy_delayed_work_flush(struct wiphy *wiphy, in wiphy_delayed_work_flush() argument
1701 lockdep_assert_held(&wiphy->mtx); in wiphy_delayed_work_flush()
1704 wiphy_work_flush(wiphy, &dwork->work); in wiphy_delayed_work_flush()