例子:8188eu.ko和8188gu.ko
首先,先获取最新的驱动文件
\kernel\drivers\net\wireless\rtlwifi\

然后修改Kconfig和Makefile先编译出8188xx.o文件
CONFIG_RTL8188EU=y
CONFIG_RTL8188GU=y
先分别测试好之后修改成
CONFIG_RTL8188EU=m
# CONFIG_RTL8189ES is not set
# CONFIG_RTL8192CU is not set
# CONFIG_RTL8192DU is not set
# CONFIG_RTL8723AU is not set
# CONFIG_RTL8723BU is not set
# CONFIG_RTL8723DU is not set
# CONFIG_RTL8723BS is not set
# CONFIG_RTL8723BS_VQ0 is not set
# CONFIG_RTL8812AU is not set
# CONFIG_RTL8189FS is not set
# CONFIG_RTL8188FU is not set
CONFIG_RTL8188GTVU=m
# CONFIG_RK915 is not set
# CONFIG_ESP8089 is not set
# CONFIG_RKWIFI is not set
然后到kernel下编译 make modules 得到8188eu.ko和8188gu.ko
然后复制到external/wlan_loader/firmware/
然后\sdk\device\rockchip\rk3128\rk3128.mk中添加
PRODUCT_COPY_FILES += \
external/wlan_loader/8188eu.ko:system/lib/modules/8188eu.ko \
external/wlan_loader/8188gu.ko:system/lib/modules/8188gu.ko
然后ko文件就安排好了,可以手动进去
insmod /system/lib/modules/8188eu.ko
insmod /system/lib/modules/8188gu.ko
安装看一下有无反应
然后
\device\rockchip\common\开机运行脚本.sh
function check_fac_reset()
{
reset=`getprop persist.sys.nt68661`
log reset= $reset
if [ "a$reset" == "a1" ]; then
mount -o rw,remount -t ext4 /system
log upadte-hdmi-bin
chmod 777 /system/etc/*.bin
echo updatebin > /proc/oem_gpio
mount -o ro,remount -t ext4 /system
log upadte-hdmi-bin ok
setprop persist.sys.nt68661 "0"
fi
}
+ detect_wifi(){
+
+ log "detect wifi----"
+
+ id=`cat /sys/kernel/debug/usb/devices | grep 0179`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8188
+ insmod /system/lib/modules/8188eu.ko
+
+ return
+
+ fi
+
+ id=`cat /sys/kernel/debug/usb/devices | grep 8179`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8188 es
+ insmod /system/lib/modules/8188eu.ko
+
+ return
+
+ fi
+
+ id=`cat /sys/kernel/debug/usb/devices | grep 018c`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8188 gu
+ insmod /system/lib/modules/8188gu.ko
+
+ return
+
+ fi
+
+
+ id=`cat /sys/kernel/debug/usb/devices | grep c811`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8821
+
+ insmod /system/lib/modules/8821cu.ko
+ return
+ fi
+
+ id=`cat /sys/kernel/debug/usb/devices | grep b720`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8723bu
+
+ insmod /system/lib/modules/8723bu.ko
+ return
+ fi
+
+ id=`cat /sys/kernel/debug/usb/devices | grep f179`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8188fu
+
+ insmod /system/lib/modules/8188fu.ko
+ return
+ fi
+
+ id=`cat /sys/kernel/debug/usb/devices | grep 8194`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8192du
+
+ insmod /system/lib/modules/8192du.ko
+ return
+ fi
+
+ id=`cat /sys/kernel/debug/usb/devices | grep 8812`
+
+ log $id
+
+ if [ "a$id" != "a" ]; then
+
+ log wifi--rtl8812au
+
+ insmod /system/lib/modules/8812au.ko
+ return
+ fi
+
+
+
+
+ }
+
+ sleep 3
rm /data/system/*.key
sleep 5
+ detect_wifi
check_fac_reset
while true
do
echo "=====get_resource_path============"
get_resource_path
然后开机就可以看到wifi兼容了
//#########################################//
\kernel\drivers\net\wireless\rockchip_wlan\wifi_sys\rkwifi_sys_iface.c
- #ifdef CONFIG_WIFI_NONE
+ #if 0 //CONFIG_WIFI_NONE
int rockchip_wifi_init_module(void) {return 0;}
void rockchip_wifi_exit_module(void) {return;}
#else
extern int rockchip_wifi_init_module(void);
extern void rockchip_wifi_exit_module(void);
extern int rockchip_wifi_init_module_rkwifi(void);
extern void rockchip_wifi_exit_module_rkwifi(void);
extern int rockchip_wifi_init_module_rtkwifi(void);
extern void rockchip_wifi_exit_module_rtkwifi(void);
extern int rockchip_wifi_init_module_esp8089(void);
extern void rockchip_wifi_exit_module_esp8089(void);
#endif
static struct semaphore driver_sem;
static int wifi_driver_insmod = 0;
static int wifi_init_exit_module(int enable)
{
int ret = 0;
+ #ifdef CONFIG_WIFI_BUILD_MODULE
+ #else
int type = 0;
#ifdef CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP
type = get_wifi_chip_type();
if (type == WIFI_ESP8089) {
if (enable > 0)
ret = rockchip_wifi_init_module_esp8089();
else
rockchip_wifi_exit_module_esp8089();
return ret;
}
#else
type = get_wifi_chip_type();
//#ifdef CONFIG_RKWIFI
if (type < WIFI_AP6XXX_SERIES) {
if (enable > 0)
ret = rockchip_wifi_init_module_rkwifi();
else
rockchip_wifi_exit_module_rkwifi();
return ret;
}
//#endif
//#ifdef CONFIG_RTL_WIRELESS_SOLUTION
if (type < WIFI_RTL_SERIES) {
if (enable > 0)
ret = rockchip_wifi_init_module_rtkwifi();
else
rockchip_wifi_exit_module_rtkwifi();
return ret;
}
//#endif
//#ifdef CONFIG_ESP8089
if (type == WIFI_ESP8089) {
if (enable > 0)
ret = rockchip_wifi_init_module_esp8089();
else
rockchip_wifi_exit_module_esp8089();
return ret;
}
//#endif
+ #endif
#endif
return ret;
}
\kernel\drivers\net\wireless\Kconfig
- menuconfig RTL_WIRELESS_SOLUTION
- bool "Realtek Wireless Device Driver Support"
- default y
-
- if RTL_WIRELESS_SOLUTION
- choice
- prompt "Realtek WiFi Device Driver Support"
- default RTL8188EU
-
- config RTL_WIFI_NONE
- bool "No Realtek WiFi"
+ config WIFI_BUILD_MODULE
+ bool "build wifi ko modules"
+ default n
+ ---help---
+ wifi drivers will compile as ko module
+
+ config RTL_WIRELESS_SOLUTION
+ bool "Realtek Wireless Device Driver Support"
+ default y
+
+ if RTL_WIRELESS_SOLUTION
source "drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8189es/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8192cu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8192du/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723au/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723bu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723du/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723bs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8812au/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8189fs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8188fu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8188gu/Kconfig"
- endchoice
注意更新kernel的时候要重新编译.ko文件
本文档详细介绍了如何在RK3128设备上解决Android 5.1系统的Wi-Fi兼容问题。通过获取并修改 rtlwifi 目录下的驱动文件,编译生成8188eu.ko和8188gu.ko模块,然后将它们放置在指定目录,并在rk3128.mk中添加相关配置。完成这些步骤后,需要重新编译并验证Wi-Fi驱动是否正常工作,以确保设备在启动时能正确识别并使用Wi-Fi。
1万+

被折叠的 条评论
为什么被折叠?



