Lines Matching refs:rdev

59 	struct cfg80211_registered_device *result = NULL, *rdev;  in cfg80211_rdev_by_wiphy_idx()  local
63 for_each_rdev(rdev) { in cfg80211_rdev_by_wiphy_idx()
64 if (rdev->wiphy_idx == wiphy_idx) { in cfg80211_rdev_by_wiphy_idx()
65 result = rdev; in cfg80211_rdev_by_wiphy_idx()
75 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in get_wiphy_idx() local
77 return rdev->wiphy_idx; in get_wiphy_idx()
82 struct cfg80211_registered_device *rdev; in wiphy_idx_to_wiphy() local
86 rdev = cfg80211_rdev_by_wiphy_idx(wiphy_idx); in wiphy_idx_to_wiphy()
87 if (!rdev) in wiphy_idx_to_wiphy()
89 return &rdev->wiphy; in wiphy_idx_to_wiphy()
92 static int cfg80211_dev_check_name(struct cfg80211_registered_device *rdev, in cfg80211_dev_check_name() argument
105 if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) { in cfg80211_dev_check_name()
126 int cfg80211_dev_rename(struct cfg80211_registered_device *rdev, in cfg80211_dev_rename() argument
132 lockdep_assert_wiphy(&rdev->wiphy); in cfg80211_dev_rename()
135 if (strcmp(newname, wiphy_name(&rdev->wiphy)) == 0) in cfg80211_dev_rename()
138 result = cfg80211_dev_check_name(rdev, newname); in cfg80211_dev_rename()
142 result = device_rename(&rdev->wiphy.dev, newname); in cfg80211_dev_rename()
146 if (!IS_ERR_OR_NULL(rdev->wiphy.debugfsdir)) in cfg80211_dev_rename()
147 debugfs_rename(rdev->wiphy.debugfsdir->d_parent, in cfg80211_dev_rename()
148 rdev->wiphy.debugfsdir, in cfg80211_dev_rename()
149 rdev->wiphy.debugfsdir->d_parent, newname); in cfg80211_dev_rename()
151 nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY); in cfg80211_dev_rename()
156 int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, in cfg80211_switch_netns() argument
162 if (!(rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK)) in cfg80211_switch_netns()
165 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
177 net = wiphy_net(&rdev->wiphy); in cfg80211_switch_netns()
180 &rdev->wiphy.wdev_list, in cfg80211_switch_netns()
194 wiphy_lock(&rdev->wiphy); in cfg80211_switch_netns()
195 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
198 nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE); in cfg80211_switch_netns()
201 nl80211_notify_wiphy(rdev, NL80211_CMD_DEL_WIPHY); in cfg80211_switch_netns()
203 wiphy_net_set(&rdev->wiphy, net); in cfg80211_switch_netns()
205 err = device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev)); in cfg80211_switch_netns()
208 nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY); in cfg80211_switch_netns()
210 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_switch_netns()
213 nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); in cfg80211_switch_netns()
215 wiphy_unlock(&rdev->wiphy); in cfg80211_switch_netns()
222 struct cfg80211_registered_device *rdev = data; in cfg80211_rfkill_poll() local
224 wiphy_lock(&rdev->wiphy); in cfg80211_rfkill_poll()
225 rdev_rfkill_poll(rdev); in cfg80211_rfkill_poll()
226 wiphy_unlock(&rdev->wiphy); in cfg80211_rfkill_poll()
229 void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev, in cfg80211_stop_p2p_device() argument
232 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_p2p_device()
240 rdev_stop_p2p_device(rdev, wdev); in cfg80211_stop_p2p_device()
243 rdev->opencount--; in cfg80211_stop_p2p_device()
245 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_stop_p2p_device()
246 if (WARN_ON(!rdev->scan_req->notified && in cfg80211_stop_p2p_device()
247 (!rdev->int_scan_req || in cfg80211_stop_p2p_device()
248 !rdev->int_scan_req->notified))) in cfg80211_stop_p2p_device()
249 rdev->scan_req->info.aborted = true; in cfg80211_stop_p2p_device()
250 ___cfg80211_scan_done(rdev, false); in cfg80211_stop_p2p_device()
254 void cfg80211_stop_nan(struct cfg80211_registered_device *rdev, in cfg80211_stop_nan() argument
257 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_nan()
265 rdev_stop_nan(rdev, wdev); in cfg80211_stop_nan()
268 rdev->opencount--; in cfg80211_stop_nan()
273 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_shutdown_all_interfaces() local
278 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { in cfg80211_shutdown_all_interfaces()
290 cfg80211_stop_p2p_device(rdev, wdev); in cfg80211_shutdown_all_interfaces()
293 cfg80211_stop_nan(rdev, wdev); in cfg80211_shutdown_all_interfaces()
306 struct cfg80211_registered_device *rdev = data; in cfg80211_rfkill_set_block() local
312 cfg80211_shutdown_all_interfaces(&rdev->wiphy); in cfg80211_rfkill_set_block()
320 struct cfg80211_registered_device *rdev; in cfg80211_rfkill_block_work() local
322 rdev = container_of(work, struct cfg80211_registered_device, in cfg80211_rfkill_block_work()
324 cfg80211_rfkill_set_block(rdev, true); in cfg80211_rfkill_block_work()
329 struct cfg80211_registered_device *rdev; in cfg80211_event_work() local
331 rdev = container_of(work, struct cfg80211_registered_device, in cfg80211_event_work()
334 wiphy_lock(&rdev->wiphy); in cfg80211_event_work()
335 cfg80211_process_rdev_events(rdev); in cfg80211_event_work()
336 wiphy_unlock(&rdev->wiphy); in cfg80211_event_work()
339 void cfg80211_destroy_ifaces(struct cfg80211_registered_device *rdev) in cfg80211_destroy_ifaces() argument
345 list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) { in cfg80211_destroy_ifaces()
350 wiphy_lock(&rdev->wiphy); in cfg80211_destroy_ifaces()
351 cfg80211_leave(rdev, wdev); in cfg80211_destroy_ifaces()
352 cfg80211_remove_virtual_intf(rdev, wdev); in cfg80211_destroy_ifaces()
353 wiphy_unlock(&rdev->wiphy); in cfg80211_destroy_ifaces()
360 struct cfg80211_registered_device *rdev; in cfg80211_destroy_iface_wk() local
362 rdev = container_of(work, struct cfg80211_registered_device, in cfg80211_destroy_iface_wk()
366 cfg80211_destroy_ifaces(rdev); in cfg80211_destroy_iface_wk()
373 struct cfg80211_registered_device *rdev; in cfg80211_sched_scan_stop_wk() local
376 rdev = container_of(work, struct cfg80211_registered_device, in cfg80211_sched_scan_stop_wk()
379 list_for_each_entry_safe(req, tmp, &rdev->sched_scan_req_list, list) { in cfg80211_sched_scan_stop_wk()
381 cfg80211_stop_sched_scan_req(rdev, req, false); in cfg80211_sched_scan_stop_wk()
387 struct cfg80211_registered_device *rdev; in cfg80211_propagate_radar_detect_wk() local
389 rdev = container_of(work, struct cfg80211_registered_device, in cfg80211_propagate_radar_detect_wk()
394 regulatory_propagate_dfs_state(&rdev->wiphy, &rdev->radar_chandef, in cfg80211_propagate_radar_detect_wk()
403 struct cfg80211_registered_device *rdev; in cfg80211_propagate_cac_done_wk() local
405 rdev = container_of(work, struct cfg80211_registered_device, in cfg80211_propagate_cac_done_wk()
410 regulatory_propagate_dfs_state(&rdev->wiphy, &rdev->cac_done_chandef, in cfg80211_propagate_cac_done_wk()
419 struct cfg80211_registered_device *rdev; in cfg80211_wiphy_work() local
422 rdev = container_of(work, struct cfg80211_registered_device, wiphy_work); in cfg80211_wiphy_work()
424 trace_wiphy_work_worker_start(&rdev->wiphy); in cfg80211_wiphy_work()
426 wiphy_lock(&rdev->wiphy); in cfg80211_wiphy_work()
427 if (rdev->suspended) in cfg80211_wiphy_work()
430 spin_lock_irq(&rdev->wiphy_work_lock); in cfg80211_wiphy_work()
431 wk = list_first_entry_or_null(&rdev->wiphy_work_list, in cfg80211_wiphy_work()
435 if (!list_empty(&rdev->wiphy_work_list)) in cfg80211_wiphy_work()
437 spin_unlock_irq(&rdev->wiphy_work_lock); in cfg80211_wiphy_work()
439 trace_wiphy_work_run(&rdev->wiphy, wk); in cfg80211_wiphy_work()
440 wk->func(&rdev->wiphy, wk); in cfg80211_wiphy_work()
442 spin_unlock_irq(&rdev->wiphy_work_lock); in cfg80211_wiphy_work()
445 wiphy_unlock(&rdev->wiphy); in cfg80211_wiphy_work()
455 struct cfg80211_registered_device *rdev; in wiphy_new_nm() local
475 alloc_size = sizeof(*rdev) + sizeof_priv; in wiphy_new_nm()
477 rdev = kzalloc(alloc_size, GFP_KERNEL); in wiphy_new_nm()
478 if (!rdev) in wiphy_new_nm()
481 rdev->ops = ops; in wiphy_new_nm()
483 rdev->wiphy_idx = atomic_inc_return(&wiphy_counter); in wiphy_new_nm()
485 if (unlikely(rdev->wiphy_idx < 0)) { in wiphy_new_nm()
488 kfree(rdev); in wiphy_new_nm()
493 rdev->wiphy_idx--; in wiphy_new_nm()
500 rv = cfg80211_dev_check_name(rdev, requested_name); in wiphy_new_nm()
507 rv = dev_set_name(&rdev->wiphy.dev, "%s", requested_name); in wiphy_new_nm()
521 rv = dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx); in wiphy_new_nm()
523 kfree(rdev); in wiphy_new_nm()
528 mutex_init(&rdev->wiphy.mtx); in wiphy_new_nm()
529 INIT_LIST_HEAD(&rdev->wiphy.wdev_list); in wiphy_new_nm()
530 INIT_LIST_HEAD(&rdev->beacon_registrations); in wiphy_new_nm()
531 spin_lock_init(&rdev->beacon_registrations_lock); in wiphy_new_nm()
532 spin_lock_init(&rdev->bss_lock); in wiphy_new_nm()
533 INIT_LIST_HEAD(&rdev->bss_list); in wiphy_new_nm()
534 INIT_LIST_HEAD(&rdev->sched_scan_req_list); in wiphy_new_nm()
535 wiphy_work_init(&rdev->scan_done_wk, __cfg80211_scan_done); in wiphy_new_nm()
536 INIT_DELAYED_WORK(&rdev->dfs_update_channels_wk, in wiphy_new_nm()
539 rdev->wiphy.wext = &cfg80211_wext_handler; in wiphy_new_nm()
542 device_initialize(&rdev->wiphy.dev); in wiphy_new_nm()
543 rdev->wiphy.dev.class = &ieee80211_class; in wiphy_new_nm()
544 rdev->wiphy.dev.platform_data = rdev; in wiphy_new_nm()
545 device_enable_async_suspend(&rdev->wiphy.dev); in wiphy_new_nm()
547 INIT_WORK(&rdev->destroy_work, cfg80211_destroy_iface_wk); in wiphy_new_nm()
548 wiphy_work_init(&rdev->sched_scan_stop_wk, cfg80211_sched_scan_stop_wk); in wiphy_new_nm()
549 INIT_WORK(&rdev->sched_scan_res_wk, cfg80211_sched_scan_results_wk); in wiphy_new_nm()
550 INIT_WORK(&rdev->propagate_radar_detect_wk, in wiphy_new_nm()
552 INIT_WORK(&rdev->propagate_cac_done_wk, cfg80211_propagate_cac_done_wk); in wiphy_new_nm()
553 INIT_WORK(&rdev->mgmt_registrations_update_wk, in wiphy_new_nm()
555 spin_lock_init(&rdev->mgmt_registrations_lock); in wiphy_new_nm()
558 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in wiphy_new_nm()
561 wiphy_net_set(&rdev->wiphy, &init_net); in wiphy_new_nm()
563 rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block; in wiphy_new_nm()
564 rdev->wiphy.rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev), in wiphy_new_nm()
565 &rdev->wiphy.dev, RFKILL_TYPE_WLAN, in wiphy_new_nm()
566 &rdev->rfkill_ops, rdev); in wiphy_new_nm()
568 if (!rdev->wiphy.rfkill) { in wiphy_new_nm()
569 wiphy_free(&rdev->wiphy); in wiphy_new_nm()
573 INIT_WORK(&rdev->wiphy_work, cfg80211_wiphy_work); in wiphy_new_nm()
574 INIT_LIST_HEAD(&rdev->wiphy_work_list); in wiphy_new_nm()
575 spin_lock_init(&rdev->wiphy_work_lock); in wiphy_new_nm()
576 INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work); in wiphy_new_nm()
577 INIT_WORK(&rdev->conn_work, cfg80211_conn_work); in wiphy_new_nm()
578 INIT_WORK(&rdev->event_work, cfg80211_event_work); in wiphy_new_nm()
579 INIT_WORK(&rdev->background_cac_abort_wk, in wiphy_new_nm()
581 INIT_DELAYED_WORK(&rdev->background_cac_done_wk, in wiphy_new_nm()
584 init_waitqueue_head(&rdev->dev_wait); in wiphy_new_nm()
591 rdev->wiphy.retry_short = 7; in wiphy_new_nm()
592 rdev->wiphy.retry_long = 4; in wiphy_new_nm()
593 rdev->wiphy.frag_threshold = (u32) -1; in wiphy_new_nm()
594 rdev->wiphy.rts_threshold = (u32) -1; in wiphy_new_nm()
595 rdev->wiphy.coverage_class = 0; in wiphy_new_nm()
597 rdev->wiphy.max_num_csa_counters = 1; in wiphy_new_nm()
599 rdev->wiphy.max_sched_scan_plans = 1; in wiphy_new_nm()
600 rdev->wiphy.max_sched_scan_plan_interval = U32_MAX; in wiphy_new_nm()
602 return &rdev->wiphy; in wiphy_new_nm()
698 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_register() local
717 (!rdev->ops->tdls_channel_switch || in wiphy_register()
718 !rdev->ops->tdls_cancel_channel_switch))) in wiphy_register()
722 (!rdev->ops->start_nan || !rdev->ops->stop_nan || in wiphy_register()
723 !rdev->ops->add_nan_func || !rdev->ops->del_nan_func || in wiphy_register()
795 !rdev->ops->set_mac_acl))) in wiphy_register()
805 if (WARN_ON(wiphy_ext_feature_isset(&rdev->wiphy, in wiphy_register()
807 (!rdev->ops->set_pmk || !rdev->ops->del_pmk))) in wiphy_register()
810 if (WARN_ON(!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) && in wiphy_register()
811 rdev->ops->update_connect_params)) in wiphy_register()
933 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) { in wiphy_register()
939 if (WARN_ON(!rdev->wiphy.vendor_commands[i].policy)) in wiphy_register()
941 if (WARN_ON(!rdev->wiphy.vendor_commands[i].doit && in wiphy_register()
942 !rdev->wiphy.vendor_commands[i].dumpit)) in wiphy_register()
947 if (WARN_ON(rdev->wiphy.wowlan && rdev->wiphy.wowlan->n_patterns && in wiphy_register()
948 (!rdev->wiphy.wowlan->pattern_min_len || in wiphy_register()
949 rdev->wiphy.wowlan->pattern_min_len > in wiphy_register()
950 rdev->wiphy.wowlan->pattern_max_len))) in wiphy_register()
963 rdev->wiphy.features |= NL80211_FEATURE_SCAN_FLUSH; in wiphy_register()
966 wiphy_lock(&rdev->wiphy); in wiphy_register()
967 res = device_add(&rdev->wiphy.dev); in wiphy_register()
969 wiphy_unlock(&rdev->wiphy); in wiphy_register()
974 list_add_rcu(&rdev->list, &cfg80211_rdev_list); in wiphy_register()
978 rdev->wiphy.debugfsdir = debugfs_create_dir(wiphy_name(&rdev->wiphy), in wiphy_register()
981 cfg80211_debugfs_rdev_add(rdev); in wiphy_register()
982 nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY); in wiphy_register()
983 wiphy_unlock(&rdev->wiphy); in wiphy_register()
1029 rdev->wiphy.registered = true; in wiphy_register()
1032 res = rfkill_register(rdev->wiphy.rfkill); in wiphy_register()
1034 rfkill_destroy(rdev->wiphy.rfkill); in wiphy_register()
1035 rdev->wiphy.rfkill = NULL; in wiphy_register()
1036 wiphy_unregister(&rdev->wiphy); in wiphy_register()
1046 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_start_polling() local
1048 if (!rdev->ops->rfkill_poll) in wiphy_rfkill_start_polling()
1050 rdev->rfkill_ops.poll = cfg80211_rfkill_poll; in wiphy_rfkill_start_polling()
1055 void cfg80211_process_wiphy_works(struct cfg80211_registered_device *rdev, in cfg80211_process_wiphy_works() argument
1061 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_process_wiphy_works()
1063 spin_lock_irqsave(&rdev->wiphy_work_lock, flags); in cfg80211_process_wiphy_works()
1064 while (!list_empty(&rdev->wiphy_work_list)) { in cfg80211_process_wiphy_works()
1067 wk = list_first_entry(&rdev->wiphy_work_list, in cfg80211_process_wiphy_works()
1070 spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); in cfg80211_process_wiphy_works()
1072 trace_wiphy_work_run(&rdev->wiphy, wk); in cfg80211_process_wiphy_works()
1073 wk->func(&rdev->wiphy, wk); in cfg80211_process_wiphy_works()
1075 spin_lock_irqsave(&rdev->wiphy_work_lock, flags); in cfg80211_process_wiphy_works()
1081 INIT_LIST_HEAD(&rdev->wiphy_work_list); in cfg80211_process_wiphy_works()
1083 spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); in cfg80211_process_wiphy_works()
1088 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_unregister() local
1090 wait_event(rdev->dev_wait, ({ in wiphy_unregister()
1092 wiphy_lock(&rdev->wiphy); in wiphy_unregister()
1093 __count = rdev->opencount; in wiphy_unregister()
1094 wiphy_unlock(&rdev->wiphy); in wiphy_unregister()
1097 if (rdev->wiphy.rfkill) in wiphy_unregister()
1098 rfkill_unregister(rdev->wiphy.rfkill); in wiphy_unregister()
1101 wiphy_lock(&rdev->wiphy); in wiphy_unregister()
1102 nl80211_notify_wiphy(rdev, NL80211_CMD_DEL_WIPHY); in wiphy_unregister()
1103 rdev->wiphy.registered = false; in wiphy_unregister()
1105 WARN_ON(!list_empty(&rdev->wiphy.wdev_list)); in wiphy_unregister()
1111 debugfs_remove_recursive(rdev->wiphy.debugfsdir); in wiphy_unregister()
1112 list_del_rcu(&rdev->list); in wiphy_unregister()
1122 device_del(&rdev->wiphy.dev); in wiphy_unregister()
1125 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup) in wiphy_unregister()
1126 rdev_set_wakeup(rdev, false); in wiphy_unregister()
1130 cfg80211_process_wiphy_works(rdev, NULL); in wiphy_unregister()
1131 wiphy_unlock(&rdev->wiphy); in wiphy_unregister()
1135 cancel_work_sync(&rdev->wiphy_work); in wiphy_unregister()
1137 cancel_work_sync(&rdev->conn_work); in wiphy_unregister()
1138 flush_work(&rdev->event_work); in wiphy_unregister()
1139 cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); in wiphy_unregister()
1140 cancel_delayed_work_sync(&rdev->background_cac_done_wk); in wiphy_unregister()
1141 flush_work(&rdev->destroy_work); in wiphy_unregister()
1142 flush_work(&rdev->propagate_radar_detect_wk); in wiphy_unregister()
1143 flush_work(&rdev->propagate_cac_done_wk); in wiphy_unregister()
1144 flush_work(&rdev->mgmt_registrations_update_wk); in wiphy_unregister()
1145 flush_work(&rdev->background_cac_abort_wk); in wiphy_unregister()
1147 cfg80211_rdev_free_wowlan(rdev); in wiphy_unregister()
1148 cfg80211_free_coalesce(rdev->coalesce); in wiphy_unregister()
1149 rdev->coalesce = NULL; in wiphy_unregister()
1153 void cfg80211_dev_free(struct cfg80211_registered_device *rdev) in cfg80211_dev_free() argument
1157 rfkill_destroy(rdev->wiphy.rfkill); in cfg80211_dev_free()
1158 list_for_each_entry_safe(reg, treg, &rdev->beacon_registrations, list) { in cfg80211_dev_free()
1162 list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list) in cfg80211_dev_free()
1163 cfg80211_put_bss(&rdev->wiphy, &scan->pub); in cfg80211_dev_free()
1164 mutex_destroy(&rdev->wiphy.mtx); in cfg80211_dev_free()
1173 kfree(rcu_dereference_raw(rdev->wiphy.regd)); in cfg80211_dev_free()
1175 kfree(rdev); in cfg80211_dev_free()
1187 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_rfkill_set_hw_state_reason() local
1190 schedule_work(&rdev->rfkill_block); in wiphy_rfkill_set_hw_state_reason()
1197 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in _cfg80211_unregister_wdev() local
1202 lockdep_assert_held(&rdev->wiphy.mtx); in _cfg80211_unregister_wdev()
1204 nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE); in _cfg80211_unregister_wdev()
1216 rdev->devlist_generation++; in _cfg80211_unregister_wdev()
1222 cfg80211_stop_p2p_device(rdev, wdev); in _cfg80211_unregister_wdev()
1225 cfg80211_stop_nan(rdev, wdev); in _cfg80211_unregister_wdev()
1275 void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, in cfg80211_update_iface_num() argument
1278 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_update_iface_num()
1280 rdev->num_running_ifaces += num; in cfg80211_update_iface_num()
1282 rdev->num_running_monitor_ifaces += num; in cfg80211_update_iface_num()
1285 void cfg80211_leave(struct cfg80211_registered_device *rdev, in cfg80211_leave() argument
1291 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_leave()
1299 cfg80211_leave_ibss(rdev, dev, true); in cfg80211_leave()
1303 list_for_each_entry_safe(pos, tmp, &rdev->sched_scan_req_list, in cfg80211_leave()
1306 cfg80211_stop_sched_scan_req(rdev, pos, false); in cfg80211_leave()
1315 cfg80211_disconnect(rdev, dev, in cfg80211_leave()
1319 cfg80211_leave_mesh(rdev, dev); in cfg80211_leave()
1323 cfg80211_stop_ap(rdev, dev, -1, true); in cfg80211_leave()
1326 cfg80211_leave_ocb(rdev, dev); in cfg80211_leave()
1347 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in cfg80211_stop_iface() local
1362 queue_work(cfg80211_wq, &rdev->event_work); in cfg80211_stop_iface()
1398 void cfg80211_register_wdev(struct cfg80211_registered_device *rdev, in cfg80211_register_wdev() argument
1402 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_wdev()
1412 wdev->identifier = ++rdev->wdev_id; in cfg80211_register_wdev()
1413 list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list); in cfg80211_register_wdev()
1414 rdev->devlist_generation++; in cfg80211_register_wdev()
1418 sysfs_create_link(&wdev->netdev->dev.kobj, &rdev->wiphy.dev.kobj, in cfg80211_register_wdev()
1422 nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); in cfg80211_register_wdev()
1428 struct cfg80211_registered_device *rdev; in cfg80211_register_netdevice() local
1436 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_register_netdevice()
1438 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_netdevice()
1447 cfg80211_register_wdev(rdev, wdev); in cfg80211_register_netdevice()
1462 struct cfg80211_registered_device *rdev; in cfg80211_netdev_notifier_call() local
1468 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_netdev_notifier_call()
1483 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1484 cfg80211_register_wdev(rdev, wdev); in cfg80211_netdev_notifier_call()
1485 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1494 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1496 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1500 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1501 cfg80211_leave(rdev, wdev); in cfg80211_netdev_notifier_call()
1503 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1509 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1510 cfg80211_update_iface_num(rdev, wdev->iftype, -1); in cfg80211_netdev_notifier_call()
1511 if (rdev->scan_req && rdev->scan_req->wdev == wdev) { in cfg80211_netdev_notifier_call()
1512 if (WARN_ON(!rdev->scan_req->notified && in cfg80211_netdev_notifier_call()
1513 (!rdev->int_scan_req || in cfg80211_netdev_notifier_call()
1514 !rdev->int_scan_req->notified))) in cfg80211_netdev_notifier_call()
1515 rdev->scan_req->info.aborted = true; in cfg80211_netdev_notifier_call()
1516 ___cfg80211_scan_done(rdev, false); in cfg80211_netdev_notifier_call()
1520 &rdev->sched_scan_req_list, list) { in cfg80211_netdev_notifier_call()
1522 cfg80211_stop_sched_scan_req(rdev, pos, false); in cfg80211_netdev_notifier_call()
1525 rdev->opencount--; in cfg80211_netdev_notifier_call()
1526 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1527 wake_up(&rdev->dev_wait); in cfg80211_netdev_notifier_call()
1530 wiphy_lock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1531 cfg80211_update_iface_num(rdev, wdev->iftype, 1); in cfg80211_netdev_notifier_call()
1535 cfg80211_ibss_wext_join(rdev, wdev); in cfg80211_netdev_notifier_call()
1538 cfg80211_mgd_wext_connect(rdev, wdev); in cfg80211_netdev_notifier_call()
1552 __cfg80211_join_mesh(rdev, dev, in cfg80211_netdev_notifier_call()
1561 rdev->opencount++; in cfg80211_netdev_notifier_call()
1569 rdev->ops->set_power_mgmt && in cfg80211_netdev_notifier_call()
1570 rdev_set_power_mgmt(rdev, dev, wdev->ps, in cfg80211_netdev_notifier_call()
1575 wiphy_unlock(&rdev->wiphy); in cfg80211_netdev_notifier_call()
1582 if (rfkill_blocked(rdev->wiphy.rfkill)) in cfg80211_netdev_notifier_call()
1600 struct cfg80211_registered_device *rdev; in cfg80211_pernet_exit() local
1603 for_each_rdev(rdev) { in cfg80211_pernet_exit()
1604 if (net_eq(wiphy_net(&rdev->wiphy), net)) in cfg80211_pernet_exit()
1605 WARN_ON(cfg80211_switch_netns(rdev, &init_net)); in cfg80211_pernet_exit()
1616 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_work_queue() local
1621 spin_lock_irqsave(&rdev->wiphy_work_lock, flags); in wiphy_work_queue()
1623 list_add_tail(&work->entry, &rdev->wiphy_work_list); in wiphy_work_queue()
1624 spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); in wiphy_work_queue()
1626 queue_work(system_unbound_wq, &rdev->wiphy_work); in wiphy_work_queue()
1632 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_work_cancel() local
1639 spin_lock_irqsave(&rdev->wiphy_work_lock, flags); in wiphy_work_cancel()
1642 spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); in wiphy_work_cancel()
1648 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); in wiphy_work_flush() local
1654 spin_lock_irqsave(&rdev->wiphy_work_lock, flags); in wiphy_work_flush()
1656 spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); in wiphy_work_flush()
1659 cfg80211_process_wiphy_works(rdev, work); in wiphy_work_flush()