RK3568 RTL8821cs适配 WPA3连接 与 WPA3热点配置

kernel:4-19

SOC:RK3568

system:Android12

模组:RTL8821CS

调试手段可以看之前的正基AP6256

一.驱动配置:

首先设备树配置如下:

因为 SDIO 电压是1.8V,必须加上sd-uhs-sdr104;

&sdio_pwrseq{
		compatible = "mmc-pwrseq-simple";
		clocks = <&pmucru CLK_RTC_32K>;
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_enable_h>;

		/*
		 * On the module itself this is one of these (depending
		 * on the actual card populated):
		 * - SDIO_RESET_L_WL_REG_ON
		 * - PDN (power down when low)
		 */
		post-power-on-delay-ms = <200>;
		reset-gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>;
		status = "okay";
};

//sdio

&sdmmc1 {
	max-frequency = <150000000>;
	supports-sdio;
	bus-width = <4>;
	cap-sd-highspeed;
	cap-sdio-irq;
	keep-power-in-suspend;
	mmc-pwrseq = <&sdio_pwrseq>;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
	sd-uhs-sdr104;
	status = "okay";
};

rockchip_defconfig配置如下

CONFIG_WL_ROCKCHIP=y
CONFIG_WIFI_BUILD_MODULE=y
CONFIG_RTL_WIRELESS_SOLUTION=y
CONFIG_RTL8821CS=m

如果上电和sdio通路正常,SDIO会读出该模组的ID(日志如下),

[   11.206833][    T9] mmc_host mmc1: Bus speed (slot 0) = 375000Hz (slot req 400000Hz, actual 375000HZ div = 0)
[   11.226160][  T120] dwmmc_rockchip fe2c0000.dwmmc: card claims to support voltages below defined range
[   11.254622][  T120] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 100000000Hz, actual 50000000HZ div = 0)
[   11.616025][  T120] dwmmc_rockchip fe2c0000.dwmmc: Successfully tuned phase to 1
[   11.617214][  T120] mmc1: new ultra high speed SDR50 SDIO card at address 0001

然后上层去加载驱动frameworks/opt/net/wifi/libwifi_hal/rk_wifi_ctrl.cpp

UNKOWN_DRIVER_MODULE_ARG  为驱动参数


#define RTL8723BS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8723bs.ko"
#define RTL8723BS_VQ0_DRIVER_MODULE_PATH WIFI_MODULE_PATH"8723bs-vq0.ko"
#define RTL8723CS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8723cs.ko"
#define RTL8723DS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8723ds.ko"
#define RTL8188FU_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8188fu.ko"
#define RTL8822BU_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822bu.ko"
#define RTL8822BS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822bs.ko"
#define RTL8189ES_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8189es.ko"
#define RTL8189FS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8189fs.ko"
#define RTL8192DU_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8192du.ko"
#define RTL8812AU_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8812au.ko"
#define RTL8822BE_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822be.ko"
#define RTL8821CS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8821cs.ko"
#define RTL8822CU_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822cu.ko"
#define RTL8822CS_DRIVER_MODULE_PATH     WIFI_MODULE_PATH"8822cs.ko"
#define SSV6051_DRIVER_MODULE_PATH       WIFI_MODULE_PATH"ssv6051.ko"
#define ESP8089_DRIVER_MODULE_PATH       WIFI_MODULE_PATH"esp8089.ko"
#define BCM_DRIVER_MODULE_PATH           WIFI_MODULE_PATH"bcmdhd.ko"
#define MLAN_DRIVER_MODULE_PATH          WIFI_MODULE_PATH"mlan.ko"
#define MVL_DRIVER_MODULE_PATH           WIFI_MODULE_PATH"sd8xxx.ko"
#define RK912_DRIVER_MODULE_PATH         WIFI_MODULE_PATH"rk912.ko"
#define SPRDWL_DRIVER_MODULE_PATH        WIFI_MODULE_PATH"sprdwl_ng.ko"
#define BES2600_DRIVER_MODULE_PATH        WIFI_MODULE_PATH"bes2600.ko"

#define RTL8188EU_DRIVER_MODULE_NAME     "8188eu"
#define RTL8723BU_DRIVER_MODULE_NAME     "8723bu"
#define RTL8723BS_DRIVER_MODULE_NAME     "8723bs"
#define RTL8723BS_VQ0_DRIVER_MODULE_NAME "8723bs-vq0"
#define RTL8723CS_DRIVER_MODULE_NAME     "8723cs"
#define RTL8723DS_DRIVER_MODULE_NAME     "8723ds"
#define RTL8188FU_DRIVER_MODULE_NAME     "8188fu"
#define RTL8822BU_DRIVER_MODULE_NAME     "8822bu"
#define RTL8822BS_DRIVER_MODULE_NAME     "8822bs"
#define RTL8189ES_DRIVER_MODULE_NAME     "8189es"
#define RTL8189FS_DRIVER_MODULE_NAME     "8189fs"
#define RTL8192DU_DRIVER_MODULE_NAME     "8192du"
#define RTL8812AU_DRIVER_MODULE_NAME     "8812au"
#define RTL8822BE_DRIVER_MODULE_NAME     "8822be"
#define RTL8821CS_DRIVER_MODULE_NAME     "8821cs"
#define RTL8822CU_DRIVER_MODULE_NAME     "8822cu"
#define RTL8822CS_DRIVER_MODULE_NAME     "8822cs"
#define SSV6051_DRIVER_MODULE_NAME       "ssv6051"
#define ESP8089_DRIVER_MODULE_NAME       "esp8089"
#define BCM_DRIVER_MODULE_NAME           "bcmdhd"
#define MVL_DRIVER_MODULE_NAME           "sd8xxx"
#define RK912_DRIVER_MODULE_NAME         "rk912"
#define SPRDWL_DRIVER_MODULE_NAME        "sprdwl"
WN_DRIVER_MODULE_ARG:q
#define BES2600_DRIVER_MODULE_NAME       "bes2600"

