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()
248 struct wireless_dev *wdev) in cfg80211_stop_nan() argument
252 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_NAN)) in cfg80211_stop_nan()
255 if (!wdev_running(wdev)) in cfg80211_stop_nan()
258 rdev_stop_nan(rdev, wdev); in cfg80211_stop_nan()
259 wdev->is_running = false; in cfg80211_stop_nan()
267 struct wireless_dev *wdev; in cfg80211_shutdown_all_interfaces() local
271 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_shutdown_all_interfaces()
272 if (wdev->netdev) { in cfg80211_shutdown_all_interfaces()
273 dev_close(wdev->netdev); in cfg80211_shutdown_all_interfaces()
277 switch (wdev->iftype) { in cfg80211_shutdown_all_interfaces()
279 cfg80211_stop_p2p_device(rdev, wdev); in cfg80211_shutdown_all_interfaces()
282 cfg80211_stop_nan(rdev, wdev); in cfg80211_shutdown_all_interfaces()
328 struct wireless_dev *wdev, *tmp; in cfg80211_destroy_ifaces() local
332 list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) { in cfg80211_destroy_ifaces()
333 if (wdev->nl_owner_dead) in cfg80211_destroy_ifaces()
334 rdev_del_virtual_intf(rdev, wdev); in cfg80211_destroy_ifaces()
1096 void cfg80211_cqm_config_free(struct wireless_dev *wdev) in cfg80211_cqm_config_free() argument
1098 kfree(wdev->cqm_config); in cfg80211_cqm_config_free()
1099 wdev->cqm_config = NULL; in cfg80211_cqm_config_free()
1102 static void __cfg80211_unregister_wdev(struct wireless_dev *wdev, bool sync) in __cfg80211_unregister_wdev() argument
1104 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in __cfg80211_unregister_wdev()
1108 flush_work(&wdev->pmsr_free_wk); in __cfg80211_unregister_wdev()
1110 nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE); in __cfg80211_unregister_wdev()
1112 list_del_rcu(&wdev->list); in __cfg80211_unregister_wdev()
1117 cfg80211_mlme_purge_registrations(wdev); in __cfg80211_unregister_wdev()
1119 switch (wdev->iftype) { in __cfg80211_unregister_wdev()
1121 cfg80211_stop_p2p_device(rdev, wdev); in __cfg80211_unregister_wdev()
1124 cfg80211_stop_nan(rdev, wdev); in __cfg80211_unregister_wdev()
1131 kfree_sensitive(wdev->wext.keys); in __cfg80211_unregister_wdev()
1132 wdev->wext.keys = NULL; in __cfg80211_unregister_wdev()
1135 if (wdev->netdev) in __cfg80211_unregister_wdev()
1136 flush_work(&wdev->disconnect_wk); in __cfg80211_unregister_wdev()
1138 cfg80211_cqm_config_free(wdev); in __cfg80211_unregister_wdev()
1141 void cfg80211_unregister_wdev(struct wireless_dev *wdev) in cfg80211_unregister_wdev() argument
1143 if (WARN_ON(wdev->netdev)) in cfg80211_unregister_wdev()
1146 __cfg80211_unregister_wdev(wdev, true); in cfg80211_unregister_wdev()
1165 struct wireless_dev *wdev) in __cfg80211_leave() argument
1167 struct net_device *dev = wdev->netdev; in __cfg80211_leave()
1171 ASSERT_WDEV_LOCK(wdev); in __cfg80211_leave()
1173 cfg80211_pmsr_wdev_down(wdev); in __cfg80211_leave()
1175 switch (wdev->iftype) { in __cfg80211_leave()
1188 kfree(wdev->wext.ie); in __cfg80211_leave()
1189 wdev->wext.ie = NULL; in __cfg80211_leave()
1190 wdev->wext.ie_len = 0; in __cfg80211_leave()
1191 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in __cfg80211_leave()
1225 struct wireless_dev *wdev) in cfg80211_leave() argument
1227 wdev_lock(wdev); in cfg80211_leave()
1228 __cfg80211_leave(rdev, wdev); in cfg80211_leave()
1229 wdev_unlock(wdev); in cfg80211_leave()
1232 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, in cfg80211_stop_iface() argument
1239 trace_cfg80211_stop_iface(wiphy, wdev); in cfg80211_stop_iface()
1247 spin_lock_irqsave(&wdev->event_lock, flags); in cfg80211_stop_iface()
1248 list_add_tail(&ev->list, &wdev->event_list); in cfg80211_stop_iface()
1249 spin_unlock_irqrestore(&wdev->event_lock, flags); in cfg80211_stop_iface()
1254 void cfg80211_init_wdev(struct wireless_dev *wdev) in cfg80211_init_wdev() argument
1256 mutex_init(&wdev->mtx); in cfg80211_init_wdev()
1257 INIT_LIST_HEAD(&wdev->event_list); in cfg80211_init_wdev()
1258 spin_lock_init(&wdev->event_lock); in cfg80211_init_wdev()
1259 INIT_LIST_HEAD(&wdev->mgmt_registrations); in cfg80211_init_wdev()
1260 INIT_LIST_HEAD(&wdev->pmsr_list); in cfg80211_init_wdev()
1261 spin_lock_init(&wdev->pmsr_lock); in cfg80211_init_wdev()
1262 INIT_WORK(&wdev->pmsr_free_wk, cfg80211_pmsr_free_wk); in cfg80211_init_wdev()
1265 wdev->wext.default_key = -1; in cfg80211_init_wdev()
1266 wdev->wext.default_mgmt_key = -1; in cfg80211_init_wdev()
1267 wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; in cfg80211_init_wdev()
1270 if (wdev->wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT) in cfg80211_init_wdev()
1271 wdev->ps = true; in cfg80211_init_wdev()
1273 wdev->ps = false; in cfg80211_init_wdev()
1275 wdev->ps_timeout = -1; in cfg80211_init_wdev()
1277 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_init_wdev()
1278 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || in cfg80211_init_wdev()
1279 wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) in cfg80211_init_wdev()
1280 wdev->netdev->priv_flags |= IFF_DONT_BRIDGE; in cfg80211_init_wdev()
1282 INIT_WORK(&wdev->disconnect_wk, cfg80211_autodisconnect_wk); in cfg80211_init_wdev()
1286 struct wireless_dev *wdev) in cfg80211_register_wdev() argument
1295 if (!wdev->identifier) in cfg80211_register_wdev()
1296 wdev->identifier = ++rdev->wdev_id; in cfg80211_register_wdev()
1297 list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list); in cfg80211_register_wdev()
1300 nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); in cfg80211_register_wdev()
1307 struct wireless_dev *wdev = dev->ieee80211_ptr; in cfg80211_netdev_notifier_call() local
1311 if (!wdev) in cfg80211_netdev_notifier_call()
1314 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
1316 WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED); in cfg80211_netdev_notifier_call()
1321 wdev->netdev = dev; in cfg80211_netdev_notifier_call()
1325 cfg80211_init_wdev(wdev); in cfg80211_netdev_notifier_call()
1338 cfg80211_register_wdev(rdev, wdev); in cfg80211_netdev_notifier_call()
1341 cfg80211_leave(rdev, wdev); in cfg80211_netdev_notifier_call()
1344 cfg80211_update_iface_num(rdev, wdev->iftype, -1); in cfg80211_netdev_notifier_call()
1345 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_netdev_notifier_call()
1355 if (WARN_ON(pos->dev == wdev->netdev)) in cfg80211_netdev_notifier_call()
1363 cfg80211_update_iface_num(rdev, wdev->iftype, 1); in cfg80211_netdev_notifier_call()
1364 wdev_lock(wdev); in cfg80211_netdev_notifier_call()
1365 switch (wdev->iftype) { in cfg80211_netdev_notifier_call()
1368 cfg80211_ibss_wext_join(rdev, wdev); in cfg80211_netdev_notifier_call()
1371 cfg80211_mgd_wext_connect(rdev, wdev); in cfg80211_netdev_notifier_call()
1382 setup.mesh_id = wdev->ssid; in cfg80211_netdev_notifier_call()
1383 setup.mesh_id_len = wdev->mesh_id_up_len; in cfg80211_netdev_notifier_call()
1384 if (wdev->mesh_id_up_len) in cfg80211_netdev_notifier_call()
1394 wdev_unlock(wdev); in cfg80211_netdev_notifier_call()
1401 if ((wdev->iftype == NL80211_IFTYPE_STATION || in cfg80211_netdev_notifier_call()
1402 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && in cfg80211_netdev_notifier_call()
1404 rdev_set_power_mgmt(rdev, dev, wdev->ps, in cfg80211_netdev_notifier_call()
1405 wdev->ps_timeout)) { in cfg80211_netdev_notifier_call()
1407 wdev->ps = false; in cfg80211_netdev_notifier_call()
1418 if (!list_empty(&wdev->list)) { in cfg80211_netdev_notifier_call()
1419 __cfg80211_unregister_wdev(wdev, false); in cfg80211_netdev_notifier_call()
1429 INIT_LIST_HEAD(&wdev->list); in cfg80211_netdev_notifier_call()
1434 cfg80211_process_wdev_events(wdev); in cfg80211_netdev_notifier_call()
1436 if (WARN_ON(wdev->current_bss)) { in cfg80211_netdev_notifier_call()
1437 cfg80211_unhold_bss(wdev->current_bss); in cfg80211_netdev_notifier_call()
1438 cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); in cfg80211_netdev_notifier_call()
1439 wdev->current_bss = NULL; in cfg80211_netdev_notifier_call()
1443 if (!cfg80211_iftype_allowed(wdev->wiphy, wdev->iftype, in cfg80211_netdev_notifier_call()
1444 wdev->use_4addr, 0)) in cfg80211_netdev_notifier_call()