wcnss_service: Deal with mdm-detect too
Change-Id: I1f6ad7502bb23fd59f182c1fe86ba92cb47470b7
diff --git a/wcnss-service/Android.mk b/wcnss-service/Android.mk
index 68faddb..b9e82bb 100644
--- a/wcnss-service/Android.mk
+++ b/wcnss-service/Android.mk
@@ -12,7 +12,8 @@
ifeq ($(TARGET_USES_WCNSS_MAC_ADDR_REV),true)
LOCAL_CFLAGS += -DWCNSS_QMI_MAC_ADDR_REV
endif
-LOCAL_CFLAGS += -DWCNSS_QMI
+LOCAL_CFLAGS += -DWCNSS_QMI -DMDM_DETECT
+LOCAL_HEADER_LIBRARIES += libmdmdetect_headers
ifeq ($(filter 10% Q% q%,$(TARGET_PLATFORM_VERSION)),)
#For Android R and above, assuming not compiling on Q and lower
LOCAL_HEADER_LIBRARIES += libqmi_common_headers
diff --git a/wcnss-service/wcnss_service.c b/wcnss-service/wcnss_service.c
index fcdec48..e829db4 100644
--- a/wcnss-service/wcnss_service.c
+++ b/wcnss-service/wcnss_service.c
@@ -43,8 +43,10 @@
#include <cutils/properties.h>
#ifdef WCNSS_QMI
#include "wcnss_qmi_client.h"
+#ifdef MDM_DETECT
#include "mdm_detect.h"
#endif
+#endif
#ifdef WCNSS_QMI_OSS
#include <dlfcn.h>
#endif
@@ -502,7 +504,7 @@
property_set("vendor.wlan.driver.ath", WLAN_DRIVER_ATH_DEFAULT_VAL);
}
-#ifdef WCNSS_QMI
+#ifdef MDM_DETECT
int check_modem_compatability(struct dev_info *mdm_detect_info)
{
char args[MODEM_BASEBAND_PROPERTY_SIZE] = {0};
@@ -785,9 +787,11 @@
int fd_dev, ret_cal;
#if defined(WCNSS_QMI) || defined(WCNSS_QMI_OSS)
int nv_mac_addr = FAILED;
+#ifdef MDM_DETECT
struct dev_info mdm_detect_info;
int nom = 0;
#endif
+#endif
setup_wlan_config_file();
@@ -814,6 +818,7 @@
}
#endif
#ifdef WCNSS_QMI
+#ifdef MDM_DETECT
/* Call ESOC API to get the number of modems.
If the number of modems is not zero, only then proceed
with the eap_proxy intialization.*/
@@ -835,6 +840,7 @@
ALOGE("wcnss_service: Target does not have external modem");
goto nomodem;
}
+#endif
/* initialize the DMS client and request the wlan mac address */