openwrt/staging/blogic.git
6 years agobackports: make extack backport compile on <3.13
Johannes Berg [Fri, 17 Nov 2017 09:49:10 +0000 (10:49 +0100)]
backports: make extack backport compile on <3.13

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: pre-declare stats64_fn_wrap() to avoid sparse warnings
Luca Coelho [Thu, 2 Nov 2017 09:59:35 +0000 (11:59 +0200)]
patches: pre-declare stats64_fn_wrap() to avoid sparse warnings

The stats64_fn_wrap() function was changed to be not-static so it can
be used by usbnet.  This causes problems in files that don't export
it.  Work around that byt just pre-declaring it before the actual
definition.

Fixes: 5a00d8489c7 ("patches: adapt the stat64 usage for usbnet")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix missing linux/verification.h error on < 4.7
Felix Fietkau [Thu, 16 Nov 2017 14:38:55 +0000 (15:38 +0100)]
backports: fix missing linux/verification.h error on < 4.7

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix events with extack backport
Felix Fietkau [Thu, 16 Nov 2017 14:38:54 +0000 (15:38 +0100)]
backports: fix events with extack backport

The multicast group offset needs to be synced after registering the
family, otherwise multicast messages will use the wrong id

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport-include: backport skb_get_hash_perturb
Felix Fietkau [Thu, 16 Nov 2017 14:38:53 +0000 (15:38 +0100)]
backport-include: backport skb_get_hash_perturb

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agokconf: sync with upstream version 37861ffa8c28
Felix Fietkau [Thu, 16 Nov 2017 14:38:52 +0000 (15:38 +0100)]
kconf: sync with upstream version 37861ffa8c28

Adds support for the imply keyword

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: netlink extack: Allow ext_ack to carry non-error messages
Johannes Berg [Mon, 13 Nov 2017 07:57:05 +0000 (08:57 +0100)]
backports: netlink extack: Allow ext_ack to carry non-error messages

Backport upstream

    commit 4f6265d485ea0a2507692ded8ed47b323f49587c
    Author: David Ahern <dsahern@gmail.com>
    Date:   Fri Oct 27 17:37:12 2017 -0700

        netlink: Allow ext_ack to carry non-error messages

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix the extack backport for dumps
Johannes Berg [Thu, 26 Oct 2017 08:22:53 +0000 (10:22 +0200)]
backports: fix the extack backport for dumps

I also never seem to have really tested unload after dumps,
and using the family->attrbuf was causing memory corruption
in the copied family.

Fix this by keeping track of the family copies separately
and actually copying the attrbuf over so the family can use
it from there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix the extack backport
Johannes Berg [Tue, 24 Oct 2017 14:08:48 +0000 (16:08 +0200)]
backports: fix the extack backport

I neglected to take into account that the spatch will also
be applied to the backport-4.12.c file itself, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fully add netlink extack for generic netlink
Johannes Berg [Mon, 16 Oct 2017 19:48:21 +0000 (21:48 +0200)]
backports: fully add netlink extack for generic netlink

The previous backport just made the code compatible, but removed
the extack functionality entirely.

By ignoring the setsockopt() and just assuming that userspace does
in fact support extack (which is true for all of wifi and in fact
all users of libnl), we can support full extack functionality even
on kernels that don't support it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agockmake: use white instead of blue
Johannes Berg [Fri, 13 Oct 2017 13:54:24 +0000 (15:54 +0200)]
ckmake: use white instead of blue

Blue on black is really hard to read, use white on black.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agogentree: mangle $(srctree)/$(src) directly
Johannes Berg [Fri, 13 Oct 2017 12:27:32 +0000 (14:27 +0200)]
gentree: mangle $(srctree)/$(src) directly

We used to patch this, before with the genregdb and now with
the shipped-certs.c generation - just fix it in code instead
so we don't have to deal with different patches.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: remove CRYPTO_CCM backport
Johannes Berg [Fri, 13 Oct 2017 10:26:23 +0000 (12:26 +0200)]
backports: remove CRYPTO_CCM backport

This never actually worked properly as far as I can tell,
and now it looks like it won't even compile due to the
real crypto_memneq() backport.

