From 2b7852c499d0cb6ac84c3f9a1efeaa08f30afbb0 Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Fri, 7 Aug 2020 10:44:17 -0400 Subject: [PATCH 1/3] fix cfg80211 of 8723cs --- .../wifi-4002-add-realtek-8723cs.patch | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch b/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch index c8b1a4040d..22179d141b 100644 --- a/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch +++ b/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch @@ -69951,7 +69951,7 @@ new file mode 100644 index 00000000..6ee63c1d --- /dev/null +++ b/drivers/net/wireless/realtek/rtl8723cs/core/rtw_security.c -@@ -0,0 +1,3320 @@ +@@ -0,0 +1,3354 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. @@ -314093,6 +314093,33 @@ index 00000000..4b44a788 + return ret; +} + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) ++ ++static void ++cfg80211_rtw_update_mgmt_frame_registrations(struct wiphy *wiphy, ++ struct wireless_dev *wdev, ++ struct mgmt_frame_regs *upd) ++{ ++ struct net_device *ndev = wdev_to_ndev(wdev); ++ struct rtw_wdev_priv *pwdev_priv; ++ _adapter *adapter; ++ ++ if (ndev == NULL) ++ return; ++ ++ adapter = (_adapter *)rtw_netdev_priv(ndev); ++ pwdev_priv = adapter_wdev_data(adapter); ++ ++#ifdef CONFIG_DEBUG_CFG80211 ++ RTW_INFO(FUNC_ADPT_FMT" stypes:%x\n", FUNC_ADPT_ARG(adapter), ++ upd->interface_stypes); ++#endif ++ ++ /* not implemented, see bellow */ ++} ++ ++#else ++ +static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + struct wireless_dev *wdev, @@ -314137,6 +314164,8 @@ index 00000000..4b44a788 + return; +} + ++#endif ++ +#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, + struct net_device *ndev, @@ -315046,7 +315075,11 @@ index 00000000..4b44a788 + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) + .mgmt_tx = cfg80211_rtw_mgmt_tx, -+// .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) ++ .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations, ++#else ++ .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, ++#endif +#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35)) + .action = cfg80211_rtw_mgmt_tx, +#endif From 3024e76754dea9650b463ab3109f48803dc2952f Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Fri, 7 Aug 2020 12:05:10 -0400 Subject: [PATCH 2/3] fix broken 8723cs patch --- patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch b/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch index 22179d141b..86b5056b8a 100644 --- a/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch +++ b/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch @@ -69951,7 +69951,7 @@ new file mode 100644 index 00000000..6ee63c1d --- /dev/null +++ b/drivers/net/wireless/realtek/rtl8723cs/core/rtw_security.c -@@ -0,0 +1,3354 @@ +@@ -0,0 +1,3320 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. @@ -308434,7 +308434,7 @@ new file mode 100644 index 00000000..4b44a788 --- /dev/null +++ b/drivers/net/wireless/realtek/rtl8723cs/os_dep/linux/ioctl_cfg80211.c -@@ -0,0 +1,6905 @@ +@@ -0,0 +1,6938 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. From 1e524710a2186f7ac186e514a45a8215a1c09481 Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Fri, 7 Aug 2020 12:07:51 -0400 Subject: [PATCH 3/3] fix indentation in 8723cs patch --- patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch b/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch index 86b5056b8a..fffd4a4266 100644 --- a/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch +++ b/patch/kernel/sunxi-dev/wifi-4002-add-realtek-8723cs.patch @@ -315076,7 +315076,7 @@ index 00000000..4b44a788 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) + .mgmt_tx = cfg80211_rtw_mgmt_tx, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) -+ .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations, ++ .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations, +#else + .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, +#endif