/* * We reset all the structures, and we reset the UMAC. * After calling this routine, you're expected to reload * the firmware. */ int wil_reset(struct wil6210_priv *wil) { int rc; cancel_work_sync(&wil->disconnect_worker); wil6210_disconnect(wil, NULL); wil6210_disable_irq(wil); wil->status = 0; wmi_event_flush(wil); flush_workqueue(wil->wmi_wq_conn); flush_workqueue(wil->wmi_wq); /* TODO: put MAC in reset */ wil_target_reset(wil); /* init after reset */ wil->pending_connect_cid = -1; INIT_COMPLETION(wil->wmi_ready); /* TODO: release MAC reset */ wil6210_enable_irq(wil); /* we just started MAC, wait for FW ready */ rc = wil_wait_for_fw_ready(wil); return rc; }
/* * We reset all the structures, and we reset the UMAC. * After calling this routine, you're expected to reload * the firmware. */ int wil_reset(struct wil6210_priv *wil) { int rc; WARN_ON(!mutex_is_locked(&wil->mutex)); cancel_work_sync(&wil->disconnect_worker); wil6210_disconnect(wil, NULL); wil->status = 0; /* prevent NAPI from being scheduled */ if (test_bit(wil_status_napi_en, &wil->status)) { napi_synchronize(&wil->napi_rx); } if (wil->scan_request) { wil_dbg_misc(wil, "Abort scan_request 0x%p\n", wil->scan_request); del_timer_sync(&wil->scan_timer); cfg80211_scan_done(wil->scan_request, true); wil->scan_request = NULL; } wil6210_disable_irq(wil); wmi_event_flush(wil); flush_workqueue(wil->wmi_wq_conn); flush_workqueue(wil->wmi_wq); /* TODO: put MAC in reset */ wil_target_reset(wil); wil_rx_fini(wil); /* init after reset */ wil->pending_connect_cid = -1; reinit_completion(&wil->wmi_ready); /* TODO: release MAC reset */ wil6210_enable_irq(wil); /* we just started MAC, wait for FW ready */ rc = wil_wait_for_fw_ready(wil); return rc; }