Just remove it - distro kernels have it enabled and all
others should just enable it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: reduce mbedtls bignum stack usage
Johannes Berg [Fri, 13 Oct 2017 10:18:06 +0000 (12:18 +0200)]
backports: reduce mbedtls bignum stack usage

mbedtls_mpi_exp_mod() uses almost 4k of memory, which
really shouldn't be on the stack in the kernel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add fixed version of __verify_pcpu_ptr
Johannes Berg [Fri, 13 Oct 2017 10:03:58 +0000 (12:03 +0200)]
backports: add fixed version of __verify_pcpu_ptr

Some parts of the code (ath_cmn_is_fft_buf_full) use a per-CPU
pointer to an array, so we need to backport the fixed version
or this fails to compile in 3.10/3.11.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: no longer support kernels < 3.10
Johannes Berg [Fri, 13 Oct 2017 09:25:44 +0000 (11:25 +0200)]
backports: no longer support kernels < 3.10

Since CRYPTO_CMAC was introduced in 3.10, and mac80211
depends on it, we basically get nothing out of it anyway.

I'm not removing the support code (yet) since it actually
compiles, and perhaps somebody has a need for (certain)
kernel versions lower than 3.10.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports-update-manager: use KPATH variable
Johannes Berg [Fri, 13 Oct 2017 09:41:24 +0000 (11:41 +0200)]
backports-update-manager: use KPATH variable

There's already a variable for the URL, use it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: RSI_SDIO depends on 3.13
Johannes Berg [Fri, 13 Oct 2017 09:02:49 +0000 (11:02 +0200)]
backports: RSI_SDIO depends on 3.13

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: make QTNFMAC_PEARL_PCIE depend on 3.13
Johannes Berg [Fri, 13 Oct 2017 08:49:05 +0000 (10:49 +0200)]
backports: make QTNFMAC_PEARL_PCIE depend on 3.13

It needs pcie_get_mps() which was only exported in that kernel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add netdev_upper_dev_link() extack argument
Johannes Berg [Fri, 13 Oct 2017 08:48:42 +0000 (10:48 +0200)]
backports: add netdev_upper_dev_link() extack argument

But make it optional (using magic.h) to let this still work
on kernels that didn't change the argument.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add signature verification code
Johannes Berg [Thu, 12 Oct 2017 12:10:08 +0000 (14:10 +0200)]
backports: add signature verification code

Uh, this was awful. Because the crypto/ things are completely
impossible to backport, I've actually implemented this by using
mbedtls and embedding the relevant functions it has...

The mbedtls code is taken from mbedtls version 2.6.0 and only
minimally modified (mostly to remove <string.h> and similar).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add bin2hex()
Johannes Berg [Thu, 12 Oct 2017 20:53:09 +0000 (22:53 +0200)]
backports: add bin2hex()

This is needed in the key backports in the next patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add hex_byte_pack
Johannes Berg [Fri, 13 Oct 2017 08:38:47 +0000 (10:38 +0200)]
backports: add hex_byte_pack

This was just renamed at some point, needed by bin2hex()
in the next patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocopy-list: move mpls includes
Johannes Berg [Thu, 12 Oct 2017 12:20:35 +0000 (14:20 +0200)]
copy-list: move mpls includes

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add mktime64()
Johannes Berg [Thu, 12 Oct 2017 12:36:48 +0000 (14:36 +0200)]
backports: add mktime64()

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: move headers to be clearer
Johannes Berg [Thu, 12 Oct 2017 12:08:59 +0000 (14:08 +0200)]
backports: move headers to be clearer

Those uapi header files are always needed, so don't mark them as
being for wwan drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add -Wno-pointer-sign on <= 4.3
Johannes Berg [Thu, 12 Oct 2017 09:27:55 +0000 (11:27 +0200)]
backports: add -Wno-pointer-sign on <= 4.3

This gives annoyingly many warnings on such kernels.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agogentree: add --git-debug as alias to --gitdebug
Johannes Berg [Thu, 12 Oct 2017 08:44:49 +0000 (10:44 +0200)]
gentree: add --git-debug as alias to --gitdebug

