backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/30] backports: Update to match kernel 5.10-rc6
@ 2020-12-01 22:03 Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 01/30] backports: Adapt to changes in Ubuntu mainline URLs Hauke Mehrtens
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This adds many changes to make backports compatible with kernel 5.10-rc6.

I plan to create also releaes based on 5.8.18 and 5.9.11, I will take 
the commit directly before the refresh for the next kernel version.

Felix Fietkau (2):
  backports: add sched_set_fifo_low
  backports: add tasklet_setup, from_tasklet

Hauke Mehrtens (27):
  backports: Adapt to changes in Ubuntu mainline URLs
  gentree.py: Remoace space between -I and $(src)
  backports: Extend NOSTDINC_FLAGS
  patches: Refresh on kernel 5.8.18
  backprots: make patches apply on 5.9.11
  header: add module_sdio_driver
  header: Rename kfree_sensitive(x) to kzfree(x)
  header: dummy implementation for thermal_zone_device_enable
  header: Add __skb_put_zero()
  dependency: add MT7663S
  backports: add gpiochip_request_own_desc()
  backports: Add microchip wilc1000 driver
  backports: Make rx_list handling work on older kernel versions
  patches: Add missing linux/kthread.h include
  patches: Add include to rtw88
  patches: handle netdev_walk_all_lower_dev()
  patches: Remove unneeded 0018-pv-trace-fixes patch
  patches: Refresh on kernel 5.10-rc6
  patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...)
  patches: Deactivate hikey9xx staging driver
  patches: Revert usage of small_ops
  headers: Add DEFINE_SEQ_ATTRIBUTE
  backports: Add netif_rx_any_context()
  backports: Add dev_fetch_sw_netstats()
  backports: Make ieee80211_tx_status handling work on older kernel
    versions
  backports: Add sysfs_emit()
  backports: Remove crypto/akcipher.h

Shay Bar (1):
  backports: Add time64_to_tm and ipv6_mc_check_mld

 backport/Makefile.kernel                      |   4 +-
 backport/backport-include/linux/gpio/driver.h |  12 ++
 backport/backport-include/linux/interrupt.h   |  17 +++
 .../backport-include/linux/mmc/sdio_func.h    |  14 +++
 backport/backport-include/linux/netdevice.h   |  21 ++++
 backport/backport-include/linux/sched.h       |  20 +++
 backport/backport-include/linux/seq_file.h    |  21 ++++
 backport/backport-include/linux/skbuff.h      |   8 ++
 backport/backport-include/linux/slab.h        |   4 +
 backport/backport-include/linux/sysfs.h       |  14 +++
 backport/backport-include/linux/thermal.h     |  10 ++
 backport/backport-include/linux/time.h        |   8 ++
 backport/backport-include/net/addrconf.h      |  15 +++
 backport/backport-include/net/netlink.h       |   6 +
 backport/compat/Makefile                      |   2 +
 backport/compat/backport-5.10.c               |  81 ++++++++++++
 backport/compat/backport-5.3.c                |  74 +++++++++++
 copy-list                                     |   1 +
 dependencies                                  |   1 +
 devel/backports-update-manager                |  44 ++++---
 gentree.py                                    |   2 +-
 ...2-disable-dump-adjust-on-old-kernels.patch |   4 +-
 .../include_net_cfg80211.patch                |   2 +-
 .../net_wireless_core.patch                   |   2 +-
 .../net_wireless_core.patch                   |  26 ++--
 patches/0013-fix-makefile-includes/mt76.patch |  32 +++++
 .../0013-fix-makefile-includes/rtw88.patch    |  12 ++
 .../0013-fix-makefile-includes/wilc1000.patch |  34 ++++++
 .../net_wireless_nl80211.patch                |   2 +-
 patches/0018-pv-trace-fixes/INFO              |   7 --
 ...ivers_net_wireless_iwlwifi_iwl-debug.patch |  65 ----------
 .../net_mac80211_trace.patch                  |  79 ------------
 patches/0024-led-blink-api/mac80211.patch     |   2 +-
 patches/0025-usb-sg/usbnet.patch              |  14 +--
 patches/0028-select_queue/mac80211.patch      |   4 +-
 patches/0028-select_queue/mwifiex.patch       |   2 +-
 patches/0053-possible_net_t.patch             |   2 +-
 patches/0055-name_assign_type/brcmfmac.patch  |   2 +-
 patches/0071-skb-head_frag/wireless.patch     |   2 +-
 patches/0075-ndo-stats-64/usbnet.patch        |   6 +-
 patches/0077-genl-ro-after-init/hwsim.patch   |   2 +-
 patches/0077-genl-ro-after-init/nl80211.patch |   2 +-
 patches/0079-netdev-destructor/brcmfmac.patch |   4 +-
 patches/0084-disable-some-staging-dirs.patch  |   6 +
 patches/0085-iwlwifi-pci-device-removal.patch |   4 +-
 patches/0091-fq-no-siphash_key_t/fq.patch     |  36 ------
 patches/0094-ndo-tx-timeout/prism54.patch     |   2 +-
 patches/0094-ndo-tx-timeout/usbnet.patch      |   2 +-
 patches/0095-spi-delay/wilc1000.patch         |  47 +++++++
 patches/0097-skb-list/mac80211-rx.patch       | 115 ++++++++++++++++++
 patches/0097-skb-list/mac80211-status.patch   |  47 +++++++
 patches/0098-netdev_nested_priv/qtnfmac.patch |  43 +++++++
 patches/0099-netlink-range/mac80211.patch     |  57 +++++++++
 patches/0100-revert-small_ops/mac80211.patch  |  25 ++++
 .../mac80211_hwsim.patch                      |  28 +++++
 patches/verify.patch                          |  14 ++-
 56 files changed, 861 insertions(+), 251 deletions(-)
 create mode 100644 backport/backport-include/linux/sched.h
 create mode 100644 backport/compat/backport-5.10.c
 create mode 100644 backport/compat/backport-5.3.c
 create mode 100644 patches/0013-fix-makefile-includes/wilc1000.patch
 delete mode 100644 patches/0018-pv-trace-fixes/INFO
 delete mode 100644 patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
 delete mode 100644 patches/0018-pv-trace-fixes/net_mac80211_trace.patch
 delete mode 100644 patches/0091-fq-no-siphash_key_t/fq.patch
 create mode 100644 patches/0095-spi-delay/wilc1000.patch
 create mode 100644 patches/0097-skb-list/mac80211-rx.patch
 create mode 100644 patches/0097-skb-list/mac80211-status.patch
 create mode 100644 patches/0098-netdev_nested_priv/qtnfmac.patch
 create mode 100644 patches/0099-netlink-range/mac80211.patch
 create mode 100644 patches/0100-revert-small_ops/mac80211.patch
 create mode 100644 patches/0100-revert-small_ops/mac80211_hwsim.patch

-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 01/30] backports: Adapt to changes in Ubuntu mainline URLs
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 02/30] gentree.py: Remoace space between -I and $(src) Hauke Mehrtens
                   ` (29 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The .deb files are now located in the /amd64/ sub folder.
Check not only for the _all header, but also check if there is at least
one _generic deb file. This was missing in some recent releases by
Ubuntu.

Reorder the __init__ function to be able to provide the arch to
_get_ubuntu_ppa_mainline_kernels().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 devel/backports-update-manager | 44 ++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/devel/backports-update-manager b/devel/backports-update-manager
index dc969725..2ef82854 100755
--- a/devel/backports-update-manager
+++ b/devel/backports-update-manager
@@ -37,6 +37,21 @@ def make_version_tuple(ver):
             sver.append(-1)
     return sver
 
+def parse_ubuntu_ppa_page(version, baseurl):
+    html = urlopen(baseurl).read()
+    if b'Build for amd64 failed' in html:
+        return None
+    pkgs = re.findall(b'href="linux-headers-[^"]*-generic_[^"]*\.deb"', html)
+    if not pkgs:
+        return None
+    pkgs = re.findall(b'href="linux-headers-[^"]*_all\.deb"', html)
+    if not pkgs:
+        return None
+    pkgs = [p[6:-1] for p in pkgs]
+    pkgs.sort()
+    pkg = pkgs[-1].decode('ascii')
+    return (version, baseurl + pkg)
+
 class backport_kernel_updater:
     """
     This is the Linux kernel backports kernel updater. It ensures you
@@ -53,7 +68,7 @@ class backport_kernel_updater:
         sys.exit(1)
 
     @classmethod
-    def _get_ubuntu_ppa_mainline_kernels(cls):
+    def _get_ubuntu_ppa_mainline_kernels(cls, pkg_arch):
         base = KPATH
         html = urlopen(base).read()
         builds = re.findall(b'href="([-v.0-9a-z]*)/"', html)
@@ -96,17 +111,16 @@ class backport_kernel_updater:
             for version in subvers:
                 version = version[1]
 
-                html = urlopen(base + version + '/').read()
-                if b'Build for amd64 failed' in html:
-                    continue
-                pkgs = re.findall(b'href="linux-headers-[^"]*_all\.deb"', html)
-                if not pkgs:
-                    continue
-                pkgs = [p[6:-1] for p in pkgs]
-                pkgs.sort()
-                pkg = pkgs[-1].decode('ascii')
-                result.append((version, base + version + '/' + pkg))
-                break
+                baseurl = base + version + '/'
+                pkgs = parse_ubuntu_ppa_page(version, baseurl)
+                if pkgs:
+                    result.append(pkgs)
+                    break
+                baseurl = base + version + '/' + pkg_arch + '/'
+                pkgs = parse_ubuntu_ppa_page(version, baseurl)
+                if pkgs:
+                    result.append(pkgs)
+                    break
 
         result.sort(key = lambda x: make_version_tuple(x[0][1:]))
         return [x[1] for x in result]
@@ -116,7 +130,9 @@ class backport_kernel_updater:
                  reference=None):
         self.ksrc_base = ""
         self.ksrc_prefix = ""
-        self.kernel_urls = self._get_ubuntu_ppa_mainline_kernels()
+        sysname, nodename, release, version, self.machine = os.uname()
+        self.pkg_arch = self.pkg_arch(self.machine)
+        self.kernel_urls = self._get_ubuntu_ppa_mainline_kernels(self.pkg_arch)
         self.num_kernels = len(self.kernel_urls)
         self.git_trees = GIT_TREES
         self.git_trees_missing = list()
@@ -134,8 +150,6 @@ class backport_kernel_updater:
         self.reference = reference
         self.reference_git = None
         self.cwd = os.getcwd()
-        sysname, nodename, release, version, self.machine = os.uname()
-        self.pkg_arch = self.pkg_arch(self.machine)
         if self.root:
             self.ksrc_base = self.cwd + "/"
             self.ksrc_prefix = self.ksrc_base + BACKPORTS_KSRC_DIR
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 02/30] gentree.py: Remoace space between -I and $(src)
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 01/30] backports: Adapt to changes in Ubuntu mainline URLs Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 03/30] backports: Extend NOSTDINC_FLAGS Hauke Mehrtens
                   ` (28 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

When I compile backports on Debian 9 against kernel 4.9 it fails to
compile because the include "-I $(src)" does not work, the "-I" is
somehow lost. When I remove the space between this it is working.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 gentree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gentree.py b/gentree.py
index 2a9f60d7..1fc9dbb1 100755
--- a/gentree.py
+++ b/gentree.py
@@ -1043,7 +1043,7 @@ def process(kerneldir, copy_list_file, git_revision=None,
             for r in regexes:
                 data = r.sub(r'' + bpid.full_prefix + '\\1', data)
             # we have an absolue path in $(src) since we compile out of tree
-            data = re.sub(r'\$\(srctree\)/\$\(src\)', '$(src)', data)
+            data = re.sub(r'-I ?\$\(srctree\)/\$\(src\)', '-I$(src)', data)
             data = re.sub(r'\$\(srctree\)', '$(backport_srctree)', data)
             data = re.sub(r'-Idrivers', '-I$(backport_srctree)/drivers', data)
             if bpid.integrate:
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 03/30] backports: Extend NOSTDINC_FLAGS
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 01/30] backports: Adapt to changes in Ubuntu mainline URLs Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 02/30] gentree.py: Remoace space between -I and $(src) Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 04/30] patches: Refresh on kernel 5.8.18 Hauke Mehrtens
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Instead of overwriting NOSTDINC_FLAGS our Makefile should extend
NOSTDINC_FLAGS. The kernel also sets some options in NOSTDINC_FLAGS and
we should not overwrite them.

