openwrt/staging/blogic.git
6 years agopatches: refresh on kernel v4.16-rc3
Hauke Mehrtens [Sun, 4 Mar 2018 22:57:04 +0000 (23:57 +0100)]
patches: refresh on kernel v4.16-rc3

No manual changes needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: move percpu.h file to the correct location
Luca Coelho [Wed, 28 Feb 2018 19:24:17 +0000 (21:24 +0200)]
backport: move percpu.h file to the correct location

Mistakenly, the percpu.h file was added to a new backport-include
directory at the root.  It should be in the proper location at
backport/backport-include instead.  Fix that.

Fixes: a4c44dbee35d ("backport: implement alloc_percpu_gfp() for < 3.18.")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: implement alloc_percpu_gfp() for < 3.18.
Sara Sharon [Sun, 18 Feb 2018 13:24:59 +0000 (15:24 +0200)]
backport: implement alloc_percpu_gfp() for < 3.18.

mac80211 now uses the alloc_percpu_gfp() function, which doesn't exist
in kernels older than 3.18.  Backport it accordingly.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: increase max stack frame size compiler check to 1280
Luca Coelho [Sun, 18 Feb 2018 13:24:58 +0000 (15:24 +0200)]
backport: increase max stack frame size compiler check to 1280

The verification code has some large data variables that are allocated
in the stack.  Increase the maximum stack frame size in the compiler
check slightly (from 1024 to 1280) to prevent harmless warnings.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: remove stddef.h inclusions
Luca Coelho [Sun, 18 Feb 2018 13:24:57 +0000 (15:24 +0200)]
backport: remove stddef.h inclusions

The verification code was copied from userspace code which includes
stddef.h.  In the kernel, this header should not be included, so
remove those cases.

Fixes: 988e2af4b7a0 ("backports: add signature verification code")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix typo "TIMKEEPING" and fix gfp.h
Luca Coelho [Sun, 18 Feb 2018 13:24:56 +0000 (15:24 +0200)]
backports: fix typo "TIMKEEPING" and fix gfp.h

There is a typo in the timekeeping.h backport, fix that.
Additionally, fix the gfp.h file tha has a copy/paste issue where
__BACKPORT_TIMKEEPING_H is used instead of __BACKPORT_LINUX_GFP_H.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: add new build_bug.h file
Luca Coelho [Sun, 18 Feb 2018 13:24:55 +0000 (15:24 +0200)]
backport: add new build_bug.h file

Some of the code in bug.h was moved into a new build_bug.h file.  Add
a backport that includes bug.h in the case of older kernels.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: remove pkcs7_verify.c patch hunk
Luca Coelho [Sun, 18 Feb 2018 13:24:54 +0000 (15:24 +0200)]
backport: remove pkcs7_verify.c patch hunk

The change that used to be patched into the pkcs7_verify.c file is now
part of newer kernels, so we don't need to patch it anymore.  Remove
this hunk from verify.patch accordingly.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: update genl_dump_check_consistent() backport
Luca Coelho [Sun, 18 Feb 2018 13:24:53 +0000 (15:24 +0200)]
backport: update genl_dump_check_consistent() backport

The genl_dump_check_consistent() function was changed in v4.15 to use
only two arguments.  The family is not needed anymore, because we were
erroneously subtracting the header size and that was fixed in v4.15.

Since the family was only used to check the header size, we can create
a dummy with hdrsize = 0, which will allow us to call the old version
of the function.  There is a good side-effect to doing this: the bug
is going to be fixed, because with hdrsize = 0 we will not subtract
anything and it will have the same effect as the fix.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: include lib/bucket_locks.c
Luca Coelho [Sun, 18 Feb 2018 13:24:52 +0000 (15:24 +0200)]
backport: include lib/bucket_locks.c

The alloc/free_bucket_spinlocks() functions were moved to a new lib
file, namely bucket_locks.c.  Add an auto-backport for the
bucket_locks.c file and move the patching of the code that moved from
rhashtable to bucket_locks.c.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackport: add pcie_find_root_port()
Luca Coelho [Sun, 18 Feb 2018 13:24:51 +0000 (15:24 +0200)]
backport: add pcie_find_root_port()

This function was introduced in v4.9 and added to 3.12.69, 4.4.37 and
4.8.13.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agocompat: only define thermal backports if CONFIG_THERMAL is enabled
Luca Coelho [Sun, 18 Feb 2018 13:24:50 +0000 (15:24 +0200)]
compat: only define thermal backports if CONFIG_THERMAL is enabled

If CONFIG_THERMAL is not enabled, we don't have to add all backports
for the thermal framework.  Actually this doesn't even work because we
try to use thermal_zone_device_register/unregister and they are not
present in the outer kernel, causing undefined symbols warnings:

WARNING: "thermal_zone_device_register" [/home/luca/iwlwifi/stack-dev/compat/compat.ko] undefined!
WARNING: "thermal_zone_device_unregister" [/home/luca/iwlwifi/stack-dev/compat/compat.ko] undefined!

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: include linux/err.h in key.c
Winnie Chang [Fri, 19 Jan 2018 08:02:21 +0000 (02:02 -0600)]
backports: include linux/err.h in key.c

Function IS_ERR, PTR_ERR and ERR_PTR are not found. Need to include
linux/err.h to fix compiling errors.

Signed-off-by: Winnie Chang <winnie.chang@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: clean up kconf/conf when doing make mrproper
Chi-Hsien Lin [Mon, 11 Dec 2017 08:21:14 +0000 (02:21 -0600)]
backports: clean up kconf/conf when doing make mrproper

kconf/ is built during "make defconfig-*" but not cleaned up during
"make mrproper" or "make clean". Add the clean up work to "make clean".

Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobackports: fix nlmsg_type on responses with extack backport
Felix Fietkau [Mon, 20 Nov 2017 18:01:32 +0000 (19:01 +0100)]
backports: fix nlmsg_type on responses with extack backport

This is filled with family->id, which needs to be set after registering
the copy.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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>