diff --git a/Android.mk b/Android.mk index 80e7908..6c3b334 100644 --- a/Android.mk +++ b/Android.mk @@ -1,5 +1,4 @@ -# -# Copyright (C) 2012 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. @@ -12,22 +11,13 @@ # 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. -# - -# WARNING: Everything listed here will be built on ALL platforms, -# including x86, the emulator, and the SDK. Modules must be uniquely -# named (liblights.tuna), and must build everywhere, or limit themselves -# to only building on ARM if they include assembly. Individual makefiles -# are responsible for having their own logic, for fine-grained control. LOCAL_PATH := $(call my-dir) ifeq ($(BOARD_VENDOR),samsung) -ifeq ($(TARGET_BOARD_PLATFORM),msm8974) +ifeq ($(TARGET_BOARD_PLATFORM),msm8226) include $(call all-subdir-makefiles,$(LOCAL_PATH)) -include $(CLEAR_VARS) - ADSP_IMAGES := \ adsp.b00 adsp.b01 adsp.b02 adsp.b03 adsp.b04 adsp.b05 adsp.b06 \ adsp.b08 adsp.b09 adsp.b10 adsp.b11 adsp.b12 adsp.b13 adsp.mdt @@ -41,17 +31,29 @@ $(ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(ADSP_SYMLINKS) -DTCPIP_IMAGES := \ - dtcpip.b00 dtcpip.b01 dtcpip.b02 dtcpip.b03 dtcpip.mdt +FIRMWARE_CMNLIB_IMAGES := \ + cmnlib.b00 cmnlib.b01 cmnlib.b02 cmnlib.b03 cmnlib.mdt -DTCPIP_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(DTCPIP_IMAGES))) -$(DTCPIP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "DTCPIP firmware link: $@" +FIRMWARE_CMNLIB_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(FIRMWARE_CMNLIB_IMAGES))) +$(FIRMWARE_CMNLIB_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "CMNLIB Firmware link: $@" @mkdir -p $(dir $@) @rm -rf $@ $(hide) ln -sf /firmware/image/$(notdir $@) $@ -ALL_DEFAULT_INSTALLED_MODULES += $(DTCPIP_SYMLINKS) +ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_CMNLIB_SYMLINKS) + +ISDB_IMAGES := \ + isdbtmm.b00 isdbtmm.b01 isdbtmm.b02 isdbtmm.b03 isdbtmm.mdt + +ISDB_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(ISDB_IMAGES))) +$(ISDB_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "ISDB firmware link: $@" + @mkdir -p $(dir $@) + @rm -rf $@ + $(hide) ln -sf /firmware/image/$(notdir $@) $@ + +ALL_DEFAULT_INSTALLED_MODULES += $(ISDB_SYMLINKS) KM_IMAGES := \ keymaster.b00 keymaster.b01 keymaster.b02 keymaster.b03 keymaster.mdt @@ -77,30 +79,6 @@ $(MBA_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(MBA_SYMLINKS) -DXPRDY_IMAGES := \ - dxprdy.b00 dxprdy.b01 dxprdy.b02 dxprdy.b03 dxprdy.mdt - -DXPRDY_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(DXPRDY_IMAGES))) -$(DXPRDY_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "DXPRDY firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(DXPRDY_SYMLINKS) - -MLDAP_IMAGES := \ - mldap.b00 mldap.b01 mldap.b02 mldap.b03 mldap.mdt - -MLDAP_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(MLDAP_IMAGES))) -$(MLDAP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "MLDAP firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(MLDAP_SYMLINKS) - MC_IMAGES := \ mc_v2.b00 mc_v2.b01 mc_v2.b02 mc_v2.b03 mc_v2.mdt @@ -114,10 +92,11 @@ $(MC_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(MC_SYMLINKS) MODEM_IMAGES := \ - modem.b00 modem.b01 modem.b02 modem.b03 modem.b04 modem.b05 modem.b06 \ - modem.b08 modem.b09 modem.b10 modem.b11 modem.b12 modem.b13 modem.b14 \ - modem.b15 modem.b16 modem.b17 modem.b18 modem.b19 modem.b20 modem.b21 \ - modem.b22 modem.b23 modem.b24 modem.b25 modem.b26 modem.b27 modem.mdt + modem.b00 modem.b01 modem.b02 modem.b03 modem.b04 modem.b05 \ + modem.b06 modem.b08 modem.b09 modem.b10 modem.b11 modem.b13 \ + modem.b14 modem.b15 modem.b16 modem.b17 modem.b18 modem.b19 \ + modem.b20 modem.b21 modem.b22 modem.b23 modem.b24 modem.b25 \ + modem.b26 modem.b27 modem.b28 modem.b29 modem.mdt MODEM_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(MODEM_IMAGES))) $(MODEM_SYMLINKS): $(LOCAL_INSTALLED_MODULE) @@ -128,53 +107,17 @@ $(MODEM_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(MODEM_SYMLINKS) -PROV_MODEM_IMAGES := \ - prov.b00 prov.b01 prov.b02 prov.b03 prov.mdt +PROV_IMAGES := \ + prov.b00 prov.b01 prov.b02 prov.b03 prov.mtd \ -PROV_MODEM_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(PROV_MODEM_IMAGES))) -$(PROV_MODEM_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Prov Firmware link: $@" +PROV_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(PROV_IMAGES))) +$(PROV_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "Prov firmware link: $@" @mkdir -p $(dir $@) @rm -rf $@ $(hide) ln -sf /firmware/image/$(notdir $@) $@ -ALL_DEFAULT_INSTALLED_MODULES += $(PROV_MODEM_SYMLINKS) - -ACTLOCK_IMAGES := \ - act_lock.b00 act_lock.b01 act_lock.b02 act_lock.b03 act_lock.mdt - -ACTLOCK_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(ACTLOCK_IMAGES))) -$(ACTLOCK_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Actlock firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(ACTLOCK_SYMLINKS) - -TKM_IMAGES := \ - t2_ks_mi.b00 t2_ks_mi.b01 t2_ks_mi.b02 t2_ks_mi.b03 t2_ks_mi.mdt - -TKM_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(TKM_IMAGES))) -$(TKM_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "TKM firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(TKM_SYMLINKS) - -PLAYREADY_IMAGES := \ - playread.b00 playread.b01 playread.b02 playread.b03 playread.mdt - -PLAYREADY_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(PLAYREADY_IMAGES))) -$(PLAYREADY_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Playready firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(PLAYREADY_SYMLINKS) +ALL_DEFAULT_INSTALLED_MODULES += $(PROV_SYMLINKS) SECSTOR_IMAGES := \ sec_stor.b00 sec_stor.b01 sec_stor.b02 sec_stor.b03 sec_stor.mdt @@ -224,20 +167,17 @@ $(SSHDCPAP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(SSHDCPAP_SYMLINKS) -TIMA_IMAGES := \ - tima_atn.b00 tima_atn.b01 tima_atn.b02 tima_atn.b03 tima_atn.mdt \ - tima_key.b00 tima_key.b01 tima_key.b02 tima_key.b03 tima_key.mdt \ - tima_lkm.b00 tima_lkm.b01 tima_lkm.b02 tima_lkm.b03 tima_lkm.mdt \ - tima_pkm.b00 tima_pkm.b01 tima_pkm.b02 tima_pkm.b03 tima_pkm.mdt +TBASE_IMAGES := \ + tbase300.b00 tbase300.b01 tbase300.b02 tbase300.b03 tbase300.mdt -TIMA_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(TIMA_IMAGES))) -$(TIMA_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Tima firmware link: $@" +SSHDCPAP_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(SSHDCPAP_IMAGES))) +$(TBASE_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "SSHDCPAP firmware link: $@" @mkdir -p $(dir $@) @rm -rf $@ $(hide) ln -sf /firmware/image/$(notdir $@) $@ -ALL_DEFAULT_INSTALLED_MODULES += $(TIMA_SYMLINKS) +ALL_DEFAULT_INSTALLED_MODULES += $(TBASE_SYMLINKS) TZPR_IMAGES := \ tzpr25.b00 tzpr25.b01 tzpr25.b02 tzpr25.b03 tzpr25.mdt @@ -275,8 +215,20 @@ $(VENUS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(VENUS_SYMLINKS) +WCNSS_IMAGES := \ + wcnss.b00 wcnss.b01 wcnss.b02 wcnss.b04 wcnss.b06 \ + wcnss.b07 wcnss.b08 wcnss.b09 wcnss.mdt + +WCNSS_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(WCNSS_IMAGES))) +$(WCNSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + @echo "WCNSS firmware link: $@" + @mkdir -p $(dir $@) + @rm -rf $@ + $(hide) ln -sf /firmware/image/$(notdir $@) $@ + +ALL_DEFAULT_INSTALLED_MODULES += $(WCNSS_SYMLINKS) + WV_IMAGES := \ - cmnlib.b00 cmnlib.b01 cmnlib.b02 cmnlib.b03 cmnlib.mdt \ widevine.b00 widevine.b01 widevine.b02 widevine.b03 widevine.mdt WV_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(WV_IMAGES))) @@ -289,13 +241,12 @@ $(WV_SYMLINKS): $(LOCAL_INSTALLED_MODULE) ALL_DEFAULT_INSTALLED_MODULES += $(WV_SYMLINKS) # Create links for audcal data files -$(shell mkdir -p $(TARGET_OUT)/etc/firmware/wcd9320; \ - ln -sf /data/misc/audio/wcd9320_anc.bin \ - $(TARGET_OUT)/etc/firmware/wcd9320/wcd9320_anc.bin;\ - ln -sf /data/misc/audio/mbhc.bin \ - $(TARGET_OUT)/etc/firmware/wcd9320/wcd9320_mbhc.bin; \ - ln -sf /data/misc/audio/wcd9320_mad_audio.bin \ - $(TARGET_OUT)/etc/firmware/wcd9320/wcd9320_mad_audio.bin) +$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wcd9306; \ + ln -sf /data/misc/audio/wcd9320_anc.bin \ + $(TARGET_OUT_ETC)/firmware/wcd9306/wcd9306_anc.bin; \ + ln -sf /data/misc/audio/mbhc.bin \ + $(TARGET_OUT_ETC)/firmware/wcd9306/wcd9306_mbhc.bin) + endif endif diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index e115f0e..a48e5ec 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -17,13 +17,14 @@ -include device/samsung/qcom-common/BoardConfigCommon.mk # Platform -TARGET_BOARD_PLATFORM := msm8974 -TARGET_BOARD_PLATFORM_GPU := qcom-adreno330 +TARGET_BOARD_PLATFORM := msm8226 +TARGET_BOARD_PLATFORM_GPU := qcom-adreno305 # Architecture TARGET_CPU_VARIANT := krait # Audio +AUDIO_FEATURE_ENABLED_LOW_LATENCY_CAPTURE := true BOARD_USES_ALSA_AUDIO := true # Binder API version @@ -35,15 +36,17 @@ BOARD_HAVE_BLUETOOTH := true # Camera TARGET_HAS_LEGACY_CAMERA_HAL1 := true TARGET_NEEDS_LEGACY_CAMERA_HAL1_DYN_NATIVE_HANDLE := true +TARGET_USES_MEDIA_EXTENSIONS := true # Charger BOARD_BATTERY_DEVICE_NAME := "battery" -BOARD_CHARGING_CMDLINE_NAME := "androidboot.bootchg" -BOARD_CHARGING_CMDLINE_VALUE := "true" +BOARD_CHARGING_CMDLINE_NAME := "androidboot.mode" +BOARD_CHARGING_CMDLINE_VALUE := "charger" +BOARD_CHARGER_ENABLE_SUSPEND := true WITH_LINEAGE_CHARGER := false -# CMHW -BOARD_HARDWARE_CLASS += device/samsung/msm8974-common/lineagehw +# LineageHW +BOARD_HARDWARE_CLASS += device/samsung/msm8226-common/lineagehw # Dexpreopt ifeq ($(HOST_OS),linux) @@ -53,9 +56,13 @@ ifeq ($(HOST_OS),linux) endif endif +WITH_DEXPREOPT_DEBUG_INFO := false +USE_DEX2OAT_DEBUG := false +DONT_DEXPREOPT_PREBUILTS := true + # Display NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 -OVERRIDE_RS_DRIVER:= libRSDriver_adreno.so +OVERRIDE_RS_DRIVER := libRSDriver_adreno.so # Shader cache config options # Maximum size of the GLES Shaders that can be cached for reuse. @@ -68,26 +75,50 @@ MAX_EGL_CACHE_KEY_SIZE := 12*1024 MAX_EGL_CACHE_SIZE := 2048*1024 # Filesystem -TARGET_FS_CONFIG_GEN := device/samsung/msm8974-common/config.fs +TARGET_FS_CONFIG_GEN := device/samsung/msm8226-common/config.fs # HIDL -DEVICE_MANIFEST_FILE := device/samsung/msm8974-common/manifest.xml -DEVICE_MATRIX_FILE := device/samsung/msm8974-common/compatibility_matrix.xml +DEVICE_MANIFEST_FILE := device/samsung/msm8226-common/manifest.xml +DEVICE_MATRIX_FILE := device/samsung/msm8226-common/compatibility_matrix.xml # SELinux -include device/samsung/msm8974-common/sepolicy/sepolicy.mk +include device/samsung/msm8226-common/sepolicy/sepolicy.mk + +# Shims +TARGET_LD_SHIM_LIBS += \ + /system/lib/libcrypto.so|libboringssl-compat.so # Init -TARGET_INIT_VENDOR_LIB := libinit_msm8974 -TARGET_RECOVERY_DEVICE_MODULES := libinit_msm8974 +TARGET_INIT_VENDOR_LIB := libinit_msm8226 +TARGET_RECOVERY_DEVICE_MODULES := libinit_msm8226 + +# Partitions +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true # Power -TARGET_HAS_LEGACY_POWER_STATS := true +TARGET_HAS_NO_POWER_STATS := true TARGET_HAS_NO_WIFI_STATS := true TARGET_USES_INTERACTION_BOOST := true # Time services BOARD_USES_QC_TIME_SERVICES := true +# Wifi +BOARD_WLAN_DEVICE := qcwcn +BOARD_HAS_QCOM_WLAN := true +BOARD_HAS_QCOM_WLAN_SDK := true +BOARD_HOSTAPD_DRIVER := NL80211 +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) +TARGET_PROVIDES_WCNSS_QMI := true +TARGET_USES_QCOM_WCNSS_QMI := true +TARGET_USES_WCNSS_CTRL := true +WPA_SUPPLICANT_VERSION := VER_0_8_X +WIFI_DRIVER_FW_PATH_STA := "sta" +WIFI_DRIVER_FW_PATH_AP := "ap" + # inherit from the proprietary version --include vendor/samsung/msm8974-common/BoardConfigVendor.mk +-include vendor/samsung/msm8226-common/BoardConfigVendor.mk diff --git a/README b/README index 74d19e0..e536788 100644 --- a/README +++ b/README @@ -1,3 +1,3 @@ Copyright 2012 - The CyanogenMod Project -Common Samsung 8974 repository +Common Samsung 8226 repository diff --git a/camera/Android.mk b/camera/Android.mk new file mode 100644 index 0000000..8581d26 --- /dev/null +++ b/camera/Android.mk @@ -0,0 +1,23 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_C_INCLUDES := \ + system/media/camera/include + +LOCAL_SRC_FILES := \ + CameraWrapper.cpp + +LOCAL_STATIC_LIBRARIES := libbase libarect +LOCAL_SHARED_LIBRARIES := \ + libhardware liblog libcamera_client libutils libcutils libdl libgui libhidltransport libsensor \ + android.hidl.token@1.0-utils \ + android.hardware.graphics.bufferqueue@1.0 + +LOCAL_HEADER_LIBRARIES := libnativebase_headers + +LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM) +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_MODULE_TAGS := optional +LOCAL_PROPRIETARY_MODULE := true + +include $(BUILD_SHARED_LIBRARY) diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp new file mode 100644 index 0000000..a1a8e1f --- /dev/null +++ b/camera/CameraWrapper.cpp @@ -0,0 +1,681 @@ +/* + * Copyright (C) 2013-2016, The CyanogenMod Project + * Copyright (C) 2017, The LineageOS 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. + */ + +/** +* @file CameraWrapper.cpp +* +* This file wraps a vendor camera module. +* +*/ + +#define LOG_NDEBUG 0 + +#define LOG_TAG "CameraWrapper" +#include + +#include +#include +#include +#include +#include +#include + +#define BACK_CAMERA_ID 0 +#define FRONT_CAMERA_ID 1 + +#define OPEN_RETRIES 10 +#define OPEN_RETRY_MSEC 40 + +using namespace android; + +const char KEY_SUPPORTED_ISO_MODES[] = "iso-values"; +const char KEY_SAMSUNG_CAMERA_MODE[] = "cam_mode"; +const char KEY_ISO_MODE[] = "iso"; +const char KEY_ZSL[] = "zsl"; +const char KEY_CAMERA_MODE[] = "camera-mode"; + +static Mutex gCameraWrapperLock; +static camera_module_t* gVendorModule = 0; + +static char** fixed_set_params = NULL; +static camera_notify_callback gUserNotifyCb = NULL; +static camera_data_callback gUserDataCb = NULL; +static camera_data_timestamp_callback gUserDataCbTimestamp = NULL; +static camera_request_memory gUserGetMemory = NULL; +static void *gUserCameraDevice = NULL; + +static int camera_device_open(const hw_module_t* module, const char* name, hw_device_t** device); +static int camera_get_number_of_cameras(void); +static int camera_get_camera_info(int camera_id, struct camera_info* info); +static int camera_send_command(struct camera_device* device, int32_t cmd, int32_t arg1, + int32_t arg2); + +static struct hw_module_methods_t camera_module_methods = { + .open = camera_device_open, +}; + +camera_module_t HAL_MODULE_INFO_SYM = { + .common = + { + .tag = HARDWARE_MODULE_TAG, + .module_api_version = CAMERA_MODULE_API_VERSION_1_0, + .hal_api_version = HARDWARE_HAL_API_VERSION, + .id = CAMERA_HARDWARE_MODULE_ID, + .name = "Samsung msm8226 Camera Wrapper", + .author = "The CyanogenMod Project", + .methods = &camera_module_methods, + .dso = NULL, /* remove compilation warnings */ + .reserved = {0}, /* remove compilation warnings */ + }, + + .get_number_of_cameras = camera_get_number_of_cameras, + .get_camera_info = camera_get_camera_info, + .set_callbacks = NULL, /* remove compilation warnings */ + .get_vendor_tag_ops = NULL, /* remove compilation warnings */ + .open_legacy = NULL, /* remove compilation warnings */ + .set_torch_mode = NULL, /* remove compilation warnings */ + .init = NULL, /* remove compilation warnings */ + .reserved = {0}, /* remove compilation warnings */ +}; + +typedef struct wrapper_camera_device { + camera_device_t base; + int camera_released; + int id; + camera_device_t* vendor; +} wrapper_camera_device_t; + +void camera_notify_cb(int32_t msg_type, int32_t ext1, int32_t ext2, void * /*user*/) { + gUserNotifyCb(msg_type, ext1, ext2, gUserCameraDevice); +} + +void camera_data_cb(int32_t msg_type, const camera_memory_t *data, unsigned int index, + camera_frame_metadata_t *metadata, void * /*user*/) { + gUserDataCb(msg_type, data, index, metadata, gUserCameraDevice); +} + +void camera_data_cb_timestamp(nsecs_t timestamp, int32_t msg_type, + const camera_memory_t *data, unsigned index, void * /*user*/) { + gUserDataCbTimestamp(timestamp, msg_type, data, index, gUserCameraDevice); +} + +camera_memory_t* camera_get_memory(int fd, size_t buf_size, + uint_t num_bufs, void * /*user*/) { + return gUserGetMemory(fd, buf_size, num_bufs, gUserCameraDevice); +} + +#define VENDOR_CALL(device, func, ...) \ + ({ \ + wrapper_camera_device_t* __wrapper_dev = (wrapper_camera_device_t*)device; \ + __wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \ + }) + +#define CAMERA_ID(device) (((wrapper_camera_device_t*)(device))->id) + +static int check_vendor_module() { + int rv = 0; + ALOGV("%s", __FUNCTION__); + + if (gVendorModule) return 0; + + rv = hw_get_module_by_class("camera", "vendor", (const hw_module_t**)&gVendorModule); + if (rv) ALOGE("failed to open vendor camera module"); + return rv; +} + +const static char* iso_values[] = { + "auto," +#ifdef ISO_MODE_50 + "ISO50," +#endif +#ifdef ISO_MODE_HJR + "ISO_HJR," +#endif + "ISO100,ISO200,ISO400,ISO800" +#ifdef ISO_MODE_1600 + ",ISO1600" +#endif +}; + +static char* camera_fixup_getparams(int id, const char* settings) { + CameraParameters params; + params.unflatten(String8(settings)); + +#if !LOG_NDEBUG + ALOGV("%s: original parameters:", __FUNCTION__); + params.dump(); +#endif + + params.set(KEY_SUPPORTED_ISO_MODES, iso_values[id]); + params.set(CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO, "1280x720"); + params.set(CameraParameters::KEY_SUPPORTED_SCENE_MODES, + "auto,asd,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset," + "steadyphoto,fireworks,sports,party,candlelight,backlight,flowers,AR"); + +#if !LOG_NDEBUG + ALOGV("%s: fixed parameters:", __FUNCTION__); + params.dump(); +#endif + + if (id == BACK_CAMERA_ID) { + params.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES, "auto,on,off,torch"); + } + + String8 strParams = params.flatten(); + char* ret = strdup(strParams.string()); + + return ret; +} + +static bool wasVideo = false; + +static char* camera_fixup_setparams(struct camera_device* device, const char* settings) { + int id = CAMERA_ID(device); + CameraParameters params; + params.unflatten(String8(settings)); + const char* camMode = params.get(KEY_SAMSUNG_CAMERA_MODE); + + const char* recordingHint = params.get(CameraParameters::KEY_RECORDING_HINT); + bool isVideo = false; + if (recordingHint) isVideo = !strcmp(recordingHint, "true"); + +#if !LOG_NDEBUG + ALOGV("%s: original parameters:", __FUNCTION__); + params.dump(); +#endif + + if (params.get("iso")) { + const char* isoMode = params.get(KEY_ISO_MODE); + if (strcmp(isoMode, "ISO50") == 0) + params.set(KEY_ISO_MODE, "50"); + else if (strcmp(isoMode, "ISO100") == 0) + params.set(KEY_ISO_MODE, "100"); + else if (strcmp(isoMode, "ISO200") == 0) + params.set(KEY_ISO_MODE, "200"); + else if (strcmp(isoMode, "ISO400") == 0) + params.set(KEY_ISO_MODE, "400"); + else if (strcmp(isoMode, "ISO800") == 0) + params.set(KEY_ISO_MODE, "800"); + else if (strcmp(isoMode, "ISO1600") == 0) + params.set(KEY_ISO_MODE, "1600"); + } + + if (id != 1) { + params.set(KEY_ZSL, isVideo ? "off" : "on"); + params.set(KEY_CAMERA_MODE, isVideo ? "0" : "1"); + } + +#if !LOG_NDEBUG + ALOGV("%s: fixed parameters:", __FUNCTION__); + params.dump(); +#endif + + String8 strParams = params.flatten(); + + if (fixed_set_params[id]) free(fixed_set_params[id]); + fixed_set_params[id] = strdup(strParams.string()); + char* ret = fixed_set_params[id]; + + return ret; +} + +/******************************************************************* + * implementation of camera_device_ops functions + *******************************************************************/ + +static int camera_set_preview_window(struct camera_device* device, + struct preview_stream_ops* window) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, set_preview_window, window); +} + +static void camera_set_callbacks(struct camera_device* device, camera_notify_callback notify_cb, + camera_data_callback data_cb, + camera_data_timestamp_callback data_cb_timestamp, + camera_request_memory get_memory, void* user) { + + if (!device) return; + + gUserNotifyCb = notify_cb; + gUserDataCb = data_cb; + gUserDataCbTimestamp = data_cb_timestamp; + gUserGetMemory = get_memory; + gUserCameraDevice = user; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, set_callbacks, camera_notify_cb, camera_data_cb, + camera_data_cb_timestamp, camera_get_memory, user); + +} + +static void camera_enable_msg_type(struct camera_device* device, int32_t msg_type) { + + if (!device) return; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, enable_msg_type, msg_type); +} + +static void camera_disable_msg_type(struct camera_device* device, int32_t msg_type) { + + if (!device) return; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, disable_msg_type, msg_type); +} + +static int camera_msg_type_enabled(struct camera_device* device, int32_t msg_type) { + + if (!device) return 0; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, msg_type_enabled, msg_type); +} + +static int camera_start_preview(struct camera_device* device) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, start_preview); +} + +static void camera_stop_preview(struct camera_device* device) { + + if (!device) return; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, stop_preview); +} + +static int camera_preview_enabled(struct camera_device* device) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, preview_enabled); +} + +static int camera_store_meta_data_in_buffers(struct camera_device* device, int enable) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, store_meta_data_in_buffers, enable); +} + +static int camera_start_recording(struct camera_device* device) { + + if (!device) return EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, start_recording); +} + +static void camera_stop_recording(struct camera_device* device) { + + if (!device) return; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, stop_recording); +} + +static int camera_recording_enabled(struct camera_device* device) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, recording_enabled); +} + +static void camera_release_recording_frame(struct camera_device* device, const void* opaque) { + + if (!device) return; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, release_recording_frame, opaque); +} + +static int camera_auto_focus(struct camera_device* device) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, auto_focus); +} + +static int camera_cancel_auto_focus(struct camera_device* device) { + int ret = 0; + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + +/* APEXQ/EXPRESS: Calling cancel_auto_focus causes the camera to crash for unknown reasons. + * Disabling it has no adverse effect. For others, only call cancel_auto_focus when the + * preview is enabled. This is needed so some 3rd party camera apps don't lock up. */ +#ifndef DISABLE_AUTOFOCUS + if (camera_preview_enabled(device)) ret = VENDOR_CALL(device, cancel_auto_focus); +#endif + + return ret; +} + +static int camera_take_picture(struct camera_device* device) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, take_picture); +} + +static int camera_cancel_picture(struct camera_device* device) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, cancel_picture); +} + +static int camera_set_parameters(struct camera_device* device, const char* params) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + char* tmp = NULL; + tmp = camera_fixup_setparams(device, params); + + int ret = VENDOR_CALL(device, set_parameters, tmp); + return ret; +} + +static char* camera_get_parameters(struct camera_device* device) { + + if (!device) return NULL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + char* params = VENDOR_CALL(device, get_parameters); + + char* tmp = camera_fixup_getparams(CAMERA_ID(device), params); + VENDOR_CALL(device, put_parameters, params); + params = tmp; + + return params; +} + +static void camera_put_parameters(struct camera_device* device, char* params) { + + if (params) free(params); +} + +static int camera_send_command(struct camera_device* device, int32_t cmd, int32_t arg1, + int32_t arg2) { + + if (!device) return -EINVAL; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + return VENDOR_CALL(device, send_command, cmd, arg1, arg2); +} + +static void camera_release(struct camera_device* device) { + wrapper_camera_device_t* wrapper_dev = NULL; + + if (!device) return; + + wrapper_dev = (wrapper_camera_device_t*) device; + + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + VENDOR_CALL(device, release); + + wrapper_dev->camera_released = true; +} + +static int camera_dump(struct camera_device* device, int fd) { + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + + if (!device) return -EINVAL; + + return VENDOR_CALL(device, dump, fd); +} + +extern "C" void heaptracker_free_leaked_memory(void); + +static int camera_device_close(hw_device_t* device) { + int ret = 0; + wrapper_camera_device_t* wrapper_dev = NULL; + + ALOGV("%s", __FUNCTION__); + + Mutex::Autolock lock(gCameraWrapperLock); + + if (!device) { + ret = -EINVAL; + goto done; + } + + for (int i = 0; i < camera_get_number_of_cameras(); i++) { + if (fixed_set_params[i]) free(fixed_set_params[i]); + } + + wrapper_dev = (wrapper_camera_device_t*)device; + + if (!wrapper_dev->camera_released) { + ALOGI("%s: releasing camera device with id %d", __FUNCTION__, + wrapper_dev->id); + + VENDOR_CALL(wrapper_dev, release); + + wrapper_dev->camera_released = true; + } + + wrapper_dev->vendor->common.close((hw_device_t*)wrapper_dev->vendor); + if (wrapper_dev->base.ops) free(wrapper_dev->base.ops); + free(wrapper_dev); +done: +#ifdef HEAPTRACKER + heaptracker_free_leaked_memory(); +#endif + return ret; +} + +/******************************************************************* + * implementation of camera_module functions + *******************************************************************/ + +/* open device handle to one of the cameras + * + * assume camera service will keep singleton of each camera + * so this function will always only be called once per camera instance + */ + +static int camera_device_open(const hw_module_t* module, const char* name, hw_device_t** device) { + int rv = 0; + int num_cameras = 0; + int cameraid; + wrapper_camera_device_t* camera_device = NULL; + camera_device_ops_t* camera_ops = NULL; + wasVideo = false; + + Mutex::Autolock lock(gCameraWrapperLock); + + ALOGV("%s", __FUNCTION__); + + if (name != NULL) { + if (check_vendor_module()) return -EINVAL; + + cameraid = atoi(name); + num_cameras = gVendorModule->get_number_of_cameras(); + + fixed_set_params = (char**)malloc(sizeof(char*) * num_cameras); + if (!fixed_set_params) { + ALOGE("parameter memory allocation fail"); + rv = -ENOMEM; + goto fail; + } + memset(fixed_set_params, 0, sizeof(char*) * num_cameras); + + if (cameraid > num_cameras) { + ALOGE( + "camera service provided cameraid out of bounds, " + "cameraid = %d, num supported = %d", + cameraid, num_cameras); + rv = -EINVAL; + goto fail; + } + + camera_device = (wrapper_camera_device_t*)malloc(sizeof(*camera_device)); + if (!camera_device) { + ALOGE("camera_device allocation fail"); + rv = -ENOMEM; + goto fail; + } + memset(camera_device, 0, sizeof(*camera_device)); + camera_device->camera_released = false; + camera_device->id = cameraid; + + int retries = OPEN_RETRIES; + bool retry; + do { + rv = gVendorModule->common.methods->open( + (const hw_module_t*)gVendorModule, name, + (hw_device_t**)&(camera_device->vendor)); + retry = --retries > 0 && rv; + if (retry) + usleep(OPEN_RETRY_MSEC * 1000); + } while (retry); + if (rv) { + ALOGE("vendor camera open fail"); + goto fail; + } + + ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__, + (uintptr_t)(camera_device->vendor)); + + camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops)); + if (!camera_ops) { + ALOGE("camera_ops allocation fail"); + rv = -ENOMEM; + goto fail; + } + + memset(camera_ops, 0, sizeof(*camera_ops)); + + camera_device->base.common.tag = HARDWARE_DEVICE_TAG; + camera_device->base.common.version = HARDWARE_DEVICE_API_VERSION(1, 0); + camera_device->base.common.module = (hw_module_t*)(module); + camera_device->base.common.close = camera_device_close; + camera_device->base.ops = camera_ops; + + camera_ops->set_preview_window = camera_set_preview_window; + camera_ops->set_callbacks = camera_set_callbacks; + camera_ops->enable_msg_type = camera_enable_msg_type; + camera_ops->disable_msg_type = camera_disable_msg_type; + camera_ops->msg_type_enabled = camera_msg_type_enabled; + camera_ops->start_preview = camera_start_preview; + camera_ops->stop_preview = camera_stop_preview; + camera_ops->preview_enabled = camera_preview_enabled; + camera_ops->store_meta_data_in_buffers = camera_store_meta_data_in_buffers; + camera_ops->start_recording = camera_start_recording; + camera_ops->stop_recording = camera_stop_recording; + camera_ops->recording_enabled = camera_recording_enabled; + camera_ops->release_recording_frame = camera_release_recording_frame; + camera_ops->auto_focus = camera_auto_focus; + camera_ops->cancel_auto_focus = camera_cancel_auto_focus; + camera_ops->take_picture = camera_take_picture; + camera_ops->cancel_picture = camera_cancel_picture; + camera_ops->set_parameters = camera_set_parameters; + camera_ops->get_parameters = camera_get_parameters; + camera_ops->put_parameters = camera_put_parameters; + camera_ops->send_command = camera_send_command; + camera_ops->release = camera_release; + camera_ops->dump = camera_dump; + + *device = &camera_device->base.common; + } + + return rv; + +fail: + if (camera_device) { + free(camera_device); + camera_device = NULL; + } + if (camera_ops) { + free(camera_ops); + camera_ops = NULL; + } + *device = NULL; + return rv; +} + +static int camera_get_number_of_cameras(void) { + ALOGV("%s", __FUNCTION__); + if (check_vendor_module()) return 0; + return gVendorModule->get_number_of_cameras(); +} + +static int camera_get_camera_info(int camera_id, struct camera_info* info) { + ALOGV("%s", __FUNCTION__); + if (check_vendor_module()) return 0; + return gVendorModule->get_camera_info(camera_id, info); +} diff --git a/common-proprietary-files.txt b/common-proprietary-files.txt index c5fa653..0a6eb96 100644 --- a/common-proprietary-files.txt +++ b/common-proprietary-files.txt @@ -18,9 +18,11 @@ vendor/lib/libllvm-qcom.so|fc96c949b662fb34b287a4c0aa194984fbb57d7d vendor/lib/libsc-a3xx.so|231201bcfead5f930537d2fba22d89b00e673386 vendor/lib/libscale.so|b44f44c633fa404d10e76aaa23593b516e08e2b8 -# Graphics firmware (same everywhere, so lets say Samsung G900FXXS1CQI4_G900FPHN1CQI2_PHN) -vendor/firmware/a330_pfp.fw|3e2fcee7276ded819cf2d95864fdd6788a484ee1 -vendor/firmware/a330_pm4.fw|ae739ea812f9e4462d7bba8b9ead5782d4496618 +# Graphics firmware (Samsung Galaxy S5 Mini G800HXXU1CQC1_G800HXEO1CQB1) +etc/firmware/a330_pfp.fw +etc/firmware/a330_pm4.fw +etc/firmware/a330_pfp.fw +etc/firmware/a330_pm4.fw # GPS (OnePlus bacon - lineage-14.1-20170807-nightly-bacon-signed.zip) vendor/lib/libloc_api_v02.so|9a8401afc86b54e73aa29995f228fd0243cee793 diff --git a/configs/media_codecs.xml b/configs/media_codecs.xml index 798fa4f..6e8412f 100644 --- a/configs/media_codecs.xml +++ b/configs/media_codecs.xml @@ -1,8 +1,9 @@ - - @@ -52,16 +50,25 @@ + + + + + + + + + - + - - + + @@ -72,7 +79,7 @@ - + @@ -86,43 +93,51 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - + + - + @@ -131,30 +146,18 @@ - + - - - - - - - - - - - - - - + + @@ -175,10 +178,10 @@ - - + + - + @@ -189,7 +192,7 @@ - + @@ -200,7 +203,7 @@ - + @@ -211,19 +214,32 @@ - + - + - + + + + + + + + + + + + - + + + diff --git a/configs/wifi/hostapd_default.conf b/configs/wifi/hostapd_default.conf new file mode 100644 index 0000000..915ceff --- /dev/null +++ b/configs/wifi/hostapd_default.conf @@ -0,0 +1,1043 @@ +##### hostapd configuration file ############################################## +# Empty lines and lines starting with # are ignored + +# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for +# management frames); ath0 for madwifi +interface=wlan0 + +# In case of madwifi and nl80211 driver interfaces, an additional configuration +# parameter, bridge, must be used to notify hostapd if the interface is +# included in a bridge. This parameter is not used with Host AP driver. +#bridge=br0 + +# Driver interface type (hostap/wired/madwifi/prism54/test/none/nl80211/bsd); +# default: hostap). nl80211 is used with all Linux mac80211 drivers. +# Use driver=none if building hostapd as a standalone RADIUS server that does +# not control any wireless/wired driver. +driver=nl80211 + +# hostapd event logger configuration +# +# Two output method: syslog and stdout (only usable if not forking to +# background). +# +# Module bitfield (ORed bitfield of modules that will be logged; -1 = all +# modules): +# bit 0 (1) = IEEE 802.11 +# bit 1 (2) = IEEE 802.1X +# bit 2 (4) = RADIUS +# bit 3 (8) = WPA +# bit 4 (16) = driver interface +# bit 5 (32) = IAPP +# bit 6 (64) = MLME +# +# Levels (minimum value for logged events): +# 0 = verbose debugging +# 1 = debugging +# 2 = informational messages +# 3 = notification +# 4 = warning +# +logger_syslog=-1 +logger_syslog_level=2 +logger_stdout=-1 +logger_stdout_level=2 + +# Dump file for state information (on SIGUSR1) +dump_file=/tmp/hostapd.dump + +# Interface for separate control program. If this is specified, hostapd +# will create this directory and a UNIX domain socket for listening to requests +# from external programs (CLI/GUI, etc.) for status information and +# configuration. The socket file will be named based on the interface name, so +# multiple hostapd processes/interfaces can be run at the same time if more +# than one interface is used. +# /var/run/hostapd is the recommended directory for sockets and by default, +# hostapd_cli will use it when trying to connect with hostapd. +ctrl_interface=/data/misc/wifi/hostapd + + +# Access control for the control interface can be configured by setting the +# directory to allow only members of a group to use sockets. This way, it is +# possible to run hostapd as root (since it needs to change network +# configuration and open raw sockets) and still allow GUI/CLI components to be +# run as non-root users. However, since the control interface can be used to +# change the network configuration, this access needs to be protected in many +# cases. By default, hostapd is configured to use gid 0 (root). If you +# want to allow non-root users to use the contron interface, add a new group +# and change this value to match with that group. Add users that should have +# control interface access to this group. +# +# This variable can be a group name or gid. +#ctrl_interface_group=wheel +#ctrl_interface_group=0 + + +##### IEEE 802.11 related configuration ####################################### + +# SSID to be used in IEEE 802.11 management frames +ssid=QualcommSoftAP + +# Country code (ISO/IEC 3166-1). Used to set regulatory domain. +# Set as needed to indicate country in which device is operating. +# This can limit available channels and transmit power. +#country_code=US + +# Enable IEEE 802.11d. This advertises the country_code and the set of allowed +# channels and transmit power levels based on the regulatory limits. The +# country_code setting must be configured with the correct country for +# IEEE 802.11d functions. +# (default: 0 = disabled) +#ieee80211d=1 + +# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g, +# n = IEEE 802.11n, g_only = IEEE 802.11g_only, n_only = IEEE 802.11n_only, +# Default: IEEE 802.11n +hw_mode=g + +# Channel number (IEEE 802.11) +# (default: 0, i.e., not set) +# Please note that some drivers (e.g., madwifi) do not use this value from +# hostapd and the channel will need to be configuration separately with +# iwconfig. +channel=6 + +# Beacon interval in kus (1.024 ms) (default: 100; range 15..65535) +beacon_int=100 + +# DTIM (delivery trafic information message) period (range 1..255): +# number of beacons between DTIMs (1 = every beacon includes DTIM element) +# (default: 2) +dtim_period=2 + +# Maximum number of stations allowed in station table. New stations will be +# rejected after the station table is full. IEEE 802.11 has a limit of 2007 +# different association IDs, so this number should not be larger than that. +# (default: 2007) +max_num_sta=255 + +# RTS/CTS threshold; 2347 = disabled (default); range 0..2347 +# If this field is not included in hostapd.conf, hostapd will not control +# RTS threshold and 'iwconfig wlan# rts ' can be used to set it. +#rts_threshold=2347 + +# Fragmentation threshold; 2346 = disabled (default); range 256..2346 +# If this field is not included in hostapd.conf, hostapd will not control +# fragmentation threshold and 'iwconfig wlan# frag ' can be used to set +# it. +#fragm_threshold=2346 + +# Rate configuration +# Default is to enable all rates supported by the hardware. This configuration +# item allows this list be filtered so that only the listed rates will be left +# in the list. If the list is empty, all rates are used. This list can have +# entries that are not in the list of rates the hardware supports (such entries +# are ignored). The entries in this list are in 100 kbps, i.e., 11 Mbps = 110. +# If this item is present, at least one rate have to be matching with the rates +# hardware supports. +# default: use the most common supported rate setting for the selected +# hw_mode (i.e., this line can be removed from configuration file in most +# cases) +#supported_rates=10 20 55 110 60 90 120 180 240 360 480 540 + +# Basic rate set configuration +# List of rates (in 100 kbps) that are included in the basic rate set. +# If this item is not included, usually reasonable default set is used. +# This basic rates set is currently used for g-only profile +#basic_rates=60 + +# Short Preamble +# This parameter can be used to enable optional use of short preamble for +# frames sent at 2 Mbps, 5.5 Mbps, and 11 Mbps to improve network performance. +# This applies only to IEEE 802.11b-compatible networks and this should only be +# enabled if the local hardware supports use of short preamble. If any of the +# associated STAs do not support short preamble, use of short preamble will be +# disabled (and enabled when such STAs disassociate) dynamically. +# 0 = do not allow use of short preamble (default) +# 1 = allow use of short preamble +#preamble=1 + +# Station MAC address -based authentication +# Please note that this kind of access control requires a driver that uses +# hostapd to take care of management frame processing and as such, this can be +# used with driver=hostap or driver=nl80211, but not with driver=madwifi. +# 0 = accept unless in deny list +# 1 = deny unless in accept list +# 2 = use external RADIUS server (accept/deny lists are searched first) +macaddr_acl=0 + +# Accept/deny lists are read from separate files (containing list of +# MAC addresses, one per line). Use absolute path name to make sure that the +# files can be read on SIGHUP configuration reloads. +accept_mac_file=/data/misc/wifi/hostapd.accept +deny_mac_file=/data/misc/wifi/hostapd.deny + +# IEEE 802.11 specifies two authentication algorithms. hostapd can be +# configured to allow both of these or only one. Open system authentication +# should be used with IEEE 802.1X. +# Bit fields of allowed authentication algorithms: +# bit 0 = Open System Authentication +# bit 1 = Shared Key Authentication (requires WEP) +auth_algs=3 + +# Send empty SSID in beacons and ignore probe request frames that do not +# specify full SSID, i.e., require stations to know SSID. +# default: disabled (0) +# 1 = send empty (length=0) SSID in beacon and ignore probe request for +# broadcast SSID +# 2 = clear SSID (ASCII 0), but keep the original length (this may be required +# with some clients that do not support empty SSID) and ignore probe +# requests for broadcast SSID +ignore_broadcast_ssid=0 + +# TX queue parameters (EDCF / bursting) +# default for all these fields: not set, use hardware defaults +# tx_queue__ +# queues: data0, data1, data2, data3, after_beacon, beacon +# (data0 is the highest priority queue) +# parameters: +# aifs: AIFS (default 2) +# cwmin: cwMin (1, 3, 7, 15, 31, 63, 127, 255, 511, 1023) +# cwmax: cwMax (1, 3, 7, 15, 31, 63, 127, 255, 511, 1023); cwMax >= cwMin +# burst: maximum length (in milliseconds with precision of up to 0.1 ms) for +# bursting +# +# Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e): +# These parameters are used by the access point when transmitting frames +# to the clients. +# +# Low priority / AC_BK = background +#tx_queue_data3_aifs=7 +#tx_queue_data3_cwmin=15 +#tx_queue_data3_cwmax=1023 +#tx_queue_data3_burst=0 +# Note: for IEEE 802.11b mode: cWmin=31 cWmax=1023 burst=0 +# +# Normal priority / AC_BE = best effort +#tx_queue_data2_aifs=3 +#tx_queue_data2_cwmin=15 +#tx_queue_data2_cwmax=63 +#tx_queue_data2_burst=0 +# Note: for IEEE 802.11b mode: cWmin=31 cWmax=127 burst=0 +# +# High priority / AC_VI = video +#tx_queue_data1_aifs=1 +#tx_queue_data1_cwmin=7 +#tx_queue_data1_cwmax=15 +#tx_queue_data1_burst=3.0 +# Note: for IEEE 802.11b mode: cWmin=15 cWmax=31 burst=6.0 +# +# Highest priority / AC_VO = voice +#tx_queue_data0_aifs=1 +#tx_queue_data0_cwmin=3 +#tx_queue_data0_cwmax=7 +#tx_queue_data0_burst=1.5 +# Note: for IEEE 802.11b mode: cWmin=7 cWmax=15 burst=3.3 +# +# Special queues; normally not user configurable +# +#tx_queue_after_beacon_aifs=2 +#tx_queue_after_beacon_cwmin=15 +#tx_queue_after_beacon_cwmax=1023 +#tx_queue_after_beacon_burst=0 +# +#tx_queue_beacon_aifs=2 +#tx_queue_beacon_cwmin=3 +#tx_queue_beacon_cwmax=7 +#tx_queue_beacon_burst=1.5 + +# 802.1D Tag (= UP) to AC mappings +# WMM specifies following mapping of data frames to different ACs. This mapping +# can be configured using Linux QoS/tc and sch_pktpri.o module. +# 802.1D Tag 802.1D Designation Access Category WMM Designation +# 1 BK AC_BK Background +# 2 - AC_BK Background +# 0 BE AC_BE Best Effort +# 3 EE AC_BE Best Effort +# 4 CL AC_VI Video +# 5 VI AC_VI Video +# 6 VO AC_VO Voice +# 7 NC AC_VO Voice +# Data frames with no priority information: AC_BE +# Management frames: AC_VO +# PS-Poll frames: AC_BE + +# Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e): +# for 802.11a or 802.11g networks +# These parameters are sent to WMM clients when they associate. +# The parameters will be used by WMM clients for frames transmitted to the +# access point. +# +# note - txop_limit is in units of 32microseconds +# note - acm is admission control mandatory flag. 0 = admission control not +# required, 1 = mandatory +# note - here cwMin and cmMax are in exponent form. the actual cw value used +# will be (2^n)-1 where n is the value given here +# +wmm_enabled=1 +# +# Low priority / AC_BK = background +wmm_ac_bk_cwmin=4 +wmm_ac_bk_cwmax=10 +wmm_ac_bk_aifs=7 +wmm_ac_bk_txop_limit=0 +wmm_ac_bk_acm=0 +# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10 +# +# Normal priority / AC_BE = best effort +wmm_ac_be_aifs=3 +wmm_ac_be_cwmin=4 +wmm_ac_be_cwmax=10 +wmm_ac_be_txop_limit=0 +wmm_ac_be_acm=0 +# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7 +# +# High priority / AC_VI = video +wmm_ac_vi_aifs=2 +wmm_ac_vi_cwmin=3 +wmm_ac_vi_cwmax=4 +wmm_ac_vi_txop_limit=94 +wmm_ac_vi_acm=0 +# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188 +# +# Highest priority / AC_VO = voice +wmm_ac_vo_aifs=2 +wmm_ac_vo_cwmin=2 +wmm_ac_vo_cwmax=3 +wmm_ac_vo_txop_limit=47 +wmm_ac_vo_acm=0 +# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102 + +# Static WEP key configuration +# +# The key number to use when transmitting. +# It must be between 0 and 3, and the corresponding key must be set. +# default: not set +#wep_default_key=0 +# The WEP keys to use. +# A key may be a quoted string or unquoted hexadecimal digits. +# The key length should be 5, 13, or 16 characters, or 10, 26, or 32 +# digits, depending on whether 40-bit (64-bit), 104-bit (128-bit), or +# 128-bit (152-bit) WEP is used. +# Only the default key must be supplied; the others are optional. +# default: not set +#wep_key0=1234567890 +#wep_key1=1234567890 +#wep_key2=1234567890 +#wep_key3=1234567890 + +# Station inactivity limit +# +# If a station does not send anything in ap_max_inactivity seconds, an +# empty data frame is sent to it in order to verify whether it is +# still in range. If this frame is not ACKed, the station will be +# disassociated and then deauthenticated. This feature is used to +# clear station table of old entries when the STAs move out of the +# range. +# +# The station can associate again with the AP if it is still in range; +# this inactivity poll is just used as a nicer way of verifying +# inactivity; i.e., client will not report broken connection because +# disassociation frame is not sent immediately without first polling +# the STA with a data frame. +# default: 300 (i.e., 5 minutes) +#ap_max_inactivity=300 + +# Enable/disable internal bridge for packets between associated stations. +# +# When IEEE 802.11 is used in managed mode, packets are usually send through +# the AP even if they are from a wireless station to another wireless station. +# This functionality requires that the AP has a bridge functionality that sends +# frames back to the same interface if their destination is another associated +# station. In addition, broadcast/multicast frames from wireless stations will +# be sent both to the host system net stack (e.g., to eventually wired network) +# and back to the wireless interface. +# +# The internal bridge is implemented within the wireless kernel module and it +# bypasses kernel filtering (netfilter/iptables/ebtables). If direct +# communication between the stations needs to be prevented, the internal +# bridge can be disabled by setting bridge_packets=0. +# +# Note: If this variable is not included in hostapd.conf, hostapd does not +# change the configuration and iwpriv can be used to set the value with +# 'iwpriv wlan# param 10 0' command. If the variable is in hostapd.conf, +# hostapd will override possible iwpriv configuration whenever configuration +# file is reloaded. +# +# default: do not control from hostapd (80211.o defaults to 1=enabled) +#bridge_packets=1 + +# Maximum allowed Listen Interval (how many Beacon periods STAs are allowed to +# remain asleep). Default: 65535 (no limit apart from field size) +#max_listen_interval=100 + +# Client isolation can be used to prevent low-level bridging of frames between +# associated stations in the BSS. By default, this bridging is allowed. +#ap_isolate=1 + +##### IEEE 802.11n related configuration ###################################### + +# ieee80211n: Whether IEEE 802.11n (HT) is enabled +# 0 = disabled (default) +# 1 = enabled +# Note: You will also need to enable WMM for full HT functionality. +ieee80211n=1 + +#require_ht=1 + +# ht_capab: HT capabilities (list of flags) +# LDPC coding capability: [LDPC] = supported +# Supported channel width set: [HT40-] = both 20 MHz and 40 MHz with secondary +# channel below the primary channel; [HT40+] = both 20 MHz and 40 MHz +# with secondary channel below the primary channel +# (20 MHz only if neither is set) +# Note: There are limits on which channels can be used with HT40- and +# HT40+. Following table shows the channels that may be available for +# HT40- and HT40+ use per IEEE 802.11n Annex J: +# freq HT40- HT40+ +# 2.4 GHz 5-13 1-7 (1-9 in Europe/Japan) +# 5 GHz 40,48,56,64 36,44,52,60 +# (depending on the location, not all of these channels may be available +# for use) +# Spatial Multiplexing (SM) Power Save: [SMPS-STATIC] or [SMPS-DYNAMIC] +# (SMPS disabled if neither is set) +# HT-greenfield: [GF] (disabled if not set) +# Short GI for 20 MHz: [SHORT-GI-20] (disabled if not set) +# Short GI for 40 MHz: [SHORT-GI-40] (disabled if not set) +# Tx STBC: [TX-STBC] (disabled if not set) +# Rx STBC: [RX-STBC1] (one spatial stream), [RX-STBC12] (one or two spatial +# streams), or [RX-STBC123] (one, two, or three spatial streams); Rx STBC +# disabled if none of these set +# HT-delayed Block Ack: [DELAYED-BA] (disabled if not set) +# Maximum A-MSDU length: [MAX-AMSDU-7935] for 7935 octets (3839 octets if not +# set) +# DSSS/CCK Mode in 40 MHz: [DSSS_CCK-40] = allowed (not allowed if not set) +# PSMP support: [PSMP] (disabled if not set) +# L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set) +# QcHostapd: +# LOWER byte for associated stations +# UPPER byte for overlapping stations +# each byte will have the following info +# bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 +# OBSS RIFS LSIG_TXOP NON_GF HT20 FROM_11G FROM_11B FROM_11A +# bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 +# OBSS RIFS LSIG_TXOP NON_GF HT_20 FROM_11G FROM_11B FROM_11A +#ht_capab=[HT40-] [SHORT-GI-20] [SHORT-GI-40] +ht_capab=[SHORT-GI-20] [GF] [DSSS_CCK-40] [LSIG-TXOP-PROT] +#ht_capab=[LDPC] [HT40-] [HT40+] [SMPS-STATIC] [SMPS-DYNAMIC] [GF] [SHORT-GI-20] [SHORT-GI-40] [TX-STBC] [RX-STBC1] [RX-STBC12] [RX-STBC123] [DELAYED-BA] [MAX-AMSDU-7935] [DSSS_CCK-40] [PSMP] [LSIG-TXOP-PROT] + +##### IEEE 802.1X-2004 related configuration ################################## + +# Require IEEE 802.1X authorization +#ieee8021x=1 + +# IEEE 802.1X/EAPOL version +# hostapd is implemented based on IEEE Std 802.1X-2004 which defines EAPOL +# version 2. However, there are many client implementations that do not handle +# the new version number correctly (they seem to drop the frames completely). +# In order to make hostapd interoperate with these clients, the version number +# can be set to the older version (1) with this configuration value. +#eapol_version=2 + +# Optional displayable message sent with EAP Request-Identity. The first \0 +# in this string will be converted to ASCII-0 (nul). This can be used to +# separate network info (comma separated list of attribute=value pairs); see, +# e.g., RFC 4284. +#eap_message=hello +#eap_message=hello\0networkid=netw,nasid=foo,portid=0,NAIRealms=example.com + +# WEP rekeying (disabled if key lengths are not set or are set to 0) +# Key lengths for default/broadcast and individual/unicast keys: +# 5 = 40-bit WEP (also known as 64-bit WEP with 40 secret bits) +# 13 = 104-bit WEP (also known as 128-bit WEP with 104 secret bits) +#wep_key_len_broadcast=5 +#wep_key_len_unicast=5 +# Rekeying period in seconds. 0 = do not rekey (i.e., set keys only once) +#wep_rekey_period=300 + +# EAPOL-Key index workaround (set bit7) for WinXP Supplicant (needed only if +# only broadcast keys are used) +eapol_key_index_workaround=0 + +# EAP reauthentication period in seconds (default: 3600 seconds; 0 = disable +# reauthentication). +#eap_reauth_period=3600 + +# Use PAE group address (01:80:c2:00:00:03) instead of individual target +# address when sending EAPOL frames with driver=wired. This is the most common +# mechanism used in wired authentication, but it also requires that the port +# is only used by one station. +#use_pae_group_addr=1 + +##### Integrated EAP server ################################################### + +# Optionally, hostapd can be configured to use an integrated EAP server +# to process EAP authentication locally without need for an external RADIUS +# server. This functionality can be used both as a local authentication server +# for IEEE 802.1X/EAPOL and as a RADIUS server for other devices. + +# Use integrated EAP server instead of external RADIUS authentication +# server. This is also needed if hostapd is configured to act as a RADIUS +# authentication server. +eap_server=1 + +# Path for EAP server user database +#eap_user_file=/etc/hostapd.eap_user + +# CA certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS +#ca_cert=/etc/hostapd.ca.pem + +# Server certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS +#server_cert=/etc/hostapd.server.pem + +# Private key matching with the server certificate for EAP-TLS/PEAP/TTLS +# This may point to the same file as server_cert if both certificate and key +# are included in a single file. PKCS#12 (PFX) file (.p12/.pfx) can also be +# used by commenting out server_cert and specifying the PFX file as the +# private_key. +#private_key=/etc/hostapd.server.prv + +# Passphrase for private key +#private_key_passwd=secret passphrase + +# Enable CRL verification. +# Note: hostapd does not yet support CRL downloading based on CDP. Thus, a +# valid CRL signed by the CA is required to be included in the ca_cert file. +# This can be done by using PEM format for CA certificate and CRL and +# concatenating these into one file. Whenever CRL changes, hostapd needs to be +# restarted to take the new CRL into use. +# 0 = do not verify CRLs (default) +# 1 = check the CRL of the user certificate +# 2 = check all CRLs in the certificate path +#check_crl=1 + +# dh_file: File path to DH/DSA parameters file (in PEM format) +# This is an optional configuration file for setting parameters for an +# ephemeral DH key exchange. In most cases, the default RSA authentication does +# not use this configuration. However, it is possible setup RSA to use +# ephemeral DH key exchange. In addition, ciphers with DSA keys always use +# ephemeral DH keys. This can be used to achieve forward secrecy. If the file +# is in DSA parameters format, it will be automatically converted into DH +# params. This parameter is required if anonymous EAP-FAST is used. +# You can generate DH parameters file with OpenSSL, e.g., +# "openssl dhparam -out /etc/hostapd.dh.pem 1024" +#dh_file=/etc/hostapd.dh.pem + +# Configuration data for EAP-SIM database/authentication gateway interface. +# This is a text string in implementation specific format. The example +# implementation in eap_sim_db.c uses this as the UNIX domain socket name for +# the HLR/AuC gateway (e.g., hlr_auc_gw). In this case, the path uses "unix:" +# prefix. +#eap_sim_db=unix:/tmp/hlr_auc_gw.sock + +# Encryption key for EAP-FAST PAC-Opaque values. This key must be a secret, +# random value. It is configured as a 16-octet value in hex format. It can be +# generated, e.g., with the following command: +# od -tx1 -v -N16 /dev/random | colrm 1 8 | tr -d ' ' +#pac_opaque_encr_key=000102030405060708090a0b0c0d0e0f + +# EAP-FAST authority identity (A-ID) +# A-ID indicates the identity of the authority that issues PACs. The A-ID +# should be unique across all issuing servers. In theory, this is a variable +# length field, but due to some existing implementations required A-ID to be +# 16 octets in length, it is strongly recommended to use that length for the +# field to provided interoperability with deployed peer implementation. This +# field is configured in hex format. +#eap_fast_a_id=101112131415161718191a1b1c1d1e1f + +# EAP-FAST authority identifier information (A-ID-Info) +# This is a user-friendly name for the A-ID. For example, the enterprise name +# and server name in a human-readable format. This field is encoded as UTF-8. +#eap_fast_a_id_info=test server + +# Enable/disable different EAP-FAST provisioning modes: +#0 = provisioning disabled +#1 = only anonymous provisioning allowed +#2 = only authenticated provisioning allowed +#3 = both provisioning modes allowed (default) +#eap_fast_prov=3 + +# EAP-FAST PAC-Key lifetime in seconds (hard limit) +#pac_key_lifetime=604800 + +# EAP-FAST PAC-Key refresh time in seconds (soft limit on remaining hard +# limit). The server will generate a new PAC-Key when this number of seconds +# (or fewer) of the lifetime remains. +#pac_key_refresh_time=86400 + +# EAP-SIM and EAP-AKA protected success/failure indication using AT_RESULT_IND +# (default: 0 = disabled). +#eap_sim_aka_result_ind=1 + +# Trusted Network Connect (TNC) +# If enabled, TNC validation will be required before the peer is allowed to +# connect. Note: This is only used with EAP-TTLS and EAP-FAST. If any other +# EAP method is enabled, the peer will be allowed to connect without TNC. +#tnc=1 + + +##### IEEE 802.11f - Inter-Access Point Protocol (IAPP) ####################### + +# Interface to be used for IAPP broadcast packets +#iapp_interface=eth0 + + +##### RADIUS client configuration ############################################# +# for IEEE 802.1X with external Authentication Server, IEEE 802.11 +# authentication with external ACL for MAC addresses, and accounting + +# The own IP address of the access point (used as NAS-IP-Address) +own_ip_addr=127.0.0.1 + +# Optional NAS-Identifier string for RADIUS messages. When used, this should be +# a unique to the NAS within the scope of the RADIUS server. For example, a +# fully qualified domain name can be used here. +# When using IEEE 802.11r, nas_identifier must be set and must be between 1 and +# 48 octets long. +#nas_identifier=ap.example.com + +# RADIUS authentication server +#auth_server_addr=127.0.0.1 +#auth_server_port=1812 +#auth_server_shared_secret=secret + +# RADIUS accounting server +#acct_server_addr=127.0.0.1 +#acct_server_port=1813 +#acct_server_shared_secret=secret + +# Secondary RADIUS servers; to be used if primary one does not reply to +# RADIUS packets. These are optional and there can be more than one secondary +# server listed. +#auth_server_addr=127.0.0.2 +#auth_server_port=1812 +#auth_server_shared_secret=secret2 +# +#acct_server_addr=127.0.0.2 +#acct_server_port=1813 +#acct_server_shared_secret=secret2 + +# Retry interval for trying to return to the primary RADIUS server (in +# seconds). RADIUS client code will automatically try to use the next server +# when the current server is not replying to requests. If this interval is set, +# primary server will be retried after configured amount of time even if the +# currently used secondary server is still working. +#radius_retry_primary_interval=600 + + +# Interim accounting update interval +# If this is set (larger than 0) and acct_server is configured, hostapd will +# send interim accounting updates every N seconds. Note: if set, this overrides +# possible Acct-Interim-Interval attribute in Access-Accept message. Thus, this +# value should not be configured in hostapd.conf, if RADIUS server is used to +# control the interim interval. +# This value should not be less 600 (10 minutes) and must not be less than +# 60 (1 minute). +#radius_acct_interim_interval=600 + +# Dynamic VLAN mode; allow RADIUS authentication server to decide which VLAN +# is used for the stations. This information is parsed from following RADIUS +# attributes based on RFC 3580 and RFC 2868: Tunnel-Type (value 13 = VLAN), +# Tunnel-Medium-Type (value 6 = IEEE 802), Tunnel-Private-Group-ID (value +# VLANID as a string). vlan_file option below must be configured if dynamic +# VLANs are used. Optionally, the local MAC ACL list (accept_mac_file) can be +# used to set static client MAC address to VLAN ID mapping. +# 0 = disabled (default) +# 1 = option; use default interface if RADIUS server does not include VLAN ID +# 2 = required; reject authentication if RADIUS server does not include VLAN ID +#dynamic_vlan=0 + +# VLAN interface list for dynamic VLAN mode is read from a separate text file. +# This list is used to map VLAN ID from the RADIUS server to a network +# interface. Each station is bound to one interface in the same way as with +# multiple BSSIDs or SSIDs. Each line in this text file is defining a new +# interface and the line must include VLAN ID and interface name separated by +# white space (space or tab). +#vlan_file=/etc/hostapd.vlan + +# Interface where 802.1q tagged packets should appear when a RADIUS server is +# used to determine which VLAN a station is on. hostapd creates a bridge for +# each VLAN. Then hostapd adds a VLAN interface (associated with the interface +# indicated by 'vlan_tagged_interface') and the appropriate wireless interface +# to the bridge. +#vlan_tagged_interface=eth0 + + +##### RADIUS authentication server configuration ############################## + +# hostapd can be used as a RADIUS authentication server for other hosts. This +# requires that the integrated EAP server is also enabled and both +# authentication services are sharing the same configuration. + +# File name of the RADIUS clients configuration for the RADIUS server. If this +# commented out, RADIUS server is disabled. +#radius_server_clients=/etc/hostapd.radius_clients + +# The UDP port number for the RADIUS authentication server +#radius_server_auth_port=1812 + +# Use IPv6 with RADIUS server (IPv4 will also be supported using IPv6 API) +#radius_server_ipv6=1 + + +##### WPA/IEEE 802.11i configuration ########################################## + +# Enable WPA. Setting this variable configures the AP to require WPA (either +# WPA-PSK or WPA-RADIUS/EAP based on other configuration). For WPA-PSK, either +# wpa_psk or wpa_passphrase must be set and wpa_key_mgmt must include WPA-PSK. +# For WPA-RADIUS/EAP, ieee8021x must be set (but without dynamic WEP keys), +# RADIUS authentication server must be configured, and WPA-EAP must be included +# in wpa_key_mgmt. +# This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0) +# and/or WPA2 (full IEEE 802.11i/RSN): +# bit0 = WPA +# bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled) +#wpa=1 + +# WPA pre-shared keys for WPA-PSK. This can be either entered as a 256-bit +# secret in hex format (64 hex digits), wpa_psk, or as an ASCII passphrase +# (8..63 characters) that will be converted to PSK. This conversion uses SSID +# so the PSK changes when ASCII passphrase is used and the SSID is changed. +# wpa_psk (dot11RSNAConfigPSKValue) +# wpa_passphrase (dot11RSNAConfigPSKPassPhrase) +#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef +#wpa_passphrase=qualcomm + +# Optionally, WPA PSKs can be read from a separate text file (containing list +# of (PSK,MAC address) pairs. This allows more than one PSK to be configured. +# Use absolute path name to make sure that the files can be read on SIGHUP +# configuration reloads. +#wpa_psk_file=/etc/hostapd.wpa_psk + +# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The +# entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be +# added to enable SHA256-based stronger algorithms. +# (dot11RSNAConfigAuthenticationSuitesTable) +#wpa_key_mgmt=WPA-PSK +#wpa_key_mgmt=WPA-EAP + +# Set of accepted cipher suites (encryption algorithms) for pairwise keys +# (unicast packets). This is a space separated list of algorithms: +# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] +# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] +# Group cipher suite (encryption algorithm for broadcast and multicast frames) +# is automatically selected based on this configuration. If only CCMP is +# allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise, +# TKIP will be used as the group cipher. +# (dot11RSNAConfigPairwiseCiphersTable) +# Pairwise cipher for WPA (v1) (default: TKIP) +#wpa_pairwise=TKIP CCMP +# Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value) +#rsn_pairwise=CCMP + +# Time interval for rekeying GTK (broadcast/multicast encryption keys) in +# seconds. (dot11RSNAConfigGroupRekeyTime) +wpa_group_rekey=86400 + +# Rekey GTK when any STA that possesses the current GTK is leaving the BSS. +# (dot11RSNAConfigGroupRekeyStrict) +#wpa_strict_rekey=1 + +# Time interval for rekeying GMK (master key used internally to generate GTKs +# (in seconds). +#wpa_gmk_rekey=86400 + +# Maximum lifetime for PTK in seconds. This can be used to enforce rekeying of +# PTK to mitigate some attacks against TKIP deficiencies. +#wpa_ptk_rekey=600 + +# Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up +# roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN +# authentication and key handshake before actually associating with a new AP. +# (dot11RSNAPreauthenticationEnabled) +#rsn_preauth=1 +# +# Space separated list of interfaces from which pre-authentication frames are +# accepted (e.g., 'eth0' or 'eth0 wlan0wds0'. This list should include all +# interface that are used for connections to other APs. This could include +# wired interfaces and WDS links. The normal wireless data interface towards +# associated stations (e.g., wlan0) should not be added, since +# pre-authentication is only used with APs other than the currently associated +# one. +#rsn_preauth_interfaces=eth0 + +# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e) is +# allowed. This is only used with RSN/WPA2. +# 0 = disabled (default) +# 1 = enabled +#peerkey=1 + +# ieee80211w: Whether management frame protection (MFP) is enabled +# 0 = disabled (default) +# 1 = optional +# 2 = required +#ieee80211w=0 + +# Association SA Query maximum timeout (in TU = 1.024 ms; for MFP) +# (maximum time to wait for a SA Query response) +# dot11AssociationSAQueryMaximumTimeout, 1...4294967295 +#assoc_sa_query_max_timeout=1000 + +# Association SA Query retry timeout (in TU = 1.024 ms; for MFP) +# (time between two subsequent SA Query requests) +# dot11AssociationSAQueryRetryTimeout, 1...4294967295 +#assoc_sa_query_retry_timeout=201 + + +# okc: Opportunistic Key Caching (aka Proactive Key Caching) +# Allow PMK cache to be shared opportunistically among configured interfaces +# and BSSes (i.e., all configurations within a single hostapd process). +# 0 = disabled (default) +# 1 = enabled +#okc=1 + + +##### IEEE 802.11r configuration ############################################## + +# Mobility Domain identifier (dot11FTMobilityDomainID, MDID) +# MDID is used to indicate a group of APs (within an ESS, i.e., sharing the +# same SSID) between which a STA can use Fast BSS Transition. +# 2-octet identifier as a hex string. +#mobility_domain=a1b2 + +# PMK-R0 Key Holder identifier (dot11FTR0KeyHolderID) +# 1 to 48 octet identifier. +# This is configured with nas_identifier (see RADIUS client section above). + +# Default lifetime of the PMK-RO in minutes; range 1..65535 +# (dot11FTR0KeyLifetime) +#r0_key_lifetime=10000 + +# PMK-R1 Key Holder identifier (dot11FTR1KeyHolderID) +# 6-octet identifier as a hex string. +#r1_key_holder=000102030405 + +# Reassociation deadline in time units (TUs / 1.024 ms; range 1000..65535) +# (dot11FTReassociationDeadline) +#reassociation_deadline=1000 + +# List of R0KHs in the same Mobility Domain +# format: <128-bit key as hex string> +# This list is used to map R0KH-ID (NAS Identifier) to a destination MAC +# address when requesting PMK-R1 key from the R0KH that the STA used during the +# Initial Mobility Domain Association. +#r0kh=02:01:02:03:04:05 r0kh-1.example.com 000102030405060708090a0b0c0d0e0f +#r0kh=02:01:02:03:04:06 r0kh-2.example.com 00112233445566778899aabbccddeeff +# And so on.. One line per R0KH. + +# List of R1KHs in the same Mobility Domain +# format: <128-bit key as hex string> +# This list is used to map R1KH-ID to a destination MAC address when sending +# PMK-R1 key from the R0KH. This is also the list of authorized R1KHs in the MD +# that can request PMK-R1 keys. +#r1kh=02:01:02:03:04:05 02:11:22:33:44:55 000102030405060708090a0b0c0d0e0f +#r1kh=02:01:02:03:04:06 02:11:22:33:44:66 00112233445566778899aabbccddeeff +# And so on.. One line per R1KH. + +# Whether PMK-R1 push is enabled at R0KH +# 0 = do not push PMK-R1 to all configured R1KHs (default) +# 1 = push PMK-R1 to all configured R1KHs whenever a new PMK-R0 is derived +#pmk_r1_push=1 + +##### Passive scanning ######################################################## +# Scan different channels every N seconds. 0 = disable passive scanning. +#passive_scan_interval=60 + +# Listen N usecs on each channel when doing passive scanning. +# This value plus the time needed for changing channels should be less than +# 32 milliseconds (i.e. 32000 usec) to avoid interruptions to normal +# operations. Time needed for channel changing varies based on the used wlan +# hardware. +# default: disabled (0) +#passive_scan_listen=10000 + +# Passive scanning mode: +# 0 = scan all supported modes (802.11a/b/g/Turbo) (default) +# 1 = scan only the mode that is currently used for normal operations +#passive_scan_mode=1 + +# Maximum number of entries kept in AP table (either for passive scanning or +# for detecting Overlapping Legacy BSS Condition). The oldest entry will be +# removed when adding a new entry that would make the list grow over this +# limit. Note! Wi-Fi certification for IEEE 802.11g requires that OLBC is +# enabled, so this field should not be set to 0 when using IEEE 802.11g. +# default: 255 +#ap_table_max_size=255 + +# Number of seconds of no frames received after which entries may be deleted +# from the AP table. Since passive scanning is not usually performed frequently +# this should not be set to very small value. In addition, there is no +# guarantee that every scan cycle will receive beacon frames from the +# neighboring APs. +# default: 60 +#ap_table_expiration_time=3600 + + +##### Wi-Fi Protected Setup (WPS) ############################################# + +# WPS state +# 0 = WPS disabled (default) +# 1 = WPS enabled, not configured +# 2 = WPS enabled, configured +#wps_state=2 + +# AP can be configured into a locked state where new WPS Registrar are not +# accepted, but previously authorized Registrars (including the internal one) +# can continue to add new Enrollees. +ap_setup_locked=1 + +# Universally Unique IDentifier (UUID; see RFC 4122) of the device +# This value is used as the UUID for the internal WPS Registrar. If the AP +# is also using UPnP, this value should be set to the device's UPnP UUID. +# If not configured, UUID will be generated based on the local MAC address. +#uuid=12345678-9abc-def0-1234-56789abcdef0 + +# Note: If wpa_psk_file is set, WPS is used to generate random, per-device PSKs +# that will be appended to the wpa_psk_file. If wpa_psk_file is not set, the +# default PSK (wpa_psk/wpa_passphrase) will be delivered to Enrollees. Use of +# per-device PSKs is recommended as the more secure option (i.e., make sure to +# set wpa_psk_file when using WPS with WPA-PSK). + +# When an Enrollee requests access to the network with PIN method, the Enrollee +# PIN will need to be entered for the Registrar. PIN request notifications are +# sent to hostapd ctrl_iface monitor. In addition, they can be written to a +# text file that could be used, e.g., to populate the AP administration UI with +# pending PIN requests. If the following variable is set, the PIN requests will +# be written to the configured file. +#wps_pin_requests=/var/run/hostapd_wps_pin_requests + +# Device Name +# User-friendly description of device; up to 32 octets encoded in UTF-8 +#device_name=Wireless AP + +# Manufacturer +# The manufacturer of the device (up to 64 ASCII characters) +#manufacturer=Qualcomm + +# Model Name +# Model of the device (up to 32 ASCII characters) +#model_name=QualcommSoftAP + +# Model Number +# Additional device description (up to 32 ASCII characters) +#model_number=123 + +# Serial Number +# Serial number of the device (up to 32 characters) +#serial_number=12345 + +# Primary Device Type +# Used format: -- +# categ = Category as an integer value +# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for +# default WPS OUI +# subcateg = OUI-specific Sub Category as an integer value +# Examples: +# 1-0050F204-1 (Computer / PC) +# 1-0050F204-2 (Computer / Server) +# 5-0050F204-1 (Storage / NAS) +# 6-0050F204-1 (Network Infrastructure / AP) +#device_type=6-0050F204-1 + +# OS Version +# 4-octet operating system version number (hex string) +#os_version=01020300 + +# Config Methods +# List of the supported configuration methods +config_methods=label display push_button keypad + +# Access point PIN for initial configuration and adding Registrars +# If not set, hostapd will not allow external WPS Registrars to control the +# access point. +#ap_pin=12345670 + +# Skip building of automatic WPS credential +# This can be used to allow the automatically generated Credential attribute to +# be replaced with pre-configured Credential(s). +#skip_cred_build=1 + +# Additional Credential attribute(s) +# This option can be used to add pre-configured Credential attributes into M8 +# message when acting as a Registrar. If skip_cred_build=1, this data will also +# be able to override the Credential attribute that would have otherwise been +# automatically generated based on network configuration. This configuration +# option points to an external file that much contain the WPS Credential +# attribute(s) as binary data. +#extra_cred=hostapd.cred + +# Credential processing +# 0 = process received credentials internally (default) +# 1 = do not process received credentials; just pass them over ctrl_iface to +# external program(s) +# 2 = process received credentials internally and pass them over ctrl_iface +# to external program(s) +# Note: With wps_cred_processing=1, skip_cred_build should be set to 1 and +# extra_cred be used to provide the Credential data for Enrollees. +# +# wps_cred_processing=1 will disabled automatic updates of hostapd.conf file +# both for Credential processing and for marking AP Setup Locked based on +# validation failures of AP PIN. An external program is responsible on updating +# the configuration appropriately in this case. +#wps_cred_processing=0 + +# AP Settings Attributes for M7 +# By default, hostapd generates the AP Settings Attributes for M7 based on the +# current configuration. It is possible to override this by providing a file +# with pre-configured attributes. This is similar to extra_cred file format, +# but the AP Settings attributes are not encapsulated in a Credential +# attribute. +#ap_settings=hostapd.ap_settings + +# WPS UPnP interface +# If set, support for external Registrars is enabled. +#upnp_iface=br0 + +# Friendly Name (required for UPnP) +# Short description for end use. Should be less than 64 characters. +#friendly_name=Qualcomm Access Point + +# Manufacturer URL (optional for UPnP) +#manufacturer_url=http://www.qualcomm.com/ + +# Model Description (recommended for UPnP) +# Long description for end user. Should be less than 128 characters. +#model_description=Wireless Access Point + +# Model URL (optional for UPnP) +#model_url=http://www.qualcomm.com/ + +# Universal Product Code (optional for UPnP) +# 12-digit, all-numeric code that identifies the consumer package. +#upc=123456789012 + +##### Multiple BSSID support ################################################## +# +# Above configuration is using the default interface (wlan#, or multi-SSID VLAN +# interfaces). Other BSSIDs can be added by using separator 'bss' with +# default interface name to be allocated for the data packets of the new BSS. +# +# hostapd will generate BSSID mask based on the BSSIDs that are +# configured. hostapd will verify that dev_addr & MASK == dev_addr. If this is +# not the case, the MAC address of the radio must be changed before starting +# hostapd (ifconfig wlan0 hw ether ). +# +# BSSIDs are assigned in order to each BSS, unless an explicit BSSID is +# specified using the 'bssid' parameter. +# If an explicit BSSID is specified, it must be chosen such that it: +# - results in a valid MASK that covers it and the dev_addr +# - is not the same as the MAC address of the radio +# - is not the same as any other explicitly specified BSSID +# +# Please note that hostapd uses some of the values configured for the first BSS +# as the defaults for the following BSSes. However, it is recommended that all +# BSSes include explicit configuration of all relevant configuration items. +# +#bss=wlan0_0 +#ssid=test2 +# most of the above items can be used here (apart from radio interface specific +# items, like channel) + +#bss=wlan0_1 +#bssid=00:13:10:95:fe:0b +# ... diff --git a/configs/wifi/p2p_supplicant_overlay.conf b/configs/wifi/p2p_supplicant_overlay.conf new file mode 100644 index 0000000..40c7bc7 --- /dev/null +++ b/configs/wifi/p2p_supplicant_overlay.conf @@ -0,0 +1,10 @@ +disable_scan_offload=1 +p2p_listen_reg_class=81 +p2p_listen_channel=1 +p2p_oper_reg_class=124 +p2p_oper_channel=149 +manufacturer=SAMSUNG_ELECTRONICS +model_name=SAMSUNG_MOBILE +model_number=2014 +serial_number=19691101 +update_config=1 diff --git a/configs/wifi/wpa_supplicant_overlay.conf b/configs/wifi/wpa_supplicant_overlay.conf new file mode 100644 index 0000000..4290f9d --- /dev/null +++ b/configs/wifi/wpa_supplicant_overlay.conf @@ -0,0 +1,4 @@ +disable_scan_offload=1 +p2p_disabled=1 +update_config=1 +p2p_no_group_iface=1 diff --git a/extract-files.sh b/extract-files.sh index 46982b7..cd64bc9 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -23,7 +23,7 @@ if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi # Override anything that may come from the calling environment CM_ROOT="$MY_DIR"/../../.. -BOARD=msm8974 +BOARD=msm8226 DEVICE_COMMON=${BOARD}-common VENDOR=samsung diff --git a/init/Android.mk b/init/Android.mk index 37ac855..6fde28f 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -21,11 +21,11 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_C_INCLUDES := system/core/init LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\" -LOCAL_SRC_FILES := init_msm8974.cpp -ifneq ($(TARGET_LIBINIT_MSM8974_DEFINES_FILE),) - LOCAL_SRC_FILES += ../../../../$(TARGET_LIBINIT_MSM8974_DEFINES_FILE) +LOCAL_SRC_FILES := init_msm8226.cpp +ifneq ($(TARGET_LIBINIT_MSM8226_DEFINES_FILE),) + LOCAL_SRC_FILES += ../../../../$(TARGET_LIBINIT_MSM8226_DEFINES_FILE) endif -LOCAL_MODULE := libinit_msm8974 +LOCAL_MODULE := libinit_msm8226 LOCAL_STATIC_LIBRARIES := libbase diff --git a/init/init_msm8974.cpp b/init/init_msm8226.cpp similarity index 64% rename from init/init_msm8974.cpp rename to init/init_msm8226.cpp index 374e980..2cc1544 100644 --- a/init/init_msm8974.cpp +++ b/init/init_msm8226.cpp @@ -43,7 +43,7 @@ #include "vendor_init.h" #include "property_service.h" -#include "init_msm8974.h" +#include "init_msm8226.h" using android::init::property_set; @@ -70,59 +70,8 @@ void property_override_dual(char const system_prop[], property_override(vendor_prop, value); } -static int read_file2(const char *fname, char *data, int max_size) -{ - int fd, rc; - - if (max_size < 1) - return 0; - - fd = open(fname, O_RDONLY); - if (fd < 0) { - LOG(ERROR) << "failed to open " << fname << std::endl; - return 0; - } - - rc = read(fd, data, max_size - 1); - if ((rc > 0) && (rc < max_size)) - data[rc] = '\0'; - else - data[0] = '\0'; - close(fd); - - return 1; -} - -static void init_alarm_boot_properties() -{ - char const *alarm_file = "/proc/sys/kernel/boot_reason"; - char buf[64]; - - if (read_file2(alarm_file, buf, sizeof(buf))) { - /* - * Setup ro.alarm_boot value to true when it is RTC triggered boot up - * For existing PMIC chips, the following mapping applies - * for the value of boot_reason: - * - * 0 -> unknown - * 1 -> hard reset - * 2 -> sudden momentary power loss (SMPL) - * 3 -> real time clock (RTC) - * 4 -> DC charger inserted - * 5 -> USB charger insertd - * 6 -> PON1 pin toggled (for secondary PMICs) - * 7 -> CBLPWR_N pin toggled (for external power supply) - * 8 -> KPDPWR_N pin toggled (power key pressed) - */ - if (buf[0] == '3') - property_set("ro.alarm_boot", "true"); - else - property_set("ro.alarm_boot", "false"); - } -} void vendor_load_properties() { init_target_properties(); - init_alarm_boot_properties(); } diff --git a/init/init_msm8974.h b/init/init_msm8226.h similarity index 95% rename from init/init_msm8974.h rename to init/init_msm8226.h index b33e3cb..40ceda8 100644 --- a/init/init_msm8974.h +++ b/init/init_msm8226.h @@ -28,12 +28,12 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __INIT_MSM8974__H__ -#define __INIT_MSM8974__H__ +#ifndef __INIT_MSM8226__H__ +#define __INIT_MSM8226__H__ void init_target_properties(); void property_override(char const prop[], char const value[]); void property_override_dual(char const system_prop[], char const vendor_prop[], char const value[]); -#endif /* __INIT_MSM8974__H__ */ +#endif /* __INIT_MSM8226__H__ */ diff --git a/keylayout/Button_Jack.kl b/keylayout/Button_Jack.kl new file mode 100644 index 0000000..ddb0dbf --- /dev/null +++ b/keylayout/Button_Jack.kl @@ -0,0 +1,3 @@ +key 256 HEADSETHOOK +key 257 VOLUME_UP +key 258 VOLUME_DOWN diff --git a/keylayout/Vendor_04e8_Product_7021.kl b/keylayout/Vendor_04e8_Product_7021.kl deleted file mode 100644 index 4eddce0..0000000 --- a/keylayout/Vendor_04e8_Product_7021.kl +++ /dev/null @@ -1,393 +0,0 @@ -# Copyright (C) 2010 The Android Open Source 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. - -# -# Generic key layout file for full alphabetic US English PC style external keyboards. -# -# This file is intentionally very generic and is intended to support a broad rang of keyboards. -# Do not edit the generic key layout to support a specific keyboard; instead, create -# a new key layout file with the required keyboard configuration. -# - -key 1 BACK -key 2 1 -key 3 2 -key 4 3 -key 5 4 -key 6 5 -key 7 6 -key 8 7 -key 9 8 -key 10 9 -key 11 0 -key 12 MINUS -key 13 EQUALS -key 14 DEL -key 15 TAB -key 16 Q -key 17 W -key 18 E -key 19 R -key 20 T -key 21 Y -key 22 U -key 23 I -key 24 O -key 25 P -key 26 LEFT_BRACKET -key 27 RIGHT_BRACKET -key 28 ENTER -key 29 CTRL_LEFT -key 30 A -key 31 S -key 32 D -key 33 F -key 34 G -key 35 H -key 36 J -key 37 K -key 38 L -key 39 SEMICOLON -key 40 APOSTROPHE -key 41 GRAVE -key 42 SHIFT_LEFT -key 43 BACKSLASH -key 44 Z -key 45 X -key 46 C -key 47 V -key 48 B -key 49 N -key 50 M -key 51 COMMA -key 52 PERIOD -key 53 SLASH -key 54 SHIFT_RIGHT -key 55 NUMPAD_MULTIPLY -key 56 ALT_LEFT -key 57 SPACE -key 58 CAPS_LOCK -key 59 F1 -key 60 F2 -key 61 F3 -key 62 F4 -key 63 F5 -key 64 F6 -key 65 F7 -key 66 F8 -key 67 F9 -key 68 F10 -key 69 NUM_LOCK -key 70 SCROLL_LOCK -key 71 NUMPAD_7 -key 72 NUMPAD_8 -key 73 NUMPAD_9 -key 74 NUMPAD_SUBTRACT -key 75 NUMPAD_4 -key 76 NUMPAD_5 -key 77 NUMPAD_6 -key 78 NUMPAD_ADD -key 79 NUMPAD_1 -key 80 NUMPAD_2 -key 81 NUMPAD_3 -key 82 NUMPAD_0 -key 83 NUMPAD_DOT -# key 84 (undefined) -# key 85 "KEY_ZENKAKUHANKAKU" -key 86 BACKSLASH -key 87 F11 -key 88 F12 -# key 89 "KEY_RO" -# key 90 "KEY_KATAKANA" -# key 91 "KEY_HIRAGANA" -# key 92 "KEY_HENKAN" -# key 93 "KEY_KATAKANAHIRAGANA" -# key 94 "KEY_MUHENKAN" -key 95 NUMPAD_COMMA -key 96 NUMPAD_ENTER -key 97 CTRL_RIGHT -key 98 NUMPAD_DIVIDE -key 99 SYSRQ -key 100 ALT_GR -# key 101 "KEY_LINEFEED" -key 102 MOVE_HOME -key 103 DPAD_UP -key 104 PAGE_UP -key 105 DPAD_LEFT -key 106 DPAD_RIGHT -key 107 MOVE_END -key 108 DPAD_DOWN -key 109 PAGE_DOWN -key 110 INSERT -key 111 FORWARD_DEL -# key 112 "KEY_MACRO" -key 113 MUTE -key 114 VOLUME_DOWN -key 115 VOLUME_UP -key 116 POWER WAKE -key 117 NUMPAD_EQUALS -# key 118 "KEY_KPPLUSMINUS" -key 119 BREAK -# key 120 (undefined) -key 121 NUMPAD_COMMA -# key 122 "KEY_HANGEUL" -# key 123 "KEY_HANJA" -# key 124 "KEY_YEN" -key 125 META_LEFT -key 126 META_RIGHT -key 127 MENU WAKE_DROPPED -key 128 MEDIA_STOP -# key 129 "KEY_AGAIN" -# key 130 "KEY_PROPS" -# key 131 "KEY_UNDO" -# key 132 "KEY_FRONT" -# key 133 "KEY_COPY" -# key 134 "KEY_OPEN" -# key 135 "KEY_PASTE" -# key 136 "KEY_FIND" -# key 137 "KEY_CUT" -# key 138 "KEY_HELP" -key 139 MENU WAKE_DROPPED -# key 140 "KEY_CALC" -# key 141 "KEY_SETUP" -# key 142 "KEY_SLEEP" -# key 143 "KEY_WAKEUP" -# key 144 "KEY_FILE" -# key 145 "KEY_SENDFILE" -# key 146 "KEY_DELETEFILE" -# key 147 "KEY_XFER" -# key 148 "KEY_PROG1" -# key 149 "KEY_PROG2" -key 150 EXPLORER -# key 151 "KEY_MSDOS" -# key 152 "KEY_COFFEE" -key 152 POWER WAKE -# key 153 "KEY_DIRECTION" -# key 154 "KEY_CYCLEWINDOWS" -key 155 EMAIL -key 156 BOOKMARK -# key 157 "KEY_COMPUTER" -key 158 BACK WAKE_DROPPED -key 159 FORWARD -key 160 MEDIA_CLOSE -key 161 MEDIA_EJECT -key 162 MEDIA_EJECT -key 163 MEDIA_NEXT -key 164 MEDIA_PLAY_PAUSE -key 165 MEDIA_PREVIOUS -key 166 MEDIA_STOP -key 167 MEDIA_RECORD -key 168 MEDIA_REWIND -key 169 CALL -# key 170 "KEY_ISO" -# key 171 "KEY_CONFIG" -key 172 HOME -# key 173 "KEY_REFRESH" -# key 174 "KEY_EXIT" -# key 175 "KEY_MOVE" -# key 176 "KEY_EDIT" -key 177 PAGE_UP -key 178 PAGE_DOWN -key 179 NUMPAD_LEFT_PAREN -key 180 NUMPAD_RIGHT_PAREN -# key 181 "KEY_NEW" -# key 182 "KEY_REDO" -# key 183 F13 -# key 184 F14 -# key 185 F15 -# key 186 F16 -# key 187 F17 -# key 188 F18 -# key 189 F19 -# key 190 F20 -# key 191 F21 -# key 192 F22 -# key 193 F23 -# key 194 F24 -# key 195 (undefined) -# key 196 (undefined) -# key 197 (undefined) -# key 198 (undefined) -# key 199 (undefined) -key 200 MEDIA_PLAY -key 201 MEDIA_PAUSE -# key 202 "KEY_PROG3" -# key 203 "KEY_PROG4" -# key 204 (undefined) -# key 205 "KEY_SUSPEND" -# key 206 "KEY_CLOSE" -key 207 MEDIA_PLAY -key 208 MEDIA_FAST_FORWARD -# key 209 "KEY_BASSBOOST" -# key 210 "KEY_PRINT" -# key 211 "KEY_HP" -key 212 CAMERA -# key 213 "KEY_SOUND" -# key 214 "KEY_QUESTION" -key 215 ENVELOPE -# key 216 "KEY_CHAT" -key 217 SEARCH -# key 218 "KEY_CONNECT" -# key 219 "KEY_FINANCE" -# key 220 "KEY_SPORT" -# key 221 "KEY_SHOP" -# key 222 "KEY_ALTERASE" -# key 223 "KEY_CANCEL" -key 224 BRIGHTNESS_DOWN -key 225 BRIGHTNESS_UP -key 226 HEADSETHOOK -key 227 STAR -key 228 POUND -key 229 SOFT_LEFT -key 230 SOFT_RIGHT -key 231 CALL -key 232 DPAD_CENTER -key 233 HEADSETHOOK -# key 234 "KEY_0_5" or "KEY_SAVE" -# key 235 "KEY_2_5" or "KEY_DOCUMENTS" -# key 236 "KEY_SWITCHVIDEOMODE" or "KEY_BATTERY" -# key 237 "KEY_KBDILLUMTOGGLE" -# key 238 "KEY_KBDILLUMDOWN" -# key 239 "KEY_KBDILLUMUP" -# key 240 "KEY_UNKNOWN" - - -key 304 BUTTON_A -key 305 BUTTON_B -key 306 BUTTON_C -key 307 BUTTON_X -key 308 BUTTON_Y -key 309 BUTTON_Z -key 310 BUTTON_L1 -key 311 BUTTON_R1 -key 312 BUTTON_L2 -key 313 BUTTON_R2 -key 314 BUTTON_SELECT -key 315 BUTTON_START -key 316 BUTTON_MODE -key 317 BUTTON_THUMBL -key 318 BUTTON_THUMBR - - -# key 352 "KEY_OK" -# key 353 "KEY_SELECT" -# key 354 "KEY_GOTO" -# key 355 "KEY_CLEAR" -# key 356 "KEY_POWER2" -# key 357 "KEY_OPTION" -# key 358 "KEY_INFO" -# key 359 "KEY_TIME" -# key 360 "KEY_VENDOR" -# key 361 "KEY_ARCHIVE" -key 362 GUIDE -# key 363 "KEY_CHANNEL" -# key 364 "KEY_FAVORITES" -# key 365 "KEY_EPG" -key 366 DVR -# key 367 "KEY_MHP" -# key 368 "KEY_LANGUAGE" -key 368 LANG -# key 369 "KEY_TITLE" -# key 370 "KEY_SUBTITLE" -# key 371 "KEY_ANGLE" -# key 372 "KEY_ZOOM" -# key 373 "KEY_MODE" -# key 374 "KEY_KEYBOARD" -# key 375 "KEY_SCREEN" -# key 376 "KEY_PC" -key 377 TV -# key 378 "KEY_TV2" -# key 379 "KEY_VCR" -# key 380 "KEY_VCR2" -# key 381 "KEY_SAT" -# key 382 "KEY_SAT2" -# key 383 "KEY_CD" -# key 384 "KEY_TAPE" -# key 385 "KEY_RADIO" -# key 386 "KEY_TUNER" -# key 387 "KEY_PLAYER" -# key 388 "KEY_TEXT" -# key 389 "KEY_DVD" -# key 390 "KEY_AUX" -# key 391 "KEY_MP3" -# key 392 "KEY_AUDIO" -# key 393 "KEY_VIDEO" -# key 394 "KEY_DIRECTORY" -# key 395 "KEY_LIST" -# key 396 "KEY_MEMO" -# key 397 "KEY_CALENDAR" -# key 398 "KEY_RED" -# key 399 "KEY_GREEN" -# key 400 "KEY_YELLOW" -# key 401 "KEY_BLUE" -key 402 CHANNEL_UP -key 403 CHANNEL_DOWN -# key 404 "KEY_FIRST" -# key 405 "KEY_LAST" -# key 406 "KEY_AB" -# key 407 "KEY_NEXT" -# key 408 "KEY_RESTART" -# key 409 "KEY_SLOW" -# key 410 "KEY_SHUFFLE" -# key 411 "KEY_BREAK" -# key 412 "KEY_PREVIOUS" -# key 413 "KEY_DIGITS" -# key 414 "KEY_TEEN" -# key 415 "KEY_TWEN" - - -# key 448 "KEY_DEL_EOL" -# key 449 "KEY_DEL_EOS" -# key 450 "KEY_INS_LINE" -# key 451 "KEY_DEL_LINE" - - -key 464 FUNCTION -key 465 ESCAPE FUNCTION -key 466 F1 FUNCTION -key 467 F2 FUNCTION -key 468 F3 FUNCTION -key 469 F4 FUNCTION -key 470 F5 FUNCTION -key 471 F6 FUNCTION -key 472 F7 FUNCTION -key 473 F8 FUNCTION -key 474 F9 FUNCTION -key 475 F10 FUNCTION -key 476 F11 FUNCTION -key 477 F12 FUNCTION -key 478 1 FUNCTION -key 479 2 FUNCTION -key 480 D FUNCTION -key 481 E FUNCTION -key 482 F FUNCTION -key 483 S FUNCTION -key 484 B FUNCTION - - -# key 497 KEY_BRL_DOT1 -# key 498 KEY_BRL_DOT2 -# key 499 KEY_BRL_DOT3 -# key 500 KEY_BRL_DOT4 -# key 501 KEY_BRL_DOT5 -# key 502 KEY_BRL_DOT6 -# key 503 KEY_BRL_DOT7 -# key 504 KEY_BRL_DOT8 - - -key 704 RECENTAPPS -key 705 APPLICATION -key 706 SIP_ON_OFF -key 707 VOICESEARCH -key 708 QPANEL_ON_OFF \ No newline at end of file diff --git a/keylayout/cyttsp-i2c.kl b/keylayout/cyttsp-i2c.kl deleted file mode 100644 index 8396243..0000000 --- a/keylayout/cyttsp-i2c.kl +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2011, Code Aurora Forum. All rights reserved. -# -# 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. -# - -# Function keys -key 59 MENU WAKE -key 60 HOME WAKE -key 61 CALL WAKE_DROPPED -key 62 BACK WAKE_DROPPED -key 63 ENDCALL WAKE_DROPPED -key 64 MEDIA_NEXT WAKE -key 65 MEDIA_PLAY_PAUSE WAKE -key 66 MEDIA_PREVIOUS WAKE -key 67 MEDIA_STOP WAKE -key 68 CAMERA -key 87 POWER WAKE -key 217 SEARCH WAKE_DROPPED - -# Row 2 -key 2 1 WAKE_DROPPED -key 3 2 WAKE_DROPPED -key 4 3 WAKE_DROPPED -key 5 4 WAKE_DROPPED -key 6 5 WAKE_DROPPED -key 7 6 WAKE_DROPPED -key 8 7 WAKE_DROPPED -key 9 8 WAKE_DROPPED -key 10 9 WAKE_DROPPED -key 11 0 WAKE_DROPPED -key 110 MENU WAKE -key 102 HOME WAKE - -# Row 3 -key 16 Q WAKE_DROPPED -key 17 W WAKE_DROPPED -key 18 E WAKE_DROPPED -key 19 R WAKE_DROPPED -key 20 T WAKE_DROPPED -key 21 Y WAKE_DROPPED -key 22 U WAKE_DROPPED -key 23 I WAKE_DROPPED -key 24 O WAKE_DROPPED -key 25 P WAKE_DROPPED -key 158 BACK WAKE_DROPPED -key 104 DPAD_UP WAKE_DROPPED - -# Row 4 -key 58 SHIFT_LEFT WAKE -key 30 A WAKE_DROPPED -key 31 S WAKE_DROPPED -key 32 D WAKE_DROPPED -key 33 F WAKE_DROPPED -key 34 G WAKE_DROPPED -key 35 H WAKE_DROPPED -key 36 J WAKE_DROPPED -key 37 K WAKE_DROPPED -key 38 L WAKE_DROPPED -key 28 DPAD_CENTER WAKE_DROPPED -key 109 DPAD_DOWN WAKE_DROPPED - -# Row 5 -key 183 SYM WAKE_DROPPED -key 44 Z WAKE_DROPPED -key 45 X WAKE_DROPPED -key 46 C WAKE_DROPPED -key 47 V WAKE_DROPPED -key 48 B WAKE_DROPPED -key 49 N WAKE_DROPPED -key 50 M WAKE_DROPPED -key 51 COMMA WAKE_DROPPED -key 52 PERIOD WAKE_DROPPED -key 103 DPAD_UP WAKE_DROPPED -key 107 ENDCALL WAKE_DROPPED -key 152 ENDCALL WAKE_DROPPED - -# Row 6 -key 42 SHIFT_LEFT WAKE_DROPPED -key 464 MENU WAKE_DROPPED -key 29 MENU WAKE_DROPPED -key 56 MENU WAKE_DROPPED -key 151 MENU WAKE_DROPPED -key 57 SPACE WAKE_DROPPED -key 111 DEL WAKE_DROPPED -key 54 SHIFT_RIGHT WAKE_DROPPED -key 105 DPAD_LEFT WAKE_DROPPED -key 108 DPAD_DOWN WAKE_DROPPED -key 106 DPAD_RIGHT WAKE_DROPPED - -# Volume keys -key 115 VOLUME_UP WAKE_DROPPED -key 114 VOLUME_DOWN WAKE_DROPPED - -# Numeric keypad -key 522 STAR WAKE_DROPPED -key 523 POUND WAKE_DROPPED -key 355 DEL WAKE_DROPPED -#L- Mapping -key 139 MENU WAKE -#SEND Key Mapping -key 231 CALL WAKE_DROPPED -# R+ Mapping -key 142 HOME WAKE_DROPPED -# Camera Keys -key 766 FOCUS -key 528 CAMERA diff --git a/keylayout/keypad_8960.kl b/keylayout/keypad_8960.kl deleted file mode 100644 index d56a0e0..0000000 --- a/keylayout/keypad_8960.kl +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2011, Code Aurora Forum. -# -# 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. -# - -# Function keys -key 59 MENU WAKE -key 60 HOME WAKE -key 61 CALL WAKE_DROPPED -key 62 BACK WAKE_DROPPED -key 63 ENDCALL WAKE_DROPPED -key 64 MEDIA_NEXT WAKE -key 65 MEDIA_PLAY_PAUSE WAKE -key 66 MEDIA_PREVIOUS WAKE -key 67 MEDIA_STOP WAKE -key 68 CAMERA -key 87 POWER WAKE -key 217 SEARCH WAKE_DROPPED - -# Row 2 -key 2 1 WAKE_DROPPED -key 3 2 WAKE_DROPPED -key 4 3 WAKE_DROPPED -key 5 4 WAKE_DROPPED -key 6 5 WAKE_DROPPED -key 7 6 WAKE_DROPPED -key 8 7 WAKE_DROPPED -key 9 8 WAKE_DROPPED -key 10 9 WAKE_DROPPED -key 11 0 WAKE_DROPPED -key 110 MENU WAKE -key 102 HOME WAKE - -# Row 3 -key 16 Q WAKE_DROPPED -key 17 W WAKE_DROPPED -key 18 E WAKE_DROPPED -key 19 R WAKE_DROPPED -key 20 T WAKE_DROPPED -key 21 Y WAKE_DROPPED -key 22 U WAKE_DROPPED -key 23 I WAKE_DROPPED -key 24 O WAKE_DROPPED -key 25 P WAKE_DROPPED -key 158 BACK WAKE_DROPPED -key 104 DPAD_UP WAKE_DROPPED - -# Row 4 -key 58 SHIFT_LEFT WAKE -key 30 A WAKE_DROPPED -key 31 S WAKE_DROPPED -key 32 D WAKE_DROPPED -key 33 F WAKE_DROPPED -key 34 G WAKE_DROPPED -key 35 H WAKE_DROPPED -key 36 J WAKE_DROPPED -key 37 K WAKE_DROPPED -key 38 L WAKE_DROPPED -key 28 DPAD_CENTER WAKE_DROPPED -key 109 DPAD_DOWN WAKE_DROPPED - -# Row 5 -key 183 SYM WAKE_DROPPED -key 44 Z WAKE_DROPPED -key 45 X WAKE_DROPPED -key 46 C WAKE_DROPPED -key 47 V WAKE_DROPPED -key 48 B WAKE_DROPPED -key 49 N WAKE_DROPPED -key 50 M WAKE_DROPPED -key 51 COMMA WAKE_DROPPED -key 52 PERIOD WAKE_DROPPED -key 103 DPAD_UP WAKE_DROPPED -key 107 ENDCALL WAKE_DROPPED -key 152 ENDCALL WAKE_DROPPED - -# Row 6 -key 42 SHIFT_LEFT WAKE_DROPPED -key 464 MENU WAKE_DROPPED -key 29 MENU WAKE_DROPPED -key 56 MENU WAKE_DROPPED -key 151 MENU WAKE_DROPPED -key 57 SPACE WAKE_DROPPED -key 111 DEL WAKE_DROPPED -key 54 SHIFT_RIGHT WAKE_DROPPED -key 105 DPAD_LEFT WAKE_DROPPED -key 108 DPAD_DOWN WAKE_DROPPED -key 106 DPAD_RIGHT WAKE_DROPPED - -# Volume keys -key 115 VOLUME_UP WAKE_DROPPED -key 114 VOLUME_DOWN WAKE_DROPPED - -# Numeric keypad -key 522 STAR WAKE_DROPPED -key 523 POUND WAKE_DROPPED -key 355 DEL WAKE_DROPPED -#L- Mapping -key 139 MENU WAKE -#SEND Key Mapping -key 231 CALL WAKE_DROPPED -# R+ Mapping -key 142 HOME WAKE_DROPPED -# Camera Keys -key 766 FOCUS -key 528 CAMERA diff --git a/keylayout/synaptics_rmi4_i2c.kl b/keylayout/synaptics_rmi4_i2c.kl new file mode 100644 index 0000000..8b1fe3f --- /dev/null +++ b/keylayout/synaptics_rmi4_i2c.kl @@ -0,0 +1,30 @@ +# Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + +key 139 MENU +key 102 HOME +key 158 BACK +key 217 SEARCH diff --git a/libwcnss_qmi/Android.mk b/libwcnss_qmi/Android.mk new file mode 100644 index 0000000..b68fd7a --- /dev/null +++ b/libwcnss_qmi/Android.mk @@ -0,0 +1,28 @@ +# 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. + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := wcnss_qmi_client.c + +LOCAL_C_INCLUDES += hardware/qcom/wlan/wcnss_service +LOCAL_CFLAGS += -Wall + +LOCAL_SHARED_LIBRARIES := libc libcutils libutils liblog + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libwcnss_qmi + +include $(BUILD_SHARED_LIBRARY) diff --git a/libwcnss_qmi/wcnss_qmi_client.c b/libwcnss_qmi/wcnss_qmi_client.c new file mode 100644 index 0000000..31c7260 --- /dev/null +++ b/libwcnss_qmi/wcnss_qmi_client.c @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//#define LOG_NDEBUG 0 + +#define LOG_TAG "wcnss_qmi" + +#define SUCCESS 0 +#define FAILED -1 + +#define MAC_INFO_FILE "/efs/wifi/.mac.info" + +#include +#include + +int wcnss_init_qmi(void) +{ + /* empty */ + return SUCCESS; +} + +int wcnss_qmi_get_wlan_address(unsigned char *mac) +{ + int i; + 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); + fclose(f); + return FAILED; + } else { + for (i = 0; i < 6; i++) mac[i] = tmp[i]; + } + + fclose(f); + return SUCCESS; +} + +void wcnss_qmi_deinit(void) +{ + /* empty */ +} diff --git a/manifest.xml b/manifest.xml index f7346d2..3f609aa 100644 --- a/manifest.xml +++ b/manifest.xml @@ -77,15 +77,6 @@ default - - android.hardware.ir - passthrough - 1.0 - - IConsumerIr - default - - android.hardware.keymaster passthrough diff --git a/msm8974.mk b/msm8226.mk similarity index 64% rename from msm8974.mk rename to msm8226.mk index 476526e..0461f9b 100644 --- a/msm8974.mk +++ b/msm8226.mk @@ -14,36 +14,43 @@ # limitations under the License. # Overlays -DEVICE_PACKAGE_OVERLAYS += device/samsung/msm8974-common/overlay +DEVICE_PACKAGE_OVERLAYS += device/samsung/msm8226-common/overlay # Permissions PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \ frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \ - frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml \ + frameworks/native/data/etc/android.hardware.camera.autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.autofocus.xml \ frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ - frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \ + frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \ frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \ - frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \ - frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \ frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/permissions/android.hardware.sensor.gyroscope.xml \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \ frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ - frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ - frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \ + frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml # System properties PRODUCT_PROPERTY_OVERRIDES += \ audio.offload.buffer.size.kb=32 \ audio.offload.gapless.enabled=false \ - av.offload.enable=true + av.offload.enable=true\ + ro.af.client_heap_size_kbyte=7168 PRODUCT_PROPERTY_OVERRIDES += \ ro.opengles.version=196608 +PRODUCT_PROPERTY_OVERRIDES += \ + persist.graphics.vulkan.disable=true + PRODUCT_PROPERTY_OVERRIDES += \ persist.rild.nitz_plmn="" \ persist.rild.nitz_long_ons_0="" \ @@ -53,22 +60,37 @@ PRODUCT_PROPERTY_OVERRIDES += \ persist.rild.nitz_short_ons_0="" \ persist.rild.nitz_short_ons_1="" \ persist.rild.nitz_short_ons_2="" \ - persist.rild.nitz_short_ons_3="" + persist.rild.nitz_short_ons_3="" \ + ril.subscription.types=NV,RUIM + +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.heapstartsize=8m \ + dalvik.vm.heapgrowthlimit=192m \ + dalvik.vm.heapsize=256m \ + dalvik.vm.heaptargetutilization=0.75 \ + dalvik.vm.heapminfree=512k \ + dalvik.vm.heapmaxfree=8m + +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.boot-dex2oat-threads=4 \ + dalvik.vm.dex2oat-swap=false \ + dalvik.vm.checkjni=false \ + dalvik.vm.dex2oat-flags=--no-watch-dog \ + dalvik.vm.dex2oat-threads=4 \ + dalvik.vm.image-dex2oat-threads=4 \ + dalvik.vm.verify-bytecode=false \ + persist.sys.purgeable_assets=1 PRODUCT_PROPERTY_OVERRIDES += \ persist.timed.enable=true -# Advanced Display -PRODUCT_PACKAGES += \ - AdvancedDisplay - # Audio PRODUCT_PACKAGES += \ android.hardware.audio@2.0-impl \ android.hardware.audio.effect@2.0-impl \ - audio_policy.msm8974 \ + audio_policy.msm8226 \ audio.a2dp.default \ - audio.primary.msm8974 \ + audio.primary.msm8226 \ audio.r_submix.default \ audio.usb.default \ libaudio-resampler \ @@ -91,10 +113,10 @@ PRODUCT_PACKAGES += \ android.hardware.graphics.allocator@2.0-service \ android.hardware.graphics.mapper@2.0-impl \ android.hardware.memtrack@1.0-impl \ - copybit.msm8974 \ - gralloc.msm8974 \ - hwcomposer.msm8974 \ - memtrack.msm8974 + copybit.msm8226 \ + gralloc.msm8226 \ + hwcomposer.msm8226 \ + memtrack.msm8226 # DRM PRODUCT_PACKAGES += \ @@ -104,7 +126,7 @@ PRODUCT_PACKAGES += \ # GPS PRODUCT_PACKAGES += \ android.hardware.gnss@1.0-impl \ - gps.msm8974 + gps.msm8226 PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/gps/etc/flp.conf:system/etc/flp.conf \ @@ -112,16 +134,10 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/gps/etc/izat.conf:system/etc/izat.conf \ $(LOCAL_PATH)/gps/etc/sap.conf:system/etc/sap.conf -# IR Blaster -PRODUCT_PACKAGES += \ - android.hardware.ir@1.0-impl \ - consumerir.msm8974 - # Keylayouts PRODUCT_COPY_FILES += \ - device/samsung/msm8974-common/keylayout/cyttsp-i2c.kl:system/usr/keylayout/cyttsp-i2c.kl \ - device/samsung/msm8974-common/keylayout/keypad_8960.kl:system/usr/keylayout/keypad_8960.kl \ - device/samsung/msm8974-common/keylayout/Vendor_04e8_Product_7021.kl:system/usr/keylayout/Vendor_04e8_Product_7021.kl + $(LOCAL_PATH)/keylayout/Button_Jack.kl:system/usr/keylayout/Button_Jack.kl \ + $(LOCAL_PATH)/keylayout/synaptics_rmi4_i2c.kl:system/usr/keylayout/synaptics_rmi4_i2c.kl # Keymaster PRODUCT_PACKAGES += \ @@ -132,7 +148,8 @@ PRODUCT_COPY_FILES += \ frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ - device/samsung/msm8974-common/configs/media_codecs.xml:system/etc/media_codecs.xml + frameworks/av/media/libstagefright/data/media_codecs_google_video_le.xml:system/etc/media_codecs_google_video_le.xml \ + device/samsung/msm8226-common/configs/media_codecs.xml:system/etc/media_codecs.xml # OMX PRODUCT_PACKAGES += \ @@ -150,6 +167,18 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.power@1.0-service-qti +# Ramdisk +PRODUCT_PACKAGES += \ + init.qcom.bt.sh \ + init.ril.sh + +PRODUCT_PACKAGES += \ + init.qcom.power.rc \ + init.qcom.rc \ + init.qcom.usb.rc \ + init.recovery.qcom.rc \ + ueventd.qcom.rc + # RenderScript HAL PRODUCT_PACKAGES += \ android.hardware.renderscript@1.0-impl @@ -170,13 +199,27 @@ PRODUCT_PACKAGES += \ # Wifi PRODUCT_PACKAGES += \ android.hardware.wifi@1.0-service \ + dhcpcd.conf \ hostapd \ wificond \ wpa_supplicant \ - wpa_supplicant.conf + wpa_supplicant.conf \ + libwpa_client +PRODUCT_PACKAGES += \ + libcurl \ + libwcnss_qmi \ + wcnss_service + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/wifi/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf \ + $(LOCAL_PATH)/configs/wifi/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf \ + $(LOCAL_PATH)/configs/wifi/hostapd_default.conf:system/etc/hostapd/hostapd_default.conf \ + $(LOCAL_PATH)/prima/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \ + $(LOCAL_PATH)/prima/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini \ + $(LOCAL_PATH)/prima/WCNSS_qcom_wlan_nv.bin:system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin # Get non-open-source specific aspects -$(call inherit-product-if-exists, vendor/samsung/msm8974-common/msm8974-common-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung/msm8226-common/msm8226-common-vendor.mk) -# common msm8974 +# common msm8226 $(call inherit-product, device/samsung/qcom-common/qcom-common.mk) diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index fb35a2f..b161af2 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -32,4 +32,13 @@ SUPL_MODE=1 LPP_PROFILE=0 + + + + "/system/priv-app/SystemUI/SystemUI.apk" + "/data/dalvik-cache/arm/system@priv-app@SystemUI@SystemUI.apk@classes.dex" + "/data/dalvik-cache/arm/system@priv-app@SystemUI@SystemUI.apk@classes.vdex" + "/system/lib/libsurfaceflinger.so" + + diff --git a/overlay/hardware/samsung/AdvancedDisplay/res/values/arrays.xml b/overlay/hardware/samsung/AdvancedDisplay/res/values/arrays.xml deleted file mode 100644 index 4f1ad05..0000000 --- a/overlay/hardware/samsung/AdvancedDisplay/res/values/arrays.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - @string/mdnie_scenario_ui - @string/mdnie_scenario_video - @string/mdnie_scenario_video_warm - @string/mdnie_scenario_video_cold - @string/mdnie_scenario_camera - @string/mdnie_scenario_navigation - @string/mdnie_scenario_gallery - @string/mdnie_scenario_vt - @string/mdnie_scenario_browser - @string/mdnie_scenario_ebook - @string/mdnie_scenario_email - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - - - - @string/mdnie_accessibility_normal - @string/mdnie_accessibility_inverse - @string/mdnie_accessibility_color_blind - @string/mdnie_accessibility_screen_curtain - @string/mdnie_accessibility_grayscale - @string/mdnie_accessibility_gray_negative - - - - 0 - 1 - 2 - 3 - 4 - 5 - - diff --git a/overlay/hardware/samsung/AdvancedDisplay/res/values/config.xml b/overlay/hardware/samsung/AdvancedDisplay/res/values/config.xml deleted file mode 100644 index 7f7e582..0000000 --- a/overlay/hardware/samsung/AdvancedDisplay/res/values/config.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - "/sys/class/mdnie/mdnie/scenario" - "/sys/class/mdnie/mdnie/accessibility" - diff --git a/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml b/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml index d60cdf4..d7165d3 100644 --- a/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml +++ b/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml @@ -22,29 +22,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/prima/WCNSS_cfg.dat b/prima/WCNSS_cfg.dat new file mode 100644 index 0000000..e343403 Binary files /dev/null and b/prima/WCNSS_cfg.dat differ diff --git a/prima/WCNSS_qcom_cfg.ini b/prima/WCNSS_qcom_cfg.ini new file mode 100644 index 0000000..f364332 --- /dev/null +++ b/prima/WCNSS_qcom_cfg.ini @@ -0,0 +1,419 @@ +# This file allows user to override the factory + +# defaults for the WLAN Driver + + +# Enable IMPS or not +gEnableImps=1 + +# Enable/Disable Idle Scan + +gEnableIdleScan=0 + + +# Enable/Disable vsta based on MAX Assoc limit +gEnableVSTASupport=1 + + +# Increase sleep duration (seconds) during IMPS +# 0 implies no periodic wake up from IMPS. Periodic wakeup is +# unnecessary if Idle Scan is disabled. +gImpsModSleepTime=0 + + +# Enable BMPS or not +gEnableBmps=1 + +# Enable suspend or not + +# 1: Enable standby, 2: Enable Deep sleep, 3: Enable Mcast/Bcast Filter + +gEnableSuspend=3 + +# Phy Mode (auto, b, g, n, etc) +# Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac +gDot11Mode=0 + + +# CSR Roaming Enable(1) Disable(0) + +gRoamingTime=0 + + +# Assigned MAC Addresses - This will be used until NV items are in place + +# Each byte of MAC address is represented in Hex format as XX + +Intf0MacAddress=000AF58989FF +Intf1MacAddress=000AF58989FE +Intf2MacAddress=000AF58989FD + +Intf3MacAddress=000AF58989FC + + +# UAPSD service interval for VO,VI, BE, BK traffic + +InfraUapsdVoSrvIntv=0 + +InfraUapsdViSrvIntv=0 + +InfraUapsdBeSrvIntv=0 + +InfraUapsdBkSrvIntv=0 + +# Flag to allow STA send AddTspec even when ACM is Off +gAddTSWhenACMIsOff=1 + +# Make 1x1 the default antenna configuration + +gNumRxAnt=1 + + +# Beacon filtering frequency (unit in beacon intervals) + +gNthBeaconFilter=50 + + +# Enable WAPI or not + +# WAPIIsEnabled=0 + + +# Flags to filter Mcast abd Bcast RX packets. + +# Value 0: No filtering, 1: Filter all Multicast. + +# 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast + +McastBcastFilter=3 + + +#Flag to enable HostARPOffload feature or not + +hostArpOffload=1 + + +#Flag to enable HostNSOffload feature or not + +hostNSOffload=0 + +#SoftAP Related Parameters + +# AP MAc addr + +gAPMacAddr=000AF589dcab + + +# 802.11n Protection flag + +gEnableApProt=1 + + +#Enable OBSS protection + +gEnableApOBSSProt=1 + + +#Enable/Disable UAPSD for SoftAP + +gEnableApUapsd=0 + + +# Fixed Rate + +gFixedRate=0 + + +# Maximum Tx power + +# gTxPowerCap=30 + + +# Fragmentation Threshold + +# gFragmentationThreshold=2346 + + +# RTS threshold + +RTSThreshold=2347 + + +# Intra-BSS forward + +gDisableIntraBssFwd=0 + + +# WMM Enable/Disable + +WmmIsEnabled=0 + + +# 802.11d support + +g11dSupportEnabled=1 + +# 802.11h support + +g11hSupportEnabled=1 + +# CCX Support and fast transition +CcxEnabled=0 +FastTransitionEnabled=1 +ImplicitQosIsEnabled=0 +gNeighborScanTimerPeriod=200 + +gNeighborLookupThreshold=76 +gNeighborReassocThreshold=81 + +gNeighborScanChannelMinTime=20 +gNeighborScanChannelMaxTime=30 +gMaxNeighborReqTries=3 + +# Legacy (non-CCX, non-802.11r) Fast Roaming Support +# To enable, set FastRoamEnabled=1 +# To disable, set FastRoamEnabled=0 +FastRoamEnabled=1 + +#Check if the AP to which we are roaming is better than current AP in terms of RSSI. +#Checking is disabled if set to Zero.Otherwise it will use this value as to how better +#the RSSI of the new/roamable AP should be for roaming +RoamRssiDiff=3 + +# If the RSSI of any available candidate is better than currently associated +# AP by at least gImmediateRoamRssiDiff, then being to roam immediately (without +# registering for reassoc threshold). +# NOTE: Value of 0 means that we would register for reassoc threshold. +gImmediateRoamRssiDiff=10 + +# To enable, set gRoamIntraBand=1 (Roaming within band) +# To disable, set gRoamIntraBand=0 (Roaming across band) + +gRoamIntraBand=0 + +#SAP Country code + +# Default Country Code is 2 bytes, 3rd byte is optional indoor or out door. + +# Example + +# US Indoor, USI + +# Korea Outdoor, KRO + +# Japan without optional byte, JP + +# France without optional byte, FR + +#gAPCntryCode=USI + + +#Short Guard Interval Enable/disable + +gShortGI20Mhz=1 + +gShortGI40Mhz=1 + + +#Auto Shutdown Value in seconds. A value of 0 means Auto shutoff is disabled + +gAPAutoShutOff=0 + + +# SAP auto channel selection configuration + +# 0 = disable auto channel selection + +# 1 = enable auto channel selection, channel provided by supplicant will be ignored + +gApAutoChannelSelection=0 + + +# Listen Energy Detect Mode Configuration + +# Valid values 0-128 + +# 128 means disable Energy Detect feature + +# 0-9 are threshold code and 7 is recommended value from system if feature is to be enabled. + +# 10-128 are reserved. + +# The EDET threshold mapping is as follows in 3dB step: + +# 0 = -60 dBm + +# 1 = -63 dBm + +# 2 = -66 dBm + +# ... + +# 7 = -81 dBm + +# 8 = -84 dBm + +# 9 = -87 dBm + +# Note: Any of these settings are valid. Setting 0 would yield the highest power saving (in a noisy environment) at the cost of more range. The range impact is approximately #calculated as: + +# + +# Range Loss (dB) = EDET threshold level (dBm) + 97 dBm. + +# + +gEnablePhyAgcListenMode=128 + + +#Preferred channel to start BT AMP AP mode (0 means, any channel) + +BtAmpPreferredChannel=0 + + +#Preferred band (both or 2.4 only or 5 only) + +BandCapability=0 + + +#Beacon Early Termination (1 = enable the BET feature, 0 = disable) + +enableBeaconEarlyTermination=0 + +beaconEarlyTerminationWakeInterval=3 + + +#Bluetooth Alternate Mac Phy (1 = enable the BT AMP feature, 0 = disable) + +gEnableBtAmp=0 + + +#SOFTAP Channel Range selection + +gAPChannelSelectStartChannel=1 + +gAPChannelSelectEndChannel=11 + + +#SOFTAP Channel Range selection Operating band + +# 0:2.4GHZ 1: LOW-5GHZ 2:MID-5GHZ 3:HIGH-5GHZ 4: 4.9HZ BAND + +gAPChannelSelectOperatingBand=0 + + +#Channel Bonding +gChannelBondingMode5GHz=1 + + +#Enable Keep alive with non-zero period value + +#gStaKeepAlivePeriod = 30 + +#AP LINK MONITOR TIMEOUT is used for both SAP and GO mode. +#It is used to change the frequency of keep alive packets in the AP Link Monitor period which is by +#default 20s. Currently the keep alive packets are sent as an interval of 3s but after this change +#the keep alive packet frequency can be changed. + +#gApLinkMonitorPeriod = 3 + + +#If set will start with active scan after driver load, otherwise will start with + +#passive scan to find out the domain + +gEnableBypass11d=1 + + +#If set to 0, will not scan DFS channels + +gEnableDFSChnlScan=1 + + +gVhtChannelWidth=2 +gEnableLogp=1 + + +# Enable Automatic Tx Power control + +gEnableAutomaticTxPowerControl=1 + +# 0 for OLPC 1 for CLPC and SCPC +gEnableCloseLoop=1 + +#Data Inactivity Timeout when in powersave (in ms) +gDataInactivityTimeout=200 + +# VHT Tx/Rx MCS values +# Valid values are 0,1,2. If commented out, the default value is 0. +# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9 +gVhtRxMCS=2 +gVhtTxMCS=2 + +# Enable CRDA regulatory support by settings default country code +#gCrdaDefaultCountryCode=TW + +# Scan Timing Parameters +# gPassiveMaxChannelTime=110 +# gPassiveMinChannelTime=60 +# gActiveMaxChannelTime=40 +# gActiveMinChannelTime=20 + +#If set to 0, MCC is not allowed. +gEnableMCCMode=1 + +# 1=enable STBC; 0=disable STBC +gEnableRXSTBC=1 + +# Enable Active mode offload +gEnableActiveModeOffload=1 + +#Enable Scan Results Aging based on timer +#Timer value is in seconds +#If Set to 0 it will not enable the feature +gScanAgingTime=0 + +#Enable Power saving mechanism Based on Android Framework +#If set to 0 Driver internally control the Power saving mechanism +#If set to 1 Android Framwrok control the Power saving mechanism +isAndroidPsEn=0 + +#disable LDPC in STA mode if the AP is TXBF capable +gDisableLDPCWithTxbfAP=1 + +#Enable thermal mitigation +gThermalMitigationEnable=1 + +gEnableFastRoamInConcurrency=1 + +#List of Country codes for which 11ac needs to be disabled +#Each country code must be delimited by comma(,) +gListOfNon11acCountryCode=RU,UA,ZA + +#Maxium Channel time in msec +gMaxMediumTime = 6000 + +# 802.11K support +gRrmEnable=1 +gRrmOperChanMax=8 +gRrmNonOperChanMax=8 +gRrmRandIntvl=100 + +#Scan offload +gEnableDirectedScanOffload=0 + +# Oxygen network (prop IE for IBSS) +gEnableOxygenNwk=0 + +#FlexConnect Power Factor +#Default is set to 0 (disable) +gFlexConnectPowerFactor=0 + +#SAP/P2P-GO mode traffic monitor +gEnableTrafficMonitor=1 +gTrafficIdleTimeout=3000 + +END + +# Note: Configuration parser would not read anything past the END marker + diff --git a/prima/WCNSS_qcom_wlan_nv.bin b/prima/WCNSS_qcom_wlan_nv.bin new file mode 100644 index 0000000..621c665 Binary files /dev/null and b/prima/WCNSS_qcom_wlan_nv.bin differ diff --git a/rootdir/Android.mk b/rootdir/Android.mk new file mode 100644 index 0000000..c5450e9 --- /dev/null +++ b/rootdir/Android.mk @@ -0,0 +1,59 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +# Init +include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.rc +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.qcom.rc +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.usb.rc +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.qcom.usb.rc +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +include $(BUILD_PREBUILT) + +# Copy the power config for recovery too +include $(CLEAR_VARS) +LOCAL_MODULE := init.recovery.qcom.rc +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.qcom.power.rc +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := ueventd.qcom.rc +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/ueventd.qcom.rc +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.power.rc +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.qcom.power.rc +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +include $(BUILD_PREBUILT) + +# Configuration scripts +include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.bt.sh +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/scripts/init.qcom.bt.sh +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.ril.sh +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/scripts/init.ril.sh +include $(BUILD_PREBUILT) diff --git a/rootdir/etc/init.qcom.power.rc b/rootdir/etc/init.qcom.power.rc new file mode 100644 index 0000000..51f7f50 --- /dev/null +++ b/rootdir/etc/init.qcom.power.rc @@ -0,0 +1,132 @@ +# Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Linux Foundation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +on init + # HMP scheduler settings + write /proc/sys/kernel/sched_ravg_hist_size 3 + write /proc/sys/kernel/sched_window_stats_policy 3 + + # HMP Task packing settings for 8226 + write /proc/sys/kernel/sched_small_task 50 + + # disable thermal core_control to update interactive governor settings + write /sys/module/msm_thermal/core_control/enabled 0 + + # Switch to interactive and let PowerHAL configure it + write /sys/devices/system/cpu/cpu0/online 1 + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive" + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + + # enable thermal core_control now + write /sys/module/msm_thermal/core_control/enabled 1 + + # bring all CPUs online + write /sys/devices/system/cpu/cpu1/online 1 + write /sys/devices/system/cpu/cpu2/online 1 + write /sys/devices/system/cpu/cpu3/online 1 + + # Enable low power modes + write /sys/module/lpm_levels/parameters/sleep_disabled 0 + write /sys/module/lpm_levels/enable_low_power/l2 4 + + # Set RPS mask + write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 2 + + # add a cpuset for the camera daemon + # we want all the cores for camera + mkdir /dev/cpuset/camera-daemon + chown system system /dev/cpuset/camera-daemon + chown system system /dev/cpuset/camera-daemon/tasks + chmod 0664 /dev/cpuset/camera-daemon/tasks + + # Update foreground and background cpusets + # Reserve CPU 3 for the top app + write /dev/cpuset/foreground/cpus 0-2 + write /dev/cpuset/background/cpus 0-2 + write /dev/cpuset/system-background/cpus 0-1 + write /dev/cpuset/top-app/cpus 0-3 + write /dev/cpuset/camera-daemon/cpus 0-3 + +on charger + mount ext4 /dev/block/platform/msm_sdcc.1/by-name/system /system wait ro + + wait /dev/block/platform/msm_sdcc.1/by-name/userdata + check_fs /dev/block/platform/msm_sdcc.1/by-name/userdata ext4 + mount ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata /data nosuid nodev noatime noauto_da_alloc,discard,journal_async_commit,errors=panic + chown system system /data + chmod 0771 /data + + class_start charger + write /sys/devices/system/cpu/cpu1/online 1 + write /sys/devices/system/cpu/cpu2/online 1 + write /sys/devices/system/cpu/cpu3/online 1 + write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1 + write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1 + write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1 + write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1 + write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 0 + write /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled 0 + write /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled 0 + write /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled 0 + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive" + write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "interactive" + write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "interactive" + write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "interactive" + +on property:sys.boot_completed=1 + # Post boot services + rm /data/system/perfd/default_values + start mpdecision + +on class_start:late_start + trigger enable-low-power + +on property:init.svc.recovery=running + trigger enable-low-power diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc new file mode 100644 index 0000000..ff20138 --- /dev/null +++ b/rootdir/etc/init.qcom.rc @@ -0,0 +1,751 @@ +# Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Linux Foundation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +import init.qcom.power.rc +import init.qcom.usb.rc +import init.target.rc + +on early-init + mount debugfs debugfs /sys/kernel/debug + chmod 0755 /sys/kernel/debug + + # Increase max readahead size to 512 KB + restorecon --recursive /sys/block/mmcblk0/queue + write /sys/block/mmcblk0/queue/read_ahead_kb 512 + write /sys/block/mmcblk0/queue/scheduler noop + + write /sys/block/zram0/comp_algorithm lz4 + + mkdir /firmware 0771 system system + mkdir /firmware-modem 0771 system system + + mkdir /persist 0771 system system + + mkdir /efs 0771 system radio + + symlink /data/tombstones /tombstones + + # Set permissions so radio can read + chmod 0444 /proc/cmdline + +on init + # Support legacy paths + symlink /sdcard /mnt/sdcard + symlink /sdcard /storage/sdcard0 + + write /proc/sys/vm/page-cluster 0 + +on fs + wait /dev/block/platform/soc.0/${ro.boot.bootdevice} + symlink /dev/block/platform/soc.0/${ro.boot.bootdevice} /dev/block/bootdevice + + mount_all fstab.qcom + swapon_all fstab.qcom + + restorecon_recursive /efs + + write /sys/kernel/boot_adsp/boot 1 + setprop qcom.audio.init complete + + # Kickstart the Wireless subsystem + write /dev/wcnss_wlan 1 + + # Adaptive LMK + write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1 + write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 53059 + +on post-fs-data + mkdir /data/misc/bluetooth 0770 bluetooth bluetooth + + # Create the directories used by the Wireless subsystem + mkdir /data/misc/wifi 0770 wifi wifi + chmod 0660 /data/misc/wifi/wpa_supplicant.conf + mkdir /data/misc/wifi/sockets 0770 wifi wifi + mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi + mkdir /data/misc/dhcp 0775 dhcp dhcp + + # Create the directories used by CnE subsystem + mkdir /data/connectivity 0771 system system + chown system system /data/connectivity + + # For WIFI TRP/TIS + chown system root /data/.psm.info + chmod 0664 /data/.psm.info + + # For WIFI Antena Selection + chown system root /data/.ant.info + chmod 0664 /data/.ant.info + + # For WIFI Version + write /data/.wifiver.info 0 + chown system root /data/.wifiver.info + chmod 0664 /data/.wifiver.info + + # For WIFI Cert + chmod 0664 /data/.bustxglom.info + chmod 0664 /data/.roamoff.info + chmod 0664 /data/.frameburst.info + chmod 0664 /data/.txbf.info + + # For WIFI MAC address + mkdir /efs/wifi 0775 radio system + chown system wifi /efs/wifi/.mac.info + chmod 0660 /efs/wifi/.mac.info + #restorecon /efs/wifi/.mac.info + chmod 0660 /efs/wifi/.mac.cob + + # Create directory used by audio subsystem + mkdir /data/misc/audio 0770 audio audio + + # Create directory used by radio subsystem + mkdir /data/radio 0770 radio radio + + # Create directory used by the DASH client + mkdir /data/misc/dash 0770 media audio + + # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections + # We chown/chmod /persist again so because mount is run as root + defaults + chown system system /persist + chmod 0771 /persist + + chmod 0664 /sys/devices/platform/msm_sdcc.1/polling + chmod 0664 /sys/devices/platform/msm_sdcc.2/polling + chmod 0664 /sys/devices/platform/msm_sdcc.3/polling + chmod 0664 /sys/devices/platform/msm_sdcc.4/polling + + # Chown polling nodes as needed from UI running on system server + chown system system /sys/devices/platform/msm_sdcc.1/polling + chown system system /sys/devices/platform/msm_sdcc.2/polling + chown system system /sys/devices/platform/msm_sdcc.3/polling + chown system system /sys/devices/platform/msm_sdcc.4/polling + + #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant + mkdir /data/system 0775 system system + + # Create directory from IMS services + mkdir /data/shared 0755 + chown system system /data/shared + + # Create directory for FOTA + mkdir /data/fota 0771 + chown system system /data/fota + + # Create /data/time folder for time-services + mkdir /data/time/ 0700 system system + + mkdir /data/bluetooth 0770 bluetooth bluetooth + # Enable the setgid bit on the directory + chmod 2770 /data/bluetooth + + mkdir /data/audio/ 0770 media audio + # Enable the setgid bit on the directory + chmod 2770 /data/audio + + # Gpio DVS + chown radio system /sys/class/secgpio_check/secgpio_check_all/secgpio_ctrl + + # Create thombstones folders + mkdir /data/tombstones 0771 system system + mkdir /tombstones/modem 0771 system system + mkdir /tombstones/lpass 0771 system system + mkdir /tombstones/wcnss 0771 system system + mkdir /tombstones/dsps 0771 system system + mkdir /tombstones/mdm 0771 system system + + # Create directory for ril data + mkdir /data/misc/radio 0775 radio radio + mkdir /data/misc/radio/hatp 0775 radio system + + # DRM and related files in EFS + mkdir /efs/drm 0774 drm system + mkdir /efs/drm/sdrm 0774 drm system + mkdir /efs/drm/sdrm/data_agent 0774 drm system + #restorecon /efs/drm + #restorecon /efs/drm/sdrm + #restorecon /efs/drm/sdrm/data_agent + + # DivX DRM + mkdir /efs/.files 0775 + mkdir /efs/.files/.dx1 0775 + mkdir /efs/.files/.dm33 0775 + mkdir /efs/.files/.mp301 0775 + chown media system /efs/.files/.dx1 + chown media system /efs/.files/.dm33 + chown media system /efs/.files/.mp301 + chmod 0775 /efs/.files/.dx1 + chmod 0775 /efs/.files/.dm33 + chmod 0775 /efs/.files/.mp301 + + # h2k permission + chmod 0644 /efs/redata.bin + chown radio radio /efs/h2k.dat + chmod 0644 /efs/h2k.dat + + # DRK permission + mkdir /efs/prov 0770 radio system + chown radio system /efs/prov/libdevkm.lock + chmod 0660 /efs/prov/libdevkm.lock + + #OTG Test + chown system radio /sys/class/host_notify/usb_otg/booster + chmod 0660 /sys/class/host_notify/usb_otg/booster + + # wifi + mkdir /efs/wifi 0775 system system + + # Permission for fast dormacy for RIL + chown system radio /sys/devices/virtual/sec/bamdmux/waketime + + # ICD + exec check_icd + chown system system /dev/icd + chmod 0644 /dev/icd + chown system system /dev/icdr + chmod 0644 /dev/icdr + chown system system /dev/tzic + + # Symlink to bugreport storage location + symlink /data/data/com.android.shell/files/bugreports /data/bugreports + + # Create perfd deamon related dirs + mkdir /data/misc/perfd 0755 root system + chmod 2755 /data/misc/perfd + mkdir /data/system/perfd 0770 root system + chmod 2770 /data/system/perfd + + # Remove symlinks to avoid issues with migrate after nandroid restores + # Will be recreated at end of boot + rm /data/data/com.android.providers.telephony/databases + rm /data/data/com.android.providers.telephony/shared_prefs + + # Remove the current apn as sometimes after a reboot it cant connect to 3g + # It will be regenerated by the system + rmdir /data/user_de/0/com.android.providers.telephony/shared_prefs + + setprop vold.post_fs_data_done 1 + +on early-boot + # Set RLIMIT_MEMLOCK to 64MB + setrlimit 8 67108864 67108864 + + # Allow subsystem (modem etc) debugging + write /sys/module/subsystem_restart/parameters/enable_debug ${persist.sys.ssr.enable_debug} + +on boot + # Permissions for bluetooth + mkdir /efs/bluetooth 0775 radio system + setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr" + chown bluetooth net_bt_stack ro.bt.bdaddr_path + chown radio net_bt_stack /efs/bluetooth/bt_addr + chmod 0755 /efs/bluetooth/bt_addr + #restorecon_recursive /efs/bluetooth + + # IMEI + mkdir /efs/imei 0775 radio radio + + # Create QMUX deamon socket area + mkdir /dev/socket/qmux_radio 0770 radio radio + chmod 2770 /dev/socket/qmux_radio + mkdir /dev/socket/qmux_audio 0770 media audio + chmod 2770 /dev/socket/qmux_audio + mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth + chmod 2770 /dev/socket/qmux_bluetooth + mkdir /dev/socket/qmux_gps 0770 gps gps + chmod 2770 /dev/socket/qmux_gps + + # Allow QMUX daemon to assign port open wait time + chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait + + # Modem requires this + chown root radio /proc/cmdline + chmod 0644 /proc/cmdline + + # Remove SUID bit for iproute2 ip tool + chmod 0755 /system/bin/ip + + # For bridgemgr daemon to inform the USB driver of the correct transport + chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport + + # Allow RIL daemon to assign port open fd_wakelock + chown system radio /sys/devices/virtual/sec/mdm_hsic_pm/waketime + + # To allow interfaces to get v6 address when tethering is enabled + write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb1/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb2/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb3/accept_ra 2 + + # To prevent out of order acknowledgements from making + # connection tracking to treat them as not belonging to + # the connection they belong to. + # Otherwise, a weird issue happens in which some long + # connections on high-throughput links get dropped when + # an ack packet comes out of order + write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1 + + # Set the console loglevel to < KERN_INFO + # Set the default message loglevel to KERN_INFO + # modified by SEC, SEC use a loglevel path with another way. + # write /proc/sys/kernel/printk "6 6 1 7" + + # Flash storage isn't a good entropy source, and only causes locking + # overhead in the kernel. Turn it off. + write /sys/block/mmcblk0/queue/add_random 0 + + # MUIC + chown system radio /sys/class/sec/switch/adc + chown system radio /sys/class/sec/switch/reset_switch + chown radio system /sys/class/sec/switch/usb_state + + chown radio system /sys/devices/system/cpu/kernel_max + chmod 664 /sys/devices/system/cpu/kernel_max + + chown radio system /sys/class/kgsl/kgsl-3d0/max_pwrlevel + chmod 664 /sys/class/kgsl/kgsl-3d0/max_pwrlevel + chown radio system /sys/class/kgsl/kgsl-3d0/min_pwrlevel + chmod 664 /sys/class/kgsl/kgsl-3d0/min_pwrlevel + chown radio system /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies + chmod 664 /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies + + chown radio system /sys/class/devfreq/qcom,cpubw.68/available_frequencies + chmod 664 /sys/class/devfreq/qcom,cpubw.68/available_frequencies + chown radio system /sys/class/devfreq/qcom,cpubw.68/available_governors + chmod 664 /sys/class/devfreq/qcom,cpubw.68/available_governors + chown radio system /sys/class/devfreq/qcom,cpubw.68/governor + chmod 664 /sys/class/devfreq/qcom,cpubw.68/governor + chown radio system /sys/class/devfreq/qcom,cpubw.68/max_freq + chmod 664 /sys/class/devfreq/qcom,cpubw.68/max_freq + chown radio system /sys/class/devfreq/qcom,cpubw.68/min_freq + chmod 664 /sys/class/devfreq/qcom,cpubw.68/min_freq + + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack + chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpufreq/interactive/boost + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration + chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + + # Assume SMP uses shared cpufreq policy for all CPUs + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + + # Auto Brightness + chown system system /sys/class/backlight/panel/auto_brightness + chmod 0660 /sys/class/backlight/panel/auto_brightness + + # LCD mdnie and panel work + chown system system /sys/class/mdnie/mdnie/negative + chown system media_rw /sys/class/mdnie/mdnie/accessibility + + chown radio system /sys/class/lcd/panel/lcd_power + chown radio system /sys/class/lcd/panel/lcd_type + chown radio system /sys/class/lcd/panel/power_reduce + chown radio system /sys/class/lcd/panel/siop_enable + + chown system system /sys/class/leds/keyboard-backlight/brightness + chown system system /sys/class/leds/lcd-backlight/brightness + chown system system /sys/class/leds/button-backlight/brightness + + chown system system /sys/kernel/ipv4/tcp_wmem_min + chown system system /sys/kernel/ipv4/tcp_wmem_def + chown system system /sys/kernel/ipv4/tcp_wmem_max + chown system system /sys/kernel/ipv4/tcp_rmem_min + chown system system /sys/kernel/ipv4/tcp_rmem_def + chown system system /sys/kernel/ipv4/tcp_rmem_max + + # Adjust YUV to RGB Conversion(CSC_Conversion) + chown system media_rw /sys/class/graphics/fb0/csc_cfg + chmod 0660 /sys/class/graphics/fb0/csc_cfg + + #OTG Test + chown system radio /sys/class/host_notify/usb_otg/booster + chmod 0660 /sys/class/host_notify/usb_otg/booster + + # Display color calibration + chown system system /sys/devices/virtual/graphics/fb0/rgb + chmod 0660 /sys/devices/virtual/graphics/fb0/rgb + + # Essential node for usbservice + mkdir /dev/bus/ 755 root root + mkdir /dev/bus/usb 755 root root + + # Permissions for Camera + chown root system /sys/class/camera/rear/rear_camantibanding + chown system radio /sys/class/camera/rear/rear_camfw + chown system radio /sys/class/camera/rear/rear_camfw_full + chown system radio /sys/class/camera/rear/rear_camfw_load + chown system radio /sys/class/camera/rear/rear_camtype + chown system radio /sys/class/camera/rear/rear_corever + chown system radio /sys/class/camera/rear/rear_companionfw_full + chown system radio /sys/class/camera/rear/rear_calcheck + chown system radio /sys/class/camera/rear/rear_fwcheck + chown system radio /sys/class/camera/rear/isp_core + chown system radio /sys/class/camera/flash/rear_flash + chown system radio /sys/class/camera/front/front_camfw + chown system radio /sys/class/camera/front/front_camtype + + #OTG Test + chown system radio /sys/class/host_notify/usb_otg/booster + chmod 0660 /sys/class/host_notify/usb_otg/booster + + # Permissions for SSRM + chmod 0664 /sys/devices/platform/sec-thermistor/temperature + chmod 0664 /sys/class/power_supply/battery/siop_level + chmod 0664 /sys/class/power_supply/battery/test_charge_current + chown radio system /sys/devices/platform/sec-thermistor/temperature + chown radio system /sys/class/power_supply/battery/siop_level + chown radio system /sys/class/power_supply/battery/test_charge_current + + # Permissions for Charging + chown system radio /sys/class/power_supply/battery/batt_reset_soc + chown system radio /sys/class/power_supply/battery/update + chown system radio /sys/class/power_supply/battery/factory_mode + chown system radio /sys/class/power_supply/battery/batt_slate_mode + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/call + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/video + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/music + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/browser + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/hotspot + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/camera + chown system radio /sys/class/power_supply/battery/talk_wcdma + chown system radio /sys/class/power_supply/battery/talk_gsm + chown system radio /sys/class/power_supply/battery/call + chown system radio /sys/class/power_supply/battery/data_call + chown system radio /sys/class/power_supply/battery/gps + chown system radio /sys/class/power_supply/battery/wifi + chown system radio /sys/class/power_supply/battery/lte + chown system radio /sys/class/power_supply/battery/wc_enable + chown system radio /sys/class/power_supply/battery/lcd + + # Permission for fast dormancy for RIL + chown system radio /sys/devices/virtual/sec/bamdmux/waketime + #chmod 777 /sys/devices/virtual/sec/bamdmux/waketime + + # Permissions for gpio_keys + chown system radio /sys/class/sec/sec_key/wakeup_keys + write /sys/class/sec/sec_key/wakeup_keys 116,172 + + # HDCP 2.x + mkdir /data/system/hdcp2 0775 system system + + # h2k permission + chown radio system /efs/redata.bin + chmod 0644 /efs/h2k.dat + mkdir /data/misc/radio/hatp 0775 radio system + + # Permission for HALL IC + chown system radio /sys/class/sec/sec_key/hall_detect + + # Vibetonz + chmod 0660 /dev/tspdrv + chown vibe vibe /dev/tspdrv + + # Vibrator + chmod 0644 /sys/class/timed_output/vibrator/pwm_value + chown system system /sys/class/timed_output/vibrator/pwm_value + chown system system /sys/class/timed_output/vibrator/enable + + # Permissions for TSP + chown system system /sys/class/sec/tsp/cmd + chown system system /sys/class/sec/tsp/input/enabled + chown system system /sys/class/input/input0/enabled + chown system system /sys/class/input/input1/enabled + chown system system /sys/class/input/input2/enabled + chmod 0664 /sys/class/sec/tsp/cmd + chmod 0660 /sys/class/sec/tsp/input/enabled + chmod 0664 /sys/class/input/input0/enabled + chmod 0664 /sys/class/input/input1/enabled + chmod 0664 /sys/class/input/input2/enabled + + # Permission for touchkey + chown system system /sys/class/sec/sec_touchkey/keypad_enable + chown system system /sys/class/sec/sec_touchkey/touchkey_brightness + chown system system /sys/class/sec/sec_touchkey/touchkey_menu + chown system system /sys/class/sec/sec_touchkey/touchkey_back + chown system system /sys/class/sec/sec_touchkey/touch_version + chown system system /sys/class/sec/sec_touchkey/touchkey_firm_version_panel + chown system system /sys/class/sec/sec_touchkey/touchkey_firm_version_phone + chown system system /sys/class/sec/sec_touchkey/touchkey_firm_update_status + chown system system /sys/class/sec/sec_touchkey/touchkey_firm_update + chown system system /sys/class/sec/sec_touchkey/touch_sensitivity + chown system system /sys/class/sec/sec_touchkey/touchkey_threshold + chown system system /sys/devices/virtual/sec/sec_touchkey/brightness + chmod 0664 /sys/class/sec/sec_touchkey/keypad_enable + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_brightness + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_menu + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_back + chmod 0664 /sys/class/sec/sec_touchkey/touch_version + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_firm_version_panel + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_firm_version_phone + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_firm_update_status + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_firm_update + chmod 0664 /sys/class/sec/sec_touchkey/touch_sensitivity + chmod 0664 /sys/class/sec/sec_touchkey/touchkey_threshold + chmod 0664 /sys/devices/virtual/sec/sec_touchkey/brightness + restorecon /sys/class/sec/sec_touchkey/keypad_enable + + # Assign TCP buffer thresholds to be ceiling value of technology maximums + # Increased technology maximums should be reflected here. + write /proc/sys/net/core/rmem_max 8388608 + write /proc/sys/net/core/wmem_max 8388608 + + # Wifi firmware reload path + chmod 0660 /sys/module/wlan/parameters/fwpath + chown wifi wifi /sys/module/wlan/parameters/fwpath + + # Mark wifi driver as unloaded - "ok" indicates loaded + setprop wlan.driver.status not_ok + +on property:dev.bootcomplete=1 + setprop sys.io.scheduler "bfq" + + # Symlink directories to access telephony.db and preferred-apn.xml required by libsec-ril + symlink /data/user_de/0/com.android.providers.telephony/databases /data/data/com.android.providers.telephony/databases + symlink /data/user_de/0/com.android.providers.telephony/shared_prefs /data/data/com.android.providers.telephony/shared_prefs + restorecon /data/data/com.android.providers.telephony/databases + restorecon /data/data/com.android.providers.telephony/shared_pref + +# Services begin here + +service adsprpcd /vendor/bin/adsprpcd + class main + user media + group media + +service charger /charger + class charger + critical + group root system + seclabel u:r:charger:s0 + +service healthd /sbin/healthd + class core + critical + seclabel u:r:healthd:s0 + +service lpm /vendor/bin/lpm + class charger + critical + +service healthd-charger /sbin/healthd -n + class charger + critical + seclabel u:r:healthd:s0 + +service charger_monitor /vendor/bin/charger_monitor + user system + group system + disabled + +service ds_fmc_appd /vendor/bin/ds_fmc_appd -p "rmnet0" -D + class late_start + user root + group radio wifi inet + disabled + oneshot + +on property:persist.data.ds_fmc_app.mode=1 + start ds_fmc_appd + +service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh + class late_start + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +on property:bluetooth.hciattach=true + start hciattach + +on property:bluetooth.hciattach=false + setprop bluetooth.status off + +service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config" + class main + user root + oneshot + +service mpdecision /vendor/bin/mpdecision --avg_comp + class main + user root + group root readproc + disabled + +service qcamerasvr /vendor/bin/mm-qcamera-daemon + class main + user camera + group camera system inet input graphics bluetooth + +service qmuxd /vendor/bin/qmuxd + class core + user radio + group radio audio bluetooth gps diag oem_2950 log + +service qseecomd /vendor/bin/qseecomd + class core + user root + group root + +service rfs_access /vendor/bin/rfs_access + class core + user system + group system net_raw + +service rmt_storage /vendor/bin/rmt_storage + class core + user root + group system wakelock + +service thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine-8226.conf + class main + user root + socket thermal-send-client stream 0666 system system + socket thermal-recv-client stream 0660 system system + socket thermal-recv-passive-client stream 0666 system system + group root + +service time_daemon /vendor/bin/time_daemon + class late_start + user root + group root + +service wcnss-service /system/bin/wcnss_service + class late_start + user system + group system wifi oem_2950 diag radio + oneshot + +# WPA +service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ + -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ + -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ + -I/system/etc/wifi/wpa_supplicant_overlay.conf \ + -puse_p2p_group_interface=1 \ + -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 + # we will start as root and wpa_supplicant will switch to user wifi + # after setting up the capabilities required for WEXT + # user wifi + # group wifi inet keystore + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + +on property:init.svc.wpa_supplicant=stopped + stop dhcpcd + +service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG + class late_start + disabled + oneshot + +service dhcpcd_p2p /system/bin/dhcpcd -ABKLG + class late_start + disabled + oneshot + +service iprenew_wlan0 /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service iprenew_p2p /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG + class late_start + disabled + oneshot + +service iprenew_bt-pan /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG + disabled + oneshot + +service dhcpcd_bnep1 /system/bin/dhcpcd -BKLG + disabled + oneshot + +service dhcpcd_bnep2 /system/bin/dhcpcd -BKLG + disabled + oneshot + +service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG + disabled + oneshot + +service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG + disabled + oneshot + +# Limit to SoC reset (1) and independent SSR (3) +on property:persist.sys.ssr.restart_level=1 + write /sys/module/subsystem_restart/parameters/restart_level 1 + +on property:persist.sys.ssr.restart_level=3 + write /sys/module/subsystem_restart/parameters/restart_level 3 diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc new file mode 100644 index 0000000..898069a --- /dev/null +++ b/rootdir/etc/init.qcom.usb.rc @@ -0,0 +1,818 @@ +# Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Linux Foundation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +on init + write /sys/class/android_usb/android0/iSerial ${ro.serialno} + write /sys/class/android_usb/android0/f_rndis/wceis 1 + write /sys/bus/platform/drivers/msm_hsic_host/unbind "msm_hsic_host" + chown system system /sys/class/android_usb/android0/usb30en + chmod 0660 /sys/class/android_usb/android0/usb30en + chown system system /sys/class/android_usb/android0/terminal_version + chmod 0660 /sys/class/android_usb/android0/terminal_version + +on charger + setprop sys.usb.config mass_storage + +on fs + mkdir /dev/usb-ffs 0770 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + write /sys/class/android_usb/android0/f_ffs/aliases adb + + setprop sys.usb.ffs.aio_compat 1 + +# Following are the parameters required for usb functionality. They provide configurable options like +# product_id/vendor id and allows specifying required functions: +# +# Required parameters: +# +# /sys/class/android_usb/android0/enable: Enables/disables usb composition +# Value: 0 (disable), 1 (enable) +# +# /sys/class/android_usb/android0/idVendor: Stores Vendor ID +# Value: 05c6 (Vendor id for Qualcomm Inc) +# +# /sys/class/android_usb/android0/idProduct: Stores Product id corresponding to usb composition +# Value: 0x9xxx for composite interface, 0xFxxx for single interface +# +# /sys/class/android_usb/android0/f_diag/clients: Stores name of clients representing a diag interface. +# Value: Passed one per interface. e.g. diag[,diag_mdm, diag_qsc, diag_mdm2] +# +# /sys/class/android_usb/android0/functions: Stores name of the function drivers used in usb composition. +# Value: Passed one per function driver. e.g. diag[,adb] +# +#Optional parameters: +# +# /sys/class/android_usb/android0/f_serial/transports: Stores type of underlying transports used to +# communicate to serial interface. +# Value: Passed one per interface. One value represents control and data transport together. +# e.g. smd[,sdio,tty,hsic] +# Only required if serial interface is present. +# +# /sys/class/android_usb/android0/f_serial/transport_names: Stores name of the underlying transports +# used to communicate to serial interface. This is used to distinguish between more than one interface +# using same transport type. +# Value: Passed one per interface. One value represents control and data transport together. +# e.g. serial_hsic[,serial_hsusb] +# Only required for transport type hsic, optional for other transport types. +# +# /sys/class/android_usb/android0/f_rmnet/transports: Stores type of underlying transports used to +# communicate to rmnet interface. +# Value: Passed two per interface as control, data transport type pair. +# e.g. smd,bam[,hsuart,hsuart] +# Only required if rmnet interface is present. +# +# /sys/class/android_usb/android0/f_rmnet/transport_names: Stores name of the underlying transports +# used to communicate to rmnet interface. This is used to distinguish between more than one interface +# using same transport type. +# Value: Passed one per interface. One value represents control and data transport together. +# e.g. rmnet_hsic[,rmnet_hsusb] +# Only required for transport type hsic, optional for other transport types. + + +# USB Composite for Samsung USB Driver + +on property:sys.usb.config=mtp,conn_gadget + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions mtp,acm,conn_gadget + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,conn_gadget,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions mtp,acm,conn_gadget,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions mtp,acm + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions mtp,acm,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + + +on property:sys.usb.config=ptp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6865 + write /sys/class/android_usb/android0/functions ptp + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6866 + write /sys/class/android_usb/android0/functions ptp,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6863 + write /sys/class/android_usb/android0/functions rndis + write /sys/class/android_usb/android0/bDeviceClass 224 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6864 + write /sys/class/android_usb/android0/functions rndis,adb + write /sys/class/android_usb/android0/bDeviceClass 224 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ncm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685D + write /sys/class/android_usb/android0/functions ncm + write /sys/class/android_usb/android0/bDeviceClass 2 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ncm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685D + write /sys/class/android_usb/android0/functions ncm,adb + write /sys/class/android_usb/android0/bDeviceClass 2 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# rndis,acm,diag and rmnet,acm,diag are used for IOT Hidden Menu +on property:sys.usb.config=rndis,acm,diag + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6864 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions rndis,acm,diag + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rmnet,acm,diag + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685D + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,acm,rmnet + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685D + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions diag,acm,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# For CDFS composite +on property:sys.usb.config=mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685B + write /sys/class/android_usb/android0/functions mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685E + write /sys/class/android_usb/android0/f_acm/instances 1 + write /sys/class/android_usb/android0/functions mass_storage,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,mtp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp,mass_storage,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# As request from the CHINA GOVERNMENT SECURITY POLICY +on property:sys.usb.config=askon + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=askon,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9025 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports smd,tty + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903D + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9026 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports smd,tty + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903E + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9037 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_serial/transports sdio,smd + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903B + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd + write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9038 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_serial/transports sdio,smd + write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903C + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd + write /sys/class/android_usb/android0/functions diag,acm,rmnet_smd_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9031 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_serial/transports sdio,tty + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903B + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty + write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9032 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_serial/transports sdio,tty + write /sys/class/android_usb/android0/functions diag,serial,rmnet_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903C + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty + write /sys/class/android_usb/android0/functions diag,acm,rmnet_sdio,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9025 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports tty,tty + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + start port-bridge + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903D + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty + write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + start port-bridge + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9026 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports tty,tty + write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + start port-bridge + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903E + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty + write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9025 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports smd,tty + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903D + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty + write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + start port-bridge + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9026 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports smd,tty + write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903E + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty + write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 composition +on property:sys.usb.config=diag,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9025 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_serial/transports hsic,tty + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 composition with diag_mdm and adb +on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9031 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_serial/transports hsic,tty + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 composition with diag_mdm +on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9032 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/f_serial/transports hsic,tty + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic + write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 DSDA composition with adb +on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9065 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsuart + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsuart + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 DSDA composition without adb +on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9066 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsuart + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsuart + write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 DSDA2 composition with adb +on property:sys.usb.config=diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9065 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_mdm2 + write /sys/class/android_usb/android0/f_serial/transports hsic,hsic + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsusb + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsic,hsic + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsusb + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# Fusion 3 DSDA2 composition without adb +on property:sys.usb.config=diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9066 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_mdm2 + write /sys/class/android_usb/android0/f_serial/transports hsic,hsic + write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsusb + write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsic,hsic + write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsusb + write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +# Fusion 2.2 composition with diag_qsc and adb +on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9053 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc + write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart + write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# Fusion 2.2 composition with diag_qsc +on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9054 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc + write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart + write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,diag_mdm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9041 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/functions rndis,diag + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,diag_mdm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9042 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/functions rndis,diag,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9086 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/functions rndis,diag + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9087 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/functions rndis,diag,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,diag,diag_mdm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9040 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/functions mtp,diag + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,diag,diag_mdm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 903F + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/functions mtp,diag,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9088 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/functions mtp,diag + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,diag,diag_mdm,diag_qsc,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9089 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc + write /sys/class/android_usb/android0/functions mtp,diag,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,ccid + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9045 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/functions diag,ccid + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,ccid,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9044 + write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm + write /sys/class/android_usb/android0/functions diag,adb,ccid + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 904A + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/functions diag,qdss + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9060 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/functions diag,qdss,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss,rmnet_bam + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9083 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,qdss,rmnet + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss,rmnet_bam,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9084 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/f_rmnet/transports smd,bam + write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet + write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,qdss + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9081 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/functions rndis,diag,qdss + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,qdss,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9082 + write /sys/class/android_usb/android0/f_diag/clients diag + write /sys/class/android_usb/android0/functions rndis,diag,qdss,adb + write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ncm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0525 + write /sys/class/android_usb/android0/idProduct A4A1 + write /sys/class/android_usb/android0/functions ncm + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ncm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 908C + write /sys/class/android_usb/android0/functions ncm,adb + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# USB midi configuration +on property:sys.usb.config=midi + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18D1 + write /sys/class/android_usb/android0/idProduct 4EE8 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} + +# USB midi configuration, with adb +on property:sys.usb.config=midi,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 18D1 + write /sys/class/android_usb/android0/idProduct 4EE9 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state ${sys.usb.config} diff --git a/rootdir/etc/scripts/init.qcom.bt.sh b/rootdir/etc/scripts/init.qcom.bt.sh new file mode 100644 index 0000000..bd6edd8 --- /dev/null +++ b/rootdir/etc/scripts/init.qcom.bt.sh @@ -0,0 +1,68 @@ +#!/system/bin/sh + +LOG_TAG="qcom-bluetooth" +LOG_NAME="${0}:" + +loge () +{ + /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@" +} + +logi () +{ + /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@" +} + +failed () +{ + loge "$1: exit code $2" + exit $2 +} + +setprop ro.qualcomm.bt.hci_transport smd + +# Note that "hci_qcomm_init -e" prints expressions to set the shell variables +# BTS_DEVICE, BTS_TYPE, BTS_BAUD, and BTS_ADDRESS. + +# BR/EDR & LE power class configurations +POWER_CLASS=`getprop qcom.bt.dev_power_class` +LE_POWER_CLASS=`getprop qcom.bt.le_dev_pwr_class` + +setprop bluetooth.status off + +case $POWER_CLASS in + 1) PWR_CLASS="-p 0" ; + logi "Power Class: 1";; + 2) PWR_CLASS="-p 1" ; + logi "Power Class: 2";; + 3) PWR_CLASS="-p 2" ; + logi "Power Class: CUSTOM";; + *) PWR_CLASS=""; + logi "Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)"; + logi "Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>";; +esac + +case $LE_POWER_CLASS in + 1) LE_PWR_CLASS="-P 0" ; + logi "LE Power Class: 1";; + 2) LE_PWR_CLASS="-P 1" ; + logi "LE Power Class: 2";; + 3) LE_PWR_CLASS="-P 2" ; + logi "LE Power Class: CUSTOM";; + *) LE_PWR_CLASS="-P 1"; + logi "LE Power Class: Ignored. Default(2) used (1-CLASS1/2-CLASS2/3-CUSTOM)"; + logi "LE Power Class: To override, Before turning BT ON; setprop qcom.bt.le_dev_pwr_class <1 or 2 or 3>";; +esac + +eval $(/system/bin/hci_qcomm_init -e $PWR_CLASS $LE_PWR_CLASS && echo "exit_code_hci_qcomm_init=0" || echo "exit_code_hci_qcomm_init=1") + +case $exit_code_hci_qcomm_init in + 0) logi "Bluetooth QSoC firmware download succeeded, $BTS_DEVICE $BTS_TYPE $BTS_BAUD $BTS_ADDRESS";; + *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init; + setprop bluetooth.status off + exit $exit_code_hci_qcomm_init;; +esac + +setprop bluetooth.status on + +exit 0 diff --git a/rootdir/etc/scripts/init.ril.sh b/rootdir/etc/scripts/init.ril.sh new file mode 100644 index 0000000..ddbcd44 --- /dev/null +++ b/rootdir/etc/scripts/init.ril.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -rf /data/user_de/0/com.android.providers.telephony/databases/telephony.db* +rm -rf /data/user_de/0/com.android.providers.telephony/shared_prefs diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc new file mode 100644 index 0000000..bc97f42 --- /dev/null +++ b/rootdir/etc/ueventd.qcom.rc @@ -0,0 +1,205 @@ +# Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Linux Foundation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# the DIAG device node HAS TO BE world writable/readable, otherwise libdiag cant open the socket :/ +/dev/diag 0777 system oem_2950 + +/dev/genlock 0666 system system +/dev/kgsl 0666 system system +/dev/kgsl-3d0 0666 system system +/dev/kgsl-2d0 0666 root root +/dev/kgsl-2d1 0666 root root +/dev/ion 0664 system system +/dev/rtc0 0600 system system +/dev/smd0 0660 system system +/dev/smd4 0660 system system +/dev/smd_cxm_qmi 0640 radio radio +/dev/smd5 0660 system system +/dev/smd6 0660 system system +/dev/smd7 0660 bluetooth bluetooth + +# Permissions for CSVT +/dev/smd11 0660 radio radio + +/dev/radio0 0640 system system +/dev/rfcomm0 0660 bluetooth bluetooth +/dev/smdcntl0 0640 radio radio +/dev/smdcntl1 0640 radio radio +/dev/smdcntl2 0640 radio radio +/dev/smdcntl3 0640 radio radio +/dev/smdcntl4 0640 radio radio +/dev/smdcntl5 0640 radio radio +/dev/smdcntl6 0640 radio radio +/dev/smdcntl7 0640 radio radio +/dev/smdcntl8 0640 radio radio +/dev/smdcntl9 0640 radio radio +/dev/smdcntl10 0640 radio radio +/dev/smdcntl11 0640 radio radio +/dev/smdcnt_rev0 0640 radio radio +/dev/smdcnt_rev1 0640 radio radio +/dev/smdcnt_rev2 0640 radio radio +/dev/smdcnt_rev3 0640 radio radio +/dev/smdcnt_rev4 0640 radio radio +/dev/smdcnt_rev5 0640 radio radio +/dev/smdcnt_rev6 0640 radio radio +/dev/smdcnt_rev7 0640 radio radio +/dev/smdcnt_rev8 0640 radio radio +/dev/smuxctl32 0640 radio radio +/dev/sdioctl0 0640 radio radio +/dev/sdioctl1 0640 radio radio +/dev/sdioctl2 0640 radio radio +/dev/sdioctl3 0640 radio radio +/dev/sdioctl4 0640 radio radio +/dev/sdioctl5 0640 radio radio +/dev/sdioctl6 0640 radio radio +/dev/sdioctl7 0640 radio radio +/dev/sdioctl8 0640 radio radio +/dev/rmnet_mux_ctrl 0640 radio radio +/dev/hsicctl0 0640 radio radio +/dev/hsicctl1 0640 radio radio +/dev/hsicctl2 0640 radio radio +/dev/hsicctl3 0640 radio radio +/dev/hsicctl4 0640 radio radio +/dev/hsicctl5 0640 radio radio +/dev/hsicctl6 0640 radio radio +/dev/hsicctl7 0640 radio radio +/dev/hsicctl8 0640 radio radio +/dev/hsicctl9 0640 radio radio +/dev/hsicctl10 0640 radio radio +/dev/hsicctl11 0640 radio radio +/dev/hsicctl12 0640 radio radio +/dev/hsicctl13 0640 radio radio +/dev/hsicctl14 0640 radio radio +/dev/hsicctl15 0640 radio radio +/dev/hsicctl16 0640 radio radio +/dev/video* 0660 system camera +/dev/media* 0660 system camera +/dev/v4l-subdev* 0660 system camera +/dev/qseecom 0660 system drmrpc +/dev/gemini0 0660 system camera +/dev/jpeg0 0660 system camera +/dev/jpeg1 0660 system camera +/dev/jpeg2 0660 system camera +/dev/msm_camera/* 0660 system camera +/dev/gemini/ 0660 system camera +/dev/mercury0 0660 system camera +/dev/msm_vidc_reg 0660 system audio +/dev/msm_vidc_dec 0660 system audio +/dev/msm_vidc_dec_sec 0660 system audio +/dev/msm_vidc_enc 0660 system audio +/dev/msm_vidc_enc_sec 0660 system audio +/dev/msm_rotator 0660 system system +/dev/hw_random 0660 system system +/dev/adsprpc-smd 0664 media camera +/dev/graphics/* 0660 system graphics +/dev/tun 0660 system vpn + +# Permissions for audio +/dev/msm_qcelp 0660 system audio +/dev/msm_evrc 0660 system audio +/dev/msm_wma 0660 system audio +/dev/msm_wmapro 0660 system audio +/dev/msm_amrnb 0660 system audio +/dev/msm_amrwb 0660 system audio +/dev/msm_amrwb_in 0660 system audio +/dev/msm_amrwbplus 0660 system audio +/dev/msm_aac 0660 system audio +/dev/msm_multi_aac 0660 system audio +/dev/msm_aac_in 0660 system audio +/dev/msm_qcelp_in 0660 system audio +/dev/msm_evrc_in 0660 system audio +/dev/msm_amrnb_in 0640 system audio +/dev/msm_a2dp_in 0660 system audio +/dev/msm_ac3 0660 system audio +/dev/msm_acdb 0660 system audio +/dev/msm_cad 0660 system audio +/dev/msm_fm 0660 system audio +/dev/msm_mvs 0660 system audio +/dev/msm_pcm_lp_dec 0660 system audio +/dev/msm_preproc_ctl 0660 system audio +/dev/msm_rtac 0660 system audio +/dev/msm_sps 0660 system audio +/dev/msm_voicememo 0660 system audio +/dev/radio0 0640 fm_radio fm_radio +/dev/smd3 0660 bluetooth bluetooth +/dev/smd2 0660 bluetooth bluetooth +/dev/ttyHSL0 0660 radio system +/dev/ttyHSL1 0660 system system +/dev/mdm 0660 system radio +/dev/sdio_tty_ciq_00 0660 system system +/dev/tty_sdio_00 0660 system system +/dev/ttyGS0 0660 system system +/dev/i2c-5 0660 media media +/sys/devices/virtual/smdpkt/smdcntl* open_timeout 0664 radio radio + +# DVB devices +/dev/dvb/adapter0/demux* 0440 media media +/dev/dvb/adapter0/dvr* 0660 media media +/dev/dvb/adapter0/video* 0660 media media + +# Charger +/dev/keychord 0660 system system + +# Broadcast devices +/dev/tsc_mux0 0660 media media +/dev/tsc_ci0 0660 media media + +# Sensors +/sys/devices/i2c-12/12-* pollrate_ms 0664 system system +/sys/devices/f9925000.i2c/i2c-0/0-* enable 0660 input system +/sys/devices/f9925000.i2c/i2c-0/0-* poll_delay 0660 input system +/sys/devices/virtual/optical_sensors/proximity ps_adc 0660 input system +/sys/devices/virtual/optical_sensors/proximity ps_poll_delay 0660 input system +/sys/devices/virtual/optical_sensors/lightsensor ls_auto 0660 input system +/sys/devices/virtual/optical_sensors/lightsensor ls_poll_delay 0660 input system +/sys/devices/virtual/input/input* poll 0660 input system +/sys/devices/virtual/input/input* pollrate_ms 0660 input system + +# WLAN +/dev/rfkill 0600 wifi wifi +/dev/wcnss_wlan 0660 system system +/dev/wcnss_ctrl 0660 system system + +# NFC permissions +/dev/nfc-nci 0660 nfc nfc +/dev/pn547 0660 nfc nfc +/sys/devices/f9925000.i2c/i2c-2/2-0028 init_deinit 0200 nfc nfc +/sys/devices/f9925000.i2c/i2c-2/2-0028 set_pwr 0200 nfc nfc +/sys/devices/f9925000.i2c/i2c-2/2-0028 res_ready 0400 nfc nfc +/sys/devices/f9925000.i2c/i2c-2/2-0028 recv_rsp 0600 nfc nfc +/sys/devices/f9925000.i2c/i2c-2/2-0028 send_cmd 0200 nfc nfc + +# UIO devices +/dev/uio0 0660 system system +/dev/uio1 0660 system system +/dev/uio2 0660 system system + +# Permission for dun +/dev/dun 0660 system system + +# Latin Mobile TV +/dev/isdbt 0660 system system diff --git a/seccomp/mediacodec.policy b/seccomp/mediacodec.policy index f04ecba..5e3740c 100644 --- a/seccomp/mediacodec.policy +++ b/seccomp/mediacodec.policy @@ -5,3 +5,8 @@ eventfd2: 1 sendto: 1 recvfrom: 1 _llseek: 1 +sysinfo: 1 +getcwd: 1 +getsockopt: 1 +# ffmpeg needs this +getdents64: 1 diff --git a/seccomp/mediaextractor.policy b/seccomp/mediaextractor.policy index 77c1e2a..3f9c7ce 100644 --- a/seccomp/mediaextractor.policy +++ b/seccomp/mediaextractor.policy @@ -2,3 +2,6 @@ # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy readlinkat: 1 pread64: 1 +getsockopt: 1 +# ffmpeg needs this +nanosleep: 1 diff --git a/sensors/Android.bp b/sensors/Android.bp index 4510abc..b8b2949 100644 --- a/sensors/Android.bp +++ b/sensors/Android.bp @@ -1,5 +1,5 @@ cc_library_static { - name: "multihal-samsung8974", + name: "multihal-samsung8226", vendor: true, srcs: [ "multihal.cpp", diff --git a/sensors/SensorEventQueue.cpp b/sensors/SensorEventQueue.cpp index 0d4d64a..dff7ac9 100644 --- a/sensors/SensorEventQueue.cpp +++ b/sensors/SensorEventQueue.cpp @@ -14,13 +14,11 @@ * limitations under the License. */ -#include - +#include #include - +#include #include -#include #include "SensorEventQueue.h" SensorEventQueue::SensorEventQueue(int capacity) { diff --git a/sensors/multihal.cpp b/sensors/multihal.cpp index 7acf23a..40c9e03 100644 --- a/sensors/multihal.cpp +++ b/sensors/multihal.cpp @@ -18,7 +18,7 @@ #include "multihal.h" #define LOG_NDEBUG 1 -#include +#include #include #include @@ -49,11 +49,10 @@ static pthread_mutex_t queue_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t data_available_cond = PTHREAD_COND_INITIALIZER; bool waiting_for_data = false; -// Vector of sub modules, whose indexes are referred to in this file as module_index. -static std::vector *sub_hw_modules = nullptr; - -// Vector of sub modules shared object handles -static std::vector *so_handles = nullptr; +/* + * Vector of sub modules, whose indexes are referred to in this file as module_index. + */ +static std::vector *sub_hw_modules = NULL; /* * Comparable class that globally identifies a sensor, by module index and local handle. @@ -197,12 +196,7 @@ struct sensors_poll_context_t { int poll(sensors_event_t* data, int count); int batch(int handle, int flags, int64_t period_ns, int64_t timeout); int flush(int handle); - int inject_sensor_data(const sensors_event_t *data); - int register_direct_channel(const struct sensors_direct_mem_t* mem, - int channel_handle); - int config_direct_report(int sensor_handle, - int channel_handle, - const struct sensors_direct_cfg_t *config); + int inject_sensor_data(struct sensors_poll_device_1 *dev, const sensors_event_t *data); int close(); std::vector sub_hw_devices; @@ -212,7 +206,6 @@ struct sensors_poll_context_t { sensors_poll_device_t* get_v0_device_by_handle(int global_handle); sensors_poll_device_1_t* get_v1_device_by_handle(int global_handle); - sensors_poll_device_1_t* get_primary_v1_device(); int get_device_version_by_handle(int global_handle); void copy_event_remap_handle(sensors_event_t* src, sensors_event_t* dest, int sub_index); @@ -252,14 +245,6 @@ sensors_poll_device_1_t* sensors_poll_context_t::get_v1_device_by_handle(int glo return (sensors_poll_device_1_t*) this->sub_hw_devices[sub_index]; } -// Returns the device pointer, or NULL if primary hal does not exist -sensors_poll_device_1_t* sensors_poll_context_t::get_primary_v1_device() { - if (sub_hw_devices.size() < 1) { - return nullptr; - } - return (sensors_poll_device_1_t*) this->sub_hw_devices[0]; -} - // Returns the device version, or -1 if the handle is invalid. int sensors_poll_context_t::get_device_version_by_handle(int handle) { sensors_poll_device_t* v0 = this->get_v0_device_by_handle(handle); @@ -270,26 +255,6 @@ int sensors_poll_context_t::get_device_version_by_handle(int handle) { } } -// Android N and hire require sensor HALs to be at least 1_3 compliant -#define HAL_VERSION_IS_COMPLIANT(version) \ - (version >= SENSORS_DEVICE_API_VERSION_1_3) - -// Returns true if HAL is compliant, false if HAL is not compliant or if handle is invalid -static bool halIsCompliant(sensors_poll_context_t *ctx, int handle) { - int version = ctx->get_device_version_by_handle(handle); - return version != -1 && HAL_VERSION_IS_COMPLIANT(version); -} - -static bool halIsAPILevelCompliant(sensors_poll_context_t *ctx, int handle, int level) { - int version = ctx->get_device_version_by_handle(handle); - return version != -1 && (version >= level); -} - -static bool halSupportDirectSensorReport(sensors_poll_device_1_t* v1) { - return v1 != nullptr && HAL_VERSION_IS_COMPLIANT(v1->common.version) && - v1->register_direct_channel != nullptr && v1->config_direct_report != nullptr; -} - const char *apiNumToStr(int version) { switch(version) { case SENSORS_DEVICE_API_VERSION_1_0: @@ -312,12 +277,7 @@ int sensors_poll_context_t::activate(int handle, int enabled) { ALOGV("activate"); int local_handle = get_local_handle(handle); sensors_poll_device_t* v0 = this->get_v0_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v0) { - retval = v0->activate(v0, local_handle, enabled); - } else { - ALOGE("IGNORING activate(enable %d) call to non-API-compliant sensor handle=%d !", - enabled, handle); - } + retval = v0->activate(v0, local_handle, enabled); ALOGV("retval %d", retval); return retval; } @@ -327,11 +287,7 @@ int sensors_poll_context_t::setDelay(int handle, int64_t ns) { ALOGV("setDelay"); int local_handle = get_local_handle(handle); sensors_poll_device_t* v0 = this->get_v0_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v0) { - retval = v0->setDelay(v0, local_handle, ns); - } else { - ALOGE("IGNORING setDelay() call for non-API-compliant sensor handle=%d !", handle); - } + retval = v0->setDelay(v0, local_handle, ns); ALOGV("retval %d", retval); return retval; } @@ -375,7 +331,7 @@ int sensors_poll_context_t::poll(sensors_event_t *data, int maxReads) { } else { empties = 0; this->copy_event_remap_handle(&data[eventsRead], event, nextReadIndex); - if (data[eventsRead].sensor == SENSORS_HANDLE_BASE - 1) { + if (data[eventsRead].sensor == -1) { // Bad handle, do not pass corrupted event upstream ! ALOGW("Dropping bad local handle event packet on the floor"); } else { @@ -405,11 +361,7 @@ int sensors_poll_context_t::batch(int handle, int flags, int64_t period_ns, int6 int retval = -EINVAL; int local_handle = get_local_handle(handle); sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v1) { - retval = v1->batch(v1, local_handle, flags, period_ns, timeout); - } else { - ALOGE("IGNORING batch() call to non-API-compliant sensor handle=%d !", handle); - } + retval = v1->batch(v1, local_handle, flags, period_ns, timeout); ALOGV("retval %d", retval); return retval; } @@ -419,84 +371,24 @@ int sensors_poll_context_t::flush(int handle) { int retval = -EINVAL; int local_handle = get_local_handle(handle); sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v1) { - retval = v1->flush(v1, local_handle); - } else { - ALOGE("IGNORING flush() call to non-API-compliant sensor handle=%d !", handle); - } + retval = v1->flush(v1, local_handle); ALOGV("retval %d", retval); return retval; } -int sensors_poll_context_t::inject_sensor_data(const sensors_event_t *data) { +int sensors_poll_context_t::inject_sensor_data(struct sensors_poll_device_1 *dev, + const sensors_event_t *data) { int retval = -EINVAL; ALOGV("inject_sensor_data"); - if (data->sensor == -1) { - // operational parameter - sensors_poll_device_1_t* v1 = get_primary_v1_device(); - if (v1 && v1->common.version >= SENSORS_DEVICE_API_VERSION_1_4) { - retval = v1->inject_sensor_data(v1, data); - } else { - ALOGE("IGNORED inject_sensor_data(operational param) call to non-API-compliant sensor"); - return -ENOSYS; - } - } else { - // Get handle for the sensor owning the event being injected - int local_handle = get_local_handle(data->sensor); - sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(data->sensor); - if (halIsAPILevelCompliant(this, data->sensor, SENSORS_DEVICE_API_VERSION_1_4) && - local_handle >= 0 && v1) { - // if specific sensor is used, we have to replace global sensor handle - // with local one, before passing to concrete HAL - sensors_event_t data_copy = *data; - data_copy.sensor = local_handle; - retval = v1->inject_sensor_data(v1, &data_copy); - } else { - ALOGE("IGNORED inject_sensor_data(type=%d, handle=%d) call to non-API-compliant sensor", - data->type, data->sensor); - retval = -ENOSYS; - } - } + // Get handle for the sensor owning the event being injected + int local_handle = get_local_handle(data->sensor); + sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(data->sensor); + retval = v1->inject_sensor_data(dev, data); ALOGV("retval %d", retval); return retval; + } -int sensors_poll_context_t::register_direct_channel(const struct sensors_direct_mem_t* mem, - int channel_handle) { - int retval = -EINVAL; - ALOGV("register_direct_channel"); - sensors_poll_device_1_t* v1 = get_primary_v1_device(); - if (v1 && halSupportDirectSensorReport(v1)) { - retval = v1->register_direct_channel(v1, mem, channel_handle); - } else { - ALOGE("IGNORED register_direct_channel(mem=%p, handle=%d) call to non-API-compliant sensor", - mem, channel_handle); - retval = -ENOSYS; - } - ALOGV("retval %d", retval); - return retval; -} - -int sensors_poll_context_t::config_direct_report(int sensor_handle, - int channel_handle, - const struct sensors_direct_cfg_t *config) { - int retval = -EINVAL; - ALOGV("config_direct_report"); - - if (config != nullptr) { - int local_handle = get_local_handle(sensor_handle); - sensors_poll_device_1_t* v1 = get_primary_v1_device(); - if (v1 && halSupportDirectSensorReport(v1)) { - retval = v1->config_direct_report(v1, local_handle, channel_handle, config); - } else { - ALOGE("IGNORED config_direct_report(sensor=%d, channel=%d, rate_level=%d) call to " - "non-API-compliant sensor", sensor_handle, channel_handle, config->rate_level); - retval = -ENOSYS; - } - } - ALOGV("retval %d", retval); - return retval; -} int sensors_poll_context_t::close() { ALOGV("close"); for (std::vector::iterator it = this->sub_hw_devices.begin(); @@ -510,26 +402,11 @@ int sensors_poll_context_t::close() { static int device__close(struct hw_device_t *dev) { - pthread_mutex_lock(&init_modules_mutex); sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; if (ctx != NULL) { int retval = ctx->close(); delete ctx; } - - if (sub_hw_modules != nullptr) { - delete sub_hw_modules; - sub_hw_modules = nullptr; - } - - if (so_handles != nullptr) { - for (auto handle : *so_handles) { - dlclose(handle); - } - delete so_handles; - so_handles = nullptr; - } - pthread_mutex_unlock(&init_modules_mutex); return 0; } @@ -554,7 +431,9 @@ static int device__poll(struct sensors_poll_device_t *dev, sensors_event_t* data static int device__batch(struct sensors_poll_device_1 *dev, int handle, int flags, int64_t period_ns, int64_t timeout) { sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; + ctx->setDelay(handle, period_ns); + return 0; } @@ -565,22 +444,7 @@ static int device__flush(struct sensors_poll_device_1 *dev, int handle) { static int device__inject_sensor_data(struct sensors_poll_device_1 *dev, const sensors_event_t *data) { sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; - return ctx->inject_sensor_data(data); -} - -static int device__register_direct_channel(struct sensors_poll_device_1 *dev, - const struct sensors_direct_mem_t* mem, - int channel_handle) { - sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; - return ctx->register_direct_channel(mem, channel_handle); -} - -static int device__config_direct_report(struct sensors_poll_device_1 *dev, - int sensor_handle, - int channel_handle, - const struct sensors_direct_cfg_t *config) { - sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; - return ctx->config_direct_report(sensor_handle, channel_handle, config); + return ctx->inject_sensor_data(dev, data); } static int open_sensors(const struct hw_module_t* module, const char* name, @@ -599,9 +463,7 @@ static bool starts_with(const char* s, const char* prefix) { * Adds valid paths from the config file to the vector passed in. * The vector must not be null. */ -static std::vector get_so_paths() { - std::vector so_paths; - +static void get_so_paths(std::vector *so_paths) { const std::vector config_path_list( { MULTI_HAL_CONFIG_FILE_PATH, DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH }); @@ -617,7 +479,7 @@ static std::vector get_so_paths() { } if(!stream) { ALOGW("No multihal config file found"); - return so_paths; + return; } ALOGE_IF(strcmp(path, DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH) == 0, @@ -629,9 +491,8 @@ static std::vector get_so_paths() { std::string line; while (std::getline(stream, line)) { ALOGV("config file line: '%s'", line.c_str()); - so_paths.push_back(line); + so_paths->push_back(line); } - return so_paths; } /* @@ -644,15 +505,15 @@ static void lazy_init_modules() { pthread_mutex_unlock(&init_modules_mutex); return; } - std::vector so_paths(get_so_paths()); + std::vector *so_paths = new std::vector(); + get_so_paths(so_paths); // dlopen the module files and cache their module symbols in sub_hw_modules sub_hw_modules = new std::vector(); - so_handles = new std::vector(); dlerror(); // clear any old errors const char* sym = HAL_MODULE_INFO_SYM_AS_STR; - for (const auto &s : so_paths) { - const char* path = s.c_str(); + for (std::vector::iterator it = so_paths->begin(); it != so_paths->end(); it++) { + const char* path = it->c_str(); void* lib_handle = dlopen(path, RTLD_LAZY); if (lib_handle == NULL) { ALOGW("dlerror(): %s", dlerror()); @@ -670,13 +531,8 @@ static void lazy_init_modules() { } else { ALOGV("Loaded symbols from \"%s\"", sym); sub_hw_modules->push_back(module); - so_handles->push_back(lib_handle); - lib_handle = nullptr; } } - if (lib_handle != nullptr) { - dlclose(lib_handle); - } } pthread_mutex_unlock(&init_modules_mutex); } @@ -687,11 +543,27 @@ static void lazy_init_modules() { */ static void fix_sensor_fields(sensor_t& sensor) { /* - * Because batching and flushing don't work modify the + * Becasue batching and flushing don't work modify the * sensor fields to not report any fifo counts. */ sensor.fifoReservedEventCount = 0; sensor.fifoMaxEventCount = 0; + + switch (sensor.type) { + /* + * Use the flags suggested by the sensors documentation. + */ + case SENSOR_TYPE_TILT_DETECTOR: + sensor.flags = SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE; + break; + /* + * Report a proper range to fix doze proximity check. + */ + case SENSOR_TYPE_PROXIMITY: + sensor.flags = SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE; + sensor.maxRange = 5.0; + break; + } } /* @@ -746,12 +618,6 @@ static void lazy_init_sensors_list() { memcpy(&mutable_sensor_list[mutable_sensor_index], local_sensor, sizeof(struct sensor_t)); - // sensor direct report is only for primary module - if (module_index != 0) { - mutable_sensor_list[mutable_sensor_index].flags &= - ~(SENSOR_FLAG_MASK_DIRECT_REPORT | SENSOR_FLAG_MASK_DIRECT_CHANNEL); - } - // Overwrite the global version's handle with a global handle. int global_handle = assign_global_handle(module_index, local_handle); @@ -816,7 +682,7 @@ static int open_sensors(const struct hw_module_t* hw_module, const char* name, sensors_poll_context_t *dev = new sensors_poll_context_t(); memset(dev, 0, sizeof(sensors_poll_device_1_t)); dev->proxy_device.common.tag = HARDWARE_DEVICE_TAG; - dev->proxy_device.common.version = SENSORS_DEVICE_API_VERSION_1_4; + dev->proxy_device.common.version = SENSORS_DEVICE_API_VERSION_1_3; dev->proxy_device.common.module = const_cast(hw_module); dev->proxy_device.common.close = device__close; dev->proxy_device.activate = device__activate; @@ -825,8 +691,6 @@ static int open_sensors(const struct hw_module_t* hw_module, const char* name, dev->proxy_device.batch = device__batch; dev->proxy_device.flush = device__flush; dev->proxy_device.inject_sensor_data = device__inject_sensor_data; - dev->proxy_device.register_direct_channel = device__register_direct_channel; - dev->proxy_device.config_direct_report = device__config_direct_report; dev->nextReadIndex = 0; @@ -837,12 +701,6 @@ static int open_sensors(const struct hw_module_t* hw_module, const char* name, struct hw_device_t* sub_hw_device; int sub_open_result = sensors_module->common.methods->open(*it, name, &sub_hw_device); if (!sub_open_result) { - if (!HAL_VERSION_IS_COMPLIANT(sub_hw_device->version)) { - ALOGE("SENSORS_DEVICE_API_VERSION_1_3 or newer is required for all sensor HALs"); - ALOGE("This HAL reports non-compliant API level : %s", - apiNumToStr(sub_hw_device->version)); - ALOGE("Sensors belonging to this HAL will get ignored !"); - } dev->addSubHwDevice(sub_hw_device); } } diff --git a/sepolicy/common/file_contexts b/sepolicy/common/file_contexts index a57714d..6b2c61d 100644 --- a/sepolicy/common/file_contexts +++ b/sepolicy/common/file_contexts @@ -13,14 +13,13 @@ /dev/pn547 u:object_r:nfc_device:s0 /dev/rfkill u:object_r:wlan_device:s0 /dev/sec-nfc u:object_r:nfc_device:s0 +# this should be needed but it says it is already defined +#/dev/keychord u:object_r:keychord_device:s0 # efs files /efs/bluetooth(/.*)? u:object_r:bluetooth_efs_file:s0 /efs/wifi(/.*)? u:object_r:wifi_efs_file:s0 -# executeables -/system/vendor/bin/macloader u:object_r:macloader_exec:s0 - # firmware /system/vendor/firmware/bcm(.*).hcd u:object_r:bt_fw_file:s0 /system/vendor/firmware/bcm2079x(.*).ncd u:object_r:nfc_fw_file:s0 @@ -36,10 +35,6 @@ /sys/devices/platform/bcm[0-9]+_bluetooth/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 /sys/devices/virtual/camera(/.*)? u:object_r:sysfs_camera:s0 /sys/devices/virtual/sec/sec_key/hall_irq_ctrl u:object_r:sysfs_sec:s0 +/sys/devices/.*bcl.*(/.*)? u:object_r:sysfs_thermal:s0 + -# mdnie sysfs -/sys/devices/virtual/lcd/panel/panel/auto_brightness u:object_r:sysfs_mdnie:s0 -/sys/devices/virtual/mdnie/mdnie/accessibility u:object_r:sysfs_mdnie:s0 -/sys/devices/virtual/mdnie/mdnie/mode u:object_r:sysfs_mdnie:s0 -/sys/devices/virtual/mdnie/mdnie/outdoor u:object_r:sysfs_mdnie:s0 -/sys/devices/virtual/mdnie/mdnie/scenario u:object_r:sysfs_mdnie:s0 diff --git a/sepolicy/common/hal_keymaster_default.te b/sepolicy/common/hal_keymaster_default.te new file mode 100644 index 0000000..182cfba --- /dev/null +++ b/sepolicy/common/hal_keymaster_default.te @@ -0,0 +1,2 @@ +allow hal_keymaster_default vfat:dir search; +allow hal_keymaster_default vfat:file { getattr open read }; diff --git a/sepolicy/common/hal_power_default.te b/sepolicy/common/hal_power_default.te index dbf2d4a..9a2ed20 100644 --- a/sepolicy/common/hal_power_default.te +++ b/sepolicy/common/hal_power_default.te @@ -1 +1,2 @@ allow hal_power_default sysfs_hal_pwr:file w_file_perms; +allow hal_power_default sysfs:file { open write }; diff --git a/sepolicy/common/init.te b/sepolicy/common/init.te new file mode 100644 index 0000000..20a6bee --- /dev/null +++ b/sepolicy/common/init.te @@ -0,0 +1,9 @@ +allow init debugfs:dir mounton; +allow init kernel:security check_context; +allow init rtc_device:chr_file ioctl; +allow init self:netlink_kobject_uevent_socket read; +allow init self:socket create; +allow init smd_device:chr_file write; +allow init tee_device:chr_file { ioctl write }; +allow init video_device:chr_file { ioctl write }; +allow init wcnss_device:chr_file write; diff --git a/sepolicy/common/keystore.te b/sepolicy/common/keystore.te new file mode 100644 index 0000000..649a1fc --- /dev/null +++ b/sepolicy/common/keystore.te @@ -0,0 +1,3 @@ +allow keystore vfat:dir search; +allow keystore vfat:file getattr; +allow keystore vfat:file { open read }; diff --git a/sepolicy/common/mediaserver.te b/sepolicy/common/mediaserver.te index 7990af5..acabf54 100644 --- a/sepolicy/common/mediaserver.te +++ b/sepolicy/common/mediaserver.te @@ -5,3 +5,4 @@ allow mediaserver sysfs_camera:dir search; allow mediaserver sysfs_camera:file r_file_perms; allow mediaserver thermal-engine:unix_stream_socket connectto; allow mediaserver vendor_file:file execmod; +allow mediaserver system_data_file:sock_file write; diff --git a/sepolicy/common/mm-qcamerad.te b/sepolicy/common/mm-qcamerad.te index 0f6b148..be13c79 100644 --- a/sepolicy/common/mm-qcamerad.te +++ b/sepolicy/common/mm-qcamerad.te @@ -2,8 +2,9 @@ type_transition mm-qcamerad system_data_file:sock_file camera_socket "cam_socket #allow mm-qcamerad camera_socket:sock_file create_file_perms; -# Allow mm-qcamera-daemon to create the socket camera_socket +# Allow mm-qcamera-daemon to create and unlink the socket camera_socket allow mm-qcamerad system_data_file:dir w_dir_perms; +allow mm-qcamerad system_data_file:sock_file unlink; allow mm-qcamerad sysfs_camera:dir search; allow mm-qcamerad sysfs_camera:file rw_file_perms; diff --git a/sepolicy/common/rild.te b/sepolicy/common/rild.te index 6bbe2cf..67c18fe 100644 --- a/sepolicy/common/rild.te +++ b/sepolicy/common/rild.te @@ -6,3 +6,6 @@ allow rild radio_data_file:lnk_file read; allow rild proc_net:file w_file_perms; allow rild sysfs_sec:file rw_file_perms; +allow rild unlabeled:dir search; + +allow rild unlabeled:file { getattr open read }; diff --git a/sepolicy/common/ueventd.te b/sepolicy/common/ueventd.te new file mode 100644 index 0000000..0a057f0 --- /dev/null +++ b/sepolicy/common/ueventd.te @@ -0,0 +1,2 @@ +allow ueventd vfat:dir search; +allow ueventd vfat:file { getattr open read }; diff --git a/sepolicy/common/wcnss.te b/sepolicy/common/wcnss.te new file mode 100644 index 0000000..48e83e2 --- /dev/null +++ b/sepolicy/common/wcnss.te @@ -0,0 +1 @@ +allow wcnss_service efs_file:dir search; diff --git a/sepolicy/sepolicy.mk b/sepolicy/sepolicy.mk index e1570d3..f20fccf 100644 --- a/sepolicy/sepolicy.mk +++ b/sepolicy/sepolicy.mk @@ -19,4 +19,4 @@ include device/qcom/sepolicy/legacy-sepolicy.mk # Board specific SELinux policy variable definitions BOARD_SEPOLICY_DIRS += \ - device/samsung/msm8974-common/sepolicy/common + device/samsung/msm8226-common/sepolicy/common diff --git a/setup-makefiles.sh b/setup-makefiles.sh index cbed26c..db03c11 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -24,7 +24,7 @@ if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi # Override anything that may come from the calling environment CM_ROOT="$MY_DIR"/../../.. -BOARD=msm8974 +BOARD=msm8226 DEVICE_COMMON=${BOARD}-common INITIAL_COPYRIGHT_YEAR=2017 VENDOR=samsung