现象:WiFi、蓝牙驱动已安装,设备树等配置都已完成,但是WiFi/蓝牙还是打不开,要排除是否是开发板识别蓝牙WiFi芯片有误的情况。
目录
一、WIFI 芯片识别流程
1.、开机对 wifi 模块上电,并自动进行扫描 sdio 操作。
2.、系统启动打开 wifi 操作时,分别对系统 sys/bus/sdio(sdio wifi), sys/bus/usb(usb wifi), sys/bus/pic (pcie wifi )文件系统下的 uevent 进行读取。
3、获取到 wifi 芯片 vid pid 加载相应的 wifi ko 驱动。
4. 识别到 wifi 类型后加载不同的 wpa_supplicant 参数启动 wifi。
二、WiFi芯片识别有误
1、adb命令查看加载的WIFI芯片
adb输入lsmod查看开发板加载的WiFi/蓝牙驱动。如果你是8821cs模块,它扫描SDIO_ID和8821cs模块的pid vid不一致,就会加载默认模块博通bcmdhd。下图是我已经修改后的情况。
2、WIFI芯片对应的pid vid
不同WiFi/蓝牙模块对应的pid vid在3566_Android11\sdk\frameworks\opt\net\wifi\libwifi_hal\rk_wifi_ctrl.cpp这个文件下
static wifi_device supported_wifi_devices[] = {
{"RTL8188EU", "0bda:8179"},
{"RTL8188EU", "0bda:0179"},
{"RTL8723BU", "0bda:b720"},
{"RTL8723BS", "024c:b723"},
{"RTL8822BS", "024c:b822"},
{"RTL8723CS", "024c:b703"},
{"RTL8723DS", "024c:d723"},
{"RTL8188FU", "0bda:f179"},
{"RTL8822BU", "0bda:b82c"},
{"RTL8189ES", "024c:8179"},
{"RTL8189FS", "024c:f179"},
{"RTL8192DU", "0bda:8194"},
{"RTL8812AU", "0bda:8812"},
{"RTL8821CS", "024c:c821"},
{"RTL8822CU", "0bda:c82c"},
{"RTL8822CS", "024c:c822"},
{"SSV6051", "3030:3030"},
{"ESP8089", "6666:1111"},
{"AP6354", "02d0:4354"},
{"AP6330", "02d0:4330"},
{"AP6356S", "02d0:4356"},
{"AP6335", "02d0:4335"},
{"AP6255", "02d0:a9bf"},
{"RTL8822BE", "10ec:b822"},
{"MVL88W8977", "02df:9145"},
{"SPRDWL", "0000:0000"},
};
3、查看WiFi芯片设备和ID号
当识别模块pid vid对应不上wifi_device设定的pid vid时,将默认加载“APXXX” 型号的WiFi/蓝牙芯片。如需修改,可以将默认型号改为自己开发板对应的型号,我这里以rtl8821cs举例。
通过cat uevent可以查看SDIO_ID=024C:B821,与对应的pid vid (024C:c821)不对应,匹配不上pid vid,就会加载默认的芯片。
4、修改默认加载芯片模块
diff --git a/libwifi_hal/rk_wifi_ctrl.cpp b/libwifi_hal/rk_wifi_ctrl.cpp
@@ -262,7 +266,7 @@ int check_wifi_chip_type_string(char *type)
PLOG(DEBUG) << "PCIE WIFI identify sucess";
else {
PLOG(DEBUG) << "maybe there is no usb wifi or sdio or pcie wifi,set default wifi module Brocom APXXX";
- strcpy(recoginze_wifi_chip, "APXXX");
+ strcpy(recoginze_wifi_chip, "RTL8821CS");
identify_sucess = 1 ;
}
}
标签:WiFi,vid,rk3566,芯片,pid,wifi,蓝牙,加载
From: https://blog.csdn.net/m0_59477819/article/details/141956232