Skip to content

Commit

Permalink
mido: wifi: Update and modify wcnss_service.
Browse files Browse the repository at this point in the history
* from CAF  LA.UM.8.6.r1-04000-89xx.0

Shim the library call dms_get_service_object_internal_v01(..)
with an adaptive call which tries to resolve the version automatically.
(Note: Hopefully this doesn't breaks some interface contracts..).

Change-Id: Ic037ec0cb578026742148eb7a052dfd211fd7c40
  • Loading branch information
Quallenauge authored and zeelog committed May 24, 2020
1 parent 4b88b9f commit 38dedad
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
1 change: 1 addition & 0 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ PRODUCT_PACKAGES += \
libcld80211 \
libwpa_client \
hostapd \
libqmiservices_shim \
libwifi-hal-qcom \
wpa_supplicant \
wpa_supplicant.conf
Expand Down
5 changes: 5 additions & 0 deletions extract-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,9 @@ done

# Camera debug log file
sed -i "s|persist.camera.debug.logfile|persist.vendor.camera.dbglog|g" "${DEVICE_BLOB_ROOT}"/vendor/lib/libmmcamera_dbg.so

# Wcnss_service - libqmiservices_shim
patchelf --add-needed "libqmiservices_shim.so" "${DEVICE_BLOB_ROOT}"/vendor/bin/wcnss_service
sed -i "s|dms_get_service_object_internal_v01|dms_get_service_object_shimshim_v01|g" "${DEVICE_BLOB_ROOT}"/vendor/bin/wcnss_service

"${MY_DIR}/setup-makefiles.sh"
4 changes: 2 additions & 2 deletions proprietary-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1209,8 +1209,8 @@ vendor/lib64/[email protected]|7343cf8a20fb8e72e17b014cda7b5ae
vendor/lib/vndk-sp/libcutils.so|846d5769b71abca5b8fa185d4cf83a5cf1afed3c
vendor/lib/vndk/libprocessgroup.so|62743ee7f648f0f742c35c9fbd7299186e91967a

# Wi-Fi - from Tissot PKQ1.180917.001.V10.0.18.0.PDHMIXM
vendor/bin/wcnss_service|f8ecd38a41b6b7f832380b489e0c9804c34174d8
# Wi-Fi - from LA.UM.8.6.r1-04000-89xx.0
vendor/bin/wcnss_service|33075b37b566f946c96a4b0880240335a829d876
vendor/firmware/wlan/prima/WCNSS_cfg.dat|1672af1c3d4f04804f31d4b79a6e59ea4a8b1926
vendor/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin|5e97baa4957609519835074071c879fbaf462266

Expand Down
30 changes: 30 additions & 0 deletions wifi/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (C) 2020 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 := \
libqmiservices_shim.cpp

LOCAL_SHARED_LIBRARIES := libqmiservices libbase
LOCAL_MODULE := libqmiservices_shim
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true

include $(BUILD_SHARED_LIBRARY)
19 changes: 19 additions & 0 deletions wifi/libqmiservices_shim.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#define LOG_TAG "wcnss_shim"

#include <android-base/logging.h>

extern "C" void* dms_get_service_object_internal_v01(int, int, int);

extern "C" void* dms_get_service_object_shimshim_v01(int, int, int) {
for (int i=0; i<255; ++i)
{
void* result = dms_get_service_object_internal_v01(1, i, 6);
if (result)
{
LOG(INFO) << "Found magic value: " << i;
return result;
}
}
// Nothing found
return 0;
}

0 comments on commit 38dedad

Please sign in to comment.