wip: switch to bcm wlan

add libbase shim
This commit is contained in:
ivanmeler 2023-03-30 13:22:53 +02:00
parent ad6d8fa49a
commit f6f4d51256
11 changed files with 131 additions and 96 deletions

View file

@ -19,6 +19,8 @@ BOARD_VENDOR := samsung
COMMON_PATH := device/samsung/msm8996-common
BUILD_BROKEN_DUP_RULES := true
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
@ -189,21 +191,25 @@ TARGET_LD_SHIM_LIBS := \
/vendor/lib/libbauthserver.so|libbauthtzcommon_shim.so \
/vendor/lib64/libbauthserver.so|libbauthtzcommon_shim.so \
/vendor/lib/hw/audio.primary.msm8996.so|libaudioprimary_shim.so \
/vendor/lib/hw/camera.msm8996.so|libshims_cameraclient.so
/vendor/lib/hw/camera.msm8996.so|libshims_cameraclient.so \
/vendor/lib/libwifi-hal.so|libbase_shim.so \
/vendor/lib64/libwifi-hal.so|libbase_shim.so
# Wifi
BOARD_HAVE_SAMSUNG_WIFI := true
BOARD_HAS_QCOM_WLAN := true
BOARD_HAS_QCOM_WLAN_SDK := true
BOARD_WLAN_DEVICE := qcwcn
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
TARGET_USES_64_BIT_BCMDHD := true
BOARD_WLAN_DEVICE := bcmdhd
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
HOSTAPD_VERSION := VER_0_8_X
WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true
WIFI_DRIVER_FW_PATH_AP := "ap"
WIFI_DRIVER_FW_PATH_STA := "sta"
WIFI_DRIVER_FW_PATH_P2P := "p2p"
WPA_SUPPLICANT_USE_HIDL := true
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/dhd/parameters/firmware_path"
WIFI_DRIVER_NVRAM_PATH_PARAM := "/sys/module/dhd/parameters/nvram_path"
WIFI_DRIVER_NVRAM_PATH := "/vendor/etc/wifi/nvram_mfg.txt"
WIFI_DRIVER_FW_PATH_STA := "/vendor/etc/wifi/bcmdhd_sta.bin"
WIFI_DRIVER_FW_PATH_AP := "/vendor/etc/wifi/bcmdhd_apsta.bin"
WIFI_BAND := 802_11_ABG
WIFI_HIDL_FEATURE_AWARE := true
WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
WPA_SUPPLICANT_VERSION := VER_0_8_X

View file

@ -333,7 +333,6 @@ PRODUCT_PACKAGES += \
init.samsung.rc \
init.target.rc \
ueventd.qcom.rc \
wifi_qcom.rc \
wifi_sec.rc
# Recovery
@ -414,15 +413,19 @@ PRODUCT_COPY_FILES += \
# WiFi
PRODUCT_PACKAGES += \
android.hardware.wifi@1.0-service \
libqsap_sdk \
libQWiFiSoftApCfg \
libwpa_client \
hostapd \
libbase_shim \
wificond \
wifilogd \
wlutil \
libcld80211 \
libwpa_client \
TetheringConfigOverlay \
wpa_supplicant \
wpa_supplicant.conf \
WifiOverlay \
wifiloader
android.hardware.wifi@1.0 \
android.hardware.wifi@1.0-impl \
android.hardware.wifi@1.0-service
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \

View file

