WIFI移植
因为RK3568支持RTL8821CS模组,因此从RK3568移植RTL8821CS驱动
- 移植RTL8821驱动:
1.1 drivers/net/wireless/rockchip_wlan/Kconfig
git@grsthu-virtual-machine:~/rk3399_linux/kernel$ git diff drivers/net/wireless/rockchip_wlan/Kconfig
diff --git a/drivers/net/wireless /rockchip_wlan/Kconfig b/drivers/net/wireless/rockchip_wlan/Kconfig
index 6bfc72b9fde0..d56f339eb085 100644
--- a/drivers/net/wireless/rockchip_wlan/Kconfig
+++ b/drivers/net/wireless/rockchip_wlan/Kconfig
@ @ -44,6 +44,7 @@ source "drivers/net/wireless/rockchip_wlan/rtl8723bu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723cs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723ds /Kconfig"
源 "drivers/net/wireless/rockchip_wlan/rtl8822be/Kconfig"
+source "drivers/net/wireless/rockchip_wlan/rtl8821cs/Kconfig"
1.2 驱动程序/net/wireless/rockchip_wlan/Makefile
git@grsthu-virtual-machine:~/rk3399_linux/kernel$ git diff drivers/net/wireless/rockchip_wlan/Makefile
diff --git a/drivers/net/wireless/rockchip_wlan/Makefile b/drivers/net/wireless/rockchip_wlan/Makefile
index fb0e47b2ecfd..d693f2ad0f5d 100644
--- a/drivers/net/wireless/rockchip_wlan/Makefile
+++ b /drivers/net/wireless/rockchip_wlan/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_RTL8723BU) += rtl8723bu/
obj-$(CONFIG_RTL8723CS) += rtl8723cs/
obj-$(CONFIG_RTL8723DS) += rtl8723ds/
obj-$(CONFIG_RTL8822BE) += rtl8822be/
+obj-$(CONFIG_RTL8821CS) += rtl8821cs/
1.3 arch/arm64/boot/dts/rockchip/rk3399-grst-a2.dtsi
差异 --git a/arch/arm64/boot/dts/rockchip/rk3399-grst-a2.dtsi b/arch/arm64/boot/dts /rockchip/rk3399-grst-a2.dtsi
索引 6fb7749af469..48228f2709ea 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-grst-a2.dtsi
+++ b/arch/arm64/boot/dts /rockchip/rk3399-grst-a2.dtsi
@@ -122,7 +122,7 @@
wireless-wlan {
compatible = "wlan-platdata";
Rockchip,grf = <&grf>;
- wifi_chip_type = "rtl8723ds";
+ wifi_chip_type = "rtl8821cs";
sdio_vref = <1800>;
WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>;
1.4 arch/arm64/configs/rockchip_linux_defconfig
diff --git a/arch/arm64/configs/rockchip_linux_defconfig b/arch/arm64/configs/rockchip_linux_defconfig
index 5587013ba113..093d9523a0e6 100644
--- a/arch/arm64/configs/rockchip_linux_defconfig
++ + b/arch/arm64/configs/rockchip_linux_defconfig
@@ -576,4 +576,4 @@ CONFIG_CAN_DEV=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_GW=y
-CONFIG_RTL8723DS=m
+CONFIG_RTL8821CS=m
1.5 驱动拷贝到路径
drivers/net/wireless/rockchip_wlan/rtl8821cs/
- 内核修改
2.1 增加RTL8821CS wifi类型,用于dts中的类型判断
2.1.1 include/linux/rfkill-wlan.h
git@grsthu-virtual-machine:~/rk3399_linux/kernel$ git diff include/linux/rfkill-wlan.h
diff --git a/include/linux/rfkill-wlan.h b/include/linux/rfkill-wlan.h
index 883d0ae1a8bf..8165476cddb8 100644
--- a/include/linux/rfkill-wlan.h
+++ b/include/linux/rfkill-wlan.h
@@ -74,6 +74,7 @@ enum {
WIFI_RTL8189ES,
WIFI_RTL8189FS,
WIFI_RTL8812AU,
+ WIFI_RTL8821CS,
WIFI_RTL_SERIES,
2.1.2 net/rfkill/rfkill-wlan.c
git@grsthu-virtual-machine:~/rk3399_linux/kernel$ git diff net/rfkill/rfkill-wlan.c
diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c
index 333368f2f071..e424fd4b27a6 100644
--- a/net/rfkill/rfkill-wlan.c
+++ b/net/rfkill/rfkill-wlan.c
@@ -156,6 +156,8 @@ int get_wifi_chip_type(void)
type = WIFI_RTL8189FS;
} else if (strcmp(wifi_chip_type_string, "rtl8812au") == 0) {
type = WIFI_RTL8812AU;
+ } else if (strcmp(wifi_chip_type_string, "rtl8821cs") == 0) {
+ type = WIFI_RTL8821CS;
} else if (strcmp(wifi_chip_type_string, "esp8089") == 0) {
type = WIFI_ESP8089;
} else if (strcmp(wifi_chip_type_string, "mvl88w8977") == 0) {
2.2 内核版本不一致做的修改
2.2.1 include/net/cfg80211.h
git@grsthu-virtual-machine:~/rk3399_linux/kernel$ git diff include/net/cfg80211.h
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c05748cc1b20..768a35728ce5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2220,6 +2220,34 @@ struct cfg80211_qos_map {
struct cfg80211_dscp_exception dscp_exception[IEEE80211_QOS_MAP_MAX_EX];
struct cfg80211_dscp_range up[8];
};
+/**
+ * struct cfg80211_external_auth_params - Trigger External authentication.
+ *
+ * Commonly used across the external auth request and event interfaces.
+ *
+ * @action: action type / trigger for external authentication. Only significant
+ * for the authentication request event interface (driver to user space).
+ * @bssid: BSSID of the peer with which the authentication has
+ * to happen. Used by both the authentication request event and
+ * authentication response command interface.
+ * @ssid: SSID of the AP. Used by both the authentication request event and
+ * authentication response command interface.
+ * @key_mgmt_suite: AKM suite of the respective authentication. Used by the
+ * authentication request event interface.
+ * @status: status code, %WLAN_STATUS_SUCCESS for successful authentication,
+ * use %WLAN_STATUS_UNSPECIFIED_FAILURE if user space cannot give you
+ * the real status code for failures. Used only for the authentication
+ * response command interface (user space to driver).
+ * @pmkid: The identifier to refer a PMKSA.
+ */
+struct cfg80211_external_auth_params {
+ enum nl80211_external_auth_action action;
+ u8 bssid[ETH_ALEN] __aligned(2);
+ struct cfg80211_ssid ssid;
+ unsigned int key_mgmt_suite;
+ u16 status;
+ const u8 *pmkid;
+};
/**
* struct cfg80211_ops - backend description for wireless configuration
@@ -2756,6 +2784,8 @@ struct cfg80211_ops {
void (*tdls_cancel_channel_switch)(struct wiphy *wiphy,
struct net_device *dev,
const u8 *addr);
+ int (*external_auth)(struct wiphy *wiphy, struct net_device *dev,
+ struct cfg80211_external_auth_params *params);
};
/*
@@ -3516,6 +3546,8 @@ struct wireless_dev {
u8 ssid_len, mesh_id_len, mesh_id_up_len;
struct cfg80211_conn *conn;
struct cfg80211_cached_keys *connect_keys;
+ u32 conn_owner_nlportid;
+
struct list_head event_list;
spinlock_t event_lock;
@@ -5340,6 +5372,17 @@ wiphy_ext_feature_isset(struct wiphy *wiphy,
/* ethtool helper */
void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
+/**
+ * cfg80211_external_auth_request - userspace request for authentication
+ * @netdev: network device
+ * @params: External authentication parameters
+ * @gfp: allocation flags
+ * Returns: 0 on success, < 0 on error
+ */
+int cfg80211_external_auth_request(struct net_device *netdev,
+ struct cfg80211_external_auth_params *params,
+ gfp_t gfp);
+
/* Logging, debugging and troubleshooting/diagnostic helpers. */
/* wiphy_printk helpers, similar to dev_printk */
2.2.2 include/uapi/linux/nl80211.h
git@grsthu-virtual-machine:~/rk3399_linux/kernel$ git diff include/uapi/linux/nl80211.h
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index d3aea4f10faf..86466a0f191f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1006,6 +1006,41 @@ enum nl80211_commands {
NL80211_CMD_WIPHY_REG_CHANGE,
+ NL80211_CMD_START_NAN,
+ NL80211_CMD_STOP_NAN,
+ NL80211_CMD_ADD_NAN_FUNCTION,
+ NL80211_CMD_DEL_NAN_FUNCTION,
+ NL80211_CMD_CHANGE_NAN_CONFIG,
+ NL80211_CMD_NAN_MATCH,
+
+ NL80211_CMD_SET_MULTICAST_TO_UNICAST,
+
+ NL80211_CMD_UPDATE_CONNECT_PARAMS,
+
+ NL80211_CMD_SET_PMK,
+ NL80211_CMD_DEL_PMK,
+
+ NL80211_CMD_PORT_AUTHORIZED,
+
+ NL80211_CMD_RELOAD_REGDB,
+
+ NL80211_CMD_EXTERNAL_AUTH,
+
+ NL80211_CMD_STA_OPMODE_CHANGED,
+
+ NL80211_CMD_CONTROL_PORT_FRAME,
+
+ NL80211_CMD_GET_FTM_RESPONDER_STATS,
+
+ NL80211_CMD_PEER_MEASUREMENT_START,
+ NL80211_CMD_PEER_MEASUREMENT_RESULT,
+
+ NL80211_CMD_PEER_MEASUREMENT_COMPLETE,
+
+ NL80211_CMD_NOTIFY_RADAR,
+
+ NL80211_CMD_UPDATE_OWE_INFO,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -2157,6 +2192,100 @@ enum nl80211_attrs {
NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
NL80211_ATTR_SCHED_SCAN_PLANS,
+ NL80211_ATTR_PBSS,
+
+ NL80211_ATTR_BSS_SELECT,
+
+ NL80211_ATTR_STA_SUPPORT_P2P_PS,
+
+ NL80211_ATTR_PAD,
+
+ NL80211_ATTR_IFTYPE_EXT_CAPA,
+
+ NL80211_ATTR_MU_MIMO_GROUP_DATA,
+ NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR,
+
+ NL80211_ATTR_SCAN_START_TIME_TSF,
+ NL80211_ATTR_SCAN_START_TIME_TSF_BSSID,
+ NL80211_ATTR_MEASUREMENT_DURATION,
+ NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY,
+
+ NL80211_ATTR_MESH_PEER_AID,
+
+ NL80211_ATTR_NAN_MASTER_PREF,
+ NL80211_ATTR_BANDS,
+ NL80211_ATTR_NAN_FUNC,
+ NL80211_ATTR_NAN_MATCH,
+
+ NL80211_ATTR_FILS_KEK,
+ NL80211_ATTR_FILS_NONCES,
+
+
|
|
2022-3-8 10:44:01
评论
举报
|
|
|