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()
416 rdev->wiphy.wext = &cfg80211_wext_handler; in wiphy_new_nm()
419 device_initialize(&rdev->wiphy.dev); in wiphy_new_nm()
420 rdev->wiphy.dev.class = &ieee80211_class; in wiphy_new_nm()
421 rdev->wiphy.dev.platform_data = rdev; in wiphy_new_nm()
422 device_enable_async_suspend(&rdev->wiphy.dev); in wiphy_new_nm()
430 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in wiphy_new_nm()
433 wiphy_net_set(&rdev->wiphy, &init_net); in wiphy_new_nm()
436 rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), in wiphy_new_nm()
437 &rdev->wiphy.dev, RFKILL_TYPE_WLAN, in wiphy_new_nm()
456 rdev->wiphy.retry_short = 7; in wiphy_new_nm()
457 rdev->wiphy.retry_long = 4; in wiphy_new_nm()
458 rdev->wiphy.frag_threshold = (u32) -1; in wiphy_new_nm()
459 rdev->wiphy.rts_threshold = (u32) -1; in wiphy_new_nm()
460 rdev->wiphy.coverage_class = 0; in wiphy_new_nm()
462 rdev->wiphy.max_num_csa_counters = 1; in wiphy_new_nm()
464 rdev->wiphy.max_sched_scan_plans = 1; in wiphy_new_nm()
465 rdev->wiphy.max_sched_scan_plan_interval = U32_MAX; in wiphy_new_nm()
467 return &rdev->wiphy; in wiphy_new_nm()
471 static int wiphy_verify_combinations(struct wiphy *wiphy) in wiphy_verify_combinations() argument
476 for (i = 0; i < wiphy->n_iface_combinations; i++) { in wiphy_verify_combinations()
480 c = &wiphy->iface_combinations[i]; in wiphy_verify_combinations()
521 if (WARN_ON(wiphy->software_iftypes & types)) in wiphy_verify_combinations()
534 if (WARN_ON((wiphy->interface_modes & types) != types)) in wiphy_verify_combinations()
546 int wiphy_register(struct wiphy *wiphy) in wiphy_register() argument
548 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_register()
554 u16 ifmodes = wiphy->interface_modes; in wiphy_register()
557 if (WARN_ON(wiphy->wowlan && in wiphy_register()
558 (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && in wiphy_register()
559 !(wiphy->wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY))) in wiphy_register()
561 if (WARN_ON(wiphy->wowlan && in wiphy_register()
562 !wiphy->wowlan->flags && !wiphy->wowlan->n_patterns && in wiphy_register()
563 !wiphy->wowlan->tcp)) in wiphy_register()
566 if (WARN_ON((wiphy->features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) && in wiphy_register()
575 if (wiphy->interface_modes & ~(BIT(NL80211_IFTYPE_STATION) | in wiphy_register()
583 wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; in wiphy_register()
585 if (WARN_ON((wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) && in wiphy_register()
586 (wiphy->regulatory_flags & in wiphy_register()
593 if (WARN_ON(wiphy->coalesce && in wiphy_register()
594 (!wiphy->coalesce->n_rules || in wiphy_register()
595 !wiphy->coalesce->n_patterns) && in wiphy_register()
596 (!wiphy->coalesce->pattern_min_len || in wiphy_register()
597 wiphy->coalesce->pattern_min_len > in wiphy_register()
598 wiphy->coalesce->pattern_max_len))) in wiphy_register()
601 if (WARN_ON(wiphy->ap_sme_capa && in wiphy_register()
602 !(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME))) in wiphy_register()
605 if (WARN_ON(wiphy->addresses && !wiphy->n_addresses)) in wiphy_register()
608 if (WARN_ON(wiphy->addresses && in wiphy_register()
609 !is_zero_ether_addr(wiphy->perm_addr) && in wiphy_register()
610 memcmp(wiphy->perm_addr, wiphy->addresses[0].addr, in wiphy_register()
614 if (WARN_ON(wiphy->max_acl_mac_addrs && in wiphy_register()
615 (!(wiphy->flags & WIPHY_FLAG_HAVE_AP_SME) || in wiphy_register()
619 if (wiphy->addresses) in wiphy_register()
620 memcpy(wiphy->perm_addr, wiphy->addresses[0].addr, ETH_ALEN); in wiphy_register()
625 if (WARN_ON(ifmodes != wiphy->interface_modes)) in wiphy_register()
626 wiphy->interface_modes = ifmodes; in wiphy_register()
628 res = wiphy_verify_combinations(wiphy); in wiphy_register()
634 sband = wiphy->bands[band]; in wiphy_register()
687 if (WARN_ON(rdev->wiphy.wowlan && rdev->wiphy.wowlan->n_patterns && in wiphy_register()
688 (!rdev->wiphy.wowlan->pattern_min_len || in wiphy_register()
689 rdev->wiphy.wowlan->pattern_min_len > in wiphy_register()
690 rdev->wiphy.wowlan->pattern_max_len))) in wiphy_register()
695 ieee80211_set_bitrate_flags(wiphy); in wiphy_register()
697 rdev->wiphy.features |= NL80211_FEATURE_SCAN_FLUSH; in wiphy_register()
700 res = device_add(&rdev->wiphy.dev); in wiphy_register()
707 wiphy_regulatory_register(wiphy); in wiphy_register()
713 rdev->wiphy.debugfsdir = in wiphy_register()
714 debugfs_create_dir(wiphy_name(&rdev->wiphy), in wiphy_register()
716 if (IS_ERR(rdev->wiphy.debugfsdir)) in wiphy_register()
717 rdev->wiphy.debugfsdir = NULL; in wiphy_register()
722 if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { in wiphy_register()
725 request.wiphy_idx = get_wiphy_idx(wiphy); in wiphy_register()
733 rdev->wiphy.registered = true; in wiphy_register()
740 wiphy_unregister(&rdev->wiphy); in wiphy_register()
748 void wiphy_rfkill_start_polling(struct wiphy *wiphy) in wiphy_rfkill_start_polling() argument
750 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_start_polling()
759 void wiphy_rfkill_stop_polling(struct wiphy *wiphy) in wiphy_rfkill_stop_polling() argument
761 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_stop_polling()
767 void wiphy_unregister(struct wiphy *wiphy) in wiphy_unregister() argument
769 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_unregister()
783 rdev->wiphy.registered = false; in wiphy_unregister()
791 debugfs_remove_recursive(rdev->wiphy.debugfsdir); in wiphy_unregister()
799 wiphy_regulatory_deregister(wiphy); in wiphy_unregister()
802 device_del(&rdev->wiphy.dev); in wiphy_unregister()
815 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup) in wiphy_unregister()
833 cfg80211_put_bss(&rdev->wiphy, &scan->pub); in cfg80211_dev_free()
837 void wiphy_free(struct wiphy *wiphy) in wiphy_free() argument
839 put_device(&wiphy->dev); in wiphy_free()
843 void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked) in wiphy_rfkill_set_hw_state() argument
845 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_set_hw_state()
854 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_unregister_wdev()
953 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
956 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_stop_iface()
960 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
986 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
1012 if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, in cfg80211_netdev_notifier_call()
1023 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_netdev_notifier_call()
1136 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); in cfg80211_netdev_notifier_call()
1141 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) in cfg80211_netdev_notifier_call()
1165 if (net_eq(wiphy_net(&rdev->wiphy), net)) in cfg80211_pernet_exit()