@ -928,8 +928,9 @@ lib/vendor.qti.hardware.tui_comm@1.0.so
# WiFi
vendor/bin/hw/macloader
vendor/bin/wcnss_filter
bin/cnss-daemon:vendor/bin/cnss-daemon
vendor/bin/hw/mfgloader
vendor/lib/libwifi-hal.so
vendor/lib64/libwifi-hal.so
# WiFi (display)
lib/libremotedisplay_wfd.so
@ -939,19 +940,36 @@ lib/libwfduibcsink.so
lib/libwfduibcsinkinterface.so
# WLAN (firmware)
etc/firmware/Data.msc:vendor/firmware/Data.msc
etc/firmware/bdwlan30.bin:vendor/firmware/bdwlan30.bin
etc/firmware/nvm_tlv_1.3.bin:vendor/firmware/nvm_tlv_1.3.bin
etc/firmware/nvm_tlv_2.1.bin:vendor/firmware/nvm_tlv_2.1.bin
etc/firmware/nvm_tlv_3.0.bin:vendor/firmware/nvm_tlv_3.0.bin
etc/firmware/nvm_tlv_3.2.bin:vendor/firmware/nvm_tlv_3.2.bin
etc/firmware/nvm_tlv.bin:vendor/firmware/nvm_tlv.bin
etc/firmware/otp30.bin:vendor/firmware/otp30.bin
etc/firmware/qwlan30.bin:vendor/firmware/qwlan30.bin
etc/firmware/rampatch_tlv_1.3.tlv:vendor/firmware/rampatch_tlv_1.3.tlv
etc/firmware/rampatch_tlv_2.1.tlv:vendor/firmware/rampatch_tlv_2.1.tlv
etc/firmware/rampatch_tlv_3.0.tlv:vendor/firmware/rampatch_tlv_3.0.tlv
etc/firmware/rampatch_tlv_3.2.tlv:vendor/firmware/rampatch_tlv_3.2.tlv
etc/firmware/rampatch_tlv.img:vendor/firmware/rampatch_tlv.img
etc/firmware/utfbd30.bin:vendor/firmware/utfbd30.bin
etc/firmware/utf30.bin:vendor/firmware/utf30.bin
vendor/etc/wifi/bcmdhd_apsta.bin_b1
vendor/etc/wifi/bcmdhd_apsta.bin_b90s_b1
vendor/etc/wifi/bcmdhd_apsta.bin_c0
vendor/etc/wifi/bcmdhd_ibss.bin_b1
vendor/etc/wifi/bcmdhd_ibss.bin_b90s_b1
vendor/etc/wifi/bcmdhd_ibss.bin_c0
vendor/etc/wifi/bcmdhd_mfg2.bin_b1
vendor/etc/wifi/bcmdhd_mfg2.bin_b90s_b1
vendor/etc/wifi/bcmdhd_mfg2.bin_c0
vendor/etc/wifi/bcmdhd_mfg.bin_b1
vendor/etc/wifi/bcmdhd_mfg.bin_b90s_b1
vendor/etc/wifi/bcmdhd_mfg.bin_c0
vendor/etc/wifi/bcmdhd_sta.bin_b1
vendor/etc/wifi/bcmdhd_sta.bin_b90s_b1
vendor/etc/wifi/bcmdhd_sta.bin_c0
vendor/etc/wifi/nvram_mfg.txt
vendor/etc/wifi/nvram_mfg.txt_b1
vendor/etc/wifi/nvram_mfg.txt_c0
vendor/etc/wifi/nvram_mfg.txt_murata
vendor/etc/wifi/nvram_mfg.txt_murata_b1
vendor/etc/wifi/nvram_mfg.txt_murata_c0
vendor/etc/wifi/nvram_mfg.txt_wisol
vendor/etc/wifi/nvram_mfg.txt_wisol_b1
vendor/etc/wifi/nvram_mfg.txt_wisol_c0
vendor/etc/wifi/nvram_net.txt
vendor/etc/wifi/nvram_net.txt_b1
vendor/etc/wifi/nvram_net.txt_c0
vendor/etc/wifi/nvram_net.txt_murata
vendor/etc/wifi/nvram_net.txt_murata_b1
vendor/etc/wifi/nvram_net.txt_murata_c0
vendor/etc/wifi/nvram_net.txt_wisol
vendor/etc/wifi/nvram_net.txt_wisol_b1
vendor/etc/wifi/nvram_net.txt_wisol_c0

View file

@ -117,14 +117,6 @@ LOCAL_SRC_FILES := etc/ueventd.qcom.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := wifi_qcom.rc
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/wifi_qcom.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := wifi_sec.rc
LOCAL_MODULE_TAGS := optional

View file

@ -1,33 +0,0 @@
on post-fs-data
# for fwpath
chmod 0666 /sys/module/wlan/parameters/fwpath
chown wifi root /sys/wifi/wifiver
chmod 0660 /sys/wifi/wifiver
chown wifi root /sys/wifi/softap
chmod 0660 /sys/wifi/softap
# for WIFI Antenna
write /data/vendor/conn/.wificable.info E
chown system root /data/vendor/conn/.wificable.info
chmod 0666 /data/vendor/conn/.wificable.info
chown wifi root /sys/wifi/wificable
chmod 0664 /sys/wifi/wificable
# for WIFI TRP/TIS
chown wifi root /data/vendor/conn/.psm.info
chmod 0664 /data/vendor/conn/.psm.info
chown wifi root /sys/wifi/pm
chmod 0660 /sys/wifi/pm
# for WIFI Antenna Selection
chown wifi root /data/vendor/conn/.ant.info
chmod 0664 /data/vendor/conn/.ant.info
on boot
# for wlan FTM app
service ftm_ptt /system/bin/ftm_ptt -d
user root
group radio system
disabled

