Lines Matching refs:wiphy
70 int get_wiphy_idx(struct wiphy *wiphy) in get_wiphy_idx() argument
72 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in get_wiphy_idx()
77 struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx) in wiphy_idx_to_wiphy()
86 return &rdev->wiphy; in wiphy_idx_to_wiphy()
114 if (strcmp(newname, wiphy_name(&rdev2->wiphy)) == 0) in cfg80211_dev_check_name()
128 if (strcmp(newname, wiphy_name(&rdev->wiphy)) == 0) in cfg80211_dev_rename()
135 result = device_rename(&rdev->wiphy.dev, newname); in cfg80211_dev_rename()
139 if (rdev->wiphy.debugfsdir && in cfg80211_dev_rename()
140 !debugfs_rename(rdev->wiphy.debugfsdir->d_parent, in cfg80211_dev_rename()
141 rdev->wiphy.debugfsdir, in cfg80211_dev_rename()
142 rdev->wiphy.debugfsdir->d_parent, in cfg80211_dev_rename()
157 if (!(rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK)) in cfg80211_switch_netns()
172 net = wiphy_net(&rdev->wiphy); in cfg80211_switch_netns()
188 wiphy_net_set(&rdev->wiphy, net); in cfg80211_switch_netns()
190 err = device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev)); in cfg80211_switch_netns()
226 void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy) in cfg80211_shutdown_all_interfaces() argument
228 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_shutdown_all_interfaces()
258 cfg80211_shutdown_all_interfaces(&rdev->wiphy); in cfg80211_rfkill_set_block()
339 struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, in wiphy_new_nm()
388 rv = dev_set_name(&rdev->wiphy.dev, "%s", requested_name); in wiphy_new_nm()
400 dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx); in wiphy_new_nm()
413 rdev->wiphy.wext = &cfg80211_wext_handler; in wiphy_new_nm()
416 device_initialize(&rdev->wiphy.dev); in wiphy_new_nm()
417 rdev->wiphy.dev.class = &ieee80211_class; in wiphy_new_nm()
418 rdev->wiphy.dev.platform_data = rdev; in wiphy_new_nm()
426 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in wiphy_new_nm()
429 wiphy_net_set(&rdev->wiphy, &init_net); in wiphy_new_nm()
432 rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), in wiphy_new_nm()
433 &rdev->wiphy.dev, RFKILL_TYPE_WLAN, in wiphy_new_nm()
452 rdev->wiphy.retry_short = 7; in wiphy_new_nm()
453 rdev->wiphy.retry_long = 4; in wiphy_new_nm()
454 rdev->wiphy.frag_threshold = (u32) -1; in wiphy_new_nm()
455 rdev->wiphy.rts_threshold = (u32) -1; in wiphy_new_nm()
456 rdev->wiphy.coverage_class = 0; in wiphy_new_nm()
458 rdev->wiphy.max_num_csa_counters = 1; in wiphy_new_nm()
460 return &rdev->wiphy; in wiphy_new_nm()
464 static int wiphy_verify_combinations(struct wiphy *wiphy) in wiphy_verify_combinations() argument
469 for (i = 0; i < wiphy->n_iface_combinations; i++) { in wiphy_verify_combinations()
473 c = &wiphy->iface_combinations[i]; in wiphy_verify_combinations()
514 if (WARN_ON(wiphy->software_iftypes & types)) in wiphy_verify_combinations()
527 if (WARN_ON((wiphy->interface_modes & types) != types)) in wiphy_verify_combinations()
539 int wiphy_register(struct wiphy *wiphy) in wiphy_register() argument
541 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_register()
547 u16 ifmodes = wiphy->interface_modes; in wiphy_register()
550 if (WARN_ON(wiphy->wowlan && in wiphy_register()
551 (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && in wiphy_register()
552 !(wiphy->wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY))) in wiphy_register()
554 if (WARN_ON(wiphy->wowlan && in wiphy_register()
555 !wiphy->wowlan->flags && !wiphy->wowlan->n_patterns && in wiphy_register()
556 !wiphy->wowlan->tcp)) in wiphy_register()
559 if (WARN_ON((wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) && in wiphy_register()
568 if (wiphy->interface_modes & ~(BIT(NL80211_IFTYPE_STATION) | in wiphy_register()
576 wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; in wiphy_register()
578 if (WARN_ON((wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) && in wiphy_register()
579 (wiphy->regulatory_flags & in wiphy_register()
586 if (WARN_ON(wiphy->coalesce && in wiphy_register()
587 (!wiphy->coalesce->n_rules || in wiphy_register()
588 !wiphy->coalesce->n_patterns) && in wiphy_register()
589 (!wiphy->coalesce->pattern_min_len || in wiphy_register()
590 wiphy->coalesce->pattern_min_len > in wiphy_register()
591 wiphy->coalesce->pattern_max_len))) in wiphy_register()
594 if (WARN_ON(wiphy->ap_sme_capa && in wiphy_register()
595 !(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME))) in wiphy_register()
598 if (WARN_ON(wiphy->addresses && !wiphy->n_addresses)) in wiphy_register()
601 if (WARN_ON(wiphy->addresses && in wiphy_register()
602 !is_zero_ether_addr(wiphy->perm_addr) && in wiphy_register()
603 memcmp(wiphy->perm_addr, wiphy->addresses[0].addr, in wiphy_register()
607 if (WARN_ON(wiphy->max_acl_mac_addrs && in wiphy_register()
608 (!(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME) || in wiphy_register()
612 if (wiphy->addresses) in wiphy_register()
613 memcpy(wiphy->perm_addr, wiphy->addresses[0].addr, ETH_ALEN); in wiphy_register()
618 if (WARN_ON(ifmodes != wiphy->interface_modes)) in wiphy_register()
619 wiphy->interface_modes = ifmodes; in wiphy_register()
621 res = wiphy_verify_combinations(wiphy); in wiphy_register()
627 sband = wiphy->bands[band]; in wiphy_register()
680 if (WARN_ON(rdev->wiphy.wowlan && rdev->wiphy.wowlan->n_patterns && in wiphy_register()
681 (!rdev->wiphy.wowlan->pattern_min_len || in wiphy_register()
682 rdev->wiphy.wowlan->pattern_min_len > in wiphy_register()
683 rdev->wiphy.wowlan->pattern_max_len))) in wiphy_register()
688 ieee80211_set_bitrate_flags(wiphy); in wiphy_register()
690 rdev->wiphy.features |= NL80211_FEATURE_SCAN_FLUSH; in wiphy_register()
693 res = device_add(&rdev->wiphy.dev); in wiphy_register()
700 wiphy_regulatory_register(wiphy); in wiphy_register()
706 rdev->wiphy.debugfsdir = in wiphy_register()
707 debugfs_create_dir(wiphy_name(&rdev->wiphy), in wiphy_register()
709 if (IS_ERR(rdev->wiphy.debugfsdir)) in wiphy_register()
710 rdev->wiphy.debugfsdir = NULL; in wiphy_register()
715 if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { in wiphy_register()
718 request.wiphy_idx = get_wiphy_idx(wiphy); in wiphy_register()
726 rdev->wiphy.registered = true; in wiphy_register()
733 wiphy_unregister(&rdev->wiphy); in wiphy_register()
741 void wiphy_rfkill_start_polling(struct wiphy *wiphy) in wiphy_rfkill_start_polling() argument
743 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_start_polling()
752 void wiphy_rfkill_stop_polling(struct wiphy *wiphy) in wiphy_rfkill_stop_polling() argument
754 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_stop_polling()
760 void wiphy_unregister(struct wiphy *wiphy) in wiphy_unregister() argument
762 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_unregister()
776 rdev->wiphy.registered = false; in wiphy_unregister()
784 debugfs_remove_recursive(rdev->wiphy.debugfsdir); in wiphy_unregister()
792 wiphy_regulatory_deregister(wiphy); in wiphy_unregister()
795 device_del(&rdev->wiphy.dev); in wiphy_unregister()
807 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup) in wiphy_unregister()
825 cfg80211_put_bss(&rdev->wiphy, &scan->pub); in cfg80211_dev_free()
829 void wiphy_free(struct wiphy *wiphy) in wiphy_free() argument
831 put_device(&wiphy->dev); in wiphy_free()
835 void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked) in wiphy_rfkill_set_hw_state() argument
837 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_set_hw_state()
846 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_unregister_wdev()
944 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
947 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_stop_iface()
951 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
977 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
1003 if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, in cfg80211_netdev_notifier_call()
1014 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_netdev_notifier_call()
1127 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); in cfg80211_netdev_notifier_call()
1132 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) in cfg80211_netdev_notifier_call()
1156 if (net_eq(wiphy_net(&rdev->wiphy), net)) in cfg80211_pernet_exit()