#define UNKOWN_DRIVER_MODULE_ARG "rtw_RFE_type=2" //驱动参数,
#define SSV6051_DRIVER_MODULE_ARG "stacfgpath=/vendor/etc/firmware/ssv6051-wifi.cfg"
#define MVL88W8977_DRIVER_MODULE_ARG "drv_mode=1 fw_name=mrvl/sd8977_wlan_v2.bin cal_data_cfg=none cfg80211_wext=0xf"

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"},
};

const wifi_file_name module_list[] =
{
        {"RTL8723BU", RTL8723BU_DRIVER_MODULE_NAME, RTL8723BU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8188EU", RTL8188EU_DRIVER_MODULE_NAME, RTL8188EU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8192DU", RTL8192DU_DRIVER_MODULE_NAME, RTL8192DU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8822BU", RTL8822BU_DRIVER_MODULE_NAME, RTL8822BU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8822BS", RTL8822BS_DRIVER_MODULE_NAME, RTL8822BS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8188FU", RTL8188FU_DRIVER_MODULE_NAME, RTL8188FU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8189ES", RTL8189ES_DRIVER_MODULE_NAME, RTL8189ES_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8723BS", RTL8723BS_DRIVER_MODULE_NAME, RTL8723BS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8723CS", RTL8723CS_DRIVER_MODULE_NAME, RTL8723CS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8723DS", RTL8723DS_DRIVER_MODULE_NAME, RTL8723DS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8812AU", RTL8812AU_DRIVER_MODULE_NAME, RTL8812AU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8189FS", RTL8189FS_DRIVER_MODULE_NAME, RTL8189FS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8822BE", RTL8822BE_DRIVER_MODULE_NAME, RTL8822BE_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8821CS", RTL8821CS_DRIVER_MODULE_NAME, RTL8821CS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8822CU", RTL8822CU_DRIVER_MODULE_NAME, RTL8822CU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
                                                                                                                              108,9         39%
        {"RTL8821CS", RTL8821CS_DRIVER_MODULE_NAME, RTL8821CS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8822CU", RTL8822CU_DRIVER_MODULE_NAME, RTL8822CU_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"RTL8822CS", RTL8822CS_DRIVER_MODULE_NAME, RTL8822CS_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, REALTEK_WIFI_HAL},
        {"SSV6051",     SSV6051_DRIVER_MODULE_NAME,   SSV6051_DRIVER_MODULE_PATH, SSV6051_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"ESP8089",     ESP8089_DRIVER_MODULE_NAME,   ESP8089_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"AP6335",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"AP6330",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"AP6354",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"AP6356S",         BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"AP6255",          BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"APXXX",           BCM_DRIVER_MODULE_NAME,       BCM_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"MVL88W8977",      MVL_DRIVER_MODULE_NAME,       MVL_DRIVER_MODULE_PATH, MVL88W8977_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"RK912",         RK912_DRIVER_MODULE_NAME,     RK912_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BROADCOM_WIFI_HAL},
        {"SPRDWL",          SPRDWL_DRIVER_MODULE_NAME, SPRDWL_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, SPRD_WIFI_HAL},
        {"BES2600",          BES2600_DRIVER_MODULE_NAME, BES2600_DRIVER_MODULE_PATH, UNKOWN_DRIVER_MODULE_ARG, BES_WIFI_HAL},
};

一.wpa3配置:

wpa3需要厂家给驱动的支持,没有可以找RK原厂要,他们有

修改Packages/modules/Wifi/service/ServiceWifiResources/res/values/config

@@ -28,7 +28,7 @@
          Note: This config is replacing the config_wifi_dual_band_support
          since more bands may now be supported (such as 6GHz), the naming dual_band
          is no longer indicative, and a separate config now exists for each band -->
-    false
+    true
 
     
     false
@@ -174,7 +174,7 @@
     false
 
     
-    16
+    8
 
     
     true
@@ -278,16 +278,16 @@
     true
 
     
-    false
+    true
 
     
-    false
+    true
 
     
     true
 
     
-    false
+    true

你可能感兴趣的:(fpga开发)