summaryrefslogtreecommitdiff
path: root/backport/compat
AgeCommit message (Collapse)Author
2018-12-03backports: Fix pci_alloc_irq_vectors() backportHauke Mehrtens
This copies the pci_alloc_irq_vectors() function from kernel 4.9 and replaces the __pci_enable_msi{x}_range() calls with calls to pci_enable_msi{x}_range(), these were backported to kernel versions < 3.14, so no need to handle the older kernels specially here. This also adds support for MSIx IRQs and adds the PCI_IRQ_* defines. Fixes: 162a6b312f1b ("add support for pci_alloc_irq_vectors") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: Omer Dagan <omer.dagan@tandemg.com>
2018-11-07backports: wrap pci_alloc_irq_vectors() in PCI definesWinnie Chang
pci_alloc_irq_vectors() needs to be wrapped in CONFIG_PCI and CONFIG_PCI_MSI definition to avoid a function redefinition compiler error. Fixes: 162a6b312f1b ("add support for pci_alloc_irq_vectors") 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>
2018-11-05add support for pci_alloc_irq_vectorsOmer Dagan
add support for function in kernels under 4.8 function is a wrapper around 'pci_enable_msi_block' or 'pci_enable_msi_range' depending on the kernel version the min\max number of interrupts was overridden to always use the max number of interrupts which seems correct since it was not supported in the old APIs Signed-off-by: Omer Dagan <omer.dagan@tandemg.com> [use GPL expert as everything in backports, remove unused ifdef] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-11-05backports: check if genl pre_doit and post_doit are setLuca Coelho
In the pre_doit and post_doit backports, we set the ops to our backported version, so genetlink itself will always call it. But then we don't check if the actual ops are set before calling them, which causes a call to a NULL pointer. Fix this by checking if the ops are actually set before calling them. Fixes: ff6746638cf1 ("backports: genetlink: update completely") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-10-02backports: genetlink: update completelyJohannes Berg
Replace all the different nested versions of generic netlink backport with a single one, covering from < 3.13 all the way to the upcoming netlink policy improvements in 4.20. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-10-02backports: backport most of improved netlink policy validationJohannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-10-02backports: add missing include in 3.13 compat codeJohannes Berg
If we don't include <linux/net.h> then __BACKPORT_NET_GET_RANDOM_ONCE can never be defined, and we'll never get the compat code. Fix that. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-26compat: remove bluetooth from skcipherJohannes Berg
Just clean up the dependency list, skcipher is known to not work, but we neither backport bluetooth now, nor does current upstream bluetooth actually need skcipher. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-24backport: make ktime_get_boottime_seconds() non-inlineLuca Coelho
With kernels < 3.17, we need to include hrtimer.h to get ktime_divns() for the ktime_get_boottime_seconds() backport. But we can't just include htrtimer.h in the backport timekeeping.h because we run into some cyclical inclusions that cause problems. To solve that make ktime_get_boottime_seconds() non-inline and add it to a new backport-4.18.c file. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-24backport: remove duplicate leds.h inclusion from backport-4.5.cLuca Coelho
We were including leds.h twice in backport-4.5.c and one of them was very early, which caused inclusion conflicts at least with < 3.16 kernels. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-24backport: add rhashtable-types.hLuca Coelho
This was introduced in 4.18 and is needed by rhashtable.h, that we copy. So copy it as well. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-24backport: introduce match_string() for kernels < 4.6Luca Coelho
This function was introduced in v4.6 and now the iwlwifi driver uses it. Add the function for kernels older than v4.6. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-24backport: fix compilation with IPV6 not setLuca Coelho
At least in some older kernel versions (e.g. 3.10), the tcp.h header file is not implicitly included from other headers if CONFIG_IPV6 is not set, so we need to include it in backport-4.4.c. Also, there is an IPv6 structure that is used, so we should ifdef it away when IPv6 is not enabled. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-24backports: add strreplace()Winnie Chang
wireless-drivers-next.git commit cb18e2e9ec71 (brcmfmac: fix wrong strnchr usage) used strreplace(), which is not available in kernel prior to v4.2. Before this commit proprgates to linux-stable.git, add strreplace() to avoid gentree failure. 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>
2018-09-19backports: Remove unused partsHauke Mehrtens
This removes parts which were only used by subsystems which are not included in backports any more, for example media, bluetooth and Ethernet. The patches which are removed in this commit are not applied to the kernel tree anyway with the default configuration because non of the files get copied. The freezer, media, regulator and sound parts were only used by the already removed media drivers. The flow dissector file is not copied any more. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-06-25backports: genl: fix family->family.id accessJohannes Berg
If compiling on 3.13, struct genl_family isn't actually struct backport_genl_family, and then family->family doesn't exist. In other cases, it's actually necessary to update it, so add an #ifdef with the same logic as the override from genl_family -> backport_genl_family. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-06-04backports: update id field in backports genl familyAaron Komisar
Family ID from the original family struct will be used when building genl messages (sent as nlmsg_type), so the new id should be updated in the original (older kernel format) family struct too Signed-off-by: Aaron Komisar <aaron.komisar@tandemg.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-04-26backports: rename *-asn1.[ch] to *.asn1.[ch]Winnie Chang
linux-stable 4fa8bc949de11c99ee2433c602d43f87c452f4f2 renamed *-asn1.[ch] files to *.asn1.[ch]. Make the corresponding change for backports. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-02-23backport: increase max stack frame size compiler check to 1280Luca Coelho
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>
2018-02-23backport: remove stddef.h inclusionsLuca Coelho
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>
2018-02-23backport: include lib/bucket_locks.cLuca Coelho
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>
2018-02-23compat: only define thermal backports if CONFIG_THERMAL is enabledLuca Coelho
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>
2018-01-31backports: include linux/err.h in key.cWinnie Chang
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>
2017-11-21backports: fix nlmsg_type on responses with extack backportFelix Fietkau
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>
2017-11-17backports: make extack backport compile on <3.13Johannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-11-17backports: fix events with extack backportFelix Fietkau
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>
2017-11-13backports: netlink extack: Allow ext_ack to carry non-error messagesJohannes Berg
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>
2017-10-26backports: fix the extack backport for dumpsJohannes Berg
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>
2017-10-24backports: fix the extack backportJohannes Berg
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>
2017-10-17backports: fully add netlink extack for generic netlinkJohannes Berg
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>
2017-10-13backports: remove CRYPTO_CCM backportJohannes Berg
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>
2017-10-13backports: reduce mbedtls bignum stack usageJohannes Berg
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>
2017-10-13backports: add signature verification codeJohannes Berg
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>
2017-10-13backports: add bin2hex()Johannes Berg
This is needed in the key backports in the next patch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-10-11backports: add crypto_memneq()Johannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-10-11backports: fix some dev_coredumpm() problemJohannes Berg
Sometimes the argument is const, sometimes not, just cast away that difference. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-11backports: add devm_add_action()Johannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-11backport: add ethtool_convert_legacy_u32_to_link_mode()Hauke Mehrtens
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>
2017-09-08backports: add trace_seq_buffer_ptr() where neededJohannes Berg
Some new code needs this, add it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-08backport: add some ethtool conversion functionsJohannes Berg
These weren't always exported, so we need them on some kernels. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-08add (automatic) refcount backportJohannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-09-06backport: add __print_array()Hauke Mehrtens
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>
2017-09-06header: backport mii_ethtool_{get,set}_link_ksettings()Hauke Mehrtens
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>
2017-09-06backports: remove 802.15.4 entirelyAceLan Kao
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>
2017-06-16backports: provide backport of devcoredump when disabled in kernels >= 3.18Luca Coelho
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>
2017-02-09backports: always use new version compare macrosJohannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-02-07backports: add dev_coredumpsg() where neededJohannes Berg
Add dev_coredumpsg() on kernels where dev_coredumpm() is present but _sg() isn't, and restrict building appropriately. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-02-07backports: add cdc_parse_cdc_header()Johannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-02-07backports: add devm_gpio_free()Johannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-02-07backports: add strscpy()Johannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>