From af355d5c7a9d631f731b9d664cdc023da73001f9 Mon Sep 17 00:00:00 2001 From: Valera Date: Thu, 18 Feb 2016 14:49:20 +0300 Subject: [PATCH] Clean-up (reverted from commit 54ddb2a22cb586a2d9ef5c854e7ea9396cbbefdb) --- device.mk | 6 ++++ libshims/Android.mk | 26 +++++++++++++++ libshims/icu53.c | 26 +++++++++++++++ libshims/ioprio.c | 33 +++++++++++++++++++ libwcnss_qmi/Android.mk | 28 ++++++++++++++++ libwcnss_qmi/wcnss_qmi_client.c | 57 +++++++++++++++++++++++++++++++++ rootdir/etc/init.qcom.rc | 2 +- 7 files changed, 177 insertions(+), 1 deletion(-) create mode 100755 libshims/Android.mk create mode 100755 libshims/icu53.c create mode 100755 libshims/ioprio.c create mode 100755 libwcnss_qmi/Android.mk create mode 100755 libwcnss_qmi/wcnss_qmi_client.c diff --git a/device.mk b/device.mk index 080e00d..bf28d8a 100755 --- a/device.mk +++ b/device.mk @@ -59,6 +59,7 @@ PRODUCT_COPY_FILES += \ # Camera PRODUCT_PACKAGES += \ camera.msm8974 \ + libshim_qcopt \ libxml2 # GPS @@ -130,6 +131,10 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ libstlport +# rmt_storage +PRODUCT_PACKAGES += \ + libshim_rmt_storage + # Thermal PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/thermal-engine-8974.conf:system/etc/thermal-engine-8974.conf \ @@ -144,6 +149,7 @@ PRODUCT_PACKAGES += \ dhcpcd.conf \ hostapd \ hostapd_default.conf \ + libwcnss_qmi \ libwpa_client \ macloader \ wcnss_service \ diff --git a/libshims/Android.mk b/libshims/Android.mk new file mode 100755 index 0000000..f57ac3f --- /dev/null +++ b/libshims/Android.mk @@ -0,0 +1,26 @@ +LOCAL_PATH := $(call my-dir) + +# libqc-opt + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + icu53.c + +LOCAL_SHARED_LIBRARIES := libicuuc libicui18n +LOCAL_MODULE := libshim_qcopt +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +# libshim_rmt_storage + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + ioprio.c + +LOCAL_MODULE := libshim_rmt_storage +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/libshims/icu53.c b/libshims/icu53.c new file mode 100755 index 0000000..65a197f --- /dev/null +++ b/libshims/icu53.c @@ -0,0 +1,26 @@ +#include "unicode/utext.h" +#include "unicode/utypes.h" + +U_STABLE UText * U_EXPORT2 +utext_openUChars_53(UText *ut, const UChar *s, int64_t length, UErrorCode *status) +{ + return utext_openUChars(ut, s, length, status); +} + +U_STABLE UText * U_EXPORT2 +utext_close_53(UText *ut) +{ + return utext_close(ut); +} + +U_STABLE int32_t U_EXPORT2 +u_digit_53(UChar32 ch, int8_t radix) +{ + return u_digit(ch, radix); +} + +U_STABLE const char * U_EXPORT2 +u_errorName_53(UErrorCode code) +{ + return u_errorName(code); +} diff --git a/libshims/ioprio.c b/libshims/ioprio.c new file mode 100755 index 0000000..ae5bed3 --- /dev/null +++ b/libshims/ioprio.c @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2015 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include + +/* + * FUNCTION: ioprio_set + * USE: INTERPOSE: Remaps to syscall(SYS_ioprio_set, ...) + * NOTES: This function no longer exists in M, instead remap this function + * make the appropriate syscall instead. + */ +int ioprio_set(int which, int who, int ioprio) +{ + return syscall(SYS_ioprio_set, which, who, ioprio); +} diff --git a/libwcnss_qmi/Android.mk b/libwcnss_qmi/Android.mk new file mode 100755 index 0000000..dd0df10 --- /dev/null +++ b/libwcnss_qmi/Android.mk @@ -0,0 +1,28 @@ +# Copyright (C) 2014 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := wcnss_qmi_client.c +LOCAL_CFLAGS += -Wall -Werror + +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) +LOCAL_SHARED_LIBRARIES := liblog + +LOCAL_MODULE := libwcnss_qmi + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/libwcnss_qmi/wcnss_qmi_client.c b/libwcnss_qmi/wcnss_qmi_client.c new file mode 100755 index 0000000..9742515 --- /dev/null +++ b/libwcnss_qmi/wcnss_qmi_client.c @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * Copyright (C) 2014 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "wcnss_qmi" +#include +#include + +#define MAC_INFO_FILE "/efs/wifi/.mac.info" + +#define SUCCESS 0 +#define FAILED -1 + +int wcnss_init_qmi() +{ + return SUCCESS; +} + +int wcnss_qmi_get_wlan_address(unsigned char *mac) +{ + int i; + int rc = SUCCESS; + int tmp[6]; + FILE *f; + + if ((f = fopen(MAC_INFO_FILE, "r")) == NULL) { + ALOGE("%s: failed to open %s", __func__, MAC_INFO_FILE); + return FAILED; + } + + if (fscanf(f, "%02X:%02X:%02X:%02X:%02X:%02X", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) != 6) { + ALOGE("%s: %s: file contents are not valid", __func__, MAC_INFO_FILE); + rc = FAILED; + } else { + for (i = 0; i < 6; i++) mac[i] = tmp[i]; + } + + fclose(f); + return rc; +} + +void wcnss_qmi_deinit() +{ +} diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 07e6f00..5ed955e 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -34,7 +34,7 @@ on early-init setprop sys.io.scheduler noop on init - export LD_SHIM_LIBS "/system/vendor/lib/libqc-opt.so:/system/bin/rmt_storage:/system/vendor/lib/libOpenCL.so|libboringssl-compat.so:/system/lib/libril.so|libril_shim.so" + export LD_SHIM_LIBS "/system/vendor/lib/libqc-opt.so|libshim_qcopt.so:/system/bin/rmt_storage|libshim_rmt_storage.so:/system/vendor/lib/libOpenCL.so|libboringssl-compat.so:/system/lib/libril.so|libril_shim.so" # Set permissions for persist partition mkdir /persist 0771 system system