From a60437cbcb84e41f1d2bdcc693655ad36661d97cd175ffaa618b1b028ae0ee21 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Wed, 12 May 2021 06:41:12 +0000 Subject: [PATCH] Accepting request 892370 from home:alarrosa:branches:hardware - Add patch to build with Leap 15.3's kernel which includes backported patches to support update_mgmt_frame_registrations instead of mgmt_frame_register which would be expected according to the kernel version: * fix-backported-update_mgmt_frame_registrations.patch OBS-URL: https://build.opensuse.org/request/show/892370 OBS-URL: https://build.opensuse.org/package/show/hardware/rtl8812au?expand=0&rev=33 --- ...rted-update_mgmt_frame_registrations.patch | 95 +++++++++++++++++++ rtl8812au.changes | 9 ++ rtl8812au.spec | 10 +- 3 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 fix-backported-update_mgmt_frame_registrations.patch diff --git a/fix-backported-update_mgmt_frame_registrations.patch b/fix-backported-update_mgmt_frame_registrations.patch new file mode 100644 index 0000000..020c76f --- /dev/null +++ b/fix-backported-update_mgmt_frame_registrations.patch @@ -0,0 +1,95 @@ +From: Antonio Larrosa +Subject: Fix build with SLE 15-SP3 / Leap 15.3 + +The SLE 15 SP3/Leap 15.3's kernel includes +backported patches to support update_mgmt_frame_registrations +instead of mgmt_frame_register which would be expected +according to the kernel version, so we force to use the +more modern interface. + +Index: rtl8812au-5.9.3.2+git20210427.6ef5d8f/os_dep/linux/ioctl_cfg80211.c +=================================================================== +--- rtl8812au-5.9.3.2+git20210427.6ef5d8f.orig/os_dep/linux/ioctl_cfg80211.c ++++ rtl8812au-5.9.3.2+git20210427.6ef5d8f/os_dep/linux/ioctl_cfg80211.c +@@ -7902,61 +7902,6 @@ exit: + return ret; + } + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) +-static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) +- struct wireless_dev *wdev, +-#else +- struct net_device *ndev, +-#endif +- u16 frame_type, bool reg) +-{ +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) +- struct net_device *ndev = wdev_to_ndev(wdev); +-#endif +- _adapter *adapter; +- struct rtw_wdev_priv *pwdev_priv; +- +- if (ndev == NULL) +- goto exit; +- +- adapter = (_adapter *)rtw_netdev_priv(ndev); +- pwdev_priv = adapter_wdev_data(adapter); +- +-#ifdef CONFIG_DEBUG_CFG80211 +- RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter), +- frame_type, reg); +-#endif +- +- switch (frame_type) { +- case IEEE80211_STYPE_AUTH: /* 0x00B0 */ +- if (reg > 0) +- SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH); +- else +- CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH); +- break; +-#ifdef not_yet +- case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */ +- if (reg > 0) +- SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ); +- else +- CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ); +- break; +- case IEEE80211_STYPE_ACTION: /* 0x00D0 */ +- if (reg > 0) +- SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION); +- else +- CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION); +- break; +-#endif +- default: +- break; +- } +- +-exit: +- return; +-} +-#else + static void cfg80211_rtw_update_mgmt_frame_register( + struct wiphy *wiphy, + struct wireless_dev *wdev, +@@ -7995,7 +7940,6 @@ static void cfg80211_rtw_update_mgmt_fra + exit: + return; + } +-#endif + + #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) + static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, +@@ -10394,11 +10338,7 @@ static struct cfg80211_ops rtw_cfg80211_ + + #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)) +- .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, +-#else + .update_mgmt_frame_registrations = cfg80211_rtw_update_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 diff --git a/rtl8812au.changes b/rtl8812au.changes index 35bbd89..6c82aa7 100644 --- a/rtl8812au.changes +++ b/rtl8812au.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed May 12 06:21:36 UTC 2021 - Antonio Larrosa + +- Add patch to build with Leap 15.3's kernel which includes + backported patches to support update_mgmt_frame_registrations + instead of mgmt_frame_register which would be expected + according to the kernel version: + * fix-backported-update_mgmt_frame_registrations.patch + ------------------------------------------------------------------- Tue May 11 21:50:35 UTC 2021 - Victor Kwan diff --git a/rtl8812au.spec b/rtl8812au.spec index 0aa4107..6cc75ac 100644 --- a/rtl8812au.spec +++ b/rtl8812au.spec @@ -28,6 +28,8 @@ Source1: %{name}-preamble Source2: LICENSE # PATCH-FIX-OPENSUSE fix-backported-ndo_select_queue.patch Patch0: fix-backported-ndo_select_queue.patch +# PATCH-FIX-OPENSUSE fix-backported-update_mgmt_frame_registrations.patch +Patch1: fix-backported-update_mgmt_frame_registrations.patch BuildRequires: %{kernel_module_package_buildreqs} BuildRequires: bc BuildRequires: binutils @@ -43,7 +45,7 @@ Kernel driver for Realtek 802.11ac 8812au wifi cards The sources were obtained from https://github.com/gordboy/rtl8812au, which adaptes the official driver released by Realtek to build on recent kernels. -The previous sources were obtained from https://github.com/diederikdehaas/rtl8812AU and +The previous sources were obtained from https://github.com/diederikdehaas/rtl8812AU and https://github.com/maurossi/rtl8812au/ . %package KMP @@ -56,7 +58,7 @@ Kernel driver for Realtek 802.11ac 8812au wifi cards The sources were obtained from https://github.com/gordboy/rtl8812au, which adaptes the official driver released by Realtek to build on recent kernels. -The previous sources were obtained from https://github.com/diederikdehaas/rtl8812AU and +The previous sources were obtained from https://github.com/diederikdehaas/rtl8812AU and https://github.com/maurossi/rtl8812au/ . %prep @@ -65,6 +67,10 @@ https://github.com/maurossi/rtl8812au/ . %patch0 -p1 %endif +%if 0%{?sle_version} == 150300 +%patch1 -p1 +%endif + set -- * mkdir source mv "$@" source/