Do not start/stop the driver in HAL start
The framework expects to control the state of the driver. The HAL
should not be touching it. This code is also a noop on all supported
nexi, where the driver is always started.
Bug: 29321445
Change-Id: If431b278222ca06a29232874bd0c9870bd0be785
Test: Compiles, wifi continues to work on bullhead
(cherry picked from commit 236a52b136b7fdd802389ef1687bd3df37c1adb6)
diff --git a/qcwcn/wifi_hal/Android.mk b/qcwcn/wifi_hal/Android.mk
index 9c7e5df..621fee5 100644
--- a/qcwcn/wifi_hal/Android.mk
+++ b/qcwcn/wifi_hal/Android.mk
@@ -114,7 +114,7 @@
LOCAL_MODULE := libwifi-hal-qcom
LOCAL_CLANG := true
LOCAL_SHARED_LIBRARIES += libnetutils liblog
-LOCAL_SHARED_LIBRARIES += libdl libhardware_legacy
+LOCAL_SHARED_LIBRARIES += libdl
ifneq ($(wildcard external/libnl),)
LOCAL_SHARED_LIBRARIES += libnl
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp
index 49bf2b4..c8082cb 100644
--- a/qcwcn/wifi_hal/wifi_hal.cpp
+++ b/qcwcn/wifi_hal/wifi_hal.cpp
@@ -42,8 +42,6 @@
#define LOG_TAG "WifiHAL"
-#include "hardware_legacy/wifi.h"
-
#include "wifi_hal.h"
#include "common.h"
#include "cpp_bindings.h"
@@ -368,7 +366,6 @@
wifi_error wifi_initialize(wifi_handle *handle)
{
int err = 0;
- bool driver_loaded = false;
wifi_error ret = WIFI_SUCCESS;
wifi_interface_handle iface_handle;
struct nl_sock *cmd_sock = NULL;
@@ -477,15 +474,6 @@
goto unload;
}
- if (!is_wifi_driver_loaded()) {
- ret = (wifi_error)wifi_load_driver();
- if(ret != WIFI_SUCCESS) {
- ALOGE("%s Failed to load wifi driver : %d\n", __func__, ret);
- goto unload;
- }
- driver_loaded = true;
- }
-
ret = wifi_init_interfaces(*handle);
if (ret != WIFI_SUCCESS) {
ALOGE("Failed to init interfaces");
@@ -590,8 +578,6 @@
}
}
- if (driver_loaded)
- wifi_unload_driver();
return ret;
}