1. 程式人生 > >移植rtl8188 wifi模組到android 8.1(android o)

移植rtl8188 wifi模組到android 8.1(android o)

一、驅動部分

1、rtl8188eu/rtl8188fu驅動,修改對應目錄下的makefile,適應平臺

2、檢測模組電壓、時鐘是否正確。硬體正常的話,可以用lsusb檢視到模組的廠商ID和裝置ID。

3、載入驅動後, ifconfig -a可以看到網口,用iw命令測試wifi,能掃描出附近的熱點,說明硬體和驅動部分沒什麼問題

二、安卓層

需要根據realtek文件做一些修改,andorid 8需要在啟動指令碼中載入wifi模組

三、wpa_supplicant沒有編譯的問題

1、新增軟體包:

PRODUCT_PACKAGES += \
libwpa_client wpa_supplicant hostapd wificond wifilogd wpa_supplicant.conf

2、external/wpa_supplicant_8/Android.mk是這麼寫的:

LOCAL_PATH:= $(call my-dir)

ifneq ($(filter VER_0_8_X VER_2_1_DEVEL,$(WPA_SUPPLICANT_VERSION)),)
# The order of the 2 Android.mks does matter!
# TODO: Clean up the Android.mks, reset all the temporary variables at the
# end of each Android.mk, so that one Android.mk doesn't depend on variables
# set up in the other Android.mk.
include $(LOCAL_PATH)/hostapd/Android.mk \
        $(LOCAL_PATH)/wpa_supplicant/Android.mk
endif

所以需要在.mk檔案中指定WPA_SUPPLICANT_VERSION等,才會編譯wpa_supplicant及其庫

在BoardConfig.mk中新增:

BOARD_WIFI_VENDOR := realtek
ifeq ($(BOARD_WIFI_VENDOR), realtek)

WPA_SUPPLICANT_VERSION := VER_0_8_X

BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_rtl

BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_rtl
BOARD_WLAN_DEVICE := rtl8822bu
#BOARD_WLAN_DEVICE := rtl8192cu
#BOARD_WLAN_DEVICE := rtl8192du
#BOARD_WLAN_DEVICE := rtl8192ce
#BOARD_WLAN_DEVICE := rtl8192de
#BOARD_WLAN_DEVICE := rtl8723as
#BOARD_WLAN_DEVICE := rtl8723au
#BOARD_WLAN_DEVICE := rtl8189es
#BOARD_WLAN_DEVICE := rtl8723bs
#BOARD_WLAN_DEVICE := rtl8723bu
endif