summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-12-06 14:02:09 -0800
committerLinux Build Service Account <lnxbuild@localhost>2016-12-06 14:02:09 -0800
commit01dfd848a208116820f8c811aefee416fda5ad01 (patch)
treef02677ac6b9f24f6132f7d28a56c7e1306355819
parentc461d90990dc928d068519b2edd0d38d1d105184 (diff)
parentd005e860158a21b62e7a81b2ce41c720069a5c73 (diff)
downloadandroid_hardware_qcom_wlan-01dfd848a208116820f8c811aefee416fda5ad01.tar.gz
android_hardware_qcom_wlan-01dfd848a208116820f8c811aefee416fda5ad01.tar.bz2
android_hardware_qcom_wlan-01dfd848a208116820f8c811aefee416fda5ad01.zip
Merge d005e860158a21b62e7a81b2ce41c720069a5c73 on remote branch
Change-Id: I6c68c31bc3bd3af4307d5fb6c25b001f603c287d
-rw-r--r--wcnss-service/Android.mk1
-rw-r--r--wcnss-service/wcnss_service.c19
2 files changed, 8 insertions, 12 deletions
diff --git a/wcnss-service/Android.mk b/wcnss-service/Android.mk
index 16cc10e..1e54dc9 100644
--- a/wcnss-service/Android.mk
+++ b/wcnss-service/Android.mk
@@ -19,6 +19,7 @@ LOCAL_SHARED_LIBRARIES += libqmiservices libqmi libqcci_legacy libqmi_client_qmu
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libmdmdetect/inc
LOCAL_SHARED_LIBRARIES += libmdmdetect
endif #TARGET_USES_QCOM_WCNSS_QMI
+LOCAL_CFLAGS += -DDYNAMIC_NV
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -Wall -Werror
include $(BUILD_EXECUTABLE)
diff --git a/wcnss-service/wcnss_service.c b/wcnss-service/wcnss_service.c
index 94c474d..34aa72b 100644
--- a/wcnss-service/wcnss_service.c
+++ b/wcnss-service/wcnss_service.c
@@ -92,13 +92,14 @@ unsigned char wlan_nv_mac_addr[WLAN_ADDR_SIZE];
#define WLAN_MAC_ADDR_STRING 18
#endif
+#ifdef DYNAMIC_NV
#define MAX_SOC_INFO_NAME_LEN (15)
#define MAX_DATA_NVBIN_PATH_LEN (64)
#define QRD_DYNAMIC_NV_PROP "persist.sys.dynamic.nv"
#define QRD_HW_PLATFORM "QRD"
#define QRD_PLATFORM_SUBTYPE_ID 0
#define PERSIST_NVFILE "/persist/WCNSS_qcom_wlan_nv.bin"
-#define DATA_NVFILE_DIR "/data/misc/wifi/nvbin/"
+#define DATA_NVFILE_DIR "/system/etc/wifi/nvbin/"
#define SYSFS_SOCID_PATH1 "/sys/devices/soc0/soc_id"
#define SYSFS_SOCID_PATH2 "/sys/devices/system/soc/soc0/id"
#define SYSFS_HW_PLATFORM_PATH1 "/sys/devices/soc0/hw_platform"
@@ -117,6 +118,7 @@ unsigned char wlan_nv_mac_addr[WLAN_ADDR_SIZE];
} \
info_got = atoi(buf); \
}
+#endif
int wcnss_write_cal_data(int fd_dev)
{
@@ -528,6 +530,7 @@ int check_modem_compatability(struct dev_info *mdm_detect_info)
}
#endif
+#ifdef DYNAMIC_NV
static int read_line_from_file(const char *path, char *buf, size_t count)
{
char * fgets_ret;
@@ -618,7 +621,6 @@ static int get_data_nvfile_path(char *data_nvfile_path,
static int nvbin_sendfile(const char *dst, const char *src,
struct stat *src_stat)
{
- struct utimbuf new_time;
int fp_src, fp_dst;
int rc;
if ((fp_src = open(src, O_RDONLY)) < 0)
@@ -644,16 +646,6 @@ static int nvbin_sendfile(const char *dst, const char *src,
goto exit;
}
- new_time.actime = src_stat->st_atime;
- new_time.modtime = src_stat->st_mtime;
- if (utime(dst, &new_time) != 0)
- {
- ALOGE("could not preserve the timestamp %s",
- strerror(errno));
- rc = FAILED;
- goto exit;
- }
-
rc = SUCCESS;
exit:
close(fp_dst);
@@ -719,6 +711,7 @@ void dynamic_nv_replace()
ALOGI("dynamic nv replace sucessfully!\n");
}
+#endif
int main(int argc, char *argv[])
{
@@ -777,7 +770,9 @@ int main(int argc, char *argv[])
nomodem:
#endif
+#ifdef DYNAMIC_NV
dynamic_nv_replace();
+#endif
#ifdef WCNSS_QMI
setup_wcnss_parameters(&ret_cal, nv_mac_addr);