Without this change backports included the stddef.h from the libc.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/Makefile.kernel | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backport/Makefile.kernel b/backport/Makefile.kernel
index 5c966974..62baa945 100644
--- a/backport/Makefile.kernel
+++ b/backport/Makefile.kernel
@@ -4,7 +4,7 @@ ifeq ($(CONFIG_BACKPORT_INTEGRATE),)
 backport-cc-disable-warning = $(call try-run,\
 	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
 
-NOSTDINC_FLAGS := \
+NOSTDINC_FLAGS += \
 	-I$(M)/backport-include/ \
 	-I$(M)/backport-include/uapi \
 	-I$(M)/include/ \
@@ -21,7 +21,7 @@ export backport_srctree = $(M)
 else
 export BACKPORT_DIR = backports/
 export backport_srctree = $(BACKPORT_DIR)
-NOSTDINC_FLAGS := \
+NOSTDINC_FLAGS += \
 	-I$(BACKPORT_DIR)/backport-include/ \
 	-I$(BACKPORT_DIR)/backport-include/uapi \
 	-I$(BACKPORT_DIR)/include/ \
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 04/30] patches: Refresh on kernel 5.8.18
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 03/30] backports: Extend NOSTDINC_FLAGS Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 05/30] backports: add sched_set_fifo_low Hauke Mehrtens
                   ` (26 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

No manual changes needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0002-disable-dump-adjust-on-old-kernels.patch | 4 ++--
 patches/0014-netlink_seq/net_wireless_nl80211.patch   | 2 +-
 patches/0071-skb-head_frag/wireless.patch             | 2 +-
 patches/0077-genl-ro-after-init/nl80211.patch         | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/patches/0002-disable-dump-adjust-on-old-kernels.patch b/patches/0002-disable-dump-adjust-on-old-kernels.patch
index ba34a516..4766e4c8 100644
--- a/patches/0002-disable-dump-adjust-on-old-kernels.patch
+++ b/patches/0002-disable-dump-adjust-on-old-kernels.patch
@@ -28,7 +28,7 @@ Date:   Fri Mar 1 14:03:49 2013 +0100
 
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -2680,6 +2680,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2683,6 +2683,7 @@ static int nl80211_dump_wiphy(struct sk_
  						 cb->nlh->nlmsg_seq,
  						 NLM_F_MULTI, state);
  			if (ret < 0) {
@@ -36,7 +36,7 @@ Date:   Fri Mar 1 14:03:49 2013 +0100
  				/*
  				 * If sending the wiphy data didn't fit (ENOBUFS
  				 * or EMSGSIZE returned), this SKB is still
-@@ -2701,6 +2702,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2704,6 +2705,7 @@ static int nl80211_dump_wiphy(struct sk_
  					rtnl_unlock();
  					return 1;
  				}
diff --git a/patches/0014-netlink_seq/net_wireless_nl80211.patch b/patches/0014-netlink_seq/net_wireless_nl80211.patch
index e21045f9..f5ed7e2c 100644
--- a/patches/0014-netlink_seq/net_wireless_nl80211.patch
+++ b/patches/0014-netlink_seq/net_wireless_nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -9038,7 +9038,9 @@ static int nl80211_dump_scan(struct sk_b
+@@ -9042,7 +9042,9 @@ static int nl80211_dump_scan(struct sk_b
  	if (start == 0)
  		cfg80211_bss_expire(rdev);
  
diff --git a/patches/0071-skb-head_frag/wireless.patch b/patches/0071-skb-head_frag/wireless.patch
index c4c49d99..83630eb8 100644
--- a/patches/0071-skb-head_frag/wireless.patch
+++ b/patches/0071-skb-head_frag/wireless.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/util.c
 +++ b/net/wireless/util.c
-@@ -676,7 +676,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
+@@ -678,7 +678,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
  	u8 *payload;
  	int offset = 0, remaining;
  	struct ethhdr eth;
diff --git a/patches/0077-genl-ro-after-init/nl80211.patch b/patches/0077-genl-ro-after-init/nl80211.patch
index bbc46c13..0864dca0 100644
--- a/patches/0077-genl-ro-after-init/nl80211.patch
+++ b/patches/0077-genl-ro-after-init/nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -15242,7 +15242,7 @@ static const struct genl_ops nl80211_ops
+@@ -15246,7 +15246,7 @@ static const struct genl_ops nl80211_ops
  	},
  };
  
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 05/30] backports: add sched_set_fifo_low
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 04/30] patches: Refresh on kernel 5.8.18 Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 06/30] backports: add tasklet_setup, from_tasklet Hauke Mehrtens
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Felix Fietkau, Hauke Mehrtens

From: Felix Fietkau <nbd@nbd.name>

It is needed for mt76.

This was added in upsteram Linux commit 7318d4cc14c8 ("sched: Provide sched_set_fifo()")

Signed-off-by: Felix Fietkau <nbd@nbd.name>
[Use WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sparam) !=
0); instead]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/sched.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 backport/backport-include/linux/sched.h

diff --git a/backport/backport-include/linux/sched.h b/backport/backport-include/linux/sched.h
new file mode 100644
index 00000000..36263857
--- /dev/null
+++ b/backport/backport-include/linux/sched.h
@@ -0,0 +1,20 @@
+#ifndef __BACKPORT_LINUX_SCHED_H
+#define __BACKPORT_LINUX_SCHED_H
+
+#include_next <linux/sched.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,9,0)
+#if LINUX_VERSION_IS_GEQ(4,11,0)
+#include <uapi/linux/sched/types.h>
+#endif
+
+static inline void sched_set_fifo_low(struct task_struct *p)
+{
+	struct sched_param sparam = {.sched_priority = 1};
+
+	WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sparam) != 0);
+}
+
+#endif /* < 5.9.0 */
+#endif /* __BACKPORT_LINUX_SCHED_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 06/30] backports: add tasklet_setup, from_tasklet
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 05/30] backports: add sched_set_fifo_low Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 07/30] backports: Add time64_to_tm and ipv6_mc_check_mld Hauke Mehrtens
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Felix Fietkau

From: Felix Fietkau <nbd@nbd.name>

Add the new tasklet API

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/interrupt.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/backport/backport-include/linux/interrupt.h b/backport/backport-include/linux/interrupt.h
index f7e7134d..f334a963 100644
--- a/backport/backport-include/linux/interrupt.h
+++ b/backport/backport-include/linux/interrupt.h
@@ -31,6 +31,23 @@ static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
 	hrtimer_start(timer, _time, mode);
 }
 #define hrtimer_start LINUX_BACKPORT(hrtimer_start)
+
+#endif
+
+#if LINUX_VERSION_IS_LESS(5,9,0)
+
+static inline void
+tasklet_setup(struct tasklet_struct *t,
+	      void (*callback)(struct tasklet_struct *))
+{
+	void (*cb)(unsigned long data) = (void *)callback;
+
+	tasklet_init(t, cb, (unsigned long)t);
+}
+
+#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
+	container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
+
 #endif
 
 #endif /* _BP_LINUX_INTERRUPT_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 07/30] backports: Add time64_to_tm and ipv6_mc_check_mld
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 06/30] backports: add tasklet_setup, from_tasklet Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 08/30] backprots: make patches apply on 5.9.11 Hauke Mehrtens
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Shay Bar

From: Shay Bar <shay.bar@celeno.com>

ipv6_mc_check_mld() was added in kernel version 4.2.0.
The 2nd parameter was removed in kernel version 5.1.0.

time64_to_tm() was added in kernel version 4.8.0.

Signed-off-by: Shay Bar <shay.bar@celeno.com>
---
 backport/backport-include/linux/time.h   |  8 ++++++++
 backport/backport-include/net/addrconf.h | 15 +++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/backport/backport-include/linux/time.h b/backport/backport-include/linux/time.h
index 3191047d..ce8a1b03 100644
--- a/backport/backport-include/linux/time.h
+++ b/backport/backport-include/linux/time.h
@@ -4,4 +4,12 @@
 
 #include <linux/time64.h>
 
+#if LINUX_VERSION_IS_LESS(4,8,0)
+static inline void time64_to_tm(time64_t totalsecs, int offset,
+				struct tm *result)
+{
+	time_to_tm((time_t)totalsecs, 0, result);
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_TIME_H */
diff --git a/backport/backport-include/net/addrconf.h b/backport/backport-include/net/addrconf.h
index f1e8e627..67d44e19 100644
--- a/backport/backport-include/net/addrconf.h
+++ b/backport/backport-include/net/addrconf.h
@@ -22,4 +22,19 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
 }
 #endif /* LINUX_VERSION_IS_LESS(3,9,0) */
 
+#if LINUX_VERSION_IS_LESS(4,2,0)
+static inline int ipv6_mc_check_mld(struct sk_buff *skb)
+{
+	WARN_ON(1);
+
+	return -1;
+}
+#elif LINUX_VERSION_IS_LESS(5,1,0)
+static inline int backport_ipv6_mc_check_mld(struct sk_buff *skb)
+{
+	return ipv6_mc_check_mld(skb, NULL);
+}
+#define ipv6_mc_check_mld LINUX_BACKPORT(ipv6_mc_check_mld)
+#endif
+
 #endif	/* _BACKPORT_NET_ADDRCONF_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 08/30] backprots: make patches apply on 5.9.11
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 07/30] backports: Add time64_to_tm and ipv6_mc_check_mld Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 09/30] header: add module_sdio_driver Hauke Mehrtens
                   ` (22 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch was
manually applied. The position where we add our wireless_handlers was
changed because of some upstream changes.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 .../include_net_cfg80211.patch                |  2 +-
 .../net_wireless_core.patch                   | 24 ++++++-------
 .../net_wireless_nl80211.patch                |  2 +-
 patches/0024-led-blink-api/mac80211.patch     |  2 +-
 patches/0025-usb-sg/usbnet.patch              | 14 ++++----
 patches/0053-possible_net_t.patch             |  2 +-
 patches/0055-name_assign_type/brcmfmac.patch  |  2 +-
 patches/0071-skb-head_frag/wireless.patch     |  2 +-
 patches/0075-ndo-stats-64/usbnet.patch        |  2 +-
 patches/0077-genl-ro-after-init/nl80211.patch |  2 +-
 patches/0079-netdev-destructor/brcmfmac.patch |  4 +--
 patches/0091-fq-no-siphash_key_t/fq.patch     | 36 -------------------
 patches/0094-ndo-tx-timeout/prism54.patch     |  2 +-
 patches/0094-ndo-tx-timeout/usbnet.patch      |  2 +-
 14 files changed, 31 insertions(+), 67 deletions(-)
 delete mode 100644 patches/0091-fq-no-siphash_key_t/fq.patch

diff --git a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
index c091180a..845db615 100644
--- a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
+++ b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
@@ -1,6 +1,6 @@
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4755,6 +4755,9 @@ struct wiphy_iftype_akm_suites {
+@@ -4782,6 +4782,9 @@ struct wiphy_iftype_akm_suites {
  struct wiphy {
  	/* assign these fields before you register the wiphy */
  
diff --git a/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch b/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
index d16a1cb8..38b60057 100644
--- a/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
+++ b/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
@@ -11,19 +11,19 @@
  	device_initialize(&rdev->wiphy.dev);
  	rdev->wiphy.dev.class = &ieee80211_class;
  	rdev->wiphy.dev.platform_data = rdev;
-@@ -1319,6 +1315,15 @@ static int cfg80211_netdev_notifier_call
- 		}
- 		wdev->netdev = dev;
+@@ -1271,6 +1267,15 @@ void cfg80211_init_wdev(struct wireless_
+ 	INIT_WORK(&wdev->pmsr_free_wk, cfg80211_pmsr_free_wk);
+ 
  #ifdef CONFIG_CFG80211_WEXT
 +#ifdef CONFIG_WIRELESS_EXT
-+		if (!dev->wireless_handlers)
-+			dev->wireless_handlers = &cfg80211_wext_handler;
++	if (!wdev->netdev->wireless_handlers)
++		wdev->netdev->wireless_handlers = &cfg80211_wext_handler;
 +#else
-+		printk_once(KERN_WARNING "cfg80211: wext will not work because "
-+			    "kernel was compiled with CONFIG_WIRELESS_EXT=n. "
-+			    "Tools using wext interface, like iwconfig will "
-+			    "not work.\n");
++	printk_once(KERN_WARNING "cfg80211: wext will not work because "
++		    "kernel was compiled with CONFIG_WIRELESS_EXT=n. "
++		    "Tools using wext interface, like iwconfig will "
++		    "not work.\n");
 +#endif
- 		wdev->wext.default_key = -1;
- 		wdev->wext.default_mgmt_key = -1;
- 		wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
+ 	wdev->wext.default_key = -1;
+ 	wdev->wext.default_mgmt_key = -1;
+ 	wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
diff --git a/patches/0014-netlink_seq/net_wireless_nl80211.patch b/patches/0014-netlink_seq/net_wireless_nl80211.patch
index f5ed7e2c..b33dd79b 100644
--- a/patches/0014-netlink_seq/net_wireless_nl80211.patch
+++ b/patches/0014-netlink_seq/net_wireless_nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -9042,7 +9042,9 @@ static int nl80211_dump_scan(struct sk_b
+@@ -9047,7 +9047,9 @@ static int nl80211_dump_scan(struct sk_b
  	if (start == 0)
  		cfg80211_bss_expire(rdev);
  
diff --git a/patches/0024-led-blink-api/mac80211.patch b/patches/0024-led-blink-api/mac80211.patch
index f03b1b9c..ec8ff05a 100644
--- a/patches/0024-led-blink-api/mac80211.patch
+++ b/patches/0024-led-blink-api/mac80211.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1319,6 +1319,7 @@ struct ieee80211_local {
+@@ -1318,6 +1318,7 @@ struct ieee80211_local {
  	struct mutex chanctx_mtx;
  
  #ifdef CONFIG_MAC80211_LEDS
diff --git a/patches/0025-usb-sg/usbnet.patch b/patches/0025-usb-sg/usbnet.patch
index 47f49b5c..030efb85 100644
--- a/patches/0025-usb-sg/usbnet.patch
+++ b/patches/0025-usb-sg/usbnet.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/usb/usbnet.c
 +++ b/drivers/net/usb/usbnet.c
-@@ -1310,6 +1310,7 @@ EXPORT_SYMBOL_GPL(usbnet_tx_timeout);
+@@ -1311,6 +1311,7 @@ EXPORT_SYMBOL_GPL(usbnet_tx_timeout);
  
  /*-------------------------------------------------------------------------*/
  
@@ -8,7 +8,7 @@
  static int build_dma_sg(const struct sk_buff *skb, struct urb *urb)
  {
  	unsigned num_sgs, total_len = 0;
-@@ -1342,6 +1343,12 @@ static int build_dma_sg(const struct sk_
+@@ -1343,6 +1344,12 @@ static int build_dma_sg(const struct sk_
  
  	return 1;
  }
@@ -21,7 +21,7 @@
  
  netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
  				     struct net_device *net)
-@@ -1398,12 +1405,19 @@ netdev_tx_t usbnet_start_xmit (struct sk
+@@ -1399,12 +1406,19 @@ netdev_tx_t usbnet_start_xmit (struct sk
  		if (!(info->flags & FLAG_SEND_ZLP)) {
  			if (!(info->flags & FLAG_MULTI_PACKET)) {
  				length++;
@@ -41,7 +41,7 @@
  			}
  		} else
  			urb->transfer_flags |= URB_ZERO_PACKET;
-@@ -1475,7 +1489,9 @@ not_drop:
+@@ -1476,7 +1490,9 @@ not_drop:
  		if (skb)
  			dev_kfree_skb_any (skb);
  		if (urb) {
@@ -51,17 +51,17 @@
  			usb_free_urb(urb);
  		}
  	} else
-@@ -1528,7 +1544,9 @@ static void usbnet_bh (struct timer_list
+@@ -1529,7 +1545,9 @@ static void usbnet_bh (struct timer_list
  			rx_process (dev, skb);
  			continue;
  		case tx_done:
 +#if LINUX_VERSION_IS_GEQ(3,35,0)
  			kfree(entry->urb->sg);
 +#endif
- 			/* fall through */
+ 			fallthrough;
  		case rx_cleanup:
  			usb_free_urb (entry->urb);
-@@ -1903,7 +1921,9 @@ int usbnet_resume (struct usb_interface
+@@ -1904,7 +1922,9 @@ int usbnet_resume (struct usb_interface
  			retval = usb_submit_urb(res, GFP_ATOMIC);
  			if (retval < 0) {
  				dev_kfree_skb_any(skb);
diff --git a/patches/0053-possible_net_t.patch b/patches/0053-possible_net_t.patch
index 4060a720..20585fa0 100644
--- a/patches/0053-possible_net_t.patch
+++ b/patches/0053-possible_net_t.patch
@@ -2,7 +2,7 @@ diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
 index 04e5785..a251da1 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4898,12 +4898,12 @@ struct wiphy {
+@@ -4925,12 +4925,12 @@ struct wiphy {
  
  static inline struct net *wiphy_net(struct wiphy *wiphy)
  {
diff --git a/patches/0055-name_assign_type/brcmfmac.patch b/patches/0055-name_assign_type/brcmfmac.patch
index d9e710dc..391ef04d 100644
--- a/patches/0055-name_assign_type/brcmfmac.patch
+++ b/patches/0055-name_assign_type/brcmfmac.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -2339,7 +2339,9 @@ struct wireless_dev *brcmf_p2p_add_vif(s
+@@ -2338,7 +2338,9 @@ struct wireless_dev *brcmf_p2p_add_vif(s
  	}
  
  	strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
diff --git a/patches/0071-skb-head_frag/wireless.patch b/patches/0071-skb-head_frag/wireless.patch
index 83630eb8..48aac872 100644
--- a/patches/0071-skb-head_frag/wireless.patch
+++ b/patches/0071-skb-head_frag/wireless.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/util.c
 +++ b/net/wireless/util.c
-@@ -678,7 +678,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
+@@ -686,7 +686,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
  	u8 *payload;
  	int offset = 0, remaining;
  	struct ethhdr eth;
diff --git a/patches/0075-ndo-stats-64/usbnet.patch b/patches/0075-ndo-stats-64/usbnet.patch
index fe434459..0728a195 100644
--- a/patches/0075-ndo-stats-64/usbnet.patch
+++ b/patches/0075-ndo-stats-64/usbnet.patch
@@ -12,7 +12,7 @@
  {
 --- a/include/linux/usb/usbnet.h
 +++ b/include/linux/usb/usbnet.h
-@@ -285,5 +285,9 @@ extern void usbnet_status_stop(struct us
+@@ -287,5 +287,9 @@ extern void usbnet_status_stop(struct us
  extern void usbnet_update_max_qlen(struct usbnet *dev);
  extern void usbnet_get_stats64(struct net_device *dev,
  			       struct rtnl_link_stats64 *stats);
diff --git a/patches/0077-genl-ro-after-init/nl80211.patch b/patches/0077-genl-ro-after-init/nl80211.patch
index 0864dca0..7550a794 100644
--- a/patches/0077-genl-ro-after-init/nl80211.patch
+++ b/patches/0077-genl-ro-after-init/nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -15246,7 +15246,7 @@ static const struct genl_ops nl80211_ops
+@@ -15252,7 +15252,7 @@ static const struct genl_ops nl80211_ops
  	},
  };
  
diff --git a/patches/0079-netdev-destructor/brcmfmac.patch b/patches/0079-netdev-destructor/brcmfmac.patch
index b11a0861..6e67bd4e 100644
--- a/patches/0079-netdev-destructor/brcmfmac.patch
+++ b/patches/0079-netdev-destructor/brcmfmac.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -626,6 +626,23 @@ static const struct net_device_ops brcmf
+@@ -629,6 +629,23 @@ static const struct net_device_ops brcmf
  	.ndo_set_rx_mode = brcmf_netdev_set_multicast_list
  };
  
@@ -24,7 +24,7 @@
  int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
  {
  	struct brcmf_pub *drvr = ifp->drvr;
-@@ -876,7 +893,11 @@ struct brcmf_if *brcmf_add_if(struct brc
+@@ -879,7 +896,11 @@ struct brcmf_if *brcmf_add_if(struct brc
  		if (!ndev)
  			return ERR_PTR(-ENOMEM);
  
diff --git a/patches/0091-fq-no-siphash_key_t/fq.patch b/patches/0091-fq-no-siphash_key_t/fq.patch
deleted file mode 100644
index 95c28a19..00000000
--- a/patches/0091-fq-no-siphash_key_t/fq.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/include/net/fq.h
-+++ b/include/net/fq.h
-@@ -69,7 +69,15 @@ struct fq {
- 	struct list_head backlogs;
- 	spinlock_t lock;
- 	u32 flows_cnt;
-+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
-+    LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
-+    LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
-+    LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
-+    LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
- 	siphash_key_t	perturbation;
-+#else
-+	u32 perturbation;
-+#endif
- 	u32 limit;
- 	u32 memory_limit;
- 	u32 memory_usage;
---- a/include/net/fq_impl.h
-+++ b/include/net/fq_impl.h
-@@ -108,7 +108,15 @@ begin:
- 
- static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
- {
-+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
-+    LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
-+    LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
-+    LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
-+    LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
- 	u32 hash = skb_get_hash_perturb(skb, &fq->perturbation);
-+#else
-+	u32 hash = skb_get_hash_perturb(skb, fq->perturbation);
-+#endif
- 
- 	return reciprocal_scale(hash, fq->flows_cnt);
- }
diff --git a/patches/0094-ndo-tx-timeout/prism54.patch b/patches/0094-ndo-tx-timeout/prism54.patch
index d61d3402..1e55f03c 100644
--- a/patches/0094-ndo-tx-timeout/prism54.patch
+++ b/patches/0094-ndo-tx-timeout/prism54.patch
@@ -10,7 +10,7 @@
  #endif				/* _ISL_GEN_H */
 --- a/drivers/net/wireless/intersil/prism54/islpci_eth.c
 +++ b/drivers/net/wireless/intersil/prism54/islpci_eth.c
-@@ -491,3 +491,10 @@ islpci_eth_tx_timeout(struct net_device
+@@ -487,3 +487,10 @@ islpci_eth_tx_timeout(struct net_device
  			"%s: tx_timeout, waiting for reset", ndev->name);
  	}
  }
diff --git a/patches/0094-ndo-tx-timeout/usbnet.patch b/patches/0094-ndo-tx-timeout/usbnet.patch
index 3bd1facd..2d0ef695 100644
--- a/patches/0094-ndo-tx-timeout/usbnet.patch
+++ b/patches/0094-ndo-tx-timeout/usbnet.patch
@@ -1,6 +1,6 @@
 --- a/include/linux/usb/usbnet.h
 +++ b/include/linux/usb/usbnet.h
-@@ -254,6 +254,7 @@ extern int usbnet_stop(struct net_device
+@@ -255,6 +255,7 @@ extern int usbnet_stop(struct net_device
  extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb,
  				     struct net_device *net);
  extern void usbnet_tx_timeout(struct net_device *net, unsigned int txqueue);
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 09/30] header: add module_sdio_driver
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (7 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 08/30] backprots: make patches apply on 5.9.11 Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 10/30] header: Rename kfree_sensitive(x) to kzfree(x) Hauke Mehrtens
                   ` (21 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The module_sdio_driver define is used by the mt76 driver.
This was added in upstream Linux commit db0a39083520 ("mmc: sdio: Add
helper macro for sdio_driver boilerplate").

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/mmc/sdio_func.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backport/backport-include/linux/mmc/sdio_func.h b/backport/backport-include/linux/mmc/sdio_func.h
index 0a67f992..7ff926ae 100644
--- a/backport/backport-include/linux/mmc/sdio_func.h
+++ b/backport/backport-include/linux/mmc/sdio_func.h
@@ -83,4 +83,18 @@ static inline void sdio_retune_crc_enable(struct sdio_func *func)
 }
 #endif /* < 5.2 */
 
+#ifndef module_sdio_driver
+/**
+ * module_sdio_driver() - Helper macro for registering a SDIO driver
+ * @__sdio_driver: sdio_driver struct
+ *
+ * Helper macro for SDIO drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_sdio_driver(__sdio_driver) \
+	module_driver(__sdio_driver, sdio_register_driver, \
+		      sdio_unregister_driver)
+#endif
+
 #endif /* __BACKPORT_MMC_SDIO_FUNC_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 10/30] header: Rename kfree_sensitive(x) to kzfree(x)
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (8 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 09/30] header: add module_sdio_driver Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 11/30] header: dummy implementation for thermal_zone_device_enable Hauke Mehrtens
                   ` (20 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This was added in upstream Linux commit 453431a54934 ("mm, treewide:
rename kzfree() to kfree_sensitive()").

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/slab.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/linux/slab.h b/backport/backport-include/linux/slab.h
index 66f0cc0d..f36dc40a 100644
--- a/backport/backport-include/linux/slab.h
+++ b/backport/backport-include/linux/slab.h
@@ -24,4 +24,8 @@ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
 }
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,9,0)
+#define kfree_sensitive(x)	kzfree(x)
+#endif
+
 #endif /* __BACKPORT_SLAB_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 11/30] header: dummy implementation for thermal_zone_device_enable
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (9 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 10/30] header: Rename kfree_sensitive(x) to kzfree(x) Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 12/30] header: Add __skb_put_zero() Hauke Mehrtens
                   ` (19 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Just provide an empty implementation of the thermal zone functions, they
were not called in older versions of the driver any way.
These functions were added in upstream Linux commit ac5d9ecc74d8
("thermal: Add mode helpers").

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/thermal.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index 8874e196..8ffe12aa 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -113,4 +113,14 @@ void backport_thermal_zone_device_unregister(struct thermal_zone_device *);
 #endif /* ! < 3.8.0 */
 #endif /* CONFIG_THERMAL */
 
+#if LINUX_VERSION_IS_LESS(5,9,0)
+#define thermal_zone_device_enable LINUX_BACKPORT(thermal_zone_device_enable)
+static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
+{ return 0; }
+
+#define thermal_zone_device_disable LINUX_BACKPORT(thermal_zone_device_disable)
+static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
+{ return 0; }
+#endif /* < 5.9 */
+
 #endif /* __BACKPORT_LINUX_THERMAL_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 12/30] header: Add __skb_put_zero()
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (10 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 11/30] header: dummy implementation for thermal_zone_device_enable Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 13/30] dependency: add MT7663S Hauke Mehrtens
                   ` (18 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This was added in upstream Linux commit de77b966ce8a ("net: introduce
__skb_put_[zero, data, u8]") and is now used by the mt76 driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/skbuff.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 3ed990d0..3286d36c 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -348,6 +348,14 @@ static inline void *backport___skb_push(struct sk_buff *skb, unsigned int len)
 }
 #define __skb_push LINUX_BACKPORT(__skb_push)
 
+static inline void *__skb_put_zero(struct sk_buff *skb, unsigned int len)
+{
+	void *tmp = __skb_put(skb, len);
+
+	memset(tmp, 0, len);
+	return tmp;
+}
+
 static inline void *skb_put_zero(struct sk_buff *skb, unsigned int len)
 {
 	void *tmp = skb_put(skb, len);
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 13/30] dependency: add MT7663S
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (11 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 12/30] header: Add __skb_put_zero() Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:03 ` [PATCH 14/30] backports: add gpiochip_request_own_desc() Hauke Mehrtens
                   ` (17 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This new driver was added in 5.9 and needs handling.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 dependencies | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dependencies b/dependencies
index 6d6829b2..33820e2b 100644
--- a/dependencies
+++ b/dependencies
@@ -82,6 +82,7 @@ MT76x2U 4.2
 MT7603E 4.2
 MT7615E 4.2
 MT7663U 4.2
+MT7663S 4.2
 MT7915E 4.2
 MT7622_WMAC 4.2
 
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 14/30] backports: add gpiochip_request_own_desc()
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (12 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 13/30] dependency: add MT7663S Hauke Mehrtens
@ 2020-12-01 22:03 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 15/30] backports: Add microchip wilc1000 driver Hauke Mehrtens
                   ` (16 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:03 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The signature of the gpiochip_request_own_desc() function changes
multiple times, adapt this in the backports layer as good as possible.
brcmfmac is using this function.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/gpio/driver.h | 12 +++
 backport/compat/Makefile                      |  1 +
 backport/compat/backport-5.3.c                | 74 +++++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 backport/compat/backport-5.3.c

diff --git a/backport/backport-include/linux/gpio/driver.h b/backport/backport-include/linux/gpio/driver.h
index 8df5c298..cebeb482 100644
--- a/backport/backport-include/linux/gpio/driver.h
+++ b/backport/backport-include/linux/gpio/driver.h
@@ -7,4 +7,16 @@
 #include_next <linux/gpio/driver.h>
 #endif
 
+#if LINUX_VERSION_IN_RANGE(3,17,0, 5,3,0)
+enum gpiod_flags;
+enum gpio_lookup_flags;
+
+#define gpiochip_request_own_desc LINUX_BACKPORT(gpiochip_request_own_desc)
+struct gpio_desc *backport_gpiochip_request_own_desc(struct gpio_chip *gc,
+					    unsigned int hwnum,
+					    const char *label,
+					    enum gpio_lookup_flags lflags,
+					    enum gpiod_flags dflags);
+#endif /* 3.17.0 <= x < 5.3.0 */
+
 #endif /* __BP_GPIO_DRIVER_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 6f1b0a89..8d917622 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -38,6 +38,7 @@ compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o
 compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
 compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
 compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o
+compat-$(CPTCFG_KERNEL_5_3) += backport-5.3.o
 compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o
 
 compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
diff --git a/backport/compat/backport-5.3.c b/backport/compat/backport-5.3.c
new file mode 100644
index 00000000..f501448e
--- /dev/null
+++ b/backport/compat/backport-5.3.c
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/gpio.h>
+#if LINUX_VERSION_IS_GEQ(3,17,0)
+#include <linux/gpio/driver.h>
+#include <linux/gpio/consumer.h>
+#include <linux/gpio/machine.h>
+
+/**
+ * gpiod_configure_flags - helper function to configure a given GPIO
+ * @desc:	gpio whose value will be assigned
+ * @con_id:	function within the GPIO consumer
+ * @lflags:	bitmask of gpio_lookup_flags GPIO_* values - returned from
+ *		of_find_gpio() or of_get_gpio_hog()
+ * @dflags:	gpiod_flags - optional GPIO initialization flags
+ *
+ * Return 0 on success, -ENOENT if no GPIO has been assigned to the
+ * requested function and/or index, or another IS_ERR() code if an error
+ * occurred while trying to acquire the GPIO.
+ */
+static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
+		unsigned long lflags, enum gpiod_flags dflags)
+{
+	int ret;
+
+#ifdef GPIO_TRANSITORY
+	ret = gpiod_set_transitory(desc, (lflags & GPIO_TRANSITORY));
+	if (ret < 0)
+		return ret;
+#endif
+
+	/* No particular flag request, return here... */
+	if (!(dflags & GPIOD_FLAGS_BIT_DIR_SET))
+		return 0;
+
+	/* Process flags */
+	if (dflags & GPIOD_FLAGS_BIT_DIR_OUT)
+		ret = gpiod_direction_output(desc,
+				!!(dflags & GPIOD_FLAGS_BIT_DIR_VAL));
+	else
+		ret = gpiod_direction_input(desc);
+
+	return ret;
+}
+
+#undef gpiochip_request_own_desc
+struct gpio_desc *backport_gpiochip_request_own_desc(struct gpio_chip *gc,
+					    unsigned int hwnum,
+					    const char *label,
+					    enum gpio_lookup_flags lflags,
+					    enum gpiod_flags dflags)
+{
+	struct gpio_desc *desc;
+	int ret;
+
+#if LINUX_VERSION_IS_GEQ(5,0,0)
+	desc = gpiochip_request_own_desc(gc, hwnum, label, dflags);
+#else
+	desc = gpiochip_request_own_desc(gc, hwnum, label);
+#endif
+	if (IS_ERR(desc))
+		return desc;
+
+	ret = gpiod_configure_flags(desc, label, lflags, dflags);
+	if (ret) {
+		gpiochip_free_own_desc(desc);
+		return ERR_PTR(ret);
+	}
+
+	return desc;
+}
+EXPORT_SYMBOL_GPL(backport_gpiochip_request_own_desc);
+#endif /* > 3.17 */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 15/30] backports: Add microchip wilc1000 driver
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (13 preceding siblings ...)
  2020-12-01 22:03 ` [PATCH 14/30] backports: add gpiochip_request_own_desc() Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 16/30] backports: Make rx_list handling work on older kernel versions Hauke Mehrtens
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This driver was newly added to mainline, also add it to backports.

The driver needs minimal changes to compile against older kernel
versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 copy-list                                     |  1 +
 .../0013-fix-makefile-includes/wilc1000.patch | 34 ++++++++++++++
 patches/0095-spi-delay/wilc1000.patch         | 47 +++++++++++++++++++
 3 files changed, 82 insertions(+)
 create mode 100644 patches/0013-fix-makefile-includes/wilc1000.patch
 create mode 100644 patches/0095-spi-delay/wilc1000.patch

diff --git a/copy-list b/copy-list
index 6aeb9cc6..8c787e06 100644
--- a/copy-list
+++ b/copy-list
@@ -104,6 +104,7 @@ drivers/net/wireless/intel/
 drivers/net/wireless/ralink/
 drivers/net/wireless/zydas/
 drivers/net/wireless/marvell/
+drivers/net/wireless/microchip/
 drivers/net/wireless/intersil/
 drivers/net/wireless/quantenna/
 drivers/net/wireless/realtek/
diff --git a/patches/0013-fix-makefile-includes/wilc1000.patch b/patches/0013-fix-makefile-includes/wilc1000.patch
new file mode 100644
index 00000000..819a1593
--- /dev/null
+++ b/patches/0013-fix-makefile-includes/wilc1000.patch
@@ -0,0 +1,34 @@
+linux/interrupt.h include needed for kernel 4.14
+linux/module.h include needed for kernel 3.18
+
+--- a/drivers/net/wireless/microchip/wilc1000/netdev.c
++++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
+@@ -9,6 +9,8 @@
+ #include <linux/firmware.h>
+ #include <linux/netdevice.h>
+ #include <linux/inetdevice.h>
++#include <linux/interrupt.h>
++#include <linux/module.h>
+ 
+ #include "cfg80211.h"
+ #include "wlan_cfg.h"
+--- a/drivers/net/wireless/microchip/wilc1000/sdio.c
++++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
+@@ -10,6 +10,7 @@
+ #include <linux/mmc/host.h>
+ #include <linux/mmc/sdio.h>
+ #include <linux/of_irq.h>
++#include <linux/module.h>
+ 
+ #include "netdev.h"
+ #include "cfg80211.h"
+--- a/drivers/net/wireless/microchip/wilc1000/spi.c
++++ b/drivers/net/wireless/microchip/wilc1000/spi.c
+@@ -7,6 +7,7 @@
+ #include <linux/clk.h>
+ #include <linux/spi/spi.h>
+ #include <linux/crc7.h>
++#include <linux/module.h>
+ 
+ #include "netdev.h"
+ #include "cfg80211.h"
diff --git a/patches/0095-spi-delay/wilc1000.patch b/patches/0095-spi-delay/wilc1000.patch
new file mode 100644
index 00000000..6565c432
--- /dev/null
+++ b/patches/0095-spi-delay/wilc1000.patch
@@ -0,0 +1,47 @@
+--- a/drivers/net/wireless/microchip/wilc1000/spi.c
++++ b/drivers/net/wireless/microchip/wilc1000/spi.c
+@@ -160,10 +160,14 @@ static int wilc_spi_tx(struct wilc *wilc
+ 		struct spi_transfer tr = {
+ 			.tx_buf = b,
+ 			.len = len,
++#if LINUX_VERSION_IS_GEQ(5,5,0)
+ 			.delay = {
+ 				.value = 0,
+ 				.unit = SPI_DELAY_UNIT_USECS
+ 			},
++#else
++			.delay_usecs = 0,
++#endif /* >= 5.5 */
+ 		};
+ 		char *r_buffer = kzalloc(len, GFP_KERNEL);
+ 
+@@ -204,10 +208,14 @@ static int wilc_spi_rx(struct wilc *wilc
+ 		struct spi_transfer tr = {
+ 			.rx_buf = rb,
+ 			.len = rlen,
++#if LINUX_VERSION_IS_GEQ(5,5,0)
+ 			.delay = {
+ 				.value = 0,
+ 				.unit = SPI_DELAY_UNIT_USECS
+ 			},
++#else
++			.delay_usecs = 0,
++#endif /* >= 5.5 */
+ 
+ 		};
+ 		char *t_buffer = kzalloc(rlen, GFP_KERNEL);
+@@ -249,10 +257,14 @@ static int wilc_spi_tx_rx(struct wilc *w
+ 			.tx_buf = wb,
+ 			.len = rlen,
+ 			.bits_per_word = 8,
++#if LINUX_VERSION_IS_GEQ(5,5,0)
+ 			.delay = {
+ 				.value = 0,
+ 				.unit = SPI_DELAY_UNIT_USECS
+ 			},
++#else
++			.delay_usecs = 0,
++#endif /* >= 5.5 */
+ 
+ 		};
+ 
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 16/30] backports: Make rx_list handling work on older kernel versions
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (14 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 15/30] backports: Add microchip wilc1000 driver Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 17/30] patches: Add missing linux/kthread.h include Hauke Mehrtens
                   ` (14 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The commit c5d1686b314e ("mac80211: add a function for running rx
without passing skbs to the stack") added a new function
ieee80211_rx_list() which uses the list attribute of the skbs, but they
were added only with kernel 4.19. Use the next pointer in the skb on
the older kernel instead. The list attributes where also backported to
4.14, but to make it easier, just use the next pointer also there.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/netdevice.h |  12 ++
 patches/0097-skb-list/mac80211-rx.patch     | 115 ++++++++++++++++++++
 2 files changed, 127 insertions(+)
 create mode 100644 patches/0097-skb-list/mac80211-rx.patch

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index edb0aaf3..7646d6e2 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -372,6 +372,18 @@ static inline int _bp_netdev_upper_dev_link(struct net_device *dev,
 	macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__)
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,19,0)
+static inline void netif_receive_skb_list(struct sk_buff_head *head)
+{
+	struct sk_buff *skb, *next;
+
+	skb_queue_walk_safe(head, skb, next) {
+		__skb_unlink(skb, head);
+		netif_receive_skb(skb);
+	}
+}
+#endif
+
 #if LINUX_VERSION_IS_LESS(5,0,0)
 static inline int backport_dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
 {
diff --git a/patches/0097-skb-list/mac80211-rx.patch b/patches/0097-skb-list/mac80211-rx.patch
new file mode 100644
index 00000000..b698d192
--- /dev/null
+++ b/patches/0097-skb-list/mac80211-rx.patch
@@ -0,0 +1,115 @@
+Make rx_list handling work on older kernel versions
+
+The commit c5d1686b314e ("mac80211: add a function for running rx
+without passing skbs to the stack") added a new function
+ieee80211_rx_list() which uses the list attribute of the skbs, but they
+were added only with kernel 4.19. Use the next pointer in the skb on
+the older kernel instead. The list attributes where also backported to
+4.14, but to make it easier, just use the next pointer also there.
+
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -4383,7 +4383,11 @@ void ieee80211_restart_hw(struct ieee802
+  * @list: the destination list
+  */
+ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 		       struct sk_buff *skb, struct list_head *list);
++#else
++		       struct sk_buff *skb, struct sk_buff_head *list);
++#endif
+ 
+ /**
+  * ieee80211_rx_napi - receive frame from NAPI context
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -217,7 +217,11 @@ enum ieee80211_rx_flags {
+ };
+ 
+ struct ieee80211_rx_data {
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 	struct list_head *list;
++#else
++	struct sk_buff_head *list;
++#endif
+ 	struct sk_buff *skb;
+ 	struct ieee80211_local *local;
+ 	struct ieee80211_sub_if_data *sdata;
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2580,7 +2580,11 @@ static void ieee80211_deliver_skb_to_loc
+ 
+ 		/* deliver to local stack */
+ 		if (rx->list)
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 			list_add_tail(&skb->list, rx->list);
++#else
++			__skb_queue_tail(rx->list, skb);
++#endif
+ 		else
+ 			netif_receive_skb(skb);
+ 	}
+@@ -4480,7 +4484,11 @@ static bool ieee80211_invoke_fast_rx(str
+ 	skb->protocol = eth_type_trans(skb, fast_rx->dev);
+ 	memset(skb->cb, 0, sizeof(skb->cb));
+ 	if (rx->list)
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 		list_add_tail(&skb->list, rx->list);
++#else
++		__skb_queue_tail(rx->list, skb);
++#endif
+ 	else
+ 		netif_receive_skb(skb);
+ 
+@@ -4547,7 +4555,11 @@ static bool ieee80211_prepare_and_rx_han
+ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
+ 					 struct ieee80211_sta *pubsta,
+ 					 struct sk_buff *skb,
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 					 struct list_head *list)
++#else
++					 struct sk_buff_head *list)
++#endif
+ {
+ 	struct ieee80211_local *local = hw_to_local(hw);
+ 	struct ieee80211_sub_if_data *sdata;
+@@ -4671,7 +4683,11 @@ static void __ieee80211_rx_handle_packet
+  * 802.11 MPDU is received from the hardware.
+  */
+ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 		       struct sk_buff *skb, struct list_head *list)
++#else
++		       struct sk_buff *skb, struct sk_buff_head *list)
++#endif
+ {
+ 	struct ieee80211_local *local = hw_to_local(hw);
+ 	struct ieee80211_rate *rate = NULL;
+@@ -4788,7 +4804,13 @@ void ieee80211_rx_napi(struct ieee80211_
+ 		       struct sk_buff *skb, struct napi_struct *napi)
+ {
+ 	struct sk_buff *tmp;
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 	LIST_HEAD(list);
++#else
++	struct sk_buff_head list;
++
++	__skb_queue_head_init(&list);
++#endif
+ 
+ 
+ 	/*
+@@ -4805,8 +4827,13 @@ void ieee80211_rx_napi(struct ieee80211_
+ 		return;
+ 	}
+ 
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 	list_for_each_entry_safe(skb, tmp, &list, list) {
+ 		skb_list_del_init(skb);
++#else
++	skb_queue_walk_safe(&list, skb, tmp) {
++		__skb_unlink(skb, &list);
++#endif
+ 		napi_gro_receive(napi, skb);
+ 	}
+ }
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 17/30] patches: Add missing linux/kthread.h include
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (15 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 16/30] backports: Make rx_list handling work on older kernel versions Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 18/30] patches: Add include to rtw88 Hauke Mehrtens
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The mt76 driver needs an extra include of linux/kthread.h on some older
kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0013-fix-makefile-includes/mt76.patch | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/patches/0013-fix-makefile-includes/mt76.patch b/patches/0013-fix-makefile-includes/mt76.patch
index b7628ff2..98dff5e6 100644
--- a/patches/0013-fix-makefile-includes/mt76.patch
+++ b/patches/0013-fix-makefile-includes/mt76.patch
@@ -1,5 +1,7 @@
 additional include needed for kernel 4.2, 4.11, 4.12 and 4.13
 
+linux/kthread.h include needed against kernel 4.19.
+
 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
 +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
 @@ -6,6 +6,7 @@
@@ -10,3 +12,33 @@ additional include needed for kernel 4.2, 4.11, 4.12 and 4.13
  #include "mt7615.h"
  #include "mcu.h"
  #include "mac.h"
+--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
+@@ -9,6 +9,7 @@
+ #include <linux/kernel.h>
+ #include <linux/iopoll.h>
+ #include <linux/module.h>
++#include <linux/kthread.h>
+ 
+ #include <linux/mmc/host.h>
+ #include <linux/mmc/sdio_ids.h>
+--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
+@@ -9,6 +9,7 @@
+ #include <linux/kernel.h>
+ #include <linux/iopoll.h>
+ #include <linux/module.h>
++#include <linux/kthread.h>
+ 
+ #include <linux/mmc/host.h>
+ #include <linux/mmc/sdio_ids.h>
+--- a/drivers/net/wireless/mediatek/mt76/util.h
++++ b/drivers/net/wireless/mediatek/mt76/util.h
+@@ -10,6 +10,7 @@
+ #include <linux/skbuff.h>
+ #include <linux/bitops.h>
+ #include <linux/bitfield.h>
++#include <linux/kthread.h>
+ 
+ #define MT76_INCR(_var, _size) \
+ 	(_var = (((_var) + 1) % (_size)))
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 18/30] patches: Add include to rtw88
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (16 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 17/30] patches: Add missing linux/kthread.h include Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 19/30] patches: handle netdev_walk_all_lower_dev() Hauke Mehrtens
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

On kernel 3.18 the rtw88 needs linux/module.h to compile.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0013-fix-makefile-includes/rtw88.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/patches/0013-fix-makefile-includes/rtw88.patch b/patches/0013-fix-makefile-includes/rtw88.patch
index 62aac393..961ef25c 100644
--- a/patches/0013-fix-makefile-includes/rtw88.patch
+++ b/patches/0013-fix-makefile-includes/rtw88.patch
@@ -1,3 +1,5 @@
+linux/module.h include needed for kernel 3.18
+
 --- a/drivers/net/wireless/realtek/rtw88/main.c
 +++ b/drivers/net/wireless/realtek/rtw88/main.c
 @@ -15,6 +15,7 @@
@@ -8,3 +10,13 @@
  
  unsigned int rtw_fw_lps_deep_mode;
  EXPORT_SYMBOL(rtw_fw_lps_deep_mode);
+--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
++++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+@@ -14,6 +14,7 @@
+ #include "reg.h"
+ #include "debug.h"
+ #include "bf.h"
++#include <linux/module.h>
+ 
+ static void rtw8821ce_efuse_parsing(struct rtw_efuse *efuse,
+ 				    struct rtw8821c_efuse *map)
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 19/30] patches: handle netdev_walk_all_lower_dev()
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (17 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 18/30] patches: Add include to rtw88 Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 20/30] patches: Remove unneeded 0018-pv-trace-fixes patch Hauke Mehrtens
                   ` (11 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The signature of netdev_walk_all_lower_dev() takes a pointer to struct
netdev_nested_priv starting with kernel 5.9. Add a patch to handle both
cases now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0098-netdev_nested_priv/qtnfmac.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 patches/0098-netdev_nested_priv/qtnfmac.patch

diff --git a/patches/0098-netdev_nested_priv/qtnfmac.patch b/patches/0098-netdev_nested_priv/qtnfmac.patch
new file mode 100644
index 00000000..77d07f61
--- /dev/null
+++ b/patches/0098-netdev_nested_priv/qtnfmac.patch
@@ -0,0 +1,43 @@
+--- a/drivers/net/wireless/quantenna/qtnfmac/core.c
++++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
+@@ -671,10 +671,16 @@ bool qtnf_netdev_is_qtn(const struct net
+ 	return ndev->netdev_ops == &qtnf_netdev_ops;
+ }
+ 
++#if LINUX_VERSION_IS_GEQ(5,9,0)
+ static int qtnf_check_br_ports(struct net_device *dev,
+ 			       struct netdev_nested_priv *priv)
+ {
+ 	struct net_device *ndev = (struct net_device *)priv->data;
++#else
++static int qtnf_check_br_ports(struct net_device *dev, void *data)
++{
++	struct net_device *ndev = data;
++#endif
+ 
+ 	if (dev != ndev && netdev_port_same_parent_id(dev, ndev))
+ 		return -ENOTSUPP;
+@@ -687,9 +693,11 @@ static int qtnf_core_netdevice_event(str
+ {
+ 	struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
+ 	const struct netdev_notifier_changeupper_info *info;
++#if LINUX_VERSION_IS_GEQ(5,9,0)
+ 	struct netdev_nested_priv priv = {
+ 		.data = (void *)ndev,
+ 	};
++#endif
+ 	struct net_device *brdev;
+ 	struct qtnf_vif *vif;
+ 	struct qtnf_bus *bus;
+@@ -729,7 +737,11 @@ static int qtnf_core_netdevice_event(str
+ 		} else {
+ 			ret = netdev_walk_all_lower_dev(brdev,
+ 							qtnf_check_br_ports,
++#if LINUX_VERSION_IS_GEQ(5,9,0)
+ 							&priv);
++#else
++							ndev);
++#endif
+ 		}
+ 
+ 		break;
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 20/30] patches: Remove unneeded 0018-pv-trace-fixes patch
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (18 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 19/30] patches: handle netdev_walk_all_lower_dev() Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 21/30] patches: Refresh on kernel 5.10-rc6 Hauke Mehrtens
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This patch is not applying any more and is only needed for kernel < 3.1
which is unsupported for some time by now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0018-pv-trace-fixes/INFO              |  7 --
 ...ivers_net_wireless_iwlwifi_iwl-debug.patch | 65 ---------------
 .../net_mac80211_trace.patch                  | 79 -------------------
 3 files changed, 151 deletions(-)
 delete mode 100644 patches/0018-pv-trace-fixes/INFO
 delete mode 100644 patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
 delete mode 100644 patches/0018-pv-trace-fixes/net_mac80211_trace.patch

diff --git a/patches/0018-pv-trace-fixes/INFO b/patches/0018-pv-trace-fixes/INFO
deleted file mode 100644
index a2c89e92..00000000
--- a/patches/0018-pv-trace-fixes/INFO
+++ /dev/null
@@ -1,7 +0,0 @@
-In recent kernels, %pV will copy the va_list before using it.
-This isn't true for all kernels, so copy the va_list for use
-by the dev_*() functions, otherwise the kernel will crash if
-the message is printed and traced.
-
-This is required for kernels <= 3.1, as otherwise it would
-those kernels would crash.
diff --git a/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch b/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
deleted file mode 100644
index d323f7ad..00000000
--- a/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- a/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
-+++ b/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
-@@ -69,13 +69,16 @@ void __iwl_ ##fn(struct device *dev, con
- 	struct va_format vaf = {				\
- 		.fmt = fmt,					\
- 	};							\
--	va_list args;						\
-+	va_list args1, args2;					\
- 								\
--	va_start(args, fmt);					\
--	vaf.va = &args;						\
-+	va_start(args1, fmt);					\
-+	va_copy(args2, args1);					\
-+	vaf.va = &args2;					\
- 	dev_ ##fn(dev, "%pV", &vaf);				\
-+	va_end(args2);						\
-+	vaf.va = &args1;					\
- 	trace_iwlwifi_ ##fn(&vaf);				\
--	va_end(args);						\
-+	va_end(args1);						\
- }
- 
- __iwl_fn(warn)
-@@ -94,13 +97,18 @@ void __iwl_err(struct device *dev, bool
- 	va_list args;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- 	if (!trace_only) {
-+		va_list args2;
-+
-+		va_copy(args2, args);
-+		vaf.va = &args2;
- 		if (rfkill_prefix)
- 			dev_err(dev, "(RFKILL) %pV", &vaf);
- 		else
- 			dev_err(dev, "%pV", &vaf);
-+		va_end(args2);
- 	}
-+	vaf.va = &args;
- 	trace_iwlwifi_err(&vaf);
- 	va_end(args);
- }
-@@ -117,13 +125,19 @@ void __iwl_dbg(struct device *dev,
- 	va_list args;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- #ifdef CONFIG_IWLWIFI_DEBUG
- 	if (iwl_have_debug_level(level) &&
--	    (!limit || net_ratelimit()))
-+	    (!limit || net_ratelimit())) {
-+		va_list args2;
-+
-+		va_copy(args2, args);
-+		vaf.va = &args2;
- 		dev_printk(KERN_DEBUG, dev, "%c %s %pV",
- 			   in_interrupt() ? 'I' : 'U', function, &vaf);
-+		va_end(args2);
-+	}
- #endif
-+	vaf.va = &args;
- 	trace_iwlwifi_dbg(level, in_interrupt(), function, &vaf);
- 	va_end(args);
- }
diff --git a/patches/0018-pv-trace-fixes/net_mac80211_trace.patch b/patches/0018-pv-trace-fixes/net_mac80211_trace.patch
deleted file mode 100644
index 8b3f7afd..00000000
--- a/patches/0018-pv-trace-fixes/net_mac80211_trace.patch
+++ /dev/null
@@ -1,79 +0,0 @@
---- a/net/mac80211/trace.c
-+++ b/net/mac80211/trace.c
-@@ -17,12 +17,16 @@ void __sdata_info(const char *fmt, ...)
- 	struct va_format vaf = {
- 		.fmt = fmt,
- 	};
--	va_list args;
-+	va_list args, args2;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- 
-+	va_copy(args2, args);
-+	vaf.va = &args2;
- 	pr_info("%pV", &vaf);
-+	va_end(args2);
-+
-+	vaf.va = &args;
- 	trace_mac80211_info(&vaf);
- 	va_end(args);
- }
-@@ -35,10 +39,16 @@ void __sdata_dbg(bool print, const char
- 	va_list args;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- 
--	if (print)
-+	if (print) {
-+		va_list args2;
-+
-+		va_copy(args2, args);
-+		vaf.va = &args2;
- 		pr_debug("%pV", &vaf);
-+		va_end(args2);
-+	}
-+	vaf.va = &args;
- 	trace_mac80211_dbg(&vaf);
- 	va_end(args);
- }
-@@ -48,12 +58,16 @@ void __sdata_err(const char *fmt, ...)
- 	struct va_format vaf = {
- 		.fmt = fmt,
- 	};
--	va_list args;
-+	va_list args, args2;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- 
-+	va_copy(args2, args);
-+	vaf.va = &args2;
- 	pr_err("%pV", &vaf);
-+	va_end(args2);
-+
-+	vaf.va = &args;
- 	trace_mac80211_err(&vaf);
- 	va_end(args);
- }
-@@ -66,10 +80,16 @@ void __wiphy_dbg(struct wiphy *wiphy, bo
- 	va_list args;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- 
--	if (print)
--		wiphy_dbg(wiphy, "%pV", &vaf);
-+	if (print) {
-+		va_list args2;
-+
-+		va_copy(args2, args);
-+		vaf.va = &args2;
-+		pr_debug("%pV", &vaf);
-+		va_end(args2);
-+	}
-+	vaf.va = &args;
- 	trace_mac80211_dbg(&vaf);
- 	va_end(args);
- }
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 21/30] patches: Refresh on kernel 5.10-rc6
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (19 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 20/30] patches: Remove unneeded 0018-pv-trace-fixes patch Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 22/30] patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...) Hauke Mehrtens
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Refresh the patches on kernel 5.10-rc6.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 .../0002-disable-dump-adjust-on-old-kernels.patch  |  4 ++--
 .../include_net_cfg80211.patch                     |  2 +-
 .../net_wireless_core.patch                        |  2 +-
 .../net_wireless_core.patch                        |  4 ++--
 patches/0013-fix-makefile-includes/mt76.patch      |  4 ++--
 .../0014-netlink_seq/net_wireless_nl80211.patch    |  2 +-
 patches/0024-led-blink-api/mac80211.patch          |  2 +-
 patches/0025-usb-sg/usbnet.patch                   | 12 ++++++------
 patches/0028-select_queue/mac80211.patch           |  4 ++--
 patches/0028-select_queue/mwifiex.patch            |  2 +-
 patches/0053-possible_net_t.patch                  |  2 +-
 patches/0055-name_assign_type/brcmfmac.patch       |  2 +-
 patches/0071-skb-head_frag/wireless.patch          |  2 +-
 patches/0075-ndo-stats-64/usbnet.patch             |  4 ++--
 patches/0077-genl-ro-after-init/hwsim.patch        |  2 +-
 patches/0077-genl-ro-after-init/nl80211.patch      |  2 +-
 patches/0079-netdev-destructor/brcmfmac.patch      |  4 ++--
 patches/0085-iwlwifi-pci-device-removal.patch      |  4 ++--
 patches/0097-skb-list/mac80211-rx.patch            | 14 +++++++-------
 patches/0098-netdev_nested_priv/qtnfmac.patch      |  6 +++---
 patches/verify.patch                               |  6 +++---
 21 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/patches/0002-disable-dump-adjust-on-old-kernels.patch b/patches/0002-disable-dump-adjust-on-old-kernels.patch
index 4766e4c8..36a2a928 100644
--- a/patches/0002-disable-dump-adjust-on-old-kernels.patch
+++ b/patches/0002-disable-dump-adjust-on-old-kernels.patch
@@ -28,7 +28,7 @@ Date:   Fri Mar 1 14:03:49 2013 +0100
 
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -2683,6 +2683,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2767,6 +2767,7 @@ static int nl80211_dump_wiphy(struct sk_
  						 cb->nlh->nlmsg_seq,
  						 NLM_F_MULTI, state);
  			if (ret < 0) {
@@ -36,7 +36,7 @@ Date:   Fri Mar 1 14:03:49 2013 +0100
  				/*
  				 * If sending the wiphy data didn't fit (ENOBUFS
  				 * or EMSGSIZE returned), this SKB is still
-@@ -2704,6 +2705,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2788,6 +2789,7 @@ static int nl80211_dump_wiphy(struct sk_
  					rtnl_unlock();
  					return 1;
  				}
diff --git a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
index 845db615..9d90ea82 100644
--- a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
+++ b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
@@ -1,6 +1,6 @@
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4782,6 +4782,9 @@ struct wiphy_iftype_akm_suites {
+@@ -4883,6 +4883,9 @@ struct wiphy_iftype_akm_suites {
  struct wiphy {
  	/* assign these fields before you register the wiphy */
  
diff --git a/patches/0003-cfg80211-wext-padding/net_wireless_core.patch b/patches/0003-cfg80211-wext-padding/net_wireless_core.patch
index e1eca55d..3d73e463 100644
--- a/patches/0003-cfg80211-wext-padding/net_wireless_core.patch
+++ b/patches/0003-cfg80211-wext-padding/net_wireless_core.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/core.c
 +++ b/net/wireless/core.c
-@@ -403,6 +403,17 @@ struct wiphy *wiphy_new_nm(const struct
+@@ -405,6 +405,17 @@ struct wiphy *wiphy_new_nm(const struct
  	struct cfg80211_registered_device *rdev;
  	int alloc_size;
  
diff --git a/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch b/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
index 38b60057..18b50f12 100644
--- a/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
+++ b/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/core.c
 +++ b/net/wireless/core.c
-@@ -493,10 +493,6 @@ use_default_name:
+@@ -495,10 +495,6 @@ use_default_name:
  	INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done);
  	INIT_DELAYED_WORK(&rdev->dfs_update_channels_wk,
  			  cfg80211_dfs_channels_update_work);
@@ -11,7 +11,7 @@
  	device_initialize(&rdev->wiphy.dev);
  	rdev->wiphy.dev.class = &ieee80211_class;
  	rdev->wiphy.dev.platform_data = rdev;
-@@ -1271,6 +1267,15 @@ void cfg80211_init_wdev(struct wireless_
+@@ -1273,6 +1269,15 @@ void cfg80211_init_wdev(struct wireless_
  	INIT_WORK(&wdev->pmsr_free_wk, cfg80211_pmsr_free_wk);
  
  #ifdef CONFIG_CFG80211_WEXT
diff --git a/patches/0013-fix-makefile-includes/mt76.patch b/patches/0013-fix-makefile-includes/mt76.patch
index 98dff5e6..81ee4944 100644
--- a/patches/0013-fix-makefile-includes/mt76.patch
+++ b/patches/0013-fix-makefile-includes/mt76.patch
@@ -39,6 +39,6 @@ linux/kthread.h include needed against kernel 4.19.
  #include <linux/bitops.h>
  #include <linux/bitfield.h>
 +#include <linux/kthread.h>
+ #include <net/mac80211.h>
  
- #define MT76_INCR(_var, _size) \
- 	(_var = (((_var) + 1) % (_size)))
+ struct mt76_worker
diff --git a/patches/0014-netlink_seq/net_wireless_nl80211.patch b/patches/0014-netlink_seq/net_wireless_nl80211.patch
index b33dd79b..0fd1d87b 100644
--- a/patches/0014-netlink_seq/net_wireless_nl80211.patch
+++ b/patches/0014-netlink_seq/net_wireless_nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -9047,7 +9047,9 @@ static int nl80211_dump_scan(struct sk_b
+@@ -9311,7 +9311,9 @@ static int nl80211_dump_scan(struct sk_b
  	if (start == 0)
  		cfg80211_bss_expire(rdev);
  
diff --git a/patches/0024-led-blink-api/mac80211.patch b/patches/0024-led-blink-api/mac80211.patch
index ec8ff05a..cbda2867 100644
--- a/patches/0024-led-blink-api/mac80211.patch
+++ b/patches/0024-led-blink-api/mac80211.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1318,6 +1318,7 @@ struct ieee80211_local {
+@@ -1332,6 +1332,7 @@ struct ieee80211_local {
  	struct mutex chanctx_mtx;
  
  #ifdef CONFIG_MAC80211_LEDS
diff --git a/patches/0025-usb-sg/usbnet.patch b/patches/0025-usb-sg/usbnet.patch
index 030efb85..ed72fefc 100644
--- a/patches/0025-usb-sg/usbnet.patch
+++ b/patches/0025-usb-sg/usbnet.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/usb/usbnet.c
 +++ b/drivers/net/usb/usbnet.c
-@@ -1311,6 +1311,7 @@ EXPORT_SYMBOL_GPL(usbnet_tx_timeout);
+@@ -1285,6 +1285,7 @@ EXPORT_SYMBOL_GPL(usbnet_tx_timeout);
  
  /*-------------------------------------------------------------------------*/
  
@@ -8,7 +8,7 @@
  static int build_dma_sg(const struct sk_buff *skb, struct urb *urb)
  {
  	unsigned num_sgs, total_len = 0;
-@@ -1343,6 +1344,12 @@ static int build_dma_sg(const struct sk_
+@@ -1317,6 +1318,12 @@ static int build_dma_sg(const struct sk_
  
  	return 1;
  }
@@ -21,7 +21,7 @@
  
  netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
  				     struct net_device *net)
-@@ -1399,12 +1406,19 @@ netdev_tx_t usbnet_start_xmit (struct sk
+@@ -1373,12 +1380,19 @@ netdev_tx_t usbnet_start_xmit (struct sk
  		if (!(info->flags & FLAG_SEND_ZLP)) {
  			if (!(info->flags & FLAG_MULTI_PACKET)) {
  				length++;
@@ -41,7 +41,7 @@
  			}
  		} else
  			urb->transfer_flags |= URB_ZERO_PACKET;
-@@ -1476,7 +1490,9 @@ not_drop:
+@@ -1450,7 +1464,9 @@ not_drop:
  		if (skb)
  			dev_kfree_skb_any (skb);
  		if (urb) {
@@ -51,7 +51,7 @@
  			usb_free_urb(urb);
  		}
  	} else
-@@ -1529,7 +1545,9 @@ static void usbnet_bh (struct timer_list
+@@ -1503,7 +1519,9 @@ static void usbnet_bh (struct timer_list
  			rx_process (dev, skb);
  			continue;
  		case tx_done:
@@ -61,7 +61,7 @@
  			fallthrough;
  		case rx_cleanup:
  			usb_free_urb (entry->urb);
-@@ -1904,7 +1922,9 @@ int usbnet_resume (struct usb_interface
+@@ -1878,7 +1896,9 @@ int usbnet_resume (struct usb_interface
  			retval = usb_submit_urb(res, GFP_ATOMIC);
  			if (retval < 0) {
  				dev_kfree_skb_any(skb);
diff --git a/patches/0028-select_queue/mac80211.patch b/patches/0028-select_queue/mac80211.patch
index 32ab2a54..b9f25461 100644
--- a/patches/0028-select_queue/mac80211.patch
+++ b/patches/0028-select_queue/mac80211.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -1132,9 +1132,29 @@ static void ieee80211_uninit(struct net_
+@@ -699,9 +699,29 @@ static void ieee80211_uninit(struct net_
  	ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev));
  }
  
@@ -30,7 +30,7 @@
  {
  	return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb);
  }
-@@ -1177,9 +1197,29 @@ static const struct net_device_ops ieee8
+@@ -723,9 +743,29 @@ static const struct net_device_ops ieee8
  	.ndo_get_stats64	= ieee80211_get_stats64,
  };
  
diff --git a/patches/0028-select_queue/mwifiex.patch b/patches/0028-select_queue/mwifiex.patch
index ffcb4cbb..fa99dba0 100644
--- a/patches/0028-select_queue/mwifiex.patch
+++ b/patches/0028-select_queue/mwifiex.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwifiex/main.c
 +++ b/drivers/net/wireless/marvell/mwifiex/main.c
-@@ -1277,9 +1277,28 @@ static struct net_device_stats *mwifiex_
+@@ -1279,9 +1279,28 @@ static struct net_device_stats *mwifiex_
  	return &priv->stats;
  }
  
diff --git a/patches/0053-possible_net_t.patch b/patches/0053-possible_net_t.patch
index 20585fa0..6ee009bd 100644
--- a/patches/0053-possible_net_t.patch
+++ b/patches/0053-possible_net_t.patch
@@ -2,7 +2,7 @@ diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
 index 04e5785..a251da1 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4925,12 +4925,12 @@ struct wiphy {
+@@ -5026,12 +5026,12 @@ struct wiphy {
  
  static inline struct net *wiphy_net(struct wiphy *wiphy)
  {
diff --git a/patches/0055-name_assign_type/brcmfmac.patch b/patches/0055-name_assign_type/brcmfmac.patch
index 391ef04d..a0526786 100644
--- a/patches/0055-name_assign_type/brcmfmac.patch
+++ b/patches/0055-name_assign_type/brcmfmac.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -2338,7 +2338,9 @@ struct wireless_dev *brcmf_p2p_add_vif(s
+@@ -2335,7 +2335,9 @@ struct wireless_dev *brcmf_p2p_add_vif(s
  	}
  
  	strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
diff --git a/patches/0071-skb-head_frag/wireless.patch b/patches/0071-skb-head_frag/wireless.patch
index 48aac872..58f37956 100644
--- a/patches/0071-skb-head_frag/wireless.patch
+++ b/patches/0071-skb-head_frag/wireless.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/util.c
 +++ b/net/wireless/util.c
-@@ -686,7 +686,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
+@@ -718,7 +718,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
  	u8 *payload;
  	int offset = 0, remaining;
  	struct ethhdr eth;
diff --git a/patches/0075-ndo-stats-64/usbnet.patch b/patches/0075-ndo-stats-64/usbnet.patch
index 0728a195..68cc0d65 100644
--- a/patches/0075-ndo-stats-64/usbnet.patch
+++ b/patches/0075-ndo-stats-64/usbnet.patch
@@ -1,7 +1,7 @@
 --- a/drivers/net/usb/usbnet.c
 +++ b/drivers/net/usb/usbnet.c
-@@ -1013,6 +1013,9 @@ void usbnet_get_stats64(struct net_devic
- 	}
+@@ -988,6 +988,9 @@ void usbnet_get_stats64(struct net_devic
+ 	dev_fetch_sw_netstats(stats, dev->stats64);
  }
  EXPORT_SYMBOL_GPL(usbnet_get_stats64);
 +#if LINUX_VERSION_IS_LESS(4,11,0)
diff --git a/patches/0077-genl-ro-after-init/hwsim.patch b/patches/0077-genl-ro-after-init/hwsim.patch
index 36ac2118..a877f147 100644
--- a/patches/0077-genl-ro-after-init/hwsim.patch
+++ b/patches/0077-genl-ro-after-init/hwsim.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/mac80211_hwsim.c
 +++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -3923,7 +3923,7 @@ static const struct genl_ops hwsim_ops[]
+@@ -4001,7 +4001,7 @@ static const struct genl_small_ops hwsim
  	},
  };
  
diff --git a/patches/0077-genl-ro-after-init/nl80211.patch b/patches/0077-genl-ro-after-init/nl80211.patch
index 7550a794..743d14e1 100644
--- a/patches/0077-genl-ro-after-init/nl80211.patch
+++ b/patches/0077-genl-ro-after-init/nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -15252,7 +15252,7 @@ static const struct genl_ops nl80211_ops
+@@ -15525,7 +15525,7 @@ static const struct genl_small_ops nl802
  	},
  };
  
diff --git a/patches/0079-netdev-destructor/brcmfmac.patch b/patches/0079-netdev-destructor/brcmfmac.patch
index 6e67bd4e..830f16cf 100644
--- a/patches/0079-netdev-destructor/brcmfmac.patch
+++ b/patches/0079-netdev-destructor/brcmfmac.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -629,6 +629,23 @@ static const struct net_device_ops brcmf
+@@ -633,6 +633,23 @@ static const struct net_device_ops brcmf
  	.ndo_set_rx_mode = brcmf_netdev_set_multicast_list
  };
  
@@ -24,7 +24,7 @@
  int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
  {
  	struct brcmf_pub *drvr = ifp->drvr;
-@@ -879,7 +896,11 @@ struct brcmf_if *brcmf_add_if(struct brc
+@@ -883,7 +900,11 @@ struct brcmf_if *brcmf_add_if(struct brc
  		if (!ndev)
  			return ERR_PTR(-ENOMEM);
  
diff --git a/patches/0085-iwlwifi-pci-device-removal.patch b/patches/0085-iwlwifi-pci-device-removal.patch
index c1c1dc39..a4c6b73c 100644
--- a/patches/0085-iwlwifi-pci-device-removal.patch
+++ b/patches/0085-iwlwifi-pci-device-removal.patch
@@ -2,7 +2,7 @@ diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wirel
 index f74281508197..3b11bd68f261 100644
 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-@@ -2006,6 +2006,9 @@ static void iwl_trans_pcie_removal_wk(st
+@@ -2007,6 +2007,9 @@ static void iwl_trans_pcie_removal_wk(st
  	struct iwl_trans_pcie_removal *removal =
  		container_of(wk, struct iwl_trans_pcie_removal, work);
  	struct pci_dev *pdev = removal->pdev;
@@ -12,7 +12,7 @@ index f74281508197..3b11bd68f261 100644
  	static char *prop[] = {"EVENT=INACCESSIBLE", NULL};
  
  	dev_err(&pdev->dev, "Device gone - attempting removal\n");
-@@ -2014,6 +2017,7 @@ static void iwl_trans_pcie_removal_wk(st
+@@ -2015,6 +2018,7 @@ static void iwl_trans_pcie_removal_wk(st
  	pci_dev_put(pdev);
  	pci_stop_and_remove_bus_device(pdev);
  	pci_unlock_rescan_remove();
diff --git a/patches/0097-skb-list/mac80211-rx.patch b/patches/0097-skb-list/mac80211-rx.patch
index b698d192..31abf63e 100644
--- a/patches/0097-skb-list/mac80211-rx.patch
+++ b/patches/0097-skb-list/mac80211-rx.patch
@@ -9,7 +9,7 @@ the older kernel instead. The list attributes where also backported to
 
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -4383,7 +4383,11 @@ void ieee80211_restart_hw(struct ieee802
+@@ -4450,7 +4450,11 @@ void ieee80211_restart_hw(struct ieee802
   * @list: the destination list
   */
  void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
@@ -37,7 +37,7 @@ the older kernel instead. The list attributes where also backported to
  	struct ieee80211_sub_if_data *sdata;
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -2580,7 +2580,11 @@ static void ieee80211_deliver_skb_to_loc
+@@ -2539,7 +2539,11 @@ static void ieee80211_deliver_skb_to_loc
  
  		/* deliver to local stack */
  		if (rx->list)
@@ -49,7 +49,7 @@ the older kernel instead. The list attributes where also backported to
  		else
  			netif_receive_skb(skb);
  	}
-@@ -4480,7 +4484,11 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4459,7 +4463,11 @@ static bool ieee80211_invoke_fast_rx(str
  	skb->protocol = eth_type_trans(skb, fast_rx->dev);
  	memset(skb->cb, 0, sizeof(skb->cb));
  	if (rx->list)
@@ -61,7 +61,7 @@ the older kernel instead. The list attributes where also backported to
  	else
  		netif_receive_skb(skb);
  
-@@ -4547,7 +4555,11 @@ static bool ieee80211_prepare_and_rx_han
+@@ -4526,7 +4534,11 @@ static bool ieee80211_prepare_and_rx_han
  static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
  					 struct ieee80211_sta *pubsta,
  					 struct sk_buff *skb,
@@ -73,7 +73,7 @@ the older kernel instead. The list attributes where also backported to
  {
  	struct ieee80211_local *local = hw_to_local(hw);
  	struct ieee80211_sub_if_data *sdata;
-@@ -4671,7 +4683,11 @@ static void __ieee80211_rx_handle_packet
+@@ -4651,7 +4663,11 @@ static void __ieee80211_rx_handle_packet
   * 802.11 MPDU is received from the hardware.
   */
  void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
@@ -85,7 +85,7 @@ the older kernel instead. The list attributes where also backported to
  {
  	struct ieee80211_local *local = hw_to_local(hw);
  	struct ieee80211_rate *rate = NULL;
-@@ -4788,7 +4804,13 @@ void ieee80211_rx_napi(struct ieee80211_
+@@ -4768,7 +4784,13 @@ void ieee80211_rx_napi(struct ieee80211_
  		       struct sk_buff *skb, struct napi_struct *napi)
  {
  	struct sk_buff *tmp;
@@ -99,7 +99,7 @@ the older kernel instead. The list attributes where also backported to
  
  
  	/*
-@@ -4805,8 +4827,13 @@ void ieee80211_rx_napi(struct ieee80211_
+@@ -4785,8 +4807,13 @@ void ieee80211_rx_napi(struct ieee80211_
  		return;
  	}
  
diff --git a/patches/0098-netdev_nested_priv/qtnfmac.patch b/patches/0098-netdev_nested_priv/qtnfmac.patch
index 77d07f61..7ff920c3 100644
--- a/patches/0098-netdev_nested_priv/qtnfmac.patch
+++ b/patches/0098-netdev_nested_priv/qtnfmac.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c
 +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
-@@ -671,10 +671,16 @@ bool qtnf_netdev_is_qtn(const struct net
+@@ -649,10 +649,16 @@ bool qtnf_netdev_is_qtn(const struct net
  	return ndev->netdev_ops == &qtnf_netdev_ops;
  }
  
@@ -17,7 +17,7 @@
  
  	if (dev != ndev && netdev_port_same_parent_id(dev, ndev))
  		return -ENOTSUPP;
-@@ -687,9 +693,11 @@ static int qtnf_core_netdevice_event(str
+@@ -665,9 +671,11 @@ static int qtnf_core_netdevice_event(str
  {
  	struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
  	const struct netdev_notifier_changeupper_info *info;
@@ -29,7 +29,7 @@
  	struct net_device *brdev;
  	struct qtnf_vif *vif;
  	struct qtnf_bus *bus;
-@@ -729,7 +737,11 @@ static int qtnf_core_netdevice_event(str
+@@ -707,7 +715,11 @@ static int qtnf_core_netdevice_event(str
  		} else {
  			ret = netdev_walk_all_lower_dev(brdev,
  							qtnf_check_br_ports,
diff --git a/patches/verify.patch b/patches/verify.patch
index 5adba0e6..f76b6bf5 100644
--- a/patches/verify.patch
+++ b/patches/verify.patch
@@ -23,7 +23,7 @@
  #include "x509_parser.h"
  
  /*
-@@ -150,6 +147,7 @@ not_self_signed:
+@@ -153,6 +150,7 @@ not_self_signed:
  	return 0;
  }
  
@@ -31,7 +31,7 @@
  /*
   * Attempt to parse a data blob for a key as an X509 certificate.
   */
-@@ -268,3 +266,4 @@ module_exit(x509_key_exit);
+@@ -271,3 +269,4 @@ module_exit(x509_key_exit);
  MODULE_DESCRIPTION("X.509 certificate parser");
  MODULE_AUTHOR("Red Hat, Inc.");
  MODULE_LICENSE("GPL");
@@ -64,7 +64,7 @@
  	struct x509_certificate *signer;	/* Certificate that signed this one */
 --- a/include/crypto/backport-public_key.h
 +++ b/include/crypto/backport-public_key.h
-@@ -50,34 +50,6 @@ extern void public_key_signature_free(st
+@@ -53,34 +53,6 @@ extern void public_key_signature_free(st
  
  extern struct asymmetric_key_subtype public_key_subtype;
  
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 22/30] patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...)
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (20 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 21/30] patches: Refresh on kernel 5.10-rc6 Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 23/30] patches: Deactivate hikey9xx staging driver Hauke Mehrtens
                   ` (8 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Support for NLA_POLICY_RANGE(NLA_BINARY, ...) was added in upstream
Linux commit c8b828023088 ("nl80211: use NLA_POLICY_RANGE(NLA_BINARY,
...) for a few attributes") and needs commit 8aa26c575fb ("netlink: make
NLA_BINARY validation more flexible") which was added in kernel 5.10.

Just ignore the checks in older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/net/netlink.h   |  6 +++
 patches/0099-netlink-range/mac80211.patch | 57 +++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 patches/0099-netlink-range/mac80211.patch

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index 082ac4d0..c97f9abd 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -719,4 +719,10 @@ static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp)
 }
 #endif /* < 4.9 */
 
+#ifndef NLA_POLICY_MIN_LEN
+#define NLA_POLICY_MIN_LEN(_len) {		\
+	.type = NLA_BINARY			\
+}
+#endif
+
 #endif /* __BACKPORT_NET_NETLINK_H */
diff --git a/patches/0099-netlink-range/mac80211.patch b/patches/0099-netlink-range/mac80211.patch
new file mode 100644
index 00000000..48afe208
--- /dev/null
+++ b/patches/0099-netlink-range/mac80211.patch
@@ -0,0 +1,57 @@
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -387,9 +387,11 @@ static const struct nla_policy
+ nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = {
+ 	[NL80211_FILS_DISCOVERY_ATTR_INT_MIN] = NLA_POLICY_MAX(NLA_U32, 10000),
+ 	[NL80211_FILS_DISCOVERY_ATTR_INT_MAX] = NLA_POLICY_MAX(NLA_U32, 10000),
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	NLA_POLICY_RANGE(NLA_BINARY,
+ 			 NL80211_FILS_DISCOVERY_TMPL_MIN_LEN,
+ 			 IEEE80211_MAX_DATA_LEN),
++#endif
+ };
+ 
+ static const struct nla_policy
+@@ -617,16 +619,26 @@ static const struct nla_policy nl80211_p
+ 	 * The value of the Length field of the Supported Operating
+ 	 * Classes element is between 2 and 253.
+ 	 */
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] =
+ 		NLA_POLICY_RANGE(NLA_BINARY, 2, 253),
++#else
++	[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] =
++		{ .type = NLA_BINARY },
++#endif
+ 	[NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG },
+ 	[NL80211_ATTR_OPMODE_NOTIF] = { .type = NLA_U8 },
+ 	[NL80211_ATTR_VENDOR_ID] = { .type = NLA_U32 },
+ 	[NL80211_ATTR_VENDOR_SUBCMD] = { .type = NLA_U32 },
+ 	[NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY },
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	[NL80211_ATTR_QOS_MAP] = NLA_POLICY_RANGE(NLA_BINARY,
+ 						  IEEE80211_QOS_MAP_LEN_MIN,
+ 						  IEEE80211_QOS_MAP_LEN_MAX),
++#else
++	[NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY,
++				   .len = IEEE80211_QOS_MAP_LEN_MAX },
++#endif
+ 	[NL80211_ATTR_MAC_HINT] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
+ 	[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
+ 	[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
+@@ -681,10 +693,15 @@ static const struct nla_policy nl80211_p
+ 	[NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
+ 	[NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
+ 	[NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	[NL80211_ATTR_HE_CAPABILITY] =
+ 		NLA_POLICY_RANGE(NLA_BINARY,
+ 				 NL80211_HE_MIN_CAPABILITY_LEN,
+ 				 NL80211_HE_MAX_CAPABILITY_LEN),
++#else
++	[NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
++					 .len = NL80211_HE_MAX_CAPABILITY_LEN },
++#endif
+ 	[NL80211_ATTR_FTM_RESPONDER] =
+ 		NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
+ 	[NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 23/30] patches: Deactivate hikey9xx staging driver
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (21 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 22/30] patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...) Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 24/30] patches: Revert usage of small_ops Hauke Mehrtens
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The hikey9xx driver is not included, but will be activated
unconditionally in the staging driver directory. Just comment it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0084-disable-some-staging-dirs.patch | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/patches/0084-disable-some-staging-dirs.patch b/patches/0084-disable-some-staging-dirs.patch
index 1dd86ca7..9e550b3b 100644
--- a/patches/0084-disable-some-staging-dirs.patch
+++ b/patches/0084-disable-some-staging-dirs.patch
@@ -9,3 +9,9 @@
  obj-$(CONFIG_PRISM2_USB)	+= wlan-ng/
  obj-$(CONFIG_COMEDI)		+= comedi/
  obj-$(CONFIG_FB_OLPC_DCON)	+= olpc_dcon/
+@@ -48,4 +48,4 @@ obj-$(CONFIG_FIELDBUS_DEV)     += fieldb
+ obj-$(CONFIG_KPC2000)		+= kpc2000/
+ obj-$(CONFIG_QLGE)		+= qlge/
+ obj-$(CONFIG_WFX)		+= wfx/
+-obj-y				+= hikey9xx/
++#obj-y				+= hikey9xx/
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 24/30] patches: Revert usage of small_ops
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (22 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 23/30] patches: Deactivate hikey9xx staging driver Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 25/30] headers: Add DEFINE_SEQ_ATTRIBUTE Hauke Mehrtens
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This reverts upstream Linux kernel commit 66a9b9287d2 ("genetlink: move
to smaller ops wherever possible") for older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0100-revert-small_ops/mac80211.patch  | 25 +++++++++++++++++
 .../mac80211_hwsim.patch                      | 28 +++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 patches/0100-revert-small_ops/mac80211.patch
 create mode 100644 patches/0100-revert-small_ops/mac80211_hwsim.patch

diff --git a/patches/0100-revert-small_ops/mac80211.patch b/patches/0100-revert-small_ops/mac80211.patch
new file mode 100644
index 00000000..37c2fcff
--- /dev/null
+++ b/patches/0100-revert-small_ops/mac80211.patch
@@ -0,0 +1,25 @@
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -14690,9 +14690,11 @@ static const struct genl_ops nl80211_ops
+ 		.internal_flags = NL80211_FLAG_NEED_WIPHY |
+ 				  NL80211_FLAG_NEED_RTNL,
+ 	},
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ };
+ 
+ static const struct genl_small_ops nl80211_small_ops[] = {
++#endif
+ 	{
+ 		.cmd = NL80211_CMD_SET_WIPHY,
+ 		.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+@@ -15554,8 +15556,10 @@ static struct genl_family nl80211_fam __
+ 	.module = THIS_MODULE,
+ 	.ops = nl80211_ops,
+ 	.n_ops = ARRAY_SIZE(nl80211_ops),
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	.small_ops = nl80211_small_ops,
+ 	.n_small_ops = ARRAY_SIZE(nl80211_small_ops),
++#endif
+ 	.mcgrps = nl80211_mcgrps,
+ 	.n_mcgrps = ARRAY_SIZE(nl80211_mcgrps),
+ 	.parallel_ops = true,
diff --git a/patches/0100-revert-small_ops/mac80211_hwsim.patch b/patches/0100-revert-small_ops/mac80211_hwsim.patch
new file mode 100644
index 00000000..1a764336
--- /dev/null
+++ b/patches/0100-revert-small_ops/mac80211_hwsim.patch
@@ -0,0 +1,28 @@
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -3964,7 +3964,11 @@ done:
+ }
+ 
+ /* Generic Netlink operations array */
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ static const struct genl_small_ops hwsim_ops[] = {
++#else
++static const struct genl_ops hwsim_ops[] = {
++#endif
+ 	{
+ 		.cmd = HWSIM_CMD_REGISTER,
+ 		.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+@@ -4008,8 +4012,13 @@ static struct genl_family hwsim_genl_fam
+ 	.policy = hwsim_genl_policy,
+ 	.netnsok = true,
+ 	.module = THIS_MODULE,
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	.small_ops = hwsim_ops,
+ 	.n_small_ops = ARRAY_SIZE(hwsim_ops),
++#else
++	.ops = hwsim_ops,
++	.n_ops = ARRAY_SIZE(hwsim_ops),
++#endif
+ 	.mcgrps = hwsim_mcgrps,
+ 	.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
+ };
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 25/30] headers: Add DEFINE_SEQ_ATTRIBUTE
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (23 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 24/30] patches: Revert usage of small_ops Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 26/30] backports: Add netif_rx_any_context() Hauke Mehrtens
                   ` (5 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Add the DEFINE_SEQ_ATTRIBUTE which was added in commit d2c0e6e91c79
("include/linux/seq_file.h: introduce DEFINE_SEQ_ATTRIBUTE() helper
macro") in kernel 5.8. This is used by ath5k.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/seq_file.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/backport/backport-include/linux/seq_file.h b/backport/backport-include/linux/seq_file.h
index 5b88f6f8..1d78bbbd 100644
--- a/backport/backport-include/linux/seq_file.h
+++ b/backport/backport-include/linux/seq_file.h
@@ -64,4 +64,25 @@ static const struct file_operations __name ## _fops = {			\
 }
 #endif /* DEFINE_SHOW_ATTRIBUTE */
 
+#ifndef DEFINE_SEQ_ATTRIBUTE
+#define DEFINE_SEQ_ATTRIBUTE(__name)					\
+static int __name ## _open(struct inode *inode, struct file *file)	\
+{									\
+	int ret = seq_open(file, &__name ## _sops);			\
+	if (!ret && inode->i_private) {					\
+		struct seq_file *seq_f = file->private_data;		\
+		seq_f->private = inode->i_private;			\
+	}								\
+	return ret;							\
+}									\
+									\
+static const struct file_operations __name ## _fops = {			\
+	.owner		= THIS_MODULE,					\
+	.open		= __name ## _open,				\
+	.read		= seq_read,					\
+	.llseek		= seq_lseek,					\
+	.release	= seq_release,					\
+}
+#endif /* DEFINE_SEQ_ATTRIBUTE */
+
 #endif /* __BACKPORT_SEQ_FILE_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 26/30] backports: Add netif_rx_any_context()
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (24 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 25/30] headers: Add DEFINE_SEQ_ATTRIBUTE Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 27/30] backports: Add dev_fetch_sw_netstats() Hauke Mehrtens
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Add the netif_rx_any_context which was added in commit c11171a41338
("net: Add netif_rx_any_context()") in kernel 5.10. This is used by
libertas and mwifiex.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/netdevice.h |  5 +++++
 backport/compat/Makefile                    |  1 +
 backport/compat/backport-5.10.c             | 20 ++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 backport/compat/backport-5.10.c

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 7646d6e2..411757d2 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -400,4 +400,9 @@ static inline bool netif_is_bridge_port(const struct net_device *dev)
 }
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,10,0)
+#define netif_rx_any_context LINUX_BACKPORT(netif_rx_any_context)
+int netif_rx_any_context(struct sk_buff *skb);
+#endif /* < 5.10 */
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 8d917622..b67ebc27 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -40,6 +40,7 @@ compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
 compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o
 compat-$(CPTCFG_KERNEL_5_3) += backport-5.3.o
 compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o
+compat-$(CPTCFG_KERNEL_5_10) += backport-5.10.o
 
 compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
 compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7.asn1.o
diff --git a/backport/compat/backport-5.10.c b/backport/compat/backport-5.10.c
new file mode 100644
index 00000000..a83907f4
--- /dev/null
+++ b/backport/compat/backport-5.10.c
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/netdevice.h>
+
+int netif_rx_any_context(struct sk_buff *skb)
+{
+	/*
+	 * If invoked from contexts which do not invoke bottom half
+	 * processing either at return from interrupt or when softrqs are
+	 * reenabled, use netif_rx_ni() which invokes bottomhalf processing
+	 * directly.
+	 */
+	if (in_interrupt())
+		return netif_rx(skb);
+	else
+		return netif_rx_ni(skb);
+}
+EXPORT_SYMBOL(netif_rx_any_context);
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 27/30] backports: Add dev_fetch_sw_netstats()
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (25 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 26/30] backports: Add netif_rx_any_context() Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 28/30] backports: Make ieee80211_tx_status handling work on older kernel versions Hauke Mehrtens
                   ` (3 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Add the dev_fetch_sw_netstats which was added in commit 44fa32f008ab
("net: add function dev_fetch_sw_netstats for fetching
pcpu_sw_netstats") in kernel 5.10. This is used by qmi_wwan, usbnet,
qtnfmac and mac80211.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/netdevice.h |  4 +++
 backport/compat/backport-5.10.c             | 34 +++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 411757d2..ed691961 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -401,6 +401,10 @@ static inline bool netif_is_bridge_port(const struct net_device *dev)
 #endif
 
 #if LINUX_VERSION_IS_LESS(5,10,0)
+#define dev_fetch_sw_netstats LINUX_BACKPORT(dev_fetch_sw_netstats)
+void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
+			   const struct pcpu_sw_netstats __percpu *netstats);
+
 #define netif_rx_any_context LINUX_BACKPORT(netif_rx_any_context)
 int netif_rx_any_context(struct sk_buff *skb);
 #endif /* < 5.10 */
diff --git a/backport/compat/backport-5.10.c b/backport/compat/backport-5.10.c
index a83907f4..141862da 100644
--- a/backport/compat/backport-5.10.c
+++ b/backport/compat/backport-5.10.c
@@ -4,6 +4,40 @@
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 
+/**
+ *	dev_fetch_sw_netstats - get per-cpu network device statistics
+ *	@s: place to store stats
+ *	@netstats: per-cpu network stats to read from
+ *
+ *	Read per-cpu network statistics and populate the related fields in @s.
+ */
+void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
+			   const struct pcpu_sw_netstats __percpu *netstats)
+{
+	int cpu;
+
+	for_each_possible_cpu(cpu) {
+		const struct pcpu_sw_netstats *stats;
+		struct pcpu_sw_netstats tmp;
+		unsigned int start;
+
+		stats = per_cpu_ptr(netstats, cpu);
+		do {
+			start = u64_stats_fetch_begin_irq(&stats->syncp);
+			tmp.rx_packets = stats->rx_packets;
+			tmp.rx_bytes   = stats->rx_bytes;
+			tmp.tx_packets = stats->tx_packets;
+			tmp.tx_bytes   = stats->tx_bytes;
+		} while (u64_stats_fetch_retry_irq(&stats->syncp, start));
+
+		s->rx_packets += tmp.rx_packets;
+		s->rx_bytes   += tmp.rx_bytes;
+		s->tx_packets += tmp.tx_packets;
+		s->tx_bytes   += tmp.tx_bytes;
+	}
+}
+EXPORT_SYMBOL_GPL(dev_fetch_sw_netstats);
+
 int netif_rx_any_context(struct sk_buff *skb)
 {
 	/*
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 28/30] backports: Make ieee80211_tx_status handling work on older kernel versions
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (26 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 27/30] backports: Add dev_fetch_sw_netstats() Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 29/30] backports: Add sysfs_emit() Hauke Mehrtens
                   ` (2 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The commit f02dff93e26b ("mac80211: extend ieee80211_tx_status_ext to
support bulk free") makes use of the list attribute in the skb, but this
is not available in kernel < 4.19, use the sk_buff_head instead on these
kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0097-skb-list/mac80211-status.patch | 47 +++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 patches/0097-skb-list/mac80211-status.patch

diff --git a/patches/0097-skb-list/mac80211-status.patch b/patches/0097-skb-list/mac80211-status.patch
new file mode 100644
index 00000000..ab968445
--- /dev/null
+++ b/patches/0097-skb-list/mac80211-status.patch
@@ -0,0 +1,47 @@
+Make ieee80211_tx_status handling work on older kernel versions
+
+The commit f02dff93e26b ("mac80211: extend ieee80211_tx_status_ext to
+support bulk free") makes use of the list attribute in the skb, but this
+is not available in kernel < 4.19, use the sk_buff_head instead on these
+kernel versions.
+
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -1132,7 +1132,11 @@ struct ieee80211_tx_status {
+ 	struct ieee80211_tx_info *info;
+ 	struct sk_buff *skb;
+ 	struct rate_info *rate;
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 	struct list_head *free_list;
++#else
++	struct sk_buff_head *free_list;
++#endif
+ };
+ 
+ /**
+--- a/net/mac80211/status.c
++++ b/net/mac80211/status.c
+@@ -1033,7 +1033,11 @@ static void __ieee80211_tx_status(struct
+ 	 */
+ 	if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) {
+ 		if (status->free_list)
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 			list_add_tail(&skb->list, status->free_list);
++#else
++			__skb_queue_tail(status->free_list, skb);
++#endif
+ 		else
+ 			dev_kfree_skb(skb);
+ 		return;
+@@ -1183,7 +1187,11 @@ free:
+ 
+ 	ieee80211_report_used_skb(local, skb, false);
+ 	if (status->free_list)
++#if LINUX_VERSION_IS_GEQ(4,19,0)
+ 		list_add_tail(&skb->list, status->free_list);
++#else
++		__skb_queue_tail(status->free_list, skb);
++#endif
+ 	else
+ 		dev_kfree_skb(skb);
+ }
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 29/30] backports: Add sysfs_emit()
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (27 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 28/30] backports: Make ieee80211_tx_status handling work on older kernel versions Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-01 22:04 ` [PATCH 30/30] backports: Remove crypto/akcipher.h Hauke Mehrtens
  2020-12-06 15:57 ` [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Add the sysfs_emit() function which was added in Linux upstream commit
2efc459d06f1 ("sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs
output") and is now used by drivers-base-devcoredump.c

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/sysfs.h | 14 +++++++++++++
 backport/compat/backport-5.10.c         | 27 +++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/backport/backport-include/linux/sysfs.h b/backport/backport-include/linux/sysfs.h
index 0b71db54..ad8a8229 100644
--- a/backport/backport-include/linux/sysfs.h
+++ b/backport/backport-include/linux/sysfs.h
@@ -8,4 +8,18 @@
 			 _name##_show, _name##_store)
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,10,0)
+#define sysfs_emit LINUX_BACKPORT(sysfs_emit)
+#ifdef CONFIG_SYSFS
+__printf(2, 3)
+int sysfs_emit(char *buf, const char *fmt, ...);
+#else /* CONFIG_SYSFS */
+__printf(2, 3)
+static inline int sysfs_emit(char *buf, const char *fmt, ...)
+{
+	return 0;
+}
+#endif /* CONFIG_SYSFS */
+#endif /* < 5.10 */
+
 #endif /* __BACKPORT_LINUX_SYSFS_H */
diff --git a/backport/compat/backport-5.10.c b/backport/compat/backport-5.10.c
index 141862da..c3a7b7d3 100644
--- a/backport/compat/backport-5.10.c
+++ b/backport/compat/backport-5.10.c
@@ -3,6 +3,7 @@
 #include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/sysfs.h>
 
 /**
  *	dev_fetch_sw_netstats - get per-cpu network device statistics
@@ -52,3 +53,29 @@ int netif_rx_any_context(struct sk_buff *skb)
 		return netif_rx_ni(skb);
 }
 EXPORT_SYMBOL(netif_rx_any_context);
+
+/**
+ *	sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
+ *	@buf:	start of PAGE_SIZE buffer.
+ *	@fmt:	format
+ *	@...:	optional arguments to @format
+ *
+ *
+ * Returns number of characters written to @buf.
+ */
+int sysfs_emit(char *buf, const char *fmt, ...)
+{
+	va_list args;
+	int len;
+
+	if (WARN(!buf || offset_in_page(buf),
+		 "invalid sysfs_emit: buf:%p\n", buf))
+		return 0;
+
+	va_start(args, fmt);
+	len = vscnprintf(buf, PAGE_SIZE, fmt, args);
+	va_end(args);
+
+	return len;
+}
+EXPORT_SYMBOL_GPL(sysfs_emit);
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 30/30] backports: Remove crypto/akcipher.h
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (28 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 29/30] backports: Add sysfs_emit() Hauke Mehrtens
@ 2020-12-01 22:04 ` Hauke Mehrtens
  2020-12-06 15:57 ` [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-01 22:04 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

crypto/akcipher.h is only used by code which was anyway removed in the
patches/verify.patch patch from include/crypto/backport-public_key.h.

Remove the include, because is not available on older kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/verify.patch | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/patches/verify.patch b/patches/verify.patch
index f76b6bf5..f1faff55 100644
--- a/patches/verify.patch
+++ b/patches/verify.patch
@@ -64,7 +64,15 @@
  	struct x509_certificate *signer;	/* Certificate that signed this one */
 --- a/include/crypto/backport-public_key.h
 +++ b/include/crypto/backport-public_key.h
-@@ -53,34 +53,6 @@ extern void public_key_signature_free(st
+@@ -12,7 +12,6 @@
+ 
+ #include <linux/keyctl.h>
+ #include <linux/oid_registry.h>
+-#include <crypto/akcipher.h>
+ 
+ /*
+  * Cryptographic data for the public-key subtype of the asymmetric key type.
+@@ -53,34 +52,6 @@ extern void public_key_signature_free(st
  
  extern struct asymmetric_key_subtype public_key_subtype;
  
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 00/30] backports: Update to match kernel 5.10-rc6
  2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
                   ` (29 preceding siblings ...)
  2020-12-01 22:04 ` [PATCH 30/30] backports: Remove crypto/akcipher.h Hauke Mehrtens
@ 2020-12-06 15:57 ` Hauke Mehrtens
  30 siblings, 0 replies; 32+ messages in thread
From: Hauke Mehrtens @ 2020-12-06 15:57 UTC (permalink / raw)
  To: backports; +Cc: johannes


[-- Attachment #1.1: Type: text/plain, Size: 6385 bytes --]

On 12/1/20 11:03 PM, Hauke Mehrtens wrote:
> This adds many changes to make backports compatible with kernel 5.10-rc6.
> 
> I plan to create also releaes based on 5.8.18 and 5.9.11, I will take
> the commit directly before the refresh for the next kernel version.
> 
> Felix Fietkau (2):
>    backports: add sched_set_fifo_low
>    backports: add tasklet_setup, from_tasklet
> 
> Hauke Mehrtens (27):
>    backports: Adapt to changes in Ubuntu mainline URLs
>    gentree.py: Remoace space between -I and $(src)
>    backports: Extend NOSTDINC_FLAGS
>    patches: Refresh on kernel 5.8.18
>    backprots: make patches apply on 5.9.11
>    header: add module_sdio_driver
>    header: Rename kfree_sensitive(x) to kzfree(x)
>    header: dummy implementation for thermal_zone_device_enable
>    header: Add __skb_put_zero()
>    dependency: add MT7663S
>    backports: add gpiochip_request_own_desc()
>    backports: Add microchip wilc1000 driver
>    backports: Make rx_list handling work on older kernel versions
>    patches: Add missing linux/kthread.h include
>    patches: Add include to rtw88
>    patches: handle netdev_walk_all_lower_dev()
>    patches: Remove unneeded 0018-pv-trace-fixes patch
>    patches: Refresh on kernel 5.10-rc6
>    patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...)
>    patches: Deactivate hikey9xx staging driver
>    patches: Revert usage of small_ops
>    headers: Add DEFINE_SEQ_ATTRIBUTE
>    backports: Add netif_rx_any_context()
>    backports: Add dev_fetch_sw_netstats()
>    backports: Make ieee80211_tx_status handling work on older kernel
>      versions
>    backports: Add sysfs_emit()
>    backports: Remove crypto/akcipher.h
> 
> Shay Bar (1):
>    backports: Add time64_to_tm and ipv6_mc_check_mld
> 
>   backport/Makefile.kernel                      |   4 +-
>   backport/backport-include/linux/gpio/driver.h |  12 ++
>   backport/backport-include/linux/interrupt.h   |  17 +++
>   .../backport-include/linux/mmc/sdio_func.h    |  14 +++
>   backport/backport-include/linux/netdevice.h   |  21 ++++
>   backport/backport-include/linux/sched.h       |  20 +++
>   backport/backport-include/linux/seq_file.h    |  21 ++++
>   backport/backport-include/linux/skbuff.h      |   8 ++
>   backport/backport-include/linux/slab.h        |   4 +
>   backport/backport-include/linux/sysfs.h       |  14 +++
>   backport/backport-include/linux/thermal.h     |  10 ++
>   backport/backport-include/linux/time.h        |   8 ++
>   backport/backport-include/net/addrconf.h      |  15 +++
>   backport/backport-include/net/netlink.h       |   6 +
>   backport/compat/Makefile                      |   2 +
>   backport/compat/backport-5.10.c               |  81 ++++++++++++
>   backport/compat/backport-5.3.c                |  74 +++++++++++
>   copy-list                                     |   1 +
>   dependencies                                  |   1 +
>   devel/backports-update-manager                |  44 ++++---
>   gentree.py                                    |   2 +-
>   ...2-disable-dump-adjust-on-old-kernels.patch |   4 +-
>   .../include_net_cfg80211.patch                |   2 +-
>   .../net_wireless_core.patch                   |   2 +-
>   .../net_wireless_core.patch                   |  26 ++--
>   patches/0013-fix-makefile-includes/mt76.patch |  32 +++++
>   .../0013-fix-makefile-includes/rtw88.patch    |  12 ++
>   .../0013-fix-makefile-includes/wilc1000.patch |  34 ++++++
>   .../net_wireless_nl80211.patch                |   2 +-
>   patches/0018-pv-trace-fixes/INFO              |   7 --
>   ...ivers_net_wireless_iwlwifi_iwl-debug.patch |  65 ----------
>   .../net_mac80211_trace.patch                  |  79 ------------
>   patches/0024-led-blink-api/mac80211.patch     |   2 +-
>   patches/0025-usb-sg/usbnet.patch              |  14 +--
>   patches/0028-select_queue/mac80211.patch      |   4 +-
>   patches/0028-select_queue/mwifiex.patch       |   2 +-
>   patches/0053-possible_net_t.patch             |   2 +-
>   patches/0055-name_assign_type/brcmfmac.patch  |   2 +-
>   patches/0071-skb-head_frag/wireless.patch     |   2 +-
>   patches/0075-ndo-stats-64/usbnet.patch        |   6 +-
>   patches/0077-genl-ro-after-init/hwsim.patch   |   2 +-
>   patches/0077-genl-ro-after-init/nl80211.patch |   2 +-
>   patches/0079-netdev-destructor/brcmfmac.patch |   4 +-
>   patches/0084-disable-some-staging-dirs.patch  |   6 +
>   patches/0085-iwlwifi-pci-device-removal.patch |   4 +-
>   patches/0091-fq-no-siphash_key_t/fq.patch     |  36 ------
>   patches/0094-ndo-tx-timeout/prism54.patch     |   2 +-
>   patches/0094-ndo-tx-timeout/usbnet.patch      |   2 +-
>   patches/0095-spi-delay/wilc1000.patch         |  47 +++++++
>   patches/0097-skb-list/mac80211-rx.patch       | 115 ++++++++++++++++++
>   patches/0097-skb-list/mac80211-status.patch   |  47 +++++++
>   patches/0098-netdev_nested_priv/qtnfmac.patch |  43 +++++++
>   patches/0099-netlink-range/mac80211.patch     |  57 +++++++++
>   patches/0100-revert-small_ops/mac80211.patch  |  25 ++++
>   .../mac80211_hwsim.patch                      |  28 +++++
>   patches/verify.patch                          |  14 ++-
>   56 files changed, 861 insertions(+), 251 deletions(-)
>   create mode 100644 backport/backport-include/linux/sched.h
>   create mode 100644 backport/compat/backport-5.10.c
>   create mode 100644 backport/compat/backport-5.3.c
>   create mode 100644 patches/0013-fix-makefile-includes/wilc1000.patch
>   delete mode 100644 patches/0018-pv-trace-fixes/INFO
>   delete mode 100644 patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
>   delete mode 100644 patches/0018-pv-trace-fixes/net_mac80211_trace.patch
>   delete mode 100644 patches/0091-fq-no-siphash_key_t/fq.patch
>   create mode 100644 patches/0095-spi-delay/wilc1000.patch
>   create mode 100644 patches/0097-skb-list/mac80211-rx.patch
>   create mode 100644 patches/0097-skb-list/mac80211-status.patch
>   create mode 100644 patches/0098-netdev_nested_priv/qtnfmac.patch
>   create mode 100644 patches/0099-netlink-range/mac80211.patch
>   create mode 100644 patches/0100-revert-small_ops/mac80211.patch
>   create mode 100644 patches/0100-revert-small_ops/mac80211_hwsim.patch
> 

I applied all the patches.

Hauke


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2020-12-06 15:58 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 22:03 [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 01/30] backports: Adapt to changes in Ubuntu mainline URLs Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 02/30] gentree.py: Remoace space between -I and $(src) Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 03/30] backports: Extend NOSTDINC_FLAGS Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 04/30] patches: Refresh on kernel 5.8.18 Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 05/30] backports: add sched_set_fifo_low Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 06/30] backports: add tasklet_setup, from_tasklet Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 07/30] backports: Add time64_to_tm and ipv6_mc_check_mld Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 08/30] backprots: make patches apply on 5.9.11 Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 09/30] header: add module_sdio_driver Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 10/30] header: Rename kfree_sensitive(x) to kzfree(x) Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 11/30] header: dummy implementation for thermal_zone_device_enable Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 12/30] header: Add __skb_put_zero() Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 13/30] dependency: add MT7663S Hauke Mehrtens
2020-12-01 22:03 ` [PATCH 14/30] backports: add gpiochip_request_own_desc() Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 15/30] backports: Add microchip wilc1000 driver Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 16/30] backports: Make rx_list handling work on older kernel versions Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 17/30] patches: Add missing linux/kthread.h include Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 18/30] patches: Add include to rtw88 Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 19/30] patches: handle netdev_walk_all_lower_dev() Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 20/30] patches: Remove unneeded 0018-pv-trace-fixes patch Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 21/30] patches: Refresh on kernel 5.10-rc6 Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 22/30] patches: Avoid using NLA_POLICY_RANGE(NLA_BINARY, ...) Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 23/30] patches: Deactivate hikey9xx staging driver Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 24/30] patches: Revert usage of small_ops Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 25/30] headers: Add DEFINE_SEQ_ATTRIBUTE Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 26/30] backports: Add netif_rx_any_context() Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 27/30] backports: Add dev_fetch_sw_netstats() Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 28/30] backports: Make ieee80211_tx_status handling work on older kernel versions Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 29/30] backports: Add sysfs_emit() Hauke Mehrtens
2020-12-01 22:04 ` [PATCH 30/30] backports: Remove crypto/akcipher.h Hauke Mehrtens
2020-12-06 15:57 ` [PATCH 00/30] backports: Update to match kernel 5.10-rc6 Hauke Mehrtens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).