From a0c6d7d5c63e29c8fc676e855a4b208f1a397b0b Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Mon, 17 Jul 2017 16:43:29 -0700 Subject: [PATCH] [HAL] Invalidate chip before shutting down legacy HAL Change the order of shutdown to invalidate chips before shutting down the legacy HAL. Allows pre-shutdown commands to be sent down. Bug: 63704506 Test: NAN tests passing Test: full regression suite Change-Id: I03d237d732b4e3482b1e1639848342dfdde9fcb7 --- wifi/1.1/default/wifi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wifi/1.1/default/wifi.cpp b/wifi/1.1/default/wifi.cpp index 4ed1f555e2..fe4f642302 100644 --- a/wifi/1.1/default/wifi.cpp +++ b/wifi/1.1/default/wifi.cpp @@ -126,6 +126,12 @@ WifiStatus Wifi::stopInternal() { return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, "HAL is stopping"); } + // Clear the chip object and its child objects since the HAL is now + // stopped. + if (chip_.get()) { + chip_->invalidate(); + chip_.clear(); + } WifiStatus wifi_status = stopLegacyHalAndDeinitializeModeController(); if (wifi_status.code == WifiStatusCode::SUCCESS) { for (const auto& callback : event_cb_handler_.getCallbacks()) { @@ -140,12 +146,6 @@ WifiStatus Wifi::stopInternal() { } } } - // Clear the chip object and its child objects since the HAL is now - // stopped. - if (chip_.get()) { - chip_->invalidate(); - chip_.clear(); - } LOG(INFO) << "Wifi HAL stopped"; return wifi_status; }