Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c101815a authored by Ahmed ElArabawy's avatar Ahmed ElArabawy
Browse files

WiFi: Wait for driver to be ready before operation



This commit calls a vendor hal function to wait for the driver to be
ready before it resumes operation. This ensures the driver is ready
and interfaces are created before framework tries to use them.

Bug: 73482286
Test: Manual test (reboot and make sure wifi comes up consistently)
Test: The reboot test has been performed more than 10 times in a row
Test: Also, tested toggling wifi off/on then rebooted, wifi starts fine

Change-Id: I868dac6dbaa0a5248ae6e35d4ba915bc0c4de6eb
Signed-off-by: default avatarAhmed ElArabawy <arabawy@google.com>
parent 6f8e4d55
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -360,12 +360,18 @@ wifi_error WifiLegacyHal::start() {
        LOG(DEBUG) << "Legacy HAL already started";
        return WIFI_SUCCESS;
    }
    LOG(DEBUG) << "Waiting for the driver ready";
    wifi_error status = global_func_table_.wifi_wait_for_driver_ready();
    if (status == WIFI_ERROR_TIMED_OUT) {
        LOG(ERROR) << "Timed out awaiting driver ready";
        return status;
    }
    LOG(DEBUG) << "Starting legacy HAL";
    if (!iface_tool_.SetWifiUpState(true)) {
        LOG(ERROR) << "Failed to set WiFi interface up";
        return WIFI_ERROR_UNKNOWN;
    }
    wifi_error status = global_func_table_.wifi_initialize(&global_handle_);
    status = global_func_table_.wifi_initialize(&global_handle_);
    if (status != WIFI_SUCCESS || !global_handle_) {
        LOG(ERROR) << "Failed to retrieve global handle";
        return status;
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) {
        return false;
    }
    populateStubFor(&hal_fn->wifi_initialize);
    populateStubFor(&hal_fn->wifi_wait_for_driver_ready);
    populateStubFor(&hal_fn->wifi_cleanup);
    populateStubFor(&hal_fn->wifi_event_loop);
    populateStubFor(&hal_fn->wifi_get_error_info);