View file

@ -33,9 +33,10 @@ on post-fs-data
# for WIFI MAC
chown wifi root /sys/wifi/mac_addr
chmod 0660 /sys/wifi/mac_addr
on boot
setprop wifi.interface wlan0
setprop wifi.concurrent.interface swlan0
# start for WiFi MFG (TestMode)
service mfgloader /system/vendor/bin/hw/mfgloader
@ -48,3 +49,6 @@ service macloader /system/vendor/bin/hw/macloader
oneshot
# end of WiFi MFG (TestMode)
on property:vold.decrypt=trigger_restart_framework
exec /system/vendor/bin/hw/macloader

28
shims/libbase/Android.mk Normal file
View file

@ -0,0 +1,28 @@
# Copyright (C) 2023 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.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
logging.cpp
LOCAL_SHARED_LIBRARIES := libbase
LOCAL_MODULE := libbase_shim
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
include $(BUILD_SHARED_LIBRARY)

12
shims/libbase/logging.cpp Normal file
View file

@ -0,0 +1,12 @@
#include <android-base/logging.h>
extern "C" void _ZN7android4base10LogMessageC1EPKcjNS0_5LogIdENS0_11LogSeverityES3_i(
const char* file, unsigned int line, android::base::LogId id,
android::base::LogSeverity severity, const char* tag, int error);
extern "C" void _ZN7android4base10LogMessageC1EPKcjNS0_5LogIdENS0_11LogSeverityEi(
const char* file, unsigned int line, android::base::LogId id,
android::base::LogSeverity severity, int error) {
_ZN7android4base10LogMessageC1EPKcjNS0_5LogIdENS0_11LogSeverityES3_i(file,
line, id, severity, nullptr, error);
}

View file

@ -304,7 +304,7 @@ gAPChannelSelectOperatingBand=0
#Channel Bonding
gChannelBondingMode5GHz=1
gChannelBondingMode24GHz=1
gChannelBondingMode24GHz=0
#Enable Keep alive with non-zero period value
@ -451,7 +451,7 @@ gFlexConnectPowerFactor=0
gNumChanCombinedConc=60
#Enable Power Save offload
gEnablePowerSaveOffload=1
gEnablePowerSaveOffload=5
#Enable firmware uart print
gEnablefwprint=0
@ -501,11 +501,6 @@ gActiveBpfMode=1
# 1=Enable (default), 0=Disable
gEnableMCCAdaptiveScheduler=1
#Skip DFS Channel in case of P2P Search
# 0 - disable (Scan DFS Channel in P2P Search)
# 1 - enable (Skip DFS Channel)
gSkipDfsChannelInP2pSearch=0
#Enable or Disable p2p device address administered
isP2pDeviceAddrAdministrated=1
@ -513,7 +508,7 @@ isP2pDeviceAddrAdministrated=1
# 0: no rx thread, no RPS, for MDM
# 1: RX thread
# 2: RPS
rxhandle=1
rxhandle=2
# Remove Overlap channel restriction
gEnableOverLapCh=0
@ -644,7 +639,7 @@ gMCAddrListEnable=1
# 0 - disable
# 1 - enable
gRuntimePM=0
gRuntimePM=1
# When gRuntimePM is disabled gRuntimeAutoTime won't take effect.
# The Time is in msec.
# 100 is min, 10000 is max, 500 is default.
@ -673,7 +668,6 @@ gExtScanEnable=1
gEnableModulatedDTIM=2
gMaxLIModulatedDTIM=6
gSoftApMaxPeers=16
END

View file

@ -1,3 +1,15 @@
disable_scan_offload=1
p2p_no_group_iface=1
p2p_search_delay=100
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
p2p_add_cli_chan=1
ip_addr_go=192.168.49.1
ip_addr_mask=255.255.255.0
ip_addr_start=192.168.49.200
ip_addr_end=192.168.49.254

View file

@ -1,4 +1,3 @@
disable_scan_offload=1
p2p_disabled=1
tdls_external_control=1
driver_param=use_p2p_group_interface=1
update_config=1
pmf=1