移植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



你可能感兴趣的:(移植rtl8188 wifi模块到android 8.1(android o))