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()
844 void cfg80211_unregister_wdev(struct wireless_dev *wdev) in cfg80211_unregister_wdev() argument
846 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_unregister_wdev()
850 if (WARN_ON(wdev->netdev)) in cfg80211_unregister_wdev()
853 list_del_rcu(&wdev->list); in cfg80211_unregister_wdev()
856 switch (wdev->iftype) { in cfg80211_unregister_wdev()
858 cfg80211_stop_p2p_device(rdev, wdev); in cfg80211_unregister_wdev()
882 struct wireless_dev *wdev) in __cfg80211_leave() argument
884 struct net_device *dev = wdev->netdev; in __cfg80211_leave()
888 ASSERT_WDEV_LOCK(wdev); in __cfg80211_leave()
890 switch (wdev->iftype) { in __cfg80211_leave()
901 kfree(wdev->wext.ie); in __cfg80211_leave()
902 wdev->wext.ie = NULL; in __cfg80211_leave()
903 wdev->wext.ie_len = 0; in __cfg80211_leave()
904 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in __cfg80211_leave()
937 struct wireless_dev *wdev) in cfg80211_leave() argument
939 wdev_lock(wdev); in cfg80211_leave()
940 __cfg80211_leave(rdev, wdev); in cfg80211_leave()
941 wdev_unlock(wdev); in cfg80211_leave()
944 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
951 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
959 spin_lock_irqsave(&wdev->event_lock, flags); in cfg80211_stop_iface()
960 list_add_tail(&ev->list, &wdev->event_list); in cfg80211_stop_iface()
961 spin_unlock_irqrestore(&wdev->event_lock, flags); in cfg80211_stop_iface()
970 struct wireless_dev *wdev = dev->ieee80211_ptr; in cfg80211_netdev_notifier_call() local
974 if (!wdev) in cfg80211_netdev_notifier_call()
977 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
979 WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED); in cfg80211_netdev_notifier_call()
991 mutex_init(&wdev->mtx); in cfg80211_netdev_notifier_call()
992 INIT_LIST_HEAD(&wdev->event_list); in cfg80211_netdev_notifier_call()
993 spin_lock_init(&wdev->event_lock); in cfg80211_netdev_notifier_call()
994 INIT_LIST_HEAD(&wdev->mgmt_registrations); in cfg80211_netdev_notifier_call()
995 spin_lock_init(&wdev->mgmt_registrations_lock); in cfg80211_netdev_notifier_call()
997 wdev->identifier = ++rdev->wdev_id; in cfg80211_netdev_notifier_call()
998 list_add_rcu(&wdev->list, &rdev->wdev_list); in cfg80211_netdev_notifier_call()
1007 wdev->netdev = dev; in cfg80211_netdev_notifier_call()
1009 wdev->wext.default_key = -1; in cfg80211_netdev_notifier_call()
1010 wdev->wext.default_mgmt_key = -1; in cfg80211_netdev_notifier_call()
1011 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in cfg80211_netdev_notifier_call()
1014 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_netdev_notifier_call()
1015 wdev->ps = true; in cfg80211_netdev_notifier_call()
1017 wdev->ps = false; in cfg80211_netdev_notifier_call()
1019 wdev->ps_timeout = -1; in cfg80211_netdev_notifier_call()
1021 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1022 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || in cfg80211_netdev_notifier_call()
1023 wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) in cfg80211_netdev_notifier_call()
1027 cfg80211_leave(rdev, wdev); in cfg80211_netdev_notifier_call()
1030 cfg80211_update_iface_num(rdev, wdev->iftype, -1); in cfg80211_netdev_notifier_call()
1031 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_netdev_notifier_call()
1039 sched_scan_req->dev == wdev->netdev)) { in cfg80211_netdev_notifier_call()
1047 cfg80211_update_iface_num(rdev, wdev->iftype, 1); in cfg80211_netdev_notifier_call()
1048 wdev_lock(wdev); in cfg80211_netdev_notifier_call()
1049 switch (wdev->iftype) { in cfg80211_netdev_notifier_call()
1052 cfg80211_ibss_wext_join(rdev, wdev); in cfg80211_netdev_notifier_call()
1055 cfg80211_mgd_wext_connect(rdev, wdev); in cfg80211_netdev_notifier_call()
1066 setup.mesh_id = wdev->ssid; in cfg80211_netdev_notifier_call()
1067 setup.mesh_id_len = wdev->mesh_id_up_len; in cfg80211_netdev_notifier_call()
1068 if (wdev->mesh_id_up_len) in cfg80211_netdev_notifier_call()
1078 wdev_unlock(wdev); in cfg80211_netdev_notifier_call()
1085 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1086 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && in cfg80211_netdev_notifier_call()
1088 if (rdev_set_power_mgmt(rdev, dev, wdev->ps, in cfg80211_netdev_notifier_call()
1089 wdev->ps_timeout)) { in cfg80211_netdev_notifier_call()
1091 wdev->ps = false; in cfg80211_netdev_notifier_call()
1102 if (!list_empty(&wdev->list)) { in cfg80211_netdev_notifier_call()
1104 list_del_rcu(&wdev->list); in cfg80211_netdev_notifier_call()
1106 cfg80211_mlme_purge_registrations(wdev); in cfg80211_netdev_notifier_call()
1108 kzfree(wdev->wext.keys); in cfg80211_netdev_notifier_call()
1118 INIT_LIST_HEAD(&wdev->list); in cfg80211_netdev_notifier_call()
1123 cfg80211_process_wdev_events(wdev); in cfg80211_netdev_notifier_call()
1125 if (WARN_ON(wdev->current_bss)) { in cfg80211_netdev_notifier_call()
1126 cfg80211_unhold_bss(wdev->current_bss); in cfg80211_netdev_notifier_call()
1127 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); in cfg80211_netdev_notifier_call()
1128 wdev->current_bss = NULL; in cfg80211_netdev_notifier_call()
1132 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) in cfg80211_netdev_notifier_call()