From b9fe9cebbe9ca9227c83cbbffe6b671a80a08f1a3c7c7c6d1ce3b1e2413938d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tchvatal@suse.com>
Date: Fri, 1 Feb 2019 10:50:07 +0000
Subject: [PATCH] Accepting request 670178 from home:alarrosa:branches:hardware

- Add fix-backported-ndo_select_queue.patch to fix building with
  SLE-15-SP1's 4.12 kernel with backported features from 4.19.

OBS-URL: https://build.opensuse.org/request/show/670178
OBS-URL: https://build.opensuse.org/package/show/hardware/rtl8812au?expand=0&rev=11
---
 fix-backported-ndo_select_queue.patch | 19 +++++++++++++++++++
 rtl8812au.changes                     |  6 ++++++
 rtl8812au.spec                        |  5 +++++
 3 files changed, 30 insertions(+)
 create mode 100644 fix-backported-ndo_select_queue.patch

diff --git a/fix-backported-ndo_select_queue.patch b/fix-backported-ndo_select_queue.patch
new file mode 100644
index 0000000..c1e398d
--- /dev/null
+++ b/fix-backported-ndo_select_queue.patch
@@ -0,0 +1,19 @@
+From: Antonio Larrosa <alarrosa@suse.com>
+Subject: Fix build with SLE 15-SP1 / Leap 15.1
+
+The net_device.ndo_select_queue signature in SLE-15-SP1's 4.12 kernel
+was backported from kernel 4.19 so we must actually support it from 4.12
+
+Index: rtl8812au-5.2.20.2/os_dep/linux/os_intfs.c
+===================================================================
+--- rtl8812au-5.2.20.2.orig/os_dep/linux/os_intfs.c
++++ rtl8812au-5.2.20.2/os_dep/linux/os_intfs.c
+@@ -1281,7 +1281,7 @@ unsigned int rtw_classify8021d(struct sk
+ 
+ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
+-  #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
++  #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+ 	  , void *accel_priv
+   #else
+     , struct net_device *sb_dev
diff --git a/rtl8812au.changes b/rtl8812au.changes
index 591e3ec..29ef9b9 100644
--- a/rtl8812au.changes
+++ b/rtl8812au.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Wed Jan 30 13:25:18 UTC 2019 - alarrosa@suse.com
+
+- Add fix-backported-ndo_select_queue.patch to fix building with
+  SLE-15-SP1's 4.12 kernel with backported features from 4.19.
+
 -------------------------------------------------------------------
 Wed Jan 23 09:31:46 UTC 2019 - alarrosa@suse.com
 
diff --git a/rtl8812au.spec b/rtl8812au.spec
index fdc6adc..8bebc34 100644
--- a/rtl8812au.spec
+++ b/rtl8812au.spec
@@ -26,6 +26,8 @@ Url:            https://github.com/gordboy/rtl8812au
 Source0:        %{name}-%{version}.tar.xz
 Source1:        %{name}-preamble
 Source2:        LICENSE
+# PATCH-FIX-OPENSUSE fix-backported-ndo_select_queue.patch
+Patch0:         fix-backported-ndo_select_queue.patch
 BuildRequires:  %{kernel_module_package_buildreqs}
 BuildRequires:  bc
 BuildRequires:  binutils
@@ -59,6 +61,9 @@ https://github.com/maurossi/rtl8812au/ .
 
 %prep
 %setup -q
+%if 0%{?sle_version} >= 150100
+%patch0 -p1
+%endif
 
 set -- *
 mkdir source