I always find myself typing --git-debug, so let's just add that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add crypto_memneq()
Johannes Berg [Wed, 11 Oct 2017 14:30:27 +0000 (16:30 +0200)]
backports: add crypto_memneq()

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add OPTIMIZER_HIDE_VAR
Johannes Berg [Wed, 11 Oct 2017 14:01:22 +0000 (16:01 +0200)]
backports: add OPTIMIZER_HIDE_VAR

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: remove genregdb Makefile change
Johannes Berg [Wed, 11 Oct 2017 13:42:50 +0000 (15:42 +0200)]
backports: remove genregdb Makefile change

This piece of code no longer exists.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: backport from_timer() and timer_setup()
Johannes Berg [Wed, 11 Oct 2017 13:41:56 +0000 (15:41 +0200)]
backports: backport from_timer() and timer_setup()

These are needed for Kees's new timer API, and luckily
he already provided them for conversion purposes :-)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix some dev_coredumpm() problem
Johannes Berg [Wed, 11 Oct 2017 13:32:32 +0000 (15:32 +0200)]
backports: fix some dev_coredumpm() problem

Sometimes the argument is const, sometimes not, just cast
away that difference.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: fix compile error on PowerPC (PPC_85xx)
Hauke Mehrtens [Sun, 1 Oct 2017 19:38:23 +0000 (21:38 +0200)]
header: fix compile error on PowerPC (PPC_85xx)

Including linux/interrupt.h in linux/hrtimer.h causes this error message
on PowerPC builds on x86, ARM and MIPS it works:

  CC [M]  /backports-4.14-rc2-1/compat/main.o
In file included from /backports-4.14-rc2-1/backport-include/linux/printk.h:5:0,
                 from ./include/linux/kernel.h:13,
                 from /backports-4.14-rc2-1/backport-include/linux/kernel.h:3,
                 from ./include/linux/list.h:8,
                 from /backports-4.14-rc2-1/backport-include/linux/list.h:3,
                 from ./include/linux/module.h:9,
                 from /backports-4.14-rc2-1/backport-include/linux/module.h:3,
                 from /backports-4.14-rc2-1/compat/main.c:1:
./include/linux/ratelimit.h: In function 'ratelimit_state_exit':
./include/linux/ratelimit.h:62:11: error: dereferencing pointer to incomplete type 'struct task_struct'
    current->comm, rs->missed);
           ^
./include/linux/printk.h:279:37: note: in definition of macro 'pr_warning'
  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                     ^
./include/linux/ratelimit.h:61:3: note: in expansion of macro 'pr_warn'
   pr_warn("%s: %d output lines suppressed due to ratelimiting\n",
   ^

The backport of the hrtimer_start() functions needs the
linux/interrupt.h because some parts are defined there. Fix this by
moving the hrtimer_start() backport to the linux/interrupt.h backport
header file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add ether_addr_to_u64() and u64_to_ether_addr()
Hauke Mehrtens [Sun, 17 Sep 2017 16:58:13 +0000 (18:58 +0200)]
header: add ether_addr_to_u64() and u64_to_ether_addr()

These function were added in commit 5952758101 ("dsa: mv88e6xxx:
Optimise atu_get") and are now used by mwifiex.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add UUID_STRING_LEN
Hauke Mehrtens [Sun, 17 Sep 2017 16:58:12 +0000 (18:58 +0200)]
header: add UUID_STRING_LEN

This was added in commit 2b1b0d6670 ("lib/uuid.c: introduce a few more
generic helpers") and is used by ath10k.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add uuid backports
Hauke Mehrtens [Sun, 17 Sep 2017 16:58:11 +0000 (18:58 +0200)]
header: add uuid backports

This backports the following upstream commits:
f9727a17db9: ("uuid: rename uuid types")
df33767d9fe: ("uuid: hoist helpers uuid_equal() and uuid_copy() from xfs")

ath10k now makes use of them.

Some parts should go into the uapi/linux/uuid.h file, but
then #include_next hack is not working correctly any more, so place it
all into the normal file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: refresh patches on v4.14-rc1
Hauke Mehrtens [Sun, 17 Sep 2017 16:58:10 +0000 (18:58 +0200)]
patches: refresh patches on v4.14-rc1

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: remove pm_system_wakeup(), add MWIFIEX dependency
Johannes Berg [Fri, 15 Sep 2017 07:32:09 +0000 (09:32 +0200)]
backports: remove pm_system_wakeup(), add MWIFIEX dependency

Since only MWIFIEX needs pm_system_wakeup(), and that can't be
backported properly, remove it again and add a dependency for
MWIFIEX on kernel 3.18.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: include export.h in lib/refcount.c
Johannes Berg [Mon, 11 Sep 2017 14:50:19 +0000 (16:50 +0200)]
patches: include export.h in lib/refcount.c

This isn't automatically included in all kernels, include
it explicitly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add devm_add_action()
Johannes Berg [Mon, 11 Sep 2017 14:49:42 +0000 (16:49 +0200)]
backports: add devm_add_action()

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agodependencies: make MWIFIEX_PCIE depend on kernel > 3.16
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:20 +0000 (00:10 +0200)]
dependencies: make MWIFIEX_PCIE depend on kernel > 3.16

This driver needs the reset_notify member from the struct
pci_error_handlers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agodependencies: make NFC_TRF7970A depend on kernel > 3.17
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:19 +0000 (00:10 +0200)]
dependencies: make NFC_TRF7970A depend on kernel > 3.17

devm_gpiod_get_index_optional() with flags attribute was added with
kernel 3.17, do not build drivers using it on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add pm_system_wakeup()
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:18 +0000 (00:10 +0200)]
header: add pm_system_wakeup()

