Lines Matching refs:wdev
158 struct wireless_dev *wdev; in cfg80211_switch_netns() local
164 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
165 if (!wdev->netdev) in cfg80211_switch_netns()
167 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
168 err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); in cfg80211_switch_netns()
171 wdev->netdev->features |= NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
178 list_for_each_entry_continue_reverse(wdev, in cfg80211_switch_netns()
181 if (!wdev->netdev) in cfg80211_switch_netns()
183 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
184 err = dev_change_net_namespace(wdev->netdev, net, in cfg80211_switch_netns()
187 wdev->netdev->features |= NETIF_F_NETNS_LOCAL; in cfg80211_switch_netns()
193 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
194 if (!wdev->netdev) in cfg80211_switch_netns()
196 nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE); in cfg80211_switch_netns()
206 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
207 if (!wdev->netdev) in cfg80211_switch_netns()
209 nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); in cfg80211_switch_netns()
223 struct wireless_dev *wdev) in cfg80211_stop_p2p_device() argument
227 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)) in cfg80211_stop_p2p_device()
230 if (!wdev_running(wdev)) in cfg80211_stop_p2p_device()
233 rdev_stop_p2p_device(rdev, wdev); in cfg80211_stop_p2p_device()
234 wdev->is_running = false; in cfg80211_stop_p2p_device()
238 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_stop_p2p_device()
246 struct wireless_dev *wdev) in cfg80211_stop_nan() argument
250 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_NAN)) in cfg80211_stop_nan()
253 if (!wdev_running(wdev)) in cfg80211_stop_nan()
256 rdev_stop_nan(rdev, wdev); in cfg80211_stop_nan()
257 wdev->is_running = false; in cfg80211_stop_nan()
265 struct wireless_dev *wdev; in cfg80211_shutdown_all_interfaces() local
269 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_shutdown_all_interfaces()
270 if (wdev->netdev) { in cfg80211_shutdown_all_interfaces()
271 dev_close(wdev->netdev); in cfg80211_shutdown_all_interfaces()
275 switch (wdev->iftype) { in cfg80211_shutdown_all_interfaces()
277 cfg80211_stop_p2p_device(rdev, wdev); in cfg80211_shutdown_all_interfaces()
280 cfg80211_stop_nan(rdev, wdev); in cfg80211_shutdown_all_interfaces()
326 struct wireless_dev *wdev, *tmp; in cfg80211_destroy_ifaces() local
330 list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) { in cfg80211_destroy_ifaces()
331 if (wdev->nl_owner_dead) in cfg80211_destroy_ifaces()
332 rdev_del_virtual_intf(rdev, wdev); in cfg80211_destroy_ifaces()
1069 void cfg80211_cqm_config_free(struct wireless_dev *wdev) in cfg80211_cqm_config_free() argument
1071 kfree(wdev->cqm_config); in cfg80211_cqm_config_free()
1072 wdev->cqm_config = NULL; in cfg80211_cqm_config_free()
1075 static void __cfg80211_unregister_wdev(struct wireless_dev *wdev, bool sync) in __cfg80211_unregister_wdev() argument
1077 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in __cfg80211_unregister_wdev()
1081 flush_work(&wdev->pmsr_free_wk); in __cfg80211_unregister_wdev()
1083 nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE); in __cfg80211_unregister_wdev()
1085 list_del_rcu(&wdev->list); in __cfg80211_unregister_wdev()
1090 cfg80211_mlme_purge_registrations(wdev); in __cfg80211_unregister_wdev()
1092 switch (wdev->iftype) { in __cfg80211_unregister_wdev()
1094 cfg80211_stop_p2p_device(rdev, wdev); in __cfg80211_unregister_wdev()
1097 cfg80211_stop_nan(rdev, wdev); in __cfg80211_unregister_wdev()
1104 kzfree(wdev->wext.keys); in __cfg80211_unregister_wdev()
1107 if (wdev->netdev) in __cfg80211_unregister_wdev()
1108 flush_work(&wdev->disconnect_wk); in __cfg80211_unregister_wdev()
1110 cfg80211_cqm_config_free(wdev); in __cfg80211_unregister_wdev()
1113 void cfg80211_unregister_wdev(struct wireless_dev *wdev) in cfg80211_unregister_wdev() argument
1115 if (WARN_ON(wdev->netdev)) in cfg80211_unregister_wdev()
1118 __cfg80211_unregister_wdev(wdev, true); in cfg80211_unregister_wdev()
1137 struct wireless_dev *wdev) in __cfg80211_leave() argument
1139 struct net_device *dev = wdev->netdev; in __cfg80211_leave()
1143 ASSERT_WDEV_LOCK(wdev); in __cfg80211_leave()
1145 cfg80211_pmsr_wdev_down(wdev); in __cfg80211_leave()
1147 switch (wdev->iftype) { in __cfg80211_leave()
1160 kfree(wdev->wext.ie); in __cfg80211_leave()
1161 wdev->wext.ie = NULL; in __cfg80211_leave()
1162 wdev->wext.ie_len = 0; in __cfg80211_leave()
1163 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in __cfg80211_leave()
1197 struct wireless_dev *wdev) in cfg80211_leave() argument
1199 wdev_lock(wdev); in cfg80211_leave()
1200 __cfg80211_leave(rdev, wdev); in cfg80211_leave()
1201 wdev_unlock(wdev); in cfg80211_leave()
1204 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
1211 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
1219 spin_lock_irqsave(&wdev->event_lock, flags); in cfg80211_stop_iface()
1220 list_add_tail(&ev->list, &wdev->event_list); in cfg80211_stop_iface()
1221 spin_unlock_irqrestore(&wdev->event_lock, flags); in cfg80211_stop_iface()
1227 struct wireless_dev *wdev) in cfg80211_init_wdev() argument
1229 mutex_init(&wdev->mtx); in cfg80211_init_wdev()
1230 INIT_LIST_HEAD(&wdev->event_list); in cfg80211_init_wdev()
1231 spin_lock_init(&wdev->event_lock); in cfg80211_init_wdev()
1232 INIT_LIST_HEAD(&wdev->mgmt_registrations); in cfg80211_init_wdev()
1233 spin_lock_init(&wdev->mgmt_registrations_lock); in cfg80211_init_wdev()
1234 INIT_LIST_HEAD(&wdev->pmsr_list); in cfg80211_init_wdev()
1235 spin_lock_init(&wdev->pmsr_lock); in cfg80211_init_wdev()
1236 INIT_WORK(&wdev->pmsr_free_wk, cfg80211_pmsr_free_wk); in cfg80211_init_wdev()
1245 if (!wdev->identifier) in cfg80211_init_wdev()
1246 wdev->identifier = ++rdev->wdev_id; in cfg80211_init_wdev()
1247 list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list); in cfg80211_init_wdev()
1250 nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); in cfg80211_init_wdev()
1257 struct wireless_dev *wdev = dev->ieee80211_ptr; in cfg80211_netdev_notifier_call() local
1261 if (!wdev) in cfg80211_netdev_notifier_call()
1264 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
1266 WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED); in cfg80211_netdev_notifier_call()
1285 wdev->netdev = dev; in cfg80211_netdev_notifier_call()
1287 wdev->wext.default_key = -1; in cfg80211_netdev_notifier_call()
1288 wdev->wext.default_mgmt_key = -1; in cfg80211_netdev_notifier_call()
1289 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in cfg80211_netdev_notifier_call()
1292 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_netdev_notifier_call()
1293 wdev->ps = true; in cfg80211_netdev_notifier_call()
1295 wdev->ps = false; in cfg80211_netdev_notifier_call()
1297 wdev->ps_timeout = -1; in cfg80211_netdev_notifier_call()
1299 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1300 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || in cfg80211_netdev_notifier_call()
1301 wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) in cfg80211_netdev_notifier_call()
1304 INIT_WORK(&wdev->disconnect_wk, cfg80211_autodisconnect_wk); in cfg80211_netdev_notifier_call()
1306 cfg80211_init_wdev(rdev, wdev); in cfg80211_netdev_notifier_call()
1309 cfg80211_leave(rdev, wdev); in cfg80211_netdev_notifier_call()
1312 cfg80211_update_iface_num(rdev, wdev->iftype, -1); in cfg80211_netdev_notifier_call()
1313 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_netdev_notifier_call()
1321 if (WARN_ON(pos->dev == wdev->netdev)) in cfg80211_netdev_notifier_call()
1329 cfg80211_update_iface_num(rdev, wdev->iftype, 1); in cfg80211_netdev_notifier_call()
1330 wdev_lock(wdev); in cfg80211_netdev_notifier_call()
1331 switch (wdev->iftype) { in cfg80211_netdev_notifier_call()
1334 cfg80211_ibss_wext_join(rdev, wdev); in cfg80211_netdev_notifier_call()
1337 cfg80211_mgd_wext_connect(rdev, wdev); in cfg80211_netdev_notifier_call()
1348 setup.mesh_id = wdev->ssid; in cfg80211_netdev_notifier_call()
1349 setup.mesh_id_len = wdev->mesh_id_up_len; in cfg80211_netdev_notifier_call()
1350 if (wdev->mesh_id_up_len) in cfg80211_netdev_notifier_call()
1360 wdev_unlock(wdev); in cfg80211_netdev_notifier_call()
1367 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1368 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && in cfg80211_netdev_notifier_call()
1370 rdev_set_power_mgmt(rdev, dev, wdev->ps, in cfg80211_netdev_notifier_call()
1371 wdev->ps_timeout)) { in cfg80211_netdev_notifier_call()
1373 wdev->ps = false; in cfg80211_netdev_notifier_call()
1384 if (!list_empty(&wdev->list)) { in cfg80211_netdev_notifier_call()
1385 __cfg80211_unregister_wdev(wdev, false); in cfg80211_netdev_notifier_call()
1395 INIT_LIST_HEAD(&wdev->list); in cfg80211_netdev_notifier_call()
1400 cfg80211_process_wdev_events(wdev); in cfg80211_netdev_notifier_call()
1402 if (WARN_ON(wdev->current_bss)) { in cfg80211_netdev_notifier_call()
1403 cfg80211_unhold_bss(wdev->current_bss); in cfg80211_netdev_notifier_call()
1404 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); in cfg80211_netdev_notifier_call()
1405 wdev->current_bss = NULL; in cfg80211_netdev_notifier_call()
1409 if (!cfg80211_iftype_allowed(wdev->wiphy, wdev->iftype, in cfg80211_netdev_notifier_call()
1410 wdev->use_4addr, 0)) in cfg80211_netdev_notifier_call()