Dominique Leuenberger 2021-11-30 22:16:03 +00:00 committed by Git OBS Bridge
commit 73218303ed
4 changed files with 183 additions and 5 deletions

View File

@ -0,0 +1,165 @@
From d85350854da575e1407328199062b4fd26722137 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 15 Nov 2021 11:15:42 +0100
Subject: [PATCH] Drop ipx support on Linux 5.15
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
core/rtw_br_ext.c | 61 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 45 insertions(+), 16 deletions(-)
diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c
index 9a0effd..236d242 100644
--- a/core/rtw_br_ext.c
+++ b/core/rtw_br_ext.c
@@ -14,15 +14,6 @@
*****************************************************************************/
#define _RTW_BR_EXT_C_
-#ifdef __KERNEL__
- #include <linux/if_arp.h>
- #include <net/ip.h>
- #include <net/ipx.h>
- #include <linux/atalk.h>
- #include <linux/udp.h>
- #include <linux/if_pppox.h>
-#endif
-
#if 1 /* rtw_wifi_driver */
#include <drv_types.h>
#else /* rtw_wifi_driver */
@@ -38,6 +29,17 @@
#include "./8192cd_debug.h"
#endif /* rtw_wifi_driver */
+#ifdef __KERNEL__
+ #include <linux/if_arp.h>
+ #include <net/ip.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
+ #include <net/ipx.h>
+#endif
+ #include <linux/atalk.h>
+ #include <linux/udp.h>
+ #include <linux/if_pppox.h>
+#endif
+
#ifdef CL_IPV6_PASS
#ifdef __KERNEL__
#include <linux/ipv6.h>
@@ -169,6 +171,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
{
@@ -189,6 +192,7 @@ static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned ch
memcpy(networkAddr + 1, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr + 5, (unsigned char *)ipxSocketAddr, 2);
}
+#endif
static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
@@ -892,39 +896,56 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
- else if ((protocol == __constant_htons(ETH_P_IPX)) ||
- (protocol == __constant_htons(ETH_P_ATALK)) ||
+ else if ((protocol == __constant_htons(ETH_P_ATALK)) ||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
+ (protocol == __constant_htons(ETH_P_IPX)) ||
+#endif
(protocol == __constant_htons(ETH_P_AARP))) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
unsigned char ipx_header[2] = {0xFF, 0xFF};
struct ipxhdr *ipx = NULL;
+#endif
struct elapaarp *ea = NULL;
struct ddpehdr *ddp = NULL;
unsigned char *framePtr = skb->data + ETH_HLEN;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
if (protocol == __constant_htons(ETH_P_IPX)) {
RTW_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
ipx = (struct ipxhdr *)framePtr;
- } else { /* if(protocol <= __constant_htons(ETH_FRAME_LEN)) */
+ } else
+#endif
+ { /* if(protocol <= __constant_htons(ETH_FRAME_LEN)) */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
if (!memcmp(ipx_header, framePtr, 2)) {
RTW_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n");
ipx = (struct ipxhdr *)framePtr;
- } else {
+ } else
+#endif
+ {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
unsigned char ipx_8022_type = 0xE0;
+#endif
unsigned char snap_8022_type = 0xAA;
if (*framePtr == snap_8022_type) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; /* IPX SNAP ID */
+#endif
unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; /* Apple Talk AARP SNAP ID */
unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B}; /* Apple Talk DDP SNAP ID */
framePtr += 3; /* eliminate the 802.2 header */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
if (!memcmp(ipx_snap_id, framePtr, 5)) {
framePtr += 5; /* eliminate the SNAP header */
RTW_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n");
ipx = (struct ipxhdr *)framePtr;
- } else if (!memcmp(aarp_snap_id, framePtr, 5)) {
+ } else
+#endif
+ if (!memcmp(aarp_snap_id, framePtr, 5)) {
framePtr += 5; /* eliminate the SNAP header */
ea = (struct elapaarp *)framePtr;
@@ -937,7 +958,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
framePtr[1], framePtr[2], framePtr[3], framePtr[4]);
return -1;
}
- } else if (*framePtr == ipx_8022_type) {
+ } else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
+ if (*framePtr == ipx_8022_type) {
framePtr += 3; /* eliminate the 802.2 header */
if (!memcmp(ipx_header, framePtr, 2)) {
@@ -946,9 +969,13 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
} else
return -1;
}
+#else
+ return -1;
+#endif
}
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
/* IPX */
if (ipx != NULL) {
switch (method) {
@@ -1018,7 +1045,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
/* AARP */
- else if (ea != NULL) {
+ else
+#endif
+ if (ea != NULL) {
/* Sanity check fields. */
if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
--
2.33.1

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:7b15e340e9b787f0c53ad578d4dbc355bb9535ce0b64157ace3b988ecdacfa1e oid sha256:93e43567573d972e0370b00f1c34d0b3523cca5933ac891c4bfd644812ab77d8
size 14402061 size 14402061

View File

@ -1,8 +1,15 @@
-------------------------------------------------------------------
Mon Nov 15 11:25:06 UTC 2021 - Michal Suchanek <msuchanek@suse.de>
- Fix build on Tumbleweed - use kernel_module_directory
- Fix build on Linux 5.15
+ Drop-ipx-support-on-Linux-5.15.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 1 18:29:22 UTC 2021 - Rashmi Lengade <rashmi.lengade@gmail.com> Fri Oct 1 18:29:22 UTC 2021 - Rashmi Lengade <rashmi.lengade@gmail.com>
- Exclude the s390x Architecture - Exclude the s390x Architecture
------------------------------------------------------------------- -------------------------------------------------------------------
Wed May 12 06:21:36 UTC 2021 - Antonio Larrosa <alarrosa@suse.com> Wed May 12 06:21:36 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -16,6 +16,8 @@
# #
%{?!kernel_module_directory:%define kernel_module_directory /lib/modules}
Name: rtl8812au Name: rtl8812au
Version: 5.9.3.2+git20210427.6ef5d8f Version: 5.9.3.2+git20210427.6ef5d8f
Release: 0 Release: 0
@ -31,6 +33,8 @@ Source2: LICENSE
Patch0: fix-backported-ndo_select_queue.patch Patch0: fix-backported-ndo_select_queue.patch
# PATCH-FIX-OPENSUSE fix-backported-update_mgmt_frame_registrations.patch # PATCH-FIX-OPENSUSE fix-backported-update_mgmt_frame_registrations.patch
Patch1: fix-backported-update_mgmt_frame_registrations.patch Patch1: fix-backported-update_mgmt_frame_registrations.patch
# PATCH-FIX-OPENSUSE fix-backported-update_mgmt_frame_registrations.patch
Patch2: Drop-ipx-support-on-Linux-5.15.patch
BuildRequires: %{kernel_module_package_buildreqs} BuildRequires: %{kernel_module_package_buildreqs}
BuildRequires: bc BuildRequires: bc
BuildRequires: binutils BuildRequires: binutils
@ -72,6 +76,8 @@ https://github.com/maurossi/rtl8812au/ .
%patch1 -p1 %patch1 -p1
%endif %endif
%patch2 -p1
set -- * set -- *
mkdir source mkdir source
mv "$@" source/ mv "$@" source/
@ -96,7 +102,7 @@ for flavor in %{flavors_to_build} ; do
cp -a source obj/$flavor cp -a source obj/$flavor
pushd obj/$flavor pushd obj/$flavor
sed -i -e "s,^KSRC := /lib/modules/\$(KVER)/build$,KSRC := %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor," Makefile sed -i -e "s,^KSRC := /lib/modules/\$(KVER)/build$,KSRC := %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor," Makefile
make %{?_smp_mflags} make -O V=1 %{?_smp_mflags}
popd popd
done done
@ -108,8 +114,8 @@ kernel_version=`uname -r | sed -e "s/-[^-]*$//"`
echo ${kernel_version} echo ${kernel_version}
for flavor in %{flavors_to_build} ; do for flavor in %{flavors_to_build} ; do
pushd obj/$flavor pushd obj/$flavor
install -d %{buildroot}/lib/modules/${kernel_version}-${flavor}/${INSTALL_MOD_DIR}/ install -d %{buildroot}%{kernel_module_directory}/${kernel_version}-${flavor}/${INSTALL_MOD_DIR}/
install -p -m 644 8812au.ko %{buildroot}/lib/modules/${kernel_version}-${flavor}/${INSTALL_MOD_DIR}/ install -p -m 644 8812au.ko %{buildroot}%{kernel_module_directory}/${kernel_version}-${flavor}/${INSTALL_MOD_DIR}/
popd popd
done done