This function was added in kernel 3.18 in commit 068765ba7987e ("PM /
sleep: Mechanism for aborting system suspends unconditionally") In our
implementation we only call pm_system_wakeup(() and do not handle the
abortion of the current suspend process.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add __get_dynamic_array_len
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:17 +0000 (00:10 +0200)]
header: add __get_dynamic_array_len

This was added in kernel 3.16 in commit beba4bb096201 ("tracing: Add
__get_dynamic_array_len() macro for trace events")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add IOMEM_ERR_PTR()
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:16 +0000 (00:10 +0200)]
header: add IOMEM_ERR_PTR()

This was added in kernel 3.17 in commit efd342fb0031a1 ("of: Provide a
function to request and map memory")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: add ethtool_convert_legacy_u32_to_link_mode()
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:15 +0000 (00:10 +0200)]
backport: add ethtool_convert_legacy_u32_to_link_mode()

This function was added in kernel 4.7 in commit 6d62b4d5fac62 ("net:
ethtool: export conversion function between u32 and link mode") and is
used by mii_ethtool_get_link_ksettings() in the backport-4.10.c file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: brcmfmac: Fix netdev_set_priv_destructor
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:14 +0000 (00:10 +0200)]
patches: brcmfmac: Fix netdev_set_priv_destructor

On kernel > 4.11.9 the new member priv_destructor should be set in
netdev_set_priv_destructor() and not the old destructor member any more,
it was removed.

This fixes the build on >= 4.11.9.

Fixes: 7c827d5ac9c1 ("patches: brcmfmac: fix netdev destructor")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: export bp_usbnet_get_stats64() only if function is added
Hauke Mehrtens [Sun, 10 Sep 2017 22:10:13 +0000 (00:10 +0200)]
patches: export bp_usbnet_get_stats64() only if function is added

Export the bp_usbnet_get_stats64() function only on kernel < 4.11,
because this function is only available on such kernel versions.

Fixes: 5a00d8489c7 ("patches: adapt the stat64 usage for usbnet")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add trace_seq_buffer_ptr() where needed
Johannes Berg [Fri, 8 Sep 2017 14:41:14 +0000 (16:41 +0200)]
backports: add trace_seq_buffer_ptr() where needed

Some new code needs this, add it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: add some ethtool conversion functions
Johannes Berg [Fri, 8 Sep 2017 14:40:43 +0000 (16:40 +0200)]
backport: add some ethtool conversion functions

These weren't always exported, so we need them on some kernels.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoRevert to using pycocci
Johannes Berg [Fri, 8 Sep 2017 13:53:30 +0000 (15:53 +0200)]
Revert to using pycocci

This reverts commit 3756f63528b044d6487bac046ad2972bc21583a5
and commit 709e720caa66816f32c6adc6050549fa40b9cf52 since
using built-in concurrency caused problems with --cocci-grep,
and not using that makes things slower.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agogentree: remove --use-coccigrep
Johannes Berg [Fri, 8 Sep 2017 13:32:22 +0000 (15:32 +0200)]
gentree: remove --use-coccigrep

This is causing trouble, remove it for now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocompat: avoid usage of kvzalloc() in rhashtable.c
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:08 +0000 (00:28 +0200)]
compat: avoid usage of kvzalloc() in rhashtable.c

