Lines Matching refs:wiphy

73 int get_wiphy_idx(struct wiphy *wiphy)
75 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
80 struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx)
89 return &rdev->wiphy;
120 if (strcmp(newname, wiphy_name(&rdev2->wiphy)) == 0)
134 if (strcmp(newname, wiphy_name(&rdev->wiphy)) == 0)
141 result = device_rename(&rdev->wiphy.dev, newname);
145 if (!IS_ERR_OR_NULL(rdev->wiphy.debugfsdir))
146 debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
147 rdev->wiphy.debugfsdir,
148 rdev->wiphy.debugfsdir->d_parent, newname);
161 if (!(rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK))
164 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
176 net = wiphy_net(&rdev->wiphy);
179 &rdev->wiphy.wdev_list,
193 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
200 wiphy_net_set(&rdev->wiphy, net);
202 err = device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev));
206 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
264 void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy)
266 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
271 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
299 cfg80211_shutdown_all_interfaces(&rdev->wiphy);
332 list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) {
375 regulatory_propagate_dfs_state(&rdev->wiphy, &rdev->radar_chandef,
391 regulatory_propagate_dfs_state(&rdev->wiphy, &rdev->cac_done_chandef,
400 struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
457 rv = dev_set_name(&rdev->wiphy.dev, "%s", requested_name);
471 rv = dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx);
478 INIT_LIST_HEAD(&rdev->wiphy.wdev_list);
488 rdev->wiphy.wext = &cfg80211_wext_handler;
491 device_initialize(&rdev->wiphy.dev);
492 rdev->wiphy.dev.class = &ieee80211_class;
493 rdev->wiphy.dev.platform_data = rdev;
494 device_enable_async_suspend(&rdev->wiphy.dev);
507 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
510 wiphy_net_set(&rdev->wiphy, &init_net);
513 rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev),
514 &rdev->wiphy.dev, RFKILL_TYPE_WLAN,
518 wiphy_free(&rdev->wiphy);
529 * Initialize wiphy parameters to IEEE 802.11 MIB default values.
533 rdev->wiphy.retry_short = 7;
534 rdev->wiphy.retry_long = 4;
535 rdev->wiphy.frag_threshold = (u32) -1;
536 rdev->wiphy.rts_threshold = (u32) -1;
537 rdev->wiphy.coverage_class = 0;
539 rdev->wiphy.max_num_csa_counters = 1;
541 rdev->wiphy.max_sched_scan_plans = 1;
542 rdev->wiphy.max_sched_scan_plan_interval = U32_MAX;
544 return &rdev->wiphy;
548 static int wiphy_verify_combinations(struct wiphy *wiphy)
553 for (i = 0; i < wiphy->n_iface_combinations; i++) {
557 c = &wiphy->iface_combinations[i];
598 if (WARN_ON(wiphy->software_iftypes & types))
631 if (WARN_ON((wiphy->interface_modes & types) != types))
648 int wiphy_register(struct wiphy *wiphy)
650 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
656 u16 ifmodes = wiphy->interface_modes;
659 if (WARN_ON(wiphy->wowlan &&
660 (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
661 !(wiphy->wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)))
663 if (WARN_ON(wiphy->wowlan &&
664 !wiphy->wowlan->flags && !wiphy->wowlan->n_patterns &&
665 !wiphy->wowlan->tcp))
668 if (WARN_ON((wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) &&
673 if (WARN_ON((wiphy->interface_modes & BIT(NL80211_IFTYPE_NAN)) &&
676 !(wiphy->nan_supported_bands & BIT(NL80211_BAND_2GHZ)))))
680 if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)))
684 if (WARN_ON(wiphy->pmsr_capa && !wiphy->pmsr_capa->ftm.supported))
687 if (wiphy->pmsr_capa && wiphy->pmsr_capa->ftm.supported) {
688 if (WARN_ON(!wiphy->pmsr_capa->ftm.asap &&
689 !wiphy->pmsr_capa->ftm.non_asap))
691 if (WARN_ON(!wiphy->pmsr_capa->ftm.preambles ||
692 !wiphy->pmsr_capa->ftm.bandwidths))
694 if (WARN_ON(wiphy->pmsr_capa->ftm.preambles &
701 if (WARN_ON((wiphy->pmsr_capa->ftm.trigger_based ||
702 wiphy->pmsr_capa->ftm.non_trigger_based) &&
703 !(wiphy->pmsr_capa->ftm.preambles &
706 if (WARN_ON(wiphy->pmsr_capa->ftm.bandwidths &
719 * if a wiphy has unsupported modes for regulatory channel enforcement,
722 if (wiphy->interface_modes & ~(BIT(NL80211_IFTYPE_STATION) |
731 wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
733 if (WARN_ON((wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) &&
734 (wiphy->regulatory_flags &
741 if (WARN_ON(wiphy->coalesce &&
742 (!wiphy->coalesce->n_rules ||
743 !wiphy->coalesce->n_patterns) &&
744 (!wiphy->coalesce->pattern_min_len ||
745 wiphy->coalesce->pattern_min_len >
746 wiphy->coalesce->pattern_max_len)))
749 if (WARN_ON(wiphy->ap_sme_capa &&
750 !(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME)))
753 if (WARN_ON(wiphy->addresses && !wiphy->n_addresses))
756 if (WARN_ON(wiphy->addresses &&
757 !is_zero_ether_addr(wiphy->perm_addr) &&
758 memcmp(wiphy->perm_addr, wiphy->addresses[0].addr,
762 if (WARN_ON(wiphy->max_acl_mac_addrs &&
763 (!(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME) ||
770 if (WARN_ON(wiphy->bss_select_support &&
771 (wiphy->bss_select_support & ~(BIT(__NL80211_BSS_SELECT_ATTR_AFTER_LAST) - 2))))
774 if (WARN_ON(wiphy_ext_feature_isset(&rdev->wiphy,
779 if (WARN_ON(!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) &&
783 if (wiphy->addresses)
784 memcpy(wiphy->perm_addr, wiphy->addresses[0].addr, ETH_ALEN);
789 if (WARN_ON(ifmodes != wiphy->interface_modes))
790 wiphy->interface_modes = ifmodes;
792 res = wiphy_verify_combinations(wiphy);
801 sband = wiphy->bands[band];
888 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
894 if (WARN_ON(!rdev->wiphy.vendor_commands[i].policy))
896 if (WARN_ON(!rdev->wiphy.vendor_commands[i].doit &&
897 !rdev->wiphy.vendor_commands[i].dumpit))
902 if (WARN_ON(rdev->wiphy.wowlan && rdev->wiphy.wowlan->n_patterns &&
903 (!rdev->wiphy.wowlan->pattern_min_len ||
904 rdev->wiphy.wowlan->pattern_min_len >
905 rdev->wiphy.wowlan->pattern_max_len)))
910 ieee80211_set_bitrate_flags(wiphy);
912 rdev->wiphy.features |= NL80211_FEATURE_SCAN_FLUSH;
915 res = device_add(&rdev->wiphy.dev);
925 rdev->wiphy.debugfsdir = debugfs_create_dir(wiphy_name(&rdev->wiphy),
932 wiphy_regulatory_register(wiphy);
934 if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
937 request.wiphy_idx = get_wiphy_idx(wiphy);
948 if (wiphy->extended_capabilities_len &&
949 wiphy->num_iftype_ext_capab &&
950 wiphy->iftype_ext_capab) {
954 capab = wiphy->iftype_ext_capab;
955 for (j = 0; j < wiphy->extended_capabilities_len; j++) {
961 for (i = 1; i < wiphy->num_iftype_ext_capab; i++) {
969 if (WARN_ON(wiphy->extended_capabilities[j] &
975 rdev->wiphy.registered = true;
982 wiphy_unregister(&rdev->wiphy);
990 void wiphy_rfkill_start_polling(struct wiphy *wiphy)
992 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1001 void wiphy_rfkill_stop_polling(struct wiphy *wiphy)
1003 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1009 void wiphy_unregister(struct wiphy *wiphy)
1011 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1025 rdev->wiphy.registered = false;
1027 WARN_ON(!list_empty(&rdev->wiphy.wdev_list));
1033 debugfs_remove_recursive(rdev->wiphy.debugfsdir);
1041 wiphy_regulatory_deregister(wiphy);
1044 device_del(&rdev->wiphy.dev);
1059 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
1077 cfg80211_put_bss(&rdev->wiphy, &scan->pub);
1081 void wiphy_free(struct wiphy *wiphy)
1083 put_device(&wiphy->dev);
1087 void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked)
1089 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1104 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
1232 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
1235 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1239 trace_cfg80211_stop_iface(wiphy, wdev);
1270 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT)
1297 list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list);
1314 rdev = wiphy_to_rdev(wdev->wiphy);
1322 /* can only change netns with wiphy */
1333 if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
1438 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
1443 if (!cfg80211_iftype_allowed(wdev->wiphy, wdev->iftype,
1469 if (net_eq(wiphy_net(&rdev->wiphy), net))