这里演示的是替换AIC8800D80到 RK3568
一. 修改device配置
在BPI-RockChip-Android11/device/rockchip/common/device.mk中增加
ifeq ($(strip $(BOARD_HAVE_BLUETOOTH_AIC)), true)
include hardware/aic/aicbt/aicbt.mk
endif
在init.insmod.cfg 下增加
insmod /vendor/lib/modules/aic8800_bsp.ko
在wifi_bt_common.mk 中增加
BOARD_HAVE_BLUETOOTH_AIC := true
在wpa_config.txt 中增加
[aic]
/vendor/bin/hw/wpa_supplicant
-O/data/vendor/wifi/wpa/sockets
-puse_p2p_group_interface=1
-g@android:wpa_wlan0
二. 配置AIC的Wifi驱动到wpa_supplicant
在 external/wpa_supplicant_8/wpa_supplicant 下面修改main.c
#define AIC_MODULE_NAME "[aic]"
....
int main(int argc, char *argv[])
{
int ret = -1;
char module_type[20]={0};
wpa_printf(MSG_INFO,"argc = %d\n",argc);
if(argc == 2) {
if (wifi_type[0] == 0) {
check_wifi_chip_type_string(wifi_type);
}
wpa_printf(MSG_INFO,"Current wifi chip is %s\n",wifi_type);
if (0 == strncmp(wifi_type, "RTL", 3)) {
wpa_printf(MSG_INFO,"Start rtl_wpa_supplicant\n");
ret = read_wpa_param_config(REALTEK_MODULE_NAME,argv[1]);
} else if (0 == strncmp(wifi_type, "AP", 2)) {
wpa_printf(MSG_INFO,"Start bcm_wpa_supplicant\n");
ret = read_wpa_param_config(BROADCOM_MODULE_NAME,argv[1]);
} else if (0 == strncmp(wifi_type, "SSV", 3) ||
0 == strncmp(wifi_type, "RK912", 5)) {
wpa_printf(MSG_INFO,"Start ssv_wpa_supplicant\n");
ret = read_wpa_param_config(SSV_MODULE_NAME,argv[1]);
} else if (0 == strncmp(wifi_type, "ESP", 3)) {
wpa_printf(MSG_INFO,"Start esp_wpa_supplicant\n");
ret = read_wpa_param_config(ESP_MODULE_NAME,argv[1]);
} else if (0 == strncmp(wifi_type, "SPRDWL", 6)) {
wpa_printf(MSG_INFO,"Start sprdwl_wpa_supplicant\n");
ret = read_wpa_param_config(SPRDWL_MODULE_NAME,argv[1]);
} else if (0 == strncmp(wifi_type, "AIC", 3)) { // ----------增加AIC的配置写入
wpa_printf(MSG_INFO,"Start aic_wpa_supplicant\n");
ret = read_wpa_param_config(AIC_MODULE_NAME,argv[1]);
} else {
wpa_printf(MSG_INFO,"Start wpa_supplicant\n");
sprintf(module_type,"[%s]",wifi_type);
ret = read_wpa_param_config(module_type,argv[1]);
}
} else {
wpa_printf(MSG_INFO,"Start wpa_supplicant\n");
ret = main_loop(argc, argv);
}
return ret;
}
三.修改libwifi的配置,使得后续加载AIC驱动
在frameworks/opt/net/wifi/libwifi_hal
rk_wifi_ctrl.cpp
static wifi_device supported_wifi_devices[] = {
....
{"SPRDWL", "0000:0000"},
{"AIC8800", "5449:0145"}, // 增加配置
};
wifi_hal_common.cpp
// 增加配置
#define AIC8800_DRIVER_MODULE_PATH WIFI_MODULE_PAT