This reverts commit 12e8fd6fd3802 ("lib/rhashtable.c: use kvzalloc() in
bucket_table_alloc() when possible") from upstream kernel.
Kernel versions older that 4.12 do not have kvzalloc() try to avoid the
usage of this.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: brcmfmac: fix netdev destructor
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:12 +0000 (00:28 +0200)]
patches: brcmfmac: fix netdev destructor

brcmfmac uses a complicated netdev destructor handling. The
brcmf_net_attach() function just adds a normal destructor and later the
brcmf_add_if() function sets the needs_free_netdev callback.

The normal spatch was not applied correctly to this file, add a patch
before to try to fx this problem manually.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports-update-manager: split --force into --yes and --no-keep
Johannes Berg [Fri, 8 Sep 2017 13:18:19 +0000 (15:18 +0200)]
backports-update-manager: split --force into --yes and --no-keep

--yes allows skipping the question
--no-keep allows removing all installed data and reinstalling
--force does both (as before)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport-update-manager: automatically get list of ubuntu kernels
Johannes Berg [Fri, 8 Sep 2017 12:36:16 +0000 (14:36 +0200)]
backport-update-manager: automatically get list of ubuntu kernels

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoadd (automatic) refcount backport
Johannes Berg [Fri, 8 Sep 2017 10:04:08 +0000 (12:04 +0200)]
add (automatic) refcount backport

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheaders: atomic: add atomic_try_cmpxchg()
Johannes Berg [Fri, 8 Sep 2017 11:24:27 +0000 (13:24 +0200)]
headers: atomic: add atomic_try_cmpxchg()

This is needed for the refcount code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agouse spatch's built-in concurrency
Johannes Berg [Fri, 8 Sep 2017 10:40:48 +0000 (12:40 +0200)]
use spatch's built-in concurrency

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agochange protection of module_param_hw_array
Johannes Berg [Fri, 8 Sep 2017 11:13:20 +0000 (13:13 +0200)]
change protection of module_param_hw_array

Some (distro) kernels backported this, so simply protect the
backport definition with #ifndef.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: acpi: fix version comment
Johannes Berg [Fri, 8 Sep 2017 09:27:08 +0000 (11:27 +0200)]
header: acpi: fix version comment

I intended to not even apply the patch, but did anyway...
Fix the comment now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocopy-list: add quantenna qtnfmac driver
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:17 +0000 (00:28 +0200)]
copy-list: add quantenna qtnfmac driver

This driver was compile tested on kernel 3.18 and 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add dma_wmb()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:16 +0000 (00:28 +0200)]
header: add dma_wmb()

This is used by the qtnfmac driver.
This was added in commit 1077fa36f23e259 ("arch: Add lightweight memory
barriers dma_rmb() and dma_wmb()")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: adapt signature of proto_ops->accept
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:14 +0000 (00:28 +0200)]
patches: adapt signature of proto_ops->accept

In commit cdfbabfb2f0ce ("net: Work around lockdep limitation in sockets
that use sockets") a extra parameter was added to proto_ops->accept(),
do not assume it on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: backport the probe_new for i2c drivers
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:13 +0000 (00:28 +0200)]
patches: backport the probe_new for i2c drivers

I2C got a new probe function which does not take the struct
i2c_device_id any more, backport this to older kernel versions with a
spatch.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agodependencies: add deps for struct acpi_gpio_mapping
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:11 +0000 (00:28 +0200)]
dependencies: add deps for struct acpi_gpio_mapping

These NFC drivers are using struct acpi_gpio_mapping which was added in
kernel 3.19. Do not try to build them on older kernel versions where
this structures is not available.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add offsetofend()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:10 +0000 (00:28 +0200)]
header: add offsetofend()

offsetofend() was moved from vfio.h to stddef.h in commit
3876488444e7123 ("include/stddef.h: Move offsetofend() from vfio.h to a
generic kernel header") for kernel 4.1. Add it again to stddef.h so it
is available in more include paths.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatch: Allow usage of pci_error_handlers->reset_notify
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:09 +0000 (00:28 +0200)]
patch: Allow usage of pci_error_handlers->reset_notify

