aosp14版本 搭配了kernel6.1 ,DTS配置wifi节点.
wifi驱动使用 kernel中默认的 /common/drivers/net/wireless/bcmdhd
aosp烧录后bcmdhd.ko文件被复制到/vendor/lib/module下面.开机过程中驱动会被自动加载,
在设置菜单上开启wifi时候会有遇到
android.hardware.wifi-service: finit_module return: -1: File exists
android.hardware.wifi-service: Failed to load WiFi driver
android.hardware.wifi-service: Failed to initialize firmware mode controller
android.hardware.wifi-service: Wifi HAL start failed
查看代码位置在aosp14_vim3/frameworks/opt/net/wifi/libwifi_hal/wifi_hal_common.cpp
ret = syscall(__NR_finit_module, fd, args, 0);
wifi开启中如果已经加载会返回错误,无法完成load,是因为不需要自动加载ko还是其他权限没有配置导致?
static int insmod(const char *filename, const char *args) {
int ret;
int fd;
fd = TEMP_FAILURE_RETRY(open(filename, O_RDONLY | O_CLOEXEC | O_NOFOLLOW));
if (fd < 0) {
PLOG(ERROR) << "Failed to open " << filename;
return -1;
}
ret = syscall(__NR_finit_module, fd, args, 0);
close(fd);
if (ret < 0) {
PLOG(ERROR) << "finit_module return: " << ret;
}