Lines Matching refs:wdev

154 	struct wireless_dev *wdev;  in cfg80211_switch_netns()  local
160 list_for_each_entry(wdev, &rdev->wdev_list, list) { in cfg80211_switch_netns()
161 if (!wdev->netdev) in cfg80211_switch_netns()
163 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
164 err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); in cfg80211_switch_netns()
167 wdev->netdev->features |= NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
174 list_for_each_entry_continue_reverse(wdev, &rdev->wdev_list, in cfg80211_switch_netns()
176 if (!wdev->netdev) in cfg80211_switch_netns()
178 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
179 err = dev_change_net_namespace(wdev->netdev, net, in cfg80211_switch_netns()
182 wdev->netdev->features |= NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
204 struct wireless_dev *wdev) in cfg80211_stop_p2p_device() argument
208 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)) in cfg80211_stop_p2p_device()
211 if (!wdev->p2p_started) in cfg80211_stop_p2p_device()
214 rdev_stop_p2p_device(rdev, wdev); in cfg80211_stop_p2p_device()
215 wdev->p2p_started = false; in cfg80211_stop_p2p_device()
219 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_stop_p2p_device()
229 struct wireless_dev *wdev; in cfg80211_shutdown_all_interfaces() local
233 list_for_each_entry(wdev, &rdev->wdev_list, list) { in cfg80211_shutdown_all_interfaces()
234 if (wdev->netdev) { in cfg80211_shutdown_all_interfaces()
235 dev_close(wdev->netdev); in cfg80211_shutdown_all_interfaces()
239 switch (wdev->iftype) { in cfg80211_shutdown_all_interfaces()
241 cfg80211_stop_p2p_device(rdev, wdev); in cfg80211_shutdown_all_interfaces()
294 struct wireless_dev *wdev, *tmp; in cfg80211_destroy_ifaces() local
301 list_for_each_entry_safe(wdev, tmp, &rdev->wdev_list, list) { in cfg80211_destroy_ifaces()
302 if (nlportid == wdev->owner_nlportid) in cfg80211_destroy_ifaces()
303 rdev_del_virtual_intf(rdev, wdev); in cfg80211_destroy_ifaces()
852 void cfg80211_unregister_wdev(struct wireless_dev *wdev) in cfg80211_unregister_wdev() argument
854 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_unregister_wdev()
858 if (WARN_ON(wdev->netdev)) in cfg80211_unregister_wdev()
861 list_del_rcu(&wdev->list); in cfg80211_unregister_wdev()
864 switch (wdev->iftype) { in cfg80211_unregister_wdev()
866 cfg80211_mlme_purge_registrations(wdev); in cfg80211_unregister_wdev()
867 cfg80211_stop_p2p_device(rdev, wdev); in cfg80211_unregister_wdev()
891 struct wireless_dev *wdev) in __cfg80211_leave() argument
893 struct net_device *dev = wdev->netdev; in __cfg80211_leave()
897 ASSERT_WDEV_LOCK(wdev); in __cfg80211_leave()
899 switch (wdev->iftype) { in __cfg80211_leave()
910 kfree(wdev->wext.ie); in __cfg80211_leave()
911 wdev->wext.ie = NULL; in __cfg80211_leave()
912 wdev->wext.ie_len = 0; in __cfg80211_leave()
913 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in __cfg80211_leave()
946 struct wireless_dev *wdev) in cfg80211_leave() argument
948 wdev_lock(wdev); in cfg80211_leave()
949 __cfg80211_leave(rdev, wdev); in cfg80211_leave()
950 wdev_unlock(wdev); in cfg80211_leave()
953 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
960 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
968 spin_lock_irqsave(&wdev->event_lock, flags); in cfg80211_stop_iface()
969 list_add_tail(&ev->list, &wdev->event_list); in cfg80211_stop_iface()
970 spin_unlock_irqrestore(&wdev->event_lock, flags); in cfg80211_stop_iface()
979 struct wireless_dev *wdev = dev->ieee80211_ptr; in cfg80211_netdev_notifier_call() local
983 if (!wdev) in cfg80211_netdev_notifier_call()
986 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
988 WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED); in cfg80211_netdev_notifier_call()
1000 mutex_init(&wdev->mtx); in cfg80211_netdev_notifier_call()
1001 INIT_LIST_HEAD(&wdev->event_list); in cfg80211_netdev_notifier_call()
1002 spin_lock_init(&wdev->event_lock); in cfg80211_netdev_notifier_call()
1003 INIT_LIST_HEAD(&wdev->mgmt_registrations); in cfg80211_netdev_notifier_call()
1004 spin_lock_init(&wdev->mgmt_registrations_lock); in cfg80211_netdev_notifier_call()
1006 wdev->identifier = ++rdev->wdev_id; in cfg80211_netdev_notifier_call()
1007 list_add_rcu(&wdev->list, &rdev->wdev_list); in cfg80211_netdev_notifier_call()
1016 wdev->netdev = dev; in cfg80211_netdev_notifier_call()
1018 wdev->wext.default_key = -1; in cfg80211_netdev_notifier_call()
1019 wdev->wext.default_mgmt_key = -1; in cfg80211_netdev_notifier_call()
1020 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in cfg80211_netdev_notifier_call()
1023 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_netdev_notifier_call()
1024 wdev->ps = true; in cfg80211_netdev_notifier_call()
1026 wdev->ps = false; in cfg80211_netdev_notifier_call()
1028 wdev->ps_timeout = -1; in cfg80211_netdev_notifier_call()
1030 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1031 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || in cfg80211_netdev_notifier_call()
1032 wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) in cfg80211_netdev_notifier_call()
1036 cfg80211_leave(rdev, wdev); in cfg80211_netdev_notifier_call()
1039 cfg80211_update_iface_num(rdev, wdev->iftype, -1); in cfg80211_netdev_notifier_call()
1040 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_netdev_notifier_call()
1048 sched_scan_req->dev == wdev->netdev)) { in cfg80211_netdev_notifier_call()
1056 cfg80211_update_iface_num(rdev, wdev->iftype, 1); in cfg80211_netdev_notifier_call()
1057 wdev_lock(wdev); in cfg80211_netdev_notifier_call()
1058 switch (wdev->iftype) { in cfg80211_netdev_notifier_call()
1061 cfg80211_ibss_wext_join(rdev, wdev); in cfg80211_netdev_notifier_call()
1064 cfg80211_mgd_wext_connect(rdev, wdev); in cfg80211_netdev_notifier_call()
1075 setup.mesh_id = wdev->ssid; in cfg80211_netdev_notifier_call()
1076 setup.mesh_id_len = wdev->mesh_id_up_len; in cfg80211_netdev_notifier_call()
1077 if (wdev->mesh_id_up_len) in cfg80211_netdev_notifier_call()
1087 wdev_unlock(wdev); in cfg80211_netdev_notifier_call()
1094 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1095 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && in cfg80211_netdev_notifier_call()
1097 if (rdev_set_power_mgmt(rdev, dev, wdev->ps, in cfg80211_netdev_notifier_call()
1098 wdev->ps_timeout)) { in cfg80211_netdev_notifier_call()
1100 wdev->ps = false; in cfg80211_netdev_notifier_call()
1111 if (!list_empty(&wdev->list)) { in cfg80211_netdev_notifier_call()
1113 list_del_rcu(&wdev->list); in cfg80211_netdev_notifier_call()
1115 cfg80211_mlme_purge_registrations(wdev); in cfg80211_netdev_notifier_call()
1117 kzfree(wdev->wext.keys); in cfg80211_netdev_notifier_call()
1127 INIT_LIST_HEAD(&wdev->list); in cfg80211_netdev_notifier_call()
1132 cfg80211_process_wdev_events(wdev); in cfg80211_netdev_notifier_call()
1134 if (WARN_ON(wdev->current_bss)) { in cfg80211_netdev_notifier_call()
1135 cfg80211_unhold_bss(wdev->current_bss); in cfg80211_netdev_notifier_call()
1136 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); in cfg80211_netdev_notifier_call()
1137 wdev->current_bss = NULL; in cfg80211_netdev_notifier_call()
1141 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) in cfg80211_netdev_notifier_call()