The member reset_notify in the struct pci_error_handlers was divided
into reset_prepare and reset_done in upstream commit 775755ed3c65fb
("PCI: Split ->reset_notify() method into ->reset_prepare() and
->reset_done()"). Make new code also work with old kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: add __print_array()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:07 +0000 (00:28 +0200)]
backport: add __print_array()

This is used in the tracing system and needed by wireless now, it was
introduced in commit 6ea22486ba46bc ("tracing: Add array printing
helper").
This code is copied from kernel 4.0.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: rename wait_queue_entry_t to wait_queue_t
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:06 +0000 (00:28 +0200)]
header: rename wait_queue_entry_t to wait_queue_t

In kernel 4.13 wait_queue_t was renamed to wait_queue_entry_t, reverse
this for older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add get_random_u32()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:05 +0000 (00:28 +0200)]
header: add get_random_u32()

This was renamed in upstream kernel and changed from unsigned int to u32.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: backport devm_acpi_dev_add_driver_gpios()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:04 +0000 (00:28 +0200)]
header: backport devm_acpi_dev_add_driver_gpios()

This is used by some NFC drivers to get information from the ACPI.
This was added in kernel 4.13, but backporting it to older kernel
versions than 3.19 is hard because such old kernel versions do not even
have struct acpi_gpio_mapping. This only adds the empty version of this
function as this normally needed some extra support in the generic ACPI
code and I do not care about this functionality.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: add module_param_hw_array()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:03 +0000 (00:28 +0200)]
header: add module_param_hw_array()

This macro is used for some module parameters.

This hwtype was newly introduced for module parameters in kernel 4.12,
just ignore it on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agopatches: adapt the stat64 usage for usbnet
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:02 +0000 (00:28 +0200)]
patches: adapt the stat64 usage for usbnet

The usbnet driver shares the stat64 implementation over multiple drivers
and file, the spatch is not able to handle this, add a manual patch to
work around this problem.

The spatch is still modifying all usbnet drivers, but the function gets
exported by the usbnet main driver now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: backport mii_ethtool_{get,set}_link_ksettings()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:01 +0000 (00:28 +0200)]
header: backport mii_ethtool_{get,set}_link_ksettings()

This function was added in kernel 4.10 and is needed by the usbnet
drivers.

