From 5a3219062d27fcd70543435ccad37ffd440a9363 Mon Sep 17 00:00:00 2001 From: dodyirawan85 <40514988+dodyirawan85@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:23:01 +0700 Subject: [PATCH] X6833B: Configure Wi-Fi stack Refs: https://github.com/PQEnablers-Devices/android_device_xiaomi_ruby/commit/c0fb62cdc98468f4a5f53878e048f86a83473cc6 Co-authored-by: bengris32 Signed-off-by: dodyirawan85 <40514988+dodyirawan85@users.noreply.github.com> --- BoardConfig.mk | 16 ++++++++++++++++ configs/properties/vendor.prop | 14 ++++++++++++++ configs/wifi/p2p_supplicant_overlay.conf | 6 ++++++ configs/wifi/wpa_supplicant.conf | 16 ++++++++++++++++ configs/wifi/wpa_supplicant_overlay.conf | 5 +++++ device.mk | 15 +++++++++++++++ proprietary-files.txt | 14 ++++++++++++++ 7 files changed, 86 insertions(+) create mode 100644 configs/wifi/p2p_supplicant_overlay.conf create mode 100644 configs/wifi/wpa_supplicant.conf create mode 100644 configs/wifi/wpa_supplicant_overlay.conf diff --git a/BoardConfig.mk b/BoardConfig.mk index b1f5ccb..eca60ef 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -160,6 +160,22 @@ DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(CONFIGS_PATH)/vintf/framework_co DEVICE_MANIFEST_FILE := $(CONFIGS_PATH)/vintf/manifest.xml DEVICE_MATRIX_FILE := $(CONFIGS_PATH)/vintf/compatibility_matrix.xml +# Wi-Fi +BOARD_WLAN_DEVICE := MediaTek +WPA_SUPPLICANT_VERSION := VER_0_8_X +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_mt66xx +BOARD_HOSTAPD_DRIVER := NL80211 +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_mt66xx +WIFI_DRIVER_FW_PATH_PARAM := /dev/wmtWifi +WIFI_DRIVER_FW_PATH_STA := STA +WIFI_DRIVER_FW_PATH_AP := AP +WIFI_DRIVER_FW_PATH_P2P := P2P +WIFI_DRIVER_STATE_CTRL_PARAM := /dev/wmtWifi +WIFI_DRIVER_STATE_ON := 1 +WIFI_DRIVER_STATE_OFF := 0 +WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true + # Workaround to make lineage's soong generator work TARGET_KERNEL_SOURCE := $(KERNEL_PATH)/kernel-headers diff --git a/configs/properties/vendor.prop b/configs/properties/vendor.prop index 0094139..29058a1 100644 --- a/configs/properties/vendor.prop +++ b/configs/properties/vendor.prop @@ -2,6 +2,14 @@ aaudio.mmap_exclusive_policy=2 aaudio.mmap_policy=2 +# Connsys +persist.vendor.connsys.chipid=-1 +persist.vendor.connsys.dynamic.dump=0 +persist.vendor.connsys.patch.version=-1 +ro.vendor.connsys.dedicated.log.port=bt,wifi,gps,mcu +ro.vendor.connsys.dedicated.log=1 +vendor.connsys.driver.ready=no + # Display debug.sf.use_phase_offsets_as_durations=1 debug.sf.late.sf.duration=27600000 @@ -29,3 +37,9 @@ ro.hardware.kmsetkey=trustonic # TEE ro.vendor.mtk_trustonic_tee_support=1 + +# Wi-Fi +ro.vendor.wifi.sap.concurrent.iface=ap1 +ro.vendor.wifi.sap.interface=ap0 +ro.vendor.wlan.chrdev=wmt_chrdev_wifi +ro.vendor.wlan.gen=gen4m_6789 diff --git a/configs/wifi/p2p_supplicant_overlay.conf b/configs/wifi/p2p_supplicant_overlay.conf new file mode 100644 index 0000000..230880f --- /dev/null +++ b/configs/wifi/p2p_supplicant_overlay.conf @@ -0,0 +1,6 @@ +p2p_no_group_iface=1 +driver_param=use_p2p_group_interface=1 +bss_expiration_scan_count=1 +wowlan_triggers=disconnect +p2p_search_delay=50 +p2p_go_he=1 diff --git a/configs/wifi/wpa_supplicant.conf b/configs/wifi/wpa_supplicant.conf new file mode 100644 index 0000000..8553f02 --- /dev/null +++ b/configs/wifi/wpa_supplicant.conf @@ -0,0 +1,16 @@ +ctrl_interface=wlan0 +update_config=1 +manufacturer=MediaTek Inc. +device_name=Wireless Client +model_name=MTK Wireless Model +model_number=1.0 +serial_number=2.0 +device_type=10-0050F204-5 +os_version=01020300 +config_methods=display push_button keypad +p2p_no_group_iface=1 +driver_param=use_p2p_group_interface=1 +hs20=1 +pmf=1 +wowlan_disconnect_on_deinit=1 +sae_pwe=2 diff --git a/configs/wifi/wpa_supplicant_overlay.conf b/configs/wifi/wpa_supplicant_overlay.conf new file mode 100644 index 0000000..e2539b2 --- /dev/null +++ b/configs/wifi/wpa_supplicant_overlay.conf @@ -0,0 +1,5 @@ +p2p_no_group_iface=1 +driver_param=use_p2p_group_interface=1 +wowlan_triggers=disconnect +p2p_disabled=1 +bss_no_flush_when_down=1 diff --git a/device.mk b/device.mk index 08508c1..81ea0bc 100644 --- a/device.mk +++ b/device.mk @@ -182,5 +182,20 @@ PRODUCT_SOONG_NAMESPACES += \ # Updatable APEXes $(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) +# Wi-Fi +PRODUCT_PACKAGES += \ + wpa_supplicant \ + hostapd \ + libwifi-hal-mt66xx \ + android.hardware.wifi@1.0-service-lazy + +PRODUCT_PACKAGES += \ + android.hardware.tetheroffload.config@1.0.vendor \ + android.hardware.tetheroffload.control@1.0.vendor \ + android.hardware.tetheroffload.control@1.1.vendor + +PRODUCT_COPY_FILES += \ + $(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/wifi/,$(TARGET_COPY_OUT_VENDOR)/etc/wifi) + # Inherit the proprietary files $(call inherit-product, vendor/infinix/X6833B/X6833B-vendor.mk) diff --git a/proprietary-files.txt b/proprietary-files.txt index c51ba99..588622f 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -527,3 +527,17 @@ vendor/lib64/libgz_uree.so vendor/lib64/vendor.trustonic.tee.tui@1.0.so vendor/lib64/vendor.trustonic.tee@1.0.so vendor/lib64/vendor.trustonic.tee@1.1.so + +# Tether Offload +vendor/bin/hw/tetheroffloadservice +vendor/bin/netdagent +vendor/etc/init/netdagent.rc +vendor/etc/init/tetheroffloadservice.rc +vendor/lib64/libforkexecwrap.so +vendor/lib64/libifcutils_mtk.so +vendor/lib64/vendor.mediatek.hardware.netdagent@1.0.so + +# Wi-Fi +vendor/bin/wlan_assistant +vendor/etc/init/init.wlan_drv.rc +vendor/etc/init/wlan_assistant.rc