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

Commit 7153e81c authored by Ahmed ElArabawy's avatar Ahmed ElArabawy
Browse files

Wifi: Set wlan.driver.status to 'ok' when ready



Currently, the wlan.driver.status property is set to 'ok' once the
driver is loaded. This is not accurate, cause having the driver loaded
does not necessarily means it is ready for operation.

This commit sets the driver to 'ok' state after it is checked for
readiness. This implementation of the check is device specific.

Bug: 111924712
Test: Manual test

Change-Id: I074d819e9acdfdd6f033d85cdd71c0bc3984eb9d
Signed-off-by: default avatarAhmed ElArabawy <arabawy@google.com>
parent 4b5acbaf
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <chrono>

#include <android-base/logging.h>
#include <cutils/properties.h>

#include "hidl_sync_util.h"
#include "wifi_legacy_hal.h"
@@ -35,6 +36,7 @@ static constexpr uint32_t kLinkLayerStatsDataMpduSizeThreshold = 128;
static constexpr uint32_t kMaxWakeReasonStatsArraySize = 32;
static constexpr uint32_t kMaxRingBuffers = 10;
static constexpr uint32_t kMaxStopCompleteWaitMs = 100;
static constexpr char kDriverPropName[] = "wlan.driver.status";

// Helper function to create a non-const char* for legacy Hal API's.
std::vector<char> makeCharVec(const std::string& str) {
@@ -366,6 +368,8 @@ wifi_error WifiLegacyHal::start() {
        LOG(ERROR) << "Timed out awaiting driver ready";
        return status;
    }
    property_set(kDriverPropName, "ok");

    LOG(DEBUG) << "Starting legacy HAL";
    if (!iface_tool_.SetWifiUpState(true)) {
        LOG(ERROR) << "Failed to set WiFi interface up";