These functions were added in upstream commit: bc8ee596afe8f3 ("net:
mii: add generic function to support ksetting support")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: skbuff: fix signature of skb_put(), skb_push() and __skb_push()
Hauke Mehrtens [Mon, 21 Aug 2017 22:28:00 +0000 (00:28 +0200)]
header: skbuff: fix signature of skb_put(), skb_push() and __skb_push()

In older kernel versions these functions returned a unsigned char*, now
they return a void *.

This change was done in upstream commit d58ff35122847a8 ("networking:
make skb_push & __skb_push return void pointers")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoheader: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8()
Hauke Mehrtens [Mon, 21 Aug 2017 22:27:59 +0000 (00:27 +0200)]
header: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8()

These functions were added in kernel 4.13 and are used by many driver
now.

This was added in the following upsteram comits:
e45a79da863c19 ("skbuff/mac80211: introduce and use skb_put_zero()")
59ae1d127ac0ae ("networking: introduce and use skb_put_data()")
634fef61076d64 ("networking: add and use skb_put_u8()")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocopy-list: remove st-nci.h and patch
AceLan Kao [Fri, 14 Jul 2017 03:07:54 +0000 (11:07 +0800)]
copy-list: remove st-nci.h and patch

>From below commit, st-nci.h has been removed
   61a0410 NFC: st-nci: Get rid of platform data
And we don't need st-nci-spi.patch, either. The patch is included in
upstream kernel source.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocopy-list: remove wil6210_uapi.h
AceLan Kao [Fri, 14 Jul 2017 03:07:53 +0000 (11:07 +0800)]
copy-list: remove wil6210_uapi.h

>From below commit, the file has been removed
   a520b49 wil6210: remove ioctl interface

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: remove 802.15.4 entirely
AceLan Kao [Tue, 8 Aug 2017 13:14:51 +0000 (21:14 +0800)]
backports: remove 802.15.4 entirely

802.15.4 has been removed by this commit,
   15a3df8 backports: remove 802.15.4 entirely
but there are some files left behind.
Remove them all.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: fix netdev destructor backport for v4.11.9
Luca Coelho [Tue, 5 Sep 2017 06:50:39 +0000 (09:50 +0300)]
backport: fix netdev destructor backport for v4.11.9

The patch that changed the netdev destructor code was backported to
v4.11.9, so handle that in the backport.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: fix netdev destructor backport
Luca Coelho [Tue, 18 Jul 2017 12:58:34 +0000 (15:58 +0300)]
backport: fix netdev destructor backport

The commit that changed the netdev destructor was also applied in
v4.12-rc6, so we need to update the backport.

Another issue was that when the default free_netdev() destructor was supposed to be used, we would get compilation errors, such as this one in hwsim:

In file included from ./include/net/dst.h:12:0,
                 from /home/luca/iwlwifi/stack-dev/drivers/net/wireless/mac80211_hwsim.c:22:
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/mac80211_hwsim.c: In function hwsim_mon_setup':
/home/luca/iwlwifi/stack-dev/backport-include/linux/netdevice.h:325:23: error: '__free_netdev' undeclared (first use in this function)
  (_dev)->destructor = __ ## _destructor
                       ^
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/mac80211_hwsim.c:2977:2: note: in expansion of macro 'netdev_set_priv_destructor'
  netdev_set_priv_destructor(dev, free_netdev);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/luca/iwlwifi/stack-dev/backport-include/linux/netdevice.h:325:23: note: each undeclared identifier is reported only once for each function it appears in
  (_dev)->destructor = __ ## _destructor
                       ^
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/mac80211_hwsim.c:2977:2: note: in expansion of macro 'netdev_set_priv_destructor'
  netdev_set_priv_destructor(dev, free_netdev);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:300: recipe for target '/home/luca/iwlwifi/stack-dev/drivers/net/wireless/mac80211_hwsim.o' failed

To fix this, add a new macro, netdev_set_def_destructor(), that
handles this special case.

Change-Id: Ifcf1f19690487aee67e776b5700ff496c779e86c
Fixes: 721ae78f9355 ("backport: handle change in netdevice destructor usage")
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agocopy-list: remove nfc platform data headers
Arend Van Spriel [Thu, 22 Jun 2017 07:33:21 +0000 (08:33 +0100)]
copy-list: remove nfc platform data headers

These files got removed from upstream kernel so they result in
backport failure.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: handle change in netdevice destructor usage
Arend Van Spriel [Thu, 22 Jun 2017 07:31:04 +0000 (08:31 +0100)]
backport: handle change in netdevice destructor usage

This patch deals with changes made in struct net_device by commit
cf124db566e6 ("net: Fix inconsistent teardown and release of private
netdev state.").

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: add lockdep_rtnl_is_held() for < 3.13 without CONFIG_PROVE_LOCKING
Luca Coelho [Wed, 31 May 2017 08:30:10 +0000 (11:30 +0300)]
backports: add lockdep_rtnl_is_held() for < 3.13 without CONFIG_PROVE_LOCKING

In kernels earlier than 3.13, lockdep_rtnl_is_held() is only declared
in rtnetlink.h when CONFIG_PROVE_LOCKING is not set.  Backport this
function if that's the case.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: provide backport of devcoredump when disabled in kernels >= 3.18
Luca Coelho [Tue, 30 May 2017 08:09:34 +0000 (11:09 +0300)]
backports: provide backport of devcoredump when disabled in kernels >= 3.18

When devcoredump is not enabled in a kernel that supports it, we would
only use stubs for the devcoredump in the backports.  Allow the
backport to compile when that's the case.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agopatches: add patch for compat/lib-rhashtable.c
Arend Van Spriel [Fri, 19 May 2017 20:46:17 +0000 (21:46 +0100)]
patches: add patch for compat/lib-rhashtable.c

The file compat/lib-rhashtable.c is a copy from the backported kernel
source lib/rhashtable.c. This patch reverts a recent change to that
file, ie. commit 43ca5bc4f72e ("lib/rhashtable.c: simplify a strange
allocation pattern"). It introduced the function gfpflags_allow_blocking()
introduced in 4.4 kernel and kvmalloc() introduced in 4.12-rc1. Looking
at those functions backporting them is complicated so instead add this
patch that reverts the change for kernel prior to 4.12.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: add the necessary backports for netlink extack
Johannes Berg [Fri, 21 Apr 2017 10:36:12 +0000 (12:36 +0200)]
backports: add the necessary backports for netlink extack

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: extend magic to 6 possible arguments
Johannes Berg [Fri, 21 Apr 2017 10:35:53 +0000 (12:35 +0200)]
backports: extend magic to 6 possible arguments

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: provide backport for setup_deferrable_timer()
Arend Van Spriel [Fri, 10 Mar 2017 10:01:10 +0000 (10:01 +0000)]
backports: provide backport for setup_deferrable_timer()

Since commit f8f118ceaa56 ("mac80211: Use setup_timer instead of
init_timer") mac80211 needs setup_deferrable_timer() which is not
available in older kernels. Provide a backport in linux/timer.h.
Really need two flavors of backport to support up to 3.0 kernel.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: add dummy include/linux/sched/signal.h
Arend Van Spriel [Thu, 9 Mar 2017 12:57:33 +0000 (12:57 +0000)]
backports: add dummy include/linux/sched/signal.h

Simply including linux/sched.h for older kernels not carrying this
file. This new include file was introduced by commit 3f07c0144132
("sched/headers: Prepare for new header dependencies before moving
code to <linux/sched/signal.h>").

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: copy average.h from original kernel
Johannes Berg [Fri, 31 Mar 2017 07:27:54 +0000 (09:27 +0200)]
backports: copy average.h from original kernel

Instead of maintaining our own version of average.h,
just copy the upstream version while generating the
backport.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: add backport for idr_remove
Arend Van Spriel [Thu, 9 Mar 2017 12:57:31 +0000 (12:57 +0000)]
backports: add backport for idr_remove

Since commit d3e709e63e97 ("idr: Return the deleted entry from
idr_remove") the function signature changed so provide a backport
which does a idr_find() and subsequent idr_remove().

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agopatches: update crypto-ccm.patch for v4.11-rc1
Arend Van Spriel [Thu, 9 Mar 2017 12:57:30 +0000 (12:57 +0000)]
patches: update crypto-ccm.patch for v4.11-rc1

Since v4.11-rc1 the patch file for crypto/ccm.c, which is incorporated
in the compat module, no longer applies. Update the patch file to fix
the issue.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agogit-tracker: add Change-Id to all types of commits if configured
Johannes Berg [Mon, 27 Feb 2017 09:09:38 +0000 (10:09 +0100)]
git-tracker: add Change-Id to all types of commits if configured

My previous commit to optionally add a Change-Id missed two out
of three types of commits internally created by the tracker, add
the Change-Id to them as well.

Fixes: 7d89b544a1d9 ("git-tracker: add an option to add a Change-Id to commits")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: adjust ndo_get_stats64 change to 4.11
Johannes Berg [Fri, 24 Feb 2017 09:48:52 +0000 (10:48 +0100)]
backports: adjust ndo_get_stats64 change to 4.11

This will only land in kernel 4.11, I mixed up the
versions before. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: add definitions S32_MAX and S32_MIN
Arend Van Spriel [Wed, 22 Feb 2017 22:18:45 +0000 (22:18 +0000)]
backports: add definitions S32_MAX and S32_MIN

Since commit 20e32810bcf4 ("cfg80211: Accept multiple RSSI thresholds
for CQM") the backports need to have S32_MAX and S32_MIN which were
introduced in kernel.h since v3.14.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: adjust mwifiex uapi patch for new context
Johannes Berg [Tue, 14 Feb 2017 10:01:11 +0000 (11:01 +0100)]
backports: adjust mwifiex uapi patch for new context

This showed up in wt-2017-02-12.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agobackports: add "MBIM Extended Functional Descriptor" structure definition
Arend Van Spriel [Sat, 11 Feb 2017 23:14:59 +0000 (23:14 +0000)]
backports: add "MBIM Extended Functional Descriptor" structure definition

commit 477c6d345604 ("backports: add USB_CDC_MBIM_EXTENDED_TYPE if needed")
added define but the structure definition that goes with it is also needed.
As they were introduced in the same kernel version we can add the structure
with the same #ifndef USB_CDC_MBIM_EXTENDED_TYPE.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>