SHA256
1
0
forked from pool/rtl8812au

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
This commit is contained in:
Antonio Larrosa 2021-05-12 06:41:12 +00:00 committed by Git OBS Bridge
parent 03bf1f3bb4
commit a60437cbcb
3 changed files with 112 additions and 2 deletions

View File

@ -0,0 +1,95 @@
From: Antonio Larrosa <alarrosa@suse.com>
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

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed May 12 06:21:36 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
- 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 <vkwan8@uwo.ca>

View File

@ -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/