├── lib ├── __init__.py ├── splitpatch.py ├── bpar.py ├── bpgpg.py ├── tempdir.py ├── bpkup.py ├── bpversion.py └── make.py ├── .gitignore ├── devel ├── .gitignore ├── gplizer └── git-tracker.ini.example ├── backport ├── kconf │ ├── lxdialog │ │ ├── .gitignore │ │ ├── BIG.FAT.WARNING │ │ ├── check-lxdialog.sh │ │ └── yesno.c │ ├── .gitignore │ ├── Makefile │ ├── kconf_id.c │ └── lkc_proto.h ├── scripts │ ├── make │ ├── mod_helpers.sh │ ├── compress_modules.sh │ ├── uninstall.sh │ ├── blacklist.sh │ ├── update-initramfs.sh │ └── check_depmod.sh ├── defconfigs │ ├── wil6210 │ ├── wwan │ ├── ath6kl │ ├── mwl8k │ ├── brcmsmac │ ├── ar5523 │ ├── ath5k │ ├── carl9170 │ ├── mwifiex │ ├── b43legacy │ ├── brcmfmac │ ├── ath9k │ ├── libertas_tf │ ├── cw1200 │ ├── libertas │ ├── b43 │ ├── ath10k │ ├── ath11k │ ├── hwsim │ ├── wcn36xx │ ├── ath9k-debug │ ├── iwlwifi │ └── rtlwifi ├── backport-include │ ├── linux │ │ ├── align.h │ │ ├── minmax.h │ │ ├── kmemleak.h │ │ ├── cache.h │ │ ├── poll.h │ │ ├── tty.h │ │ ├── ioport.h │ │ ├── miscdevice.h │ │ ├── types.h │ │ ├── list_nulls.h │ │ ├── slab.h │ │ ├── unaligned.h │ │ ├── sched │ │ │ └── signal.h │ │ ├── eeprom_93cx6.h │ │ ├── ktime.h │ │ ├── jump_label.h │ │ ├── math.h │ │ ├── nospec.h │ │ ├── of.h │ │ ├── bits.h │ │ ├── tcp.h │ │ ├── moduleparam.h │ │ ├── virtio.h │ │ ├── kthread.h │ │ ├── efi.h │ │ ├── net.h │ │ ├── export.h │ │ ├── bcma │ │ │ └── bcma_driver_chipcommon.h │ │ ├── if_arp.h │ │ ├── mm.h │ │ ├── device │ │ │ └── class.h │ │ ├── netdev_features.h │ │ ├── percpu-defs.h │ │ ├── idr.h │ │ ├── mmc │ │ │ ├── sdio_ids.h │ │ │ ├── sdio.h │ │ │ ├── core.h │ │ │ └── sdio_func.h │ │ ├── input.h │ │ ├── hw_random.h │ │ ├── io.h │ │ ├── ethtool.h │ │ ├── socket.h │ │ ├── clk.h │ │ ├── device.h │ │ ├── netlink.h │ │ ├── bug.h │ │ ├── kcov.h │ │ ├── init.h │ │ ├── list.h │ │ ├── hwmon-sysfs.h │ │ ├── cordic.h │ │ ├── delay.h │ │ ├── kernel.h │ │ ├── gpio │ │ │ └── driver.h │ │ ├── genetlink.h │ │ ├── of_device.h │ │ ├── kconfig.h │ │ ├── sched.h │ │ ├── version.h │ │ ├── math64.h │ │ ├── pnp.h │ │ ├── compiler_types.h │ │ ├── timekeeping.h │ │ ├── fs.h │ │ ├── scatterlist.h │ │ ├── of_net.h │ │ ├── bitops.h │ │ ├── dma-mapping.h │ │ ├── leds.h │ │ ├── rfkill.h │ │ ├── time.h │ │ ├── pm_runtime.h │ │ ├── mod_devicetable.h │ │ ├── bitmap.h │ │ ├── build_bug.h │ │ ├── rculist.h │ │ ├── u64_stats_sync.h │ │ ├── usb.h │ │ ├── lockdep.h │ │ ├── pm_qos.h │ │ ├── spinlock.h │ │ ├── hrtimer.h │ │ ├── compiler_attributes.h │ │ ├── i2c.h │ │ ├── wwan.h │ │ ├── firmware.h │ │ ├── sysfs.h │ │ ├── etherdevice.h │ │ ├── interrupt.h │ │ ├── seq_file.h │ │ ├── pm.h │ │ ├── pci.h │ │ ├── soc │ │ │ └── mediatek │ │ │ │ └── mtk_wed.h │ │ ├── atomic.h │ │ ├── if_ether.h │ │ ├── thermal.h │ │ ├── string.h │ │ ├── debugfs.h │ │ ├── acpi_amd_wbrf.h │ │ ├── module.h │ │ ├── compiler.h │ │ ├── timer.h │ │ ├── platform_device.h │ │ ├── skbuff.h │ │ └── rcupdate.h │ ├── asm │ │ ├── ioctls.h │ │ ├── unaligned.h │ │ ├── barrier.h │ │ └── errno.h │ ├── crypto │ │ └── utils.h │ ├── net │ │ ├── gso.h │ │ ├── ipv6_stubs.h │ │ ├── xfrm.h │ │ ├── addrconf.h │ │ ├── dropreason-core.h │ │ ├── sock.h │ │ ├── dropreason.h │ │ └── inet_ecn.h │ ├── trace │ │ ├── events │ │ │ └── sock.h │ │ ├── ftrace.h │ │ └── trace_events.h │ ├── uapi │ │ └── linux │ │ │ ├── genetlink.h │ │ │ └── eventpoll.h │ ├── backport │ │ ├── backport.h │ │ ├── checks.h │ │ └── magic.h │ ├── kunit │ │ └── visibility.h │ ├── pcmcia │ │ ├── device_id.h │ │ └── ds.h │ ├── generated │ │ └── utsrelease.h │ └── asm-generic │ │ └── bug.h ├── Kconfig.package.hacks ├── .gitignore ├── compat │ ├── backport-4.18.c │ ├── backport-5.11.c │ ├── backport-4.19.c │ ├── backport-6.11.c │ ├── Makefile │ ├── backport-5.9.c │ ├── backport-5.15.c │ ├── backport-5.5.c │ ├── backport-5.13.c │ ├── main.c │ ├── backport-5.3.c │ ├── Kconfig │ ├── backport-6.4.c │ └── backport-5.10.c ├── .blacklist.map ├── Makefile.build ├── Kconfig.sources ├── Kconfig.package ├── Kconfig.integrate └── Makefile.kernel ├── patches ├── 0000-upstream-backport-changes │ └── 0005-uapi-compromise │ │ └── INFO ├── 0084-disable-some-staging-dirs.patch ├── 0005-disable-usb-net-asix.patch ├── 0100-platform_driver_remove.cocci ├── 0110-bin_attr_read.cocci ├── 0112-remove-IRQF_NO_AUTOEN │ ├── p54.patch │ └── mwifiex.patch ├── 0010-add-wext-handlers-to-netdev │ ├── INFO │ └── net_wireless_core.patch ├── 0004-disable-wext-kconfig.patch └── 0018-pv-trace-fixes │ └── drivers_net_wireless_iwlwifi_iwl-debug.patch ├── .devcontainer └── Dockerfile ├── dependencies ├── copy-list.hwsim ├── integration-patches └── 0001-enable-backports │ └── 0001-enable-backports-built-in.patch ├── .github └── workflows │ └── reusable_build-backports.yml └── copy-list /lib/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *pyc 3 | output/ 4 | -------------------------------------------------------------------------------- /devel/.gitignore: -------------------------------------------------------------------------------- 1 | git-tracker.ini 2 | -------------------------------------------------------------------------------- /backport/kconf/lxdialog/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Generated files 3 | # 4 | lxdialog 5 | -------------------------------------------------------------------------------- /backport/scripts/make: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # SPDX-License-Identifier: GPL-2.0 3 | 4 | exec make --eval '-include $(BACKPORT_DIR)/.config' "$@" 5 | -------------------------------------------------------------------------------- /backport/defconfigs/wil6210: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_WLAN=y 4 | CPTCFG_WLAN_VENDOR_ATH=y 5 | CPTCFG_WIL6210=m 6 | -------------------------------------------------------------------------------- /backport/defconfigs/wwan: -------------------------------------------------------------------------------- 1 | CPTCFG_USB_USBNET=m 2 | CPTCFG_USB_NET_CDC_NCM=m 3 | CPTCFG_USB_NET_CDC_MBIM=m 4 | CPTCFG_USB_NET_QMI_WWAN=m 5 | CPTCFG_USB_SIERRA_NET=m 6 | CPTCFG_USB_WDM=m 7 | -------------------------------------------------------------------------------- /backport/defconfigs/ath6kl: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_WLAN=y 4 | CPTCFG_WLAN_VENDOR_ATH=y 5 | CPTCFG_ATH6KL=m 6 | CPTCFG_ATH6KL_SDIO=m 7 | CPTCFG_ATH6KL_USB=m 8 | -------------------------------------------------------------------------------- /backport/defconfigs/mwl8k: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_WLAN=y 6 | CPTCFG_WLAN_VENDOR_MARVELL=y 7 | CPTCFG_MWL8K=m 8 | -------------------------------------------------------------------------------- /backport/backport-include/linux/align.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if LINUX_VERSION_IS_GEQ(5,13,0) 4 | #include_next 5 | #else 6 | #include 7 | #endif 8 | -------------------------------------------------------------------------------- /backport/backport-include/linux/minmax.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if LINUX_VERSION_IS_GEQ(5,10,0) 4 | #include_next 5 | #else 6 | #include 7 | #endif 8 | -------------------------------------------------------------------------------- /backport/defconfigs/brcmsmac: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_WLAN=y 6 | CPTCFG_WLAN_VENDOR_BROADCOM=y 7 | CPTCFG_BRCMSMAC=m 8 | -------------------------------------------------------------------------------- /backport/backport-include/linux/kmemleak.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_KMEMLEAK_H 2 | #define __BACKPORT_KMEMLEAK_H 3 | #include 4 | #include_next 5 | #endif /* __BACKPORT_KMEMLEAK_H */ 6 | -------------------------------------------------------------------------------- /backport/defconfigs/ar5523: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_ATH=y 8 | CPTCFG_AR5523=m 9 | -------------------------------------------------------------------------------- /backport/defconfigs/ath5k: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_ATH=y 8 | CPTCFG_ATH5K=m 9 | -------------------------------------------------------------------------------- /backport/defconfigs/carl9170: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_ATH=y 8 | CPTCFG_CARL9170=m 9 | -------------------------------------------------------------------------------- /backport/defconfigs/mwifiex: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_WLAN=y 4 | CPTCFG_WLAN_VENDOR_MARVELL=y 5 | CPTCFG_MWIFIEX=m 6 | CPTCFG_MWIFIEX_SDIO=m 7 | CPTCFG_MWIFIEX_PCIE=m 8 | CPTCFG_MWIFIEX_USB=m 9 | -------------------------------------------------------------------------------- /backport/defconfigs/b43legacy: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_MESH=y 5 | CPTCFG_MAC80211_LEDS=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_BROADCOM=y 8 | CPTCFG_B43LEGACY=m 9 | -------------------------------------------------------------------------------- /backport/defconfigs/brcmfmac: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_WLAN=y 4 | CPTCFG_WLAN_VENDOR_BROADCOM=y 5 | CPTCFG_BRCMFMAC=m 6 | CPTCFG_BRCMFMAC_SDIO=y 7 | CPTCFG_BRCMFMAC_USB=y 8 | CPTCFG_BRCMFMAC_PCIE=y 9 | -------------------------------------------------------------------------------- /backport/kconf/.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Generated files 3 | # 4 | *.moc 5 | gconf.glade.h 6 | *.pot 7 | *.mo 8 | 9 | # 10 | # configuration programs 11 | # 12 | conf 13 | mconf 14 | nconf 15 | qconf 16 | gconf 17 | kxgettext 18 | -------------------------------------------------------------------------------- /backport/Kconfig.package.hacks: -------------------------------------------------------------------------------- 1 | # some hacks for when we use backports to generate a package 2 | # to build modules out of tree. 3 | config WIRELESS 4 | def_bool y 5 | config NET_CORE 6 | def_bool y 7 | config EXPERT 8 | def_bool y 9 | -------------------------------------------------------------------------------- /backport/defconfigs/ath9k: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_ATH=y 8 | CPTCFG_ATH9K=m 9 | CPTCFG_ATH9K_HTC=m 10 | -------------------------------------------------------------------------------- /backport/backport-include/linux/cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORT_CACHE_H 2 | #define _BACKPORT_CACHE_H 3 | 4 | #include_next 5 | 6 | #ifndef __ro_after_init 7 | #define __ro_after_init 8 | #endif 9 | 10 | #endif /* _BACKPORT_CACHE_H */ 11 | -------------------------------------------------------------------------------- /backport/backport-include/asm/ioctls.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_ASM_IOCTLS_H 2 | #define __BACKPORT_ASM_IOCTLS_H 3 | #include_next 4 | 5 | #ifndef TIOCPKT_IOCTL 6 | #define TIOCPKT_IOCTL 64 7 | #endif 8 | 9 | #endif /* __BACKPORT_ASM_IOCTLS_H */ 10 | -------------------------------------------------------------------------------- /backport/backport-include/crypto/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_CRYPTO_UTILS_H 2 | #define __BACKPORT_CRYPTO_UTILS_H 3 | 4 | #if LINUX_VERSION_IS_GEQ(6,4,0) 5 | #include_next 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /backport/backport-include/linux/poll.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_POLL_H 2 | #define __BACKPORT_LINUX_POLL_H 3 | #include_next 4 | /* This import is needed for <= 4.15 */ 5 | #include 6 | 7 | #endif /* __BACKPORT_LINUX_POLL_H */ 8 | -------------------------------------------------------------------------------- /backport/backport-include/linux/tty.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_TTY_H 2 | #define __BACKPORT_LINUX_TTY_H 3 | #include_next 4 | 5 | #ifndef N_NCI 6 | #define N_NCI 25 /* NFC NCI UART */ 7 | #endif 8 | 9 | #endif /* __BACKPORT_LINUX_TTY_H */ 10 | -------------------------------------------------------------------------------- /backport/backport-include/net/gso.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_GSO_H 2 | #define __BACKPORT_GSO_H 3 | 4 | #include 5 | 6 | #if LINUX_VERSION_IS_GEQ(6,5,0) 7 | #include_next 8 | #else 9 | #include 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /backport/defconfigs/libertas_tf: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_MESH=y 5 | CPTCFG_MAC80211_LEDS=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_MARVELL=y 8 | CPTCFG_LIBERTAS_THINFIRM=m 9 | CPTCFG_LIBERTAS_THINFIRM_USB=m 10 | -------------------------------------------------------------------------------- /backport/defconfigs/cw1200: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_ST=y 8 | CPTCFG_CW1200=m 9 | CPTCFG_CW1200_WLAN_SDIO=m 10 | CPTCFG_CW1200_WLAN_SPI=m 11 | -------------------------------------------------------------------------------- /backport/backport-include/linux/ioport.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_IOPORT_H 2 | #define __BACKPORT_LINUX_IOPORT_H 3 | #include_next 4 | 5 | #ifndef IORESOURCE_REG 6 | #define IORESOURCE_REG 0x00000300 7 | #endif 8 | 9 | #endif /* __BACKPORT_LINUX_IOPORT_H */ 10 | -------------------------------------------------------------------------------- /backport/backport-include/linux/miscdevice.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORT_LINUX_MISCDEVICE_H 2 | #define _BACKPORT_LINUX_MISCDEVICE_H 3 | #include_next 4 | 5 | #ifndef VHCI_MINOR 6 | #define VHCI_MINOR 137 7 | #endif 8 | 9 | #endif /* _BACKPORT_LINUX_MISCDEVICE_H */ 10 | -------------------------------------------------------------------------------- /backport/defconfigs/libertas: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_WLAN=y 4 | CPTCFG_WLAN_VENDOR_MARVELL=y 5 | CPTCFG_LIBERTAS=m 6 | CPTCFG_LIBERTAS_USB=m 7 | CPTCFG_LIBERTAS_CS=m 8 | CPTCFG_LIBERTAS_SDIO=m 9 | CPTCFG_LIBERTAS_SPI=m 10 | CPTCFG_LIBERTAS_MESH=y 11 | -------------------------------------------------------------------------------- /backport/kconf/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /backport/backport-include/linux/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_TYPES 2 | #define __BACKPORT_TYPES 3 | #include 4 | #include_next 5 | 6 | #if LINUX_VERSION_IS_LESS(4,16,0) 7 | typedef unsigned __poll_t; 8 | #endif 9 | 10 | #endif /* __BACKPORT_TYPES */ 11 | -------------------------------------------------------------------------------- /patches/0000-upstream-backport-changes/0005-uapi-compromise/INFO: -------------------------------------------------------------------------------- 1 | Older kernel versions do not have the uapi include directory, but they 2 | have the same functions in the include file without uapi. On recent 3 | kernel versions the include file without uapi in the name includes the 4 | uapi one. 5 | -------------------------------------------------------------------------------- /backport/backport-include/linux/list_nulls.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LIST_NULLS 2 | #define __BACKPORT_LIST_NULLS 3 | #include_next 4 | 5 | #ifndef NULLS_MARKER 6 | #define NULLS_MARKER(value) (1UL | (((long)value) << 1)) 7 | #endif 8 | 9 | #endif /* __BACKPORT_LIST_NULLS */ 10 | -------------------------------------------------------------------------------- /backport/backport-include/linux/slab.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_SLAB_H 2 | #define __BACKPORT_SLAB_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(5,9,0) 7 | #define kfree_sensitive(x) kzfree(x) 8 | #endif 9 | 10 | #endif /* __BACKPORT_SLAB_H */ 11 | -------------------------------------------------------------------------------- /backport/scripts/mod_helpers.sh: -------------------------------------------------------------------------------- 1 | function mod_filename() 2 | { 3 | which modinfo > /dev/null 2>&1 4 | if [[ $? -eq 0 ]]; then 5 | MOD_QUERY="modinfo -F filename" 6 | else 7 | MOD_QUERY="modprobe -l" 8 | fi 9 | mod_path="$($MOD_QUERY $1 | tail -1)" 10 | echo $(basename "$mod_path") 11 | } 12 | -------------------------------------------------------------------------------- /backport/backport-include/linux/unaligned.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_UNALIGNED_H 2 | #define __BACKPORT_LINUX_UNALIGNED_H 3 | 4 | #include 5 | #if LINUX_VERSION_IS_LESS(6,12,0) 6 | #include 7 | #else 8 | #include_next 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /backport/scripts/compress_modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source ./scripts/mod_helpers.sh 6 | 7 | if test "$(mod_filename mac80211)" = "mac80211.ko.gz" ; then 8 | for driver in $(find "$1" -type f -name *.ko); do 9 | echo COMPRESS $driver 10 | gzip -9 $driver 11 | done 12 | fi 13 | -------------------------------------------------------------------------------- /backport/backport-include/linux/sched/signal.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORT_LINUX_SCHED_SIGNAL_H 2 | #define _BACKPORT_LINUX_SCHED_SIGNAL_H 3 | 4 | #if LINUX_VERSION_IS_LESS(4, 11, 0) 5 | #include 6 | #else 7 | #include_next 8 | #endif 9 | 10 | #endif /* _BACKPORT_LINUX_SCHED_SIGNAL_H */ 11 | -------------------------------------------------------------------------------- /backport/backport-include/trace/events/sock.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_TRACE_EVENTS_SOCK_H 2 | #define __BACKPORT_TRACE_EVENTS_SOCK_H 3 | 4 | #include 5 | #include_next 6 | 7 | #if LINUX_VERSION_IS_LESS(6,3,0) 8 | #define trace_sk_data_ready(sk) do {} while(0) 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /backport/backport-include/uapi/linux/genetlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_UAPI_LINUX_GENETLINK_H 2 | #define __BACKPORT_UAPI_LINUX_GENETLINK_H 3 | #include_next 4 | 5 | #ifndef GENL_UNS_ADMIN_PERM 6 | #define GENL_UNS_ADMIN_PERM GENL_ADMIN_PERM 7 | #endif 8 | 9 | #endif /* __BACKPORT_UAPI_LINUX_GENETLINK_H */ 10 | -------------------------------------------------------------------------------- /backport/defconfigs/b43: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_MESH=y 5 | CPTCFG_MAC80211_LEDS=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_BROADCOM=y 8 | CPTCFG_B43=m 9 | CPTCFG_B43_BCMA=y 10 | CPTCFG_B43_SDIO=y 11 | CPTCFG_B43_PHY_N=y 12 | CPTCFG_B43_PHY_LP=y 13 | CPTCFG_B43_PHY_HT=y 14 | -------------------------------------------------------------------------------- /backport/.gitignore: -------------------------------------------------------------------------------- 1 | Kconfig.kernel 2 | Kconfig.versions 3 | .kernel_config_md5 4 | .config 5 | .config.old 6 | *~ 7 | *.o 8 | *.d 9 | .tmp_* 10 | *.ko 11 | *.cmd 12 | *.tmp 13 | *.ver 14 | *.mod 15 | modules.order 16 | backport-include/backport/autoconf.h 17 | modules 18 | .tmp_versions 19 | Module.symvers 20 | *.mod.c 21 | .cache.mk 22 | -------------------------------------------------------------------------------- /backport/backport-include/linux/eeprom_93cx6.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPAT_LINUX_EEPROM_93CX6_H 2 | #define _COMPAT_LINUX_EEPROM_93CX6_H 1 3 | 4 | #include_next 5 | 6 | #ifndef PCI_EEPROM_WIDTH_93C86 7 | #define PCI_EEPROM_WIDTH_93C86 8 8 | #endif /* PCI_EEPROM_WIDTH_93C86 */ 9 | 10 | #endif /* _COMPAT_LINUX_EEPROM_93CX6_H */ 11 | -------------------------------------------------------------------------------- /backport/backport-include/net/ipv6_stubs.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef _BACKPORT_IPV6_STUBS_H 3 | #define _BACKPORT_IPV6_STUBS_H 4 | 5 | #if LINUX_VERSION_IS_LESS(5,2,0) 6 | 7 | #include 8 | 9 | #else 10 | #include_next 11 | #endif 12 | 13 | #endif /* _BACKPORT_IPV6_STUBS_H */ 14 | -------------------------------------------------------------------------------- /backport/compat/backport-4.18.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Intel Corporation 3 | * Copyright (c) 2020 Toradex 4 | */ 5 | 6 | #include 7 | 8 | time64_t ktime_get_boottime_seconds(void) 9 | { 10 | return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC); 11 | } 12 | EXPORT_SYMBOL_GPL(ktime_get_boottime_seconds); 13 | 14 | -------------------------------------------------------------------------------- /backport/defconfigs/ath10k: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_WLAN=y 7 | CPTCFG_WLAN_VENDOR_ATH=y 8 | CPTCFG_ATH10K_PCI=m 9 | CPTCFG_ATH10K_SDIO=m 10 | CPTCFG_ATH10K_USB=m 11 | CPTCFG_ATH10K=m 12 | CPTCFG_ATH10K_DEBUG=y 13 | CPTCFG_ATH10K_DEBUGFS=y 14 | -------------------------------------------------------------------------------- /backport/backport-include/linux/ktime.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_KTIME_H 2 | #define __BACKPORT_LINUX_KTIME_H 3 | #include_next 4 | 5 | #if LINUX_VERSION_IS_LESS(6,14,0) 6 | static inline ktime_t us_to_ktime(u64 us) 7 | { 8 | return us * NSEC_PER_USEC; 9 | } 10 | #endif /* < 6.14 */ 11 | 12 | #endif /* __BACKPORT_LINUX_KTIME_H */ 13 | -------------------------------------------------------------------------------- /backport/backport-include/linux/jump_label.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_JUMP_LABEL_H 2 | #define __BACKPORT_LINUX_JUMP_LABEL_H 3 | #include_next 4 | 5 | #ifndef DECLARE_STATIC_KEY_FALSE 6 | #define DECLARE_STATIC_KEY_FALSE(name) \ 7 | extern struct static_key_false name 8 | #endif 9 | 10 | #endif /* __BACKPORT_LINUX_JUMP_LABEL_H */ 11 | -------------------------------------------------------------------------------- /backport/backport-include/linux/math.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __BACKPORTS_LINUX_MATH_H 3 | #define __BACKPORTS_LINUX_MATH_H 4 | #include 5 | 6 | #if LINUX_VERSION_IS_GEQ(5,11,0) 7 | #include_next 8 | #else 9 | #include 10 | #endif 11 | 12 | #endif /* __BACKPORTS_LINUX_MATH_H */ 13 | -------------------------------------------------------------------------------- /backport/defconfigs/ath11k: -------------------------------------------------------------------------------- 1 | CPTCFG_MHI_BUS=m 2 | CPTCFG_QRTR=m 3 | CPTCFG_QRTR_MHI=m 4 | CPTCFG_CFG80211=m 5 | CPTCFG_CFG80211_WEXT=y 6 | CPTCFG_MAC80211=m 7 | CPTCFG_MAC80211_LEDS=y 8 | CPTCFG_MAC80211_MESH=y 9 | CPTCFG_WLAN=y 10 | CPTCFG_WLAN_VENDOR_ATH=y 11 | CPTCFG_ATH11K_PCI=m 12 | CPTCFG_ATH11K=m 13 | CPTCFG_ATH11K_DEBUG=y 14 | CPTCFG_ATH11K_DEBUGFS=y 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/nospec.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORT_LINUX_NOSPEC_H 2 | #define _BACKPORT_LINUX_NOSPEC_H 3 | 4 | #if LINUX_VERSION_IS_GEQ(4,15,2) || \ 5 | LINUX_VERSION_IN_RANGE(4,14,18, 4,15,0) 6 | #include_next 7 | #else 8 | #define array_index_nospec(index, size) (index) 9 | #endif 10 | 11 | #endif /* _BACKPORT_LINUX_NOSPEC_H */ 12 | -------------------------------------------------------------------------------- /backport/backport-include/linux/of.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_BACKPORT_OF_H 2 | #define __LINUX_BACKPORT_OF_H 3 | #include 4 | #include_next 5 | 6 | #if LINUX_VERSION_IS_LESS(6,3,0) 7 | #define of_property_present of_property_read_bool 8 | #endif 9 | 10 | #if LINUX_VERSION_IS_LESS(6,4,0) 11 | #include 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/bits.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_BITS_H 2 | #define __BACKPORT_LINUX_BITS_H 3 | #include 4 | 5 | #if LINUX_VERSION_IS_GEQ(4,19,0) || \ 6 | LINUX_VERSION_IN_RANGE(4,14,119, 4,15,0) 7 | #include_next 8 | #else 9 | #include 10 | #endif /* >= 4.19 */ 11 | 12 | #endif /* __BACKPORT_LINUX_BITS_H */ 13 | -------------------------------------------------------------------------------- /backport/backport-include/linux/tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_TCP_H 2 | #define __BACKPORT_LINUX_TCP_H 3 | 4 | #include_next 5 | #include 6 | 7 | #if LINUX_VERSION_IS_LESS(6,0,0) 8 | static inline int skb_tcp_all_headers(const struct sk_buff *skb) 9 | { 10 | return skb_transport_offset(skb) + tcp_hdrlen(skb); 11 | } 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/moduleparam.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_MODULEPARAM_H 2 | #define __BACKPORT_LINUX_MODULEPARAM_H 3 | #include_next 4 | 5 | #ifndef module_param_hw_array 6 | #define module_param_hw_array(name, type, hwtype, nump, perm) \ 7 | module_param_array(name, type, nump, perm) 8 | #endif 9 | 10 | #endif /* __BACKPORT_LINUX_MODULEPARAM_H */ 11 | -------------------------------------------------------------------------------- /patches/0084-disable-some-staging-dirs.patch: -------------------------------------------------------------------------------- 1 | --- a/drivers/staging/Makefile 2 | +++ b/drivers/staging/Makefile 3 | @@ -1,7 +1,7 @@ 4 | # SPDX-License-Identifier: GPL-2.0 5 | # Makefile for staging directory 6 | 7 | -obj-y += media/ 8 | +#obj-y += media/ 9 | obj-$(CONFIG_RTL8723BS) += rtl8723bs/ 10 | obj-$(CONFIG_OCTEON_ETHERNET) += octeon/ 11 | obj-$(CONFIG_VME_BUS) += vme_user/ 12 | -------------------------------------------------------------------------------- /backport/backport-include/linux/virtio.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_VIRTIO_H 2 | #define __BACKPORT_LINUX_VIRTIO_H 3 | #include_next 4 | 5 | #if LINUX_VERSION_IS_LESS(5,17,0) 6 | #include 7 | static inline void virtio_reset_device(struct virtio_device *dev) 8 | { 9 | dev->config->reset(dev); 10 | } 11 | #endif 12 | 13 | #endif /* __BACKPORT_LINUX_VIRTIO_H */ 14 | -------------------------------------------------------------------------------- /backport/.blacklist.map: -------------------------------------------------------------------------------- 1 | # Update this map when a driver gets renamed or 2 | # symbols from old drivers get moved to a newer 3 | # driver. If you have the driver on the right 4 | # hand side it will be blacklisted upon installation 5 | # only if you actually installed the driver on the 6 | # left. 7 | 8 | # new-driver old-driver 9 | iwlwifi iwlagn 10 | iwl4965 iwlagn 11 | videodev v4l2-compat-ioctl32 12 | -------------------------------------------------------------------------------- /backport/backport-include/linux/kthread.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_KTHREAD_H 2 | #define __BACKPORT_LINUX_KTHREAD_H 3 | #include_next 4 | 5 | #if LINUX_VERSION_IS_LESS(5,17,0) 6 | static inline void __noreturn 7 | kthread_complete_and_exit(struct completion *c, long ret) 8 | { 9 | complete_and_exit(c, ret); 10 | } 11 | #endif /* < 5.17 */ 12 | 13 | #endif /* __BACKPORT_LINUX_KTHREAD_H */ 14 | -------------------------------------------------------------------------------- /backport/defconfigs/hwsim: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_DEFAULT_PS=y 3 | CPTCFG_CFG80211_DEBUGFS=y 4 | CPTCFG_CFG80211_WEXT=y 5 | CPTCFG_MAC80211=m 6 | # CPTCFG_MAC80211_RC_PID is not set 7 | # CPTCFG_MAC80211_RC_MINSTREL is not set 8 | # CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set 9 | CPTCFG_MAC80211_DEBUGFS=y 10 | CPTCFG_MAC80211_MESSAGE_TRACING=y 11 | CPTCFG_WLAN=y 12 | CPTCFG_MAC80211_HWSIM=m 13 | -------------------------------------------------------------------------------- /backport/backport-include/net/xfrm.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_NET_XFRM_H 2 | #define __BACKPORT_NET_XFRM_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(5,4,0) 7 | #define skb_ext_reset LINUX_BACKPORT(skb_ext_reset) 8 | static inline void skb_ext_reset(struct sk_buff *skb) 9 | { 10 | secpath_reset(skb); 11 | } 12 | #endif 13 | 14 | #endif /* __BACKPORT_NET_XFRM_H */ 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/efi.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | /* 3 | * Copyright (C) 2022 Intel Corporation 4 | */ 5 | #ifndef __BACKPORT_LINUX_EFI_H 6 | #define __BACKPORT_LINUX_EFI_H 7 | #include_next 8 | 9 | #ifndef EFI_RT_SUPPORTED_GET_VARIABLE 10 | #define efi_rt_services_supported(...) efi_enabled(EFI_RUNTIME_SERVICES) 11 | #endif 12 | 13 | #endif /* __BACKPORT_LINUX_EFI_H */ 14 | -------------------------------------------------------------------------------- /backport/backport-include/linux/net.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_NET_H 2 | #define __BACKPORT_LINUX_NET_H 3 | #include_next 4 | #include 5 | 6 | 7 | #ifndef SOCKWQ_ASYNC_NOSPACE 8 | #define SOCKWQ_ASYNC_NOSPACE SOCK_ASYNC_NOSPACE 9 | #endif 10 | #ifndef SOCKWQ_ASYNC_WAITDATA 11 | #define SOCKWQ_ASYNC_WAITDATA SOCK_ASYNC_WAITDATA 12 | #endif 13 | 14 | #endif /* __BACKPORT_LINUX_NET_H */ 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/export.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPAT_LINUX_EXPORT_H 2 | #define _COMPAT_LINUX_EXPORT_H 1 3 | 4 | #include 5 | 6 | #include_next 7 | 8 | #if LINUX_VERSION_IS_LESS(6,13,0) 9 | #undef EXPORT_SYMBOL_NS_GPL 10 | #endif 11 | 12 | #ifndef EXPORT_SYMBOL_NS_GPL 13 | #define EXPORT_SYMBOL_NS_GPL(sym, ns) EXPORT_SYMBOL_GPL(sym) 14 | #endif 15 | 16 | #endif /* _COMPAT_LINUX_EXPORT_H */ 17 | -------------------------------------------------------------------------------- /backport/defconfigs/wcn36xx: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_DEFAULT_PS=y 3 | CPTCFG_CFG80211_DEBUGFS=y 4 | CPTCFG_MAC80211=m 5 | # CPTCFG_MAC80211_RC_PID is not set 6 | # CPTCFG_MAC80211_RC_MINSTREL is not set 7 | # CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set 8 | CPTCFG_MAC80211_DEBUGFS=y 9 | CPTCFG_MAC80211_MESSAGE_TRACING=y 10 | CPTCFG_WLAN=y 11 | CPTCFG_WLAN_VENDOR_ATH=y 12 | CPTCFG_WCN36XX=m 13 | CPTCFG_WCN36XX_DEBUGFS=y 14 | -------------------------------------------------------------------------------- /backport/backport-include/linux/bcma/bcma_driver_chipcommon.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef BACKPORT_BCMA_DRIVER_CC_H_ 3 | #define BACKPORT_BCMA_DRIVER_CC_H_ 4 | 5 | #include_next 6 | 7 | #ifndef BCMA_CC_SROM_CONTROL_OTP_PRESENT 8 | #define BCMA_CC_SROM_CONTROL_OTP_PRESENT 0x00000020 9 | #endif /* BCMA_CC_SROM_CONTROL_OTP_PRESENT */ 10 | 11 | #endif /* BACKPORT_BCMA_DRIVER_CC_H_ */ 12 | -------------------------------------------------------------------------------- /backport/backport-include/linux/if_arp.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORTS_LINUX_AF_ARP_H 2 | #define _BACKPORTS_LINUX_AF_ARP_H 1 3 | 4 | #include_next 5 | 6 | #ifndef ARPHRD_IEEE802154_MONITOR 7 | #define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */ 8 | #endif 9 | 10 | #ifndef ARPHRD_6LOWPAN 11 | #define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */ 12 | #endif 13 | 14 | #endif /* _BACKPORTS_LINUX_AF_ARP_H */ 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/mm.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_MM_H 2 | #define __BACKPORT_MM_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(4,18,0) 7 | #define kvcalloc LINUX_BACKPORT(kvcalloc) 8 | static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) 9 | { 10 | return kvmalloc_array(n, size, flags | __GFP_ZERO); 11 | } 12 | #endif /* < 4.18 */ 13 | 14 | #endif /* __BACKPORT_MM_H */ 15 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:24.04 2 | 3 | RUN apt update && \ 4 | apt install -y git coccinelle build-essential python3 python3-zstandard libpython3.12 python-is-python3 flex bison libelf1 libelf-dev gcc-12 && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | RUN git clone https://github.com/hauke/backports.git 8 | 9 | RUN /backports/devel/backports-update-manager --yes --no-git-update && \ 10 | rm -rf /ksrc-backports/debs/ 11 | 12 | WORKDIR / 13 | -------------------------------------------------------------------------------- /backport/backport-include/backport/backport.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_H 2 | #define __BACKPORT_H 3 | #include 4 | #ifndef CONFIG_BACKPORT_INTEGRATE 5 | #include 6 | #endif 7 | #include 8 | 9 | #ifndef __ASSEMBLY__ 10 | #define LINUX_BACKPORT(__sym) backport_ ##__sym 11 | #ifndef CONFIG_BACKPORT_INTEGRATE 12 | #include 13 | #endif 14 | #endif 15 | 16 | #endif /* __BACKPORT_H */ 17 | -------------------------------------------------------------------------------- /backport/backport-include/linux/device/class.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_DEVICE_CLASS_H 2 | #define __BACKPORT_DEVICE_CLASS_H 3 | #include 4 | #include_next 5 | 6 | #if LINUX_VERSION_IS_LESS(6,4,0) 7 | 8 | #undef class_create 9 | #define class_create(name) \ 10 | ({ \ 11 | static struct lock_class_key __key; \ 12 | __class_create(THIS_MODULE, name, &__key); \ 13 | }) 14 | 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/netdev_features.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_NETDEV_FEATURES_H 2 | #define __BACKPORT_NETDEV_FEATURES_H 3 | 4 | #include 5 | #include_next 6 | 7 | /* this was renamed in commit 53692b1de : sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC */ 8 | #ifndef NETIF_F_SCTP_CRC 9 | #define NETIF_F_SCTP_CRC __NETIF_F(SCTP_CSUM) 10 | #endif 11 | 12 | #endif /* __BACKPORT_NETDEV_FEATURES_H */ 13 | -------------------------------------------------------------------------------- /backport/Makefile.build: -------------------------------------------------------------------------------- 1 | # detect if make supports --eval 2 | _EVAL := $(shell make --eval "test:" -f /dev/null test >/dev/null 2>&1 && echo YES || echo NO) 3 | ifeq ($(_EVAL),YES) 4 | MAKE=$(BACKPORT_DIR)/scripts/make 5 | else 6 | -include .config 7 | endif 8 | 9 | export 10 | 11 | .PHONY: modules 12 | modules: 13 | @$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) modules 14 | 15 | .PHONY: clean 16 | clean: 17 | @$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) clean 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/percpu-defs.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_PERCPU_DEFS_H 2 | #define __BACKPORT_PERCPU_DEFS_H 3 | #include_next 4 | 5 | /* override this with the array-safe version */ 6 | #undef __verify_pcpu_ptr 7 | #define __verify_pcpu_ptr(ptr) \ 8 | do { \ 9 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ 10 | (void)__vpp_verify; \ 11 | } while (0) 12 | 13 | #endif /* __BACKPORT_PERCPU_DEFS_H */ 14 | -------------------------------------------------------------------------------- /backport/backport-include/backport/checks.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_CHECKS 2 | #define __BACKPORT_CHECKS 3 | 4 | #if defined(CONFIG_MAC80211) && defined(CPTCFG_MAC80211) 5 | #error "You must not have mac80211 built into your kernel if you want to enable it" 6 | #endif 7 | 8 | #if defined(CONFIG_CFG80211) && defined(CPTCFG_CFG80211) 9 | #error "You must not have cfg80211 built into your kernel if you want to enable it" 10 | #endif 11 | 12 | #endif /* __BACKPORT_CHECKS */ 13 | -------------------------------------------------------------------------------- /backport/backport-include/linux/idr.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_IDR_H 2 | #define __BACKPORT_IDR_H 3 | #include_next 4 | #include 5 | 6 | 7 | #if LINUX_VERSION_IS_LESS(4, 11, 0) 8 | static inline void *backport_idr_remove(struct idr *idr, int id) 9 | { 10 | void *item = idr_find(idr, id); 11 | idr_remove(idr, id); 12 | return item; 13 | } 14 | #define idr_remove LINUX_BACKPORT(idr_remove) 15 | #endif 16 | 17 | #endif /* __BACKPORT_IDR_H */ 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/mmc/sdio_ids.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_MMC_SDIO_IDS_H 2 | #define __BACKPORT_MMC_SDIO_IDS_H 3 | #include 4 | #include_next 5 | 6 | #ifndef SDIO_CLASS_BT_AMP 7 | #define SDIO_CLASS_BT_AMP 0x09 /* Type-A Bluetooth AMP interface */ 8 | #endif 9 | 10 | #ifndef SDIO_DEVICE_ID_MARVELL_8688WLAN 11 | #define SDIO_DEVICE_ID_MARVELL_8688WLAN 0x9104 12 | #endif 13 | 14 | #endif /* __BACKPORT_MMC_SDIO_IDS_H */ 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/input.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_INPUT_H 2 | #define __BACKPORT_INPUT_H 3 | #include_next 4 | 5 | #ifndef KEY_WIMAX 6 | #define KEY_WIMAX 246 7 | #endif 8 | 9 | #ifndef KEY_WPS_BUTTON 10 | #define KEY_WPS_BUTTON 0x211 11 | #endif 12 | 13 | #ifndef KEY_RFKILL 14 | #define KEY_RFKILL 247 15 | #endif 16 | 17 | #ifndef SW_RFKILL_ALL 18 | #define SW_RFKILL_ALL 0x03 19 | #endif 20 | 21 | #endif /* __BACKPORT_INPUT_H */ 22 | -------------------------------------------------------------------------------- /backport/backport-include/net/addrconf.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORT_NET_ADDRCONF_H 2 | #define _BACKPORT_NET_ADDRCONF_H 1 3 | 4 | #include_next 5 | 6 | #include 7 | 8 | #if LINUX_VERSION_IS_LESS(5,1,0) 9 | static inline int backport_ipv6_mc_check_mld(struct sk_buff *skb) 10 | { 11 | return ipv6_mc_check_mld(skb, NULL); 12 | } 13 | #define ipv6_mc_check_mld LINUX_BACKPORT(ipv6_mc_check_mld) 14 | #endif 15 | 16 | #endif /* _BACKPORT_NET_ADDRCONF_H */ 17 | -------------------------------------------------------------------------------- /backport/backport-include/trace/ftrace.h: -------------------------------------------------------------------------------- 1 | #undef __print_array 2 | #define __print_array(array, count, el_size) \ 3 | ({ \ 4 | BUILD_BUG_ON(el_size != 1 && el_size != 2 && \ 5 | el_size != 4 && el_size != 8); \ 6 | ftrace_print_array_seq(p, array, count, el_size); \ 7 | }) 8 | 9 | #undef __get_dynamic_array_len 10 | #define __get_dynamic_array_len(field) \ 11 | ((__entry->__data_loc_##field >> 16) & 0xffff) 12 | 13 | #include_next 14 | -------------------------------------------------------------------------------- /backport/backport-include/linux/hw_random.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_HW_RANDOM_H 2 | #define __BACKPORT_HW_RANDOM_H 3 | 4 | #include_next 5 | #include 6 | #include 7 | 8 | #if LINUX_VERSION_IS_LESS(6,1,0) 9 | 10 | #define hwrng_msleep LINUX_BACKPORT(hwrng_msleep) 11 | static inline long hwrng_msleep(struct hwrng *rng, unsigned int msecs) 12 | { 13 | return msleep_interruptible(msecs); 14 | } 15 | 16 | #endif /* < 6.1.0 */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /backport/backport-include/linux/io.h: -------------------------------------------------------------------------------- 1 | #ifndef __BP_LINUX_IO_H 2 | #define __BP_LINUX_IO_H 3 | #include_next 4 | 5 | #ifndef IOMEM_ERR_PTR 6 | #define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err) 7 | #endif 8 | 9 | #ifndef writel_relaxed 10 | #define writel_relaxed writel_relaxed 11 | static inline void writel_relaxed(u32 value, volatile void __iomem *addr) 12 | { 13 | __raw_writel(__cpu_to_le32(value), addr); 14 | } 15 | #endif 16 | 17 | #endif /* __BP_LINUX_IO_H */ 18 | -------------------------------------------------------------------------------- /backport/scripts/uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source ./scripts/mod_helpers.sh 6 | 7 | if test "$(mod_filename compat)" = "compat.ko.gz" ; then 8 | compr=".gz" 9 | elif test "$(mod_filename compat)" = "compat.ko.xz" ; then 10 | compr=".xz" 11 | else 12 | compr="" 13 | fi 14 | 15 | for driver in $(find ${BACKPORT_DIR} -type f -name *.ko); do 16 | mod_name=${driver/${BACKPORT_DIR}/${KLIB}${KMODDIR}}${compr} 17 | echo " uninstall" $mod_name 18 | rm -f $mod_name 19 | done 20 | -------------------------------------------------------------------------------- /backport/backport-include/linux/ethtool.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_ETHTOOL_H 2 | #define __BACKPORT_LINUX_ETHTOOL_H 3 | #include_next 4 | #include 5 | 6 | #ifndef SPEED_UNKNOWN 7 | #define SPEED_UNKNOWN -1 8 | #endif /* SPEED_UNKNOWN */ 9 | 10 | #ifndef DUPLEX_UNKNOWN 11 | #define DUPLEX_UNKNOWN 0xff 12 | #endif /* DUPLEX_UNKNOWN */ 13 | 14 | #ifndef ETHTOOL_FWVERS_LEN 15 | #define ETHTOOL_FWVERS_LEN 32 16 | #endif 17 | 18 | #endif /* __BACKPORT_LINUX_ETHTOOL_H */ 19 | -------------------------------------------------------------------------------- /backport/backport-include/linux/socket.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_SOCKET_H 2 | #define __BACKPORT_SOCKET_H 3 | #include_next 4 | 5 | #ifndef SOL_NFC 6 | /* 7 | * backport SOL_NFC -- see commit: 8 | * NFC: llcp: Implement socket options 9 | */ 10 | #define SOL_NFC 280 11 | #endif 12 | 13 | #ifndef __sockaddr_check_size 14 | #define __sockaddr_check_size(size) \ 15 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) 16 | #endif 17 | 18 | #endif /* __BACKPORT_SOCKET_H */ 19 | -------------------------------------------------------------------------------- /patches/0005-disable-usb-net-asix.patch: -------------------------------------------------------------------------------- 1 | --- a/drivers/net/usb/Makefile 2 | +++ b/drivers/net/usb/Makefile 3 | @@ -11,7 +11,6 @@ obj-$(CONFIG_USB_RTL8152) += r8152.o 4 | obj-$(CONFIG_USB_HSO) += hso.o 5 | obj-$(CONFIG_USB_LAN78XX) += lan78xx.o 6 | obj-$(CONFIG_USB_NET_AX8817X) += asix.o 7 | -asix-y := asix_devices.o asix_common.o ax88172a.o 8 | obj-$(CONFIG_USB_NET_AX88179_178A) += ax88179_178a.o 9 | obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o 10 | obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o 11 | -------------------------------------------------------------------------------- /backport/backport-include/asm/unaligned.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_ASM_GENERIC_UNALIGNED_H 2 | #define __BACKPORT_ASM_GENERIC_UNALIGNED_H 3 | #include_next 4 | 5 | #if LINUX_VERSION_IS_LESS(5,7,0) 6 | static inline u32 __get_unaligned_be24(const u8 *p) 7 | { 8 | return p[0] << 16 | p[1] << 8 | p[2]; 9 | } 10 | 11 | static inline u32 get_unaligned_be24(const void *p) 12 | { 13 | return __get_unaligned_be24(p); 14 | } 15 | #endif /* < 5.7 */ 16 | 17 | #endif /* __BACKPORT_ASM_GENERIC_UNALIGNED_H */ 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/clk.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_CLK_H 2 | #define __BACKPORT_LINUX_CLK_H 3 | #include_next 4 | 5 | #include 6 | #if LINUX_VERSION_IS_LESS(5,1,0) 7 | 8 | static inline 9 | struct clk *devm_clk_get_optional(struct device *dev, const char *id) 10 | { 11 | struct clk *clk = devm_clk_get(dev, id); 12 | 13 | if (clk == ERR_PTR(-ENOENT)) 14 | return NULL; 15 | 16 | return clk; 17 | } 18 | 19 | #endif /* < 5.1 */ 20 | #endif /* __BACKPORT_LINUX_CLK_H */ 21 | -------------------------------------------------------------------------------- /backport/backport-include/linux/device.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_DEVICE_H_ 2 | #define __BACKPORT_DEVICE_H_ 3 | #include_next 4 | 5 | #ifndef DEVICE_ATTR_ADMIN_RW 6 | #define DEVICE_ATTR_ADMIN_RW(_name) \ 7 | struct device_attribute dev_attr_##_name = __ATTR_RW_MODE(_name, 0600) 8 | #endif 9 | 10 | #ifndef DEVICE_ATTR_ADMIN_RO 11 | #define DEVICE_ATTR_ADMIN_RO(_name) \ 12 | struct device_attribute dev_attr_##_name = __ATTR_RO_MODE(_name, 0400) 13 | #endif 14 | 15 | #endif /* __BACKPORT_DEVICE_H_ */ 16 | -------------------------------------------------------------------------------- /backport/backport-include/linux/netlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_NETLINK_H 2 | #define __BACKPORT_LINUX_NETLINK_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(5,0,0) 7 | static inline void nl_set_extack_cookie_u64(struct netlink_ext_ack *extack, 8 | u64 cookie) 9 | { 10 | u64 __cookie = cookie; 11 | 12 | memcpy(extack->cookie, &__cookie, sizeof(__cookie)); 13 | extack->cookie_len = sizeof(__cookie); 14 | } 15 | #endif 16 | 17 | #endif /* __BACKPORT_LINUX_NETLINK_H */ 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/bug.h: -------------------------------------------------------------------------------- 1 | #ifndef __BP_BUG_H 2 | #define __BP_BUG_H 3 | #include_next 4 | 5 | #ifndef __BUILD_BUG_ON_NOT_POWER_OF_2 6 | #ifdef __CHECKER__ 7 | #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) 8 | #else 9 | #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \ 10 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0) 11 | #endif /* __CHECKER__ */ 12 | #endif /* __BUILD_BUG_ON_NOT_POWER_OF_2 */ 13 | 14 | #ifndef BUILD_BUG_ON_MSG 15 | #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) 16 | #endif 17 | 18 | #endif /* __BP_BUG_H */ 19 | -------------------------------------------------------------------------------- /backport/backport-include/trace/trace_events.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if LINUX_VERSION_IS_LESS(6,0,0) 4 | #undef VSTRING_MSG_MAX 5 | #define VSTRING_MSG_MAX 512 6 | 7 | #undef __vstring 8 | #define __vstring(msg, fmt, va) __dynamic_array(char, msg, VSTRING_MSG_MAX) 9 | 10 | #undef __assign_vstr 11 | #define __assign_vstr(msg, fmt, va) \ 12 | WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), VSTRING_MSG_MAX, \ 13 | fmt, *va) >= VSTRING_MSG_MAX) 14 | #endif /* <6.0 */ 15 | 16 | #include_next 17 | -------------------------------------------------------------------------------- /backport/defconfigs/ath9k-debug: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_WEXT=y 3 | CPTCFG_MAC80211=m 4 | CPTCFG_MAC80211_LEDS=y 5 | CPTCFG_MAC80211_MESH=y 6 | CPTCFG_MAC80211_DEBUGFS=y 7 | CPTCFG_MAC80211_DEBUG_MENU=y 8 | CPTCFG_MAC80211_VERBOSE_DEBUG=y 9 | CPTCFG_MAC80211_MLME_DEBUG=y 10 | CPTCFG_MAC80211_STA_DEBUG=y 11 | CPTCFG_MAC80211_HT_DEBUG=y 12 | CPTCFG_MAC80211_IBSS_DEBUG=y 13 | CPTCFG_MAC80211_PS_DEBUG=y 14 | CPTCFG_WLAN=y 15 | CPTCFG_WLAN_VENDOR_ATH=y 16 | CPTCFG_ATH9K=m 17 | CPTCFG_ATH9K_HTC=m 18 | CPTCFG_ATH_DEBUG=y 19 | CPTCFG_ATH9K_DEBUGFS=y 20 | -------------------------------------------------------------------------------- /backport/backport-include/linux/kcov.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __BACKPORTS_LINUX_KCOV_H 3 | #define __BACKPORTS_LINUX_KCOV_H 4 | #include 5 | #include_next 6 | 7 | #if LINUX_VERSION_IS_LESS(5,5,0) 8 | #define kcov_remote_stop LINUX_BACKPORT(kcov_remote_stop) 9 | static inline void kcov_remote_stop(void) {} 10 | #define kcov_remote_start_common LINUX_BACKPORT(kcov_remote_start_common) 11 | static inline void kcov_remote_start_common(u64 id) {} 12 | #endif 13 | 14 | #endif /* __BACKPORTS_LINUX_KCOV_H */ 15 | -------------------------------------------------------------------------------- /backport/backport-include/linux/init.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_INIT_H 2 | #define __BACKPORT_INIT_H 3 | #include_next 4 | 5 | /* 6 | * Backports 312b1485fb509c9bc32eda28ad29537896658cb8 7 | * Author: Sam Ravnborg 8 | * Date: Mon Jan 28 20:21:15 2008 +0100 9 | * 10 | * Introduce new section reference annotations tags: __ref, __refdata, __refconst 11 | */ 12 | #ifndef __ref 13 | #define __ref __init_refok 14 | #endif 15 | #ifndef __refdata 16 | #define __refdata __initdata_refok 17 | #endif 18 | 19 | #endif /* __BACKPORT_INIT_H */ 20 | -------------------------------------------------------------------------------- /backport/backport-include/linux/list.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_LIST_H 2 | #define __BACKPORT_LINUX_LIST_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(6,3,0) 7 | /** 8 | * list_count_nodes - count nodes in the list 9 | * @head: the head for your list. 10 | */ 11 | static inline size_t list_count_nodes(struct list_head *head) 12 | { 13 | struct list_head *pos; 14 | size_t count = 0; 15 | 16 | list_for_each(pos, head) 17 | count++; 18 | 19 | return count; 20 | } 21 | #endif /* < 6.3 */ 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /backport/defconfigs/iwlwifi: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_DEFAULT_PS=y 3 | CPTCFG_CFG80211_DEBUGFS=y 4 | CPTCFG_CFG80211_WEXT=y 5 | CPTCFG_MAC80211=m 6 | # CPTCFG_MAC80211_RC_PID is not set 7 | # CPTCFG_MAC80211_RC_MINSTREL is not set 8 | # CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set 9 | CPTCFG_MAC80211_DEBUGFS=y 10 | CPTCFG_MAC80211_MESSAGE_TRACING=y 11 | CPTCFG_WLAN=y 12 | CPTCFG_WLAN_VENDOR_INTEL=y 13 | CPTCFG_IWLWIFI=m 14 | CPTCFG_IWLDVM=m 15 | CPTCFG_IWLMVM=m 16 | CPTCFG_IWLWIFI_DEBUG=y 17 | CPTCFG_IWLWIFI_DEBUGFS=y 18 | CPTCFG_IWLWIFI_DEVICE_TRACING=y 19 | -------------------------------------------------------------------------------- /backport/backport-include/asm/barrier.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_ASM_BARRIER_H 2 | #define __BACKPORT_ASM_BARRIER_H 3 | 4 | #include 5 | #include_next 6 | 7 | #ifndef dma_rmb 8 | #define dma_rmb() rmb() 9 | #endif 10 | 11 | #ifndef dma_wmb 12 | #define dma_wmb() wmb() 13 | #endif 14 | 15 | #ifndef smp_mb__after_atomic 16 | #define smp_mb__after_atomic smp_mb__after_clear_bit 17 | #endif 18 | 19 | #ifndef smp_acquire__after_ctrl_dep 20 | #define smp_acquire__after_ctrl_dep() smp_rmb() 21 | #endif 22 | 23 | #endif /* __BACKPORT_ASM_BARRIER_H */ 24 | -------------------------------------------------------------------------------- /backport/backport-include/linux/hwmon-sysfs.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_HWMON_SYSFS_H 2 | #define __BACKPORT_LINUX_HWMON_SYSFS_H 3 | #include_next 4 | 5 | #ifndef SENSOR_DEVICE_ATTR_RO 6 | #define SENSOR_DEVICE_ATTR_RO(_name, _func, _index) \ 7 | SENSOR_DEVICE_ATTR(_name, 0444, _func##_show, NULL, _index) 8 | #endif 9 | 10 | #ifndef SENSOR_DEVICE_ATTR_RW 11 | #define SENSOR_DEVICE_ATTR_RW(_name, _func, _index) \ 12 | SENSOR_DEVICE_ATTR(_name, 0644, _func##_show, _func##_store, _index) 13 | #endif 14 | 15 | #endif /* __BACKPORT_LINUX_HWMON_SYSFS_H */ 16 | -------------------------------------------------------------------------------- /lib/splitpatch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import patch, sys 4 | 5 | ps = patch.fromfile(sys.argv[1]) 6 | f = open('INFO', 'w') 7 | f.write(''.join(ps.items[0].header)) 8 | f.close() 9 | 10 | for p in ps.items: 11 | s = p.source[2:].replace('/', '_') 12 | f = open(s, 'w') 13 | f.write('--- %s\n' % p.source) 14 | f.write('+++ %s\n' % p.target) 15 | for h in p.hunks: 16 | f.write('@@ -%d,%d +%d,%d @@\n' % ( 17 | h.startsrc, h.linessrc, 18 | h.starttgt, h.linestgt)) 19 | f.write(''.join(h.text)) 20 | f.close() 21 | -------------------------------------------------------------------------------- /backport/backport-include/kunit/visibility.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | /* 3 | * KUnit API to allow symbols to be conditionally visible during KUnit 4 | * testing 5 | * 6 | * Copyright (C) 2022, Google LLC. 7 | * Author: Rae Moar 8 | */ 9 | 10 | #ifndef _BACKPORT_KUNIT_VISIBILITY_H 11 | #define _BACKPORT_KUNIT_VISIBILITY_H 12 | 13 | #if LINUX_VERSION_IS_GEQ(6,2,0) 14 | #include_next 15 | #else 16 | #define VISIBLE_IF_KUNIT static 17 | #define EXPORT_SYMBOL_IF_KUNIT(symbol) 18 | #endif 19 | 20 | #endif /* _BACKPORT_KUNIT_VISIBILITY_H */ 21 | -------------------------------------------------------------------------------- /patches/0100-platform_driver_remove.cocci: -------------------------------------------------------------------------------- 1 | @r@ 2 | identifier OPS; 3 | identifier platform_driver_remove; 4 | fresh identifier platform_driver_remove_wrap = "bp_" ## platform_driver_remove; 5 | position p; 6 | @@ 7 | +#if LINUX_VERSION_IS_LESS(6,11,0) 8 | +static int platform_driver_remove_wrap(struct platform_device *pdev) 9 | +{ 10 | + platform_driver_remove(pdev); 11 | + 12 | + return 0; 13 | +} 14 | +#endif 15 | 16 | struct platform_driver OPS@p = { 17 | +#if LINUX_VERSION_IS_GEQ(6,11,0) 18 | .remove = platform_driver_remove, 19 | +#else 20 | + .remove = platform_driver_remove_wrap, 21 | +#endif 22 | }; 23 | -------------------------------------------------------------------------------- /backport/backport-include/backport/magic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * These tricks are taken from 3 | * http://efesx.com/2010/07/17/variadic-macro-to-count-number-of-arguments/ 4 | * and 5 | * http://efesx.com/2010/08/31/overloading-macros/ 6 | */ 7 | 8 | #define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(__VA_ARGS__, 6,5,4,3,2,1) 9 | #define VA_NUM_ARGS_IMPL(_1,_2,_3,_4,_5,_6,N,...) N 10 | 11 | #define macro_dispatcher(func, ...) \ 12 | macro_dispatcher_(func, VA_NUM_ARGS(__VA_ARGS__)) 13 | #define macro_dispatcher_(func, nargs) \ 14 | macro_dispatcher__(func, nargs) 15 | #define macro_dispatcher__(func, nargs) \ 16 | func ## nargs 17 | -------------------------------------------------------------------------------- /backport/backport-include/linux/cordic.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORT_LINUX_CORDIC_H 2 | #define _BACKPORT_LINUX_CORDIC_H 1 3 | 4 | #include_next 5 | 6 | 7 | #ifndef CORDIC_FLOAT 8 | #define CORDIC_ANGLE_GEN 39797 9 | #define CORDIC_PRECISION_SHIFT 16 10 | #define CORDIC_NUM_ITER (CORDIC_PRECISION_SHIFT + 2) 11 | 12 | #define CORDIC_FIXED(X) ((s32)((X) << CORDIC_PRECISION_SHIFT)) 13 | #define CORDIC_FLOAT(X) (((X) >= 0) \ 14 | ? ((((X) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1) \ 15 | : -((((-(X)) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1)) 16 | #endif 17 | 18 | #endif /* _BACKPORT_LINUX_CORDIC_H */ 19 | -------------------------------------------------------------------------------- /backport/compat/backport-5.11.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | 3 | #include 4 | #include 5 | 6 | /** 7 | * dev_get_tstats64 - ndo_get_stats64 implementation 8 | * @dev: device to get statistics from 9 | * @s: place to store stats 10 | * 11 | * Populate @s from dev->stats and dev->tstats. Can be used as 12 | * ndo_get_stats64() callback. 13 | */ 14 | void dev_get_tstats64(struct net_device *dev, struct rtnl_link_stats64 *s) 15 | { 16 | netdev_stats_to_stats64(s, &dev->stats); 17 | dev_fetch_sw_netstats(s, dev->tstats); 18 | } 19 | EXPORT_SYMBOL_GPL(dev_get_tstats64); 20 | -------------------------------------------------------------------------------- /backport/Kconfig.sources: -------------------------------------------------------------------------------- 1 | # this has the configuration for the backport code 2 | source "$BACKPORT_DIR/compat/Kconfig" 3 | 4 | # these are copied from the kernel 5 | source "$BACKPORT_DIR/net/wireless/Kconfig" 6 | source "$BACKPORT_DIR/net/mac80211/Kconfig" 7 | source "$BACKPORT_DIR/net/qrtr/Kconfig" 8 | source "$BACKPORT_DIR/drivers/bus/mhi/Kconfig" 9 | source "$BACKPORT_DIR/drivers/soc/qcom/Kconfig" 10 | source "$BACKPORT_DIR/drivers/net/wireless/Kconfig" 11 | source "$BACKPORT_DIR/drivers/net/usb/Kconfig" 12 | 13 | source "$BACKPORT_DIR/drivers/usb/class/Kconfig" 14 | 15 | source "$BACKPORT_DIR/drivers/staging/Kconfig" 16 | -------------------------------------------------------------------------------- /backport/backport-include/linux/delay.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_DELAY_H 2 | #define __BACKPORT_LINUX_DELAY_H 3 | #include_next 4 | 5 | #include 6 | 7 | #if LINUX_VERSION_IS_LESS(5,8,0) 8 | #define fsleep LINUX_BACKPORT(fsleep) 9 | /* see Documentation/timers/timers-howto.rst for the thresholds */ 10 | static inline void fsleep(unsigned long usecs) 11 | { 12 | if (usecs <= 10) 13 | udelay(usecs); 14 | else if (usecs <= 20000) 15 | usleep_range(usecs, 2 * usecs); 16 | else 17 | msleep(DIV_ROUND_UP(usecs, 1000)); 18 | } 19 | #endif /* < 5.8.0 */ 20 | 21 | #endif /* __BACKPORT_LINUX_DELAY_H */ 22 | -------------------------------------------------------------------------------- /backport/backport-include/linux/kernel.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_KERNEL_H 2 | #define __BACKPORT_KERNEL_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(4,17,0) 7 | 8 | /* 9 | * This returns a constant expression while determining if an argument is 10 | * a constant expression, most importantly without evaluating the argument. 11 | * Glory to Martin Uecker 12 | */ 13 | #define __is_constexpr(x) \ 14 | (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) 15 | 16 | #endif /* < 4.17.0 */ 17 | 18 | #endif /* __BACKPORT_KERNEL_H */ 19 | -------------------------------------------------------------------------------- /backport/backport-include/linux/gpio/driver.h: -------------------------------------------------------------------------------- 1 | #ifndef __BP_GPIO_DRIVER_H 2 | #define __BP_GPIO_DRIVER_H 3 | #include 4 | #include_next 5 | 6 | #if LINUX_VERSION_IS_LESS(5,3,0) 7 | enum gpiod_flags; 8 | enum gpio_lookup_flags; 9 | 10 | #define gpiochip_request_own_desc LINUX_BACKPORT(gpiochip_request_own_desc) 11 | struct gpio_desc *backport_gpiochip_request_own_desc(struct gpio_chip *gc, 12 | unsigned int hwnum, 13 | const char *label, 14 | enum gpio_lookup_flags lflags, 15 | enum gpiod_flags dflags); 16 | #endif /* x < 5.3.0 */ 17 | 18 | #endif /* __BP_GPIO_DRIVER_H */ 19 | -------------------------------------------------------------------------------- /backport/backport-include/linux/genetlink.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_GENETLINK_H 2 | #define __BACKPORT_LINUX_GENETLINK_H 3 | #include_next 4 | 5 | /* This backports: 6 | * 7 | * commit e9412c37082b5c932e83364aaed0c38c2ce33acb 8 | * Author: Neil Horman 9 | * Date: Tue May 29 09:30:41 2012 +0000 10 | * 11 | * genetlink: Build a generic netlink family module alias 12 | */ 13 | #ifndef MODULE_ALIAS_GENL_FAMILY 14 | #define MODULE_ALIAS_GENL_FAMILY(family)\ 15 | MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family) 16 | #endif 17 | 18 | #endif /* __BACKPORT_LINUX_GENETLINK_H */ 19 | -------------------------------------------------------------------------------- /backport/backport-include/linux/of_device.h: -------------------------------------------------------------------------------- 1 | #ifndef __BP_OF_DEVICE_H 2 | #define __BP_OF_DEVICE_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(4,18,0) 7 | static inline int backport_of_dma_configure(struct device *dev, 8 | struct device_node *np, 9 | bool force_dma) 10 | { 11 | #if LINUX_VERSION_IS_GEQ(4,15,0) 12 | dev->bus->force_dma = force_dma; 13 | return of_dma_configure(dev, np); 14 | #else 15 | return of_dma_configure(dev, np); 16 | #endif 17 | } 18 | #define of_dma_configure LINUX_BACKPORT(of_dma_configure) 19 | #endif /* < 4.18 */ 20 | 21 | #endif /* __BP_OF_DEVICE_H */ 22 | -------------------------------------------------------------------------------- /backport/backport-include/linux/kconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_KCONFIG_H 2 | #define __BACKPORT_LINUX_KCONFIG_H 3 | #include 4 | #include_next 5 | 6 | #ifndef IS_REACHABLE 7 | /* 8 | * IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled 9 | * code can call a function defined in code compiled based on CONFIG_FOO. 10 | * This is similar to IS_ENABLED(), but returns false when invoked from 11 | * built-in code when CONFIG_FOO is set to 'm'. 12 | */ 13 | #define IS_REACHABLE(option) (config_enabled(option) || \ 14 | (config_enabled(option##_MODULE) && config_enabled(MODULE))) 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/bpar.py: -------------------------------------------------------------------------------- 1 | import subprocess, os 2 | 3 | class ArError(Exception): 4 | pass 5 | class ExecutionError(ArError): 6 | def __init__(self, errcode): 7 | self.error_code = errcode 8 | 9 | def print_data(input_file, out_file, tree=None): 10 | cmd = ['ar', 'p', input_file, 'data.tar.gz', 'data.tar.xz', 'data.tar.zst'] 11 | process = subprocess.Popen(cmd, 12 | stdout=out_file, 13 | close_fds=True, universal_newlines=True, cwd=tree) 14 | stdout = process.communicate()[0] 15 | process.wait() 16 | if process.returncode != 0: 17 | raise ExecutionError(process.returncode) 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/sched.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_SCHED_H 2 | #define __BACKPORT_LINUX_SCHED_H 3 | 4 | #include_next 5 | #include 6 | #if LINUX_VERSION_IS_LESS(4,10,0) 7 | #include 8 | #endif /* LINUX_VERSION_IS_LESS(4,10,0) */ 9 | 10 | #if LINUX_VERSION_IS_LESS(5,9,0) 11 | #include 12 | 13 | static inline void sched_set_fifo_low(struct task_struct *p) 14 | { 15 | struct sched_param sparam = {.sched_priority = 1}; 16 | 17 | WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sparam) != 0); 18 | } 19 | 20 | #endif /* < 5.9.0 */ 21 | #endif /* __BACKPORT_LINUX_SCHED_H */ 22 | -------------------------------------------------------------------------------- /backport/compat/backport-4.19.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) 8 | { 9 | return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), 10 | flags); 11 | } 12 | EXPORT_SYMBOL_GPL(bitmap_alloc); 13 | 14 | unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) 15 | { 16 | return bitmap_alloc(nbits, flags | __GFP_ZERO); 17 | } 18 | EXPORT_SYMBOL_GPL(bitmap_zalloc); 19 | 20 | void bitmap_free(const unsigned long *bitmap) 21 | { 22 | kfree(bitmap); 23 | } 24 | EXPORT_SYMBOL_GPL(bitmap_free); 25 | -------------------------------------------------------------------------------- /backport/backport-include/linux/version.h: -------------------------------------------------------------------------------- 1 | #ifndef _BP_LINUX_VERSION_H 2 | #define _BP_LINUX_VERSION_H 3 | #include_next 4 | 5 | #ifndef RHEL_RELEASE_VERSION 6 | #define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b)) 7 | #endif 8 | 9 | #ifndef RHEL_RELEASE_CODE 10 | #define RHEL_RELEASE_CODE 0 11 | #endif 12 | 13 | #define LINUX_VERSION_IS_LESS(x1,x2,x3) (LINUX_VERSION_CODE < KERNEL_VERSION(x1,x2,x3)) 14 | #define LINUX_VERSION_IS_GEQ(x1,x2,x3) (LINUX_VERSION_CODE >= KERNEL_VERSION(x1,x2,x3)) 15 | #define LINUX_VERSION_IN_RANGE(x1,x2,x3, y1,y2,y3) \ 16 | (LINUX_VERSION_IS_GEQ(x1,x2,x3) && LINUX_VERSION_IS_LESS(y1,y2,y3)) 17 | #endif /* _BP_LINUX_VERSION_H */ 18 | -------------------------------------------------------------------------------- /backport/backport-include/linux/math64.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_MATH64_H 2 | #define __BACKPORT_LINUX_MATH64_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(5,9,0) 7 | #define mul_u64_u64_div_u64 LINUX_BACKPORT(mul_u64_u64_div_u64) 8 | extern u64 mul_u64_u64_div_u64(u64 a, u64 b, u64 c); 9 | #endif /* < 5.9 */ 10 | 11 | #ifndef DIV_U64_ROUND_UP 12 | #define DIV_U64_ROUND_UP(ll, d) \ 13 | ({ u32 _tmp = (d); div_u64((ll) + _tmp - 1, _tmp); }) 14 | 15 | static inline u64 roundup_u64(u64 x, u32 y) 16 | { 17 | return DIV_U64_ROUND_UP(x, y) * y; 18 | } 19 | #endif /* DIV_U64_ROUND_UP */ 20 | 21 | #endif /* __BACKPORT_LINUX_MATH64_H */ 22 | -------------------------------------------------------------------------------- /backport/backport-include/linux/mmc/sdio.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_MMC_SDIO_H 2 | #define __BACKPORT_MMC_SDIO_H 3 | #include 4 | #include_next 5 | 6 | /* backports b4625dab */ 7 | #ifndef SDIO_CCCR_REV_3_00 8 | #define SDIO_CCCR_REV_3_00 3 /* CCCR/FBR Version 3.00 */ 9 | #endif 10 | #ifndef SDIO_SDIO_REV_3_00 11 | #define SDIO_SDIO_REV_3_00 4 /* SDIO Spec Version 3.00 */ 12 | #endif 13 | 14 | #ifndef SDIO_BUS_ECSI 15 | #define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */ 16 | #endif 17 | #ifndef SDIO_BUS_SCSI 18 | #define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */ 19 | #endif 20 | 21 | #endif /* __BACKPORT_MMC_SDIO_H */ 22 | -------------------------------------------------------------------------------- /patches/0110-bin_attr_read.cocci: -------------------------------------------------------------------------------- 1 | @r@ 2 | identifier OPS; 3 | identifier bin_attr_read; 4 | fresh identifier bin_attr_read_wrap = "bp_" ## bin_attr_read; 5 | position p; 6 | @@ 7 | +#if LINUX_VERSION_IS_LESS(6,14,0) 8 | +static ssize_t bin_attr_read_wrap(struct file *filp, struct kobject *kobj, 9 | + struct bin_attribute *bin_attr, 10 | + char *buffer, loff_t pos, size_t count) 11 | +{ 12 | + return bin_attr_read(filp, kobj, 13 | + (const struct bin_attribute *)bin_attr, 14 | + buffer, pos, count); 15 | +} 16 | +#endif 17 | 18 | struct bin_attribute OPS@p = { 19 | +#if LINUX_VERSION_IS_GEQ(6,14,0) 20 | .read = bin_attr_read, 21 | +#else 22 | + .read = bin_attr_read_wrap, 23 | +#endif 24 | }; 25 | -------------------------------------------------------------------------------- /backport/compat/backport-6.11.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | 3 | #include 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(6,11,0) 7 | 8 | static void init_dummy_netdev_core(struct net_device *dev) 9 | { 10 | dev->reg_state = NETREG_DUMMY; 11 | INIT_LIST_HEAD(&dev->napi_list); 12 | set_bit(__LINK_STATE_PRESENT, &dev->state); 13 | set_bit(__LINK_STATE_START, &dev->state); 14 | dev_net_set(dev, &init_net); 15 | } 16 | 17 | struct net_device *alloc_netdev_dummy(int sizeof_priv) 18 | { 19 | return alloc_netdev(sizeof_priv, "dummy#", NET_NAME_UNKNOWN, 20 | init_dummy_netdev_core); 21 | } 22 | EXPORT_SYMBOL_GPL(alloc_netdev_dummy); 23 | 24 | #endif /* <6.11 */ 25 | -------------------------------------------------------------------------------- /lib/bpgpg.py: -------------------------------------------------------------------------------- 1 | import subprocess, os 2 | 3 | class GpgError(Exception): 4 | pass 5 | class ExecutionError(GpgError): 6 | def __init__(self, errcode): 7 | self.error_code = errcode 8 | 9 | def sign(input_file, extra_args=[]): 10 | cmd = ['gpg', '--sign'] 11 | 12 | cmd.extend(extra_args) 13 | cmd.append(input_file) 14 | 15 | process = subprocess.Popen(cmd, 16 | stdout=subprocess.PIPE, stderr=subprocess.STDOUT, 17 | close_fds=True, universal_newlines=True) 18 | stdout = process.communicate()[0] 19 | process.wait() 20 | if process.returncode != 0: 21 | raise ExecutionError(process.returncode) 22 | return stdout 23 | -------------------------------------------------------------------------------- /backport/defconfigs/rtlwifi: -------------------------------------------------------------------------------- 1 | CPTCFG_CFG80211=m 2 | CPTCFG_CFG80211_DEFAULT_PS=y 3 | CPTCFG_CFG80211_DEBUGFS=y 4 | CPTCFG_CFG80211_WEXT=y 5 | CPTCFG_MAC80211=m 6 | # CPTCFG_MAC80211_RC_PID is not set 7 | # CPTCFG_MAC80211_RC_MINSTREL is not set 8 | # CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set 9 | CPTCFG_MAC80211_DEBUGFS=y 10 | CPTCFG_MAC80211_MESSAGE_TRACING=y 11 | CPTCFG_WLAN=y 12 | CPTCFG_WLAN_VENDOR_REALTEK=y 13 | CPTCFG_RTLWIFI=m 14 | CPTCFG_RTLWIFI_DEBUG=y 15 | CPTCFG_RTL8192CE=m 16 | CPTCFG_RTL8192SE=m 17 | CPTCFG_RTL8192DE=m 18 | CPTCFG_RTL8723AE=m 19 | CPTCFG_RTL8723BE=m 20 | CPTCFG_RTL8188EE=m 21 | CPTCFG_RTL8192CU=m 22 | CPTCFG_RTL8192C_COMMON=m 23 | CPTCFG_RTL8192EE=m 24 | CPTCFG_RTL8821AE=m 25 | CPTCFG_RTL8XXXU=m 26 | -------------------------------------------------------------------------------- /backport/backport-include/linux/pnp.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_PNP_H 2 | #define __BACKPORT_LINUX_PNP_H 3 | #include_next 4 | 5 | #ifndef module_pnp_driver 6 | /** 7 | * module_pnp_driver() - Helper macro for registering a PnP driver 8 | * @__pnp_driver: pnp_driver struct 9 | * 10 | * Helper macro for PnP drivers which do not do anything special in module 11 | * init/exit. This eliminates a lot of boilerplate. Each module may only 12 | * use this macro once, and calling it replaces module_init() and module_exit() 13 | */ 14 | #define module_pnp_driver(__pnp_driver) \ 15 | module_driver(__pnp_driver, pnp_register_driver, \ 16 | pnp_unregister_driver) 17 | #endif 18 | 19 | #endif /* __BACKPORT_LINUX_PNP_H */ 20 | -------------------------------------------------------------------------------- /backport/backport-include/linux/compiler_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORTS_LINUX_COMPILER_TYPES_H 2 | #define _BACKPORTS_LINUX_COMPILER_TYPES_H 1 3 | 4 | #if LINUX_VERSION_IS_GEQ(6,12,1) 5 | #include_next 6 | #endif 7 | 8 | #ifndef __counted_by 9 | /* 10 | * Optional: only supported since gcc >= 14 11 | * Optional: only supported since clang >= 17 12 | * 13 | * gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896 14 | * clang: https://reviews.llvm.org/D148381 15 | */ 16 | #if __has_attribute(__element_count__) 17 | # define __counted_by(member) __attribute__((__element_count__(#member))) 18 | #else 19 | # define __counted_by(member) 20 | #endif 21 | #endif 22 | 23 | #endif /* _BACKPORTS_LINUX_COMPILER_TYPES_H */ 24 | -------------------------------------------------------------------------------- /backport/backport-include/linux/timekeeping.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_TIMEKEEPING_H 2 | #define __BACKPORT_TIMEKEEPING_H 3 | #include 4 | #include 5 | 6 | #include_next 7 | 8 | #if LINUX_VERSION_IS_LESS(5,3,0) 9 | #define ktime_get_boottime_ns ktime_get_boot_ns 10 | #define ktime_get_coarse_boottime_ns ktime_get_boot_ns 11 | #endif /* < 5.3 */ 12 | 13 | #if LINUX_VERSION_IS_LESS(4,18,0) 14 | extern time64_t ktime_get_boottime_seconds(void); 15 | 16 | #define ktime_get_raw_ts64 LINUX_BACKPORT(ktime_get_raw_ts64) 17 | static inline void ktime_get_raw_ts64(struct timespec64 *ts) 18 | { 19 | return getrawmonotonic64(ts); 20 | } 21 | #endif /* < 4.18 */ 22 | 23 | #endif /* __BACKPORT_TIMEKEEPING_H */ 24 | -------------------------------------------------------------------------------- /backport/kconf/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer 2 | 3 | LXDIALOG := lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o 4 | 5 | conf: conf.o zconf.tab.o 6 | mconf_CFLAGS := $(shell ./lxdialog/check-lxdialog.sh -ccflags) -DLOCALE 7 | mconf_LDFLAGS := $(shell ./lxdialog/check-lxdialog.sh -ldflags $(CC)) 8 | mconf: CFLAGS += $(mconf_CFLAGS) 9 | 10 | mconf: mconf.o zconf.tab.o $(LXDIALOG) 11 | $(CC) -o mconf $^ $(mconf_LDFLAGS) 12 | 13 | .PHONY: clean 14 | clean: 15 | @rm -f mconf conf *.o lxdialog/*.o 16 | 17 | zconf.tab.c: zconf.lex.c 18 | 19 | %.tab.c: %.y 20 | $(YACC) -o$@ -t -l $< 21 | 22 | %.lex.c: %.l 23 | $(LEX) -o$@ -L $< 24 | -------------------------------------------------------------------------------- /backport/backport-include/linux/fs.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPAT_LINUX_FS_H 2 | #define _COMPAT_LINUX_FS_H 3 | #include_next 4 | #include 5 | 6 | 7 | #if LINUX_VERSION_IS_LESS(5,5,0) 8 | #ifdef CONFIG_COMPAT 9 | #define compat_ptr_ioctl LINUX_BACKPORT(compat_ptr_ioctl) 10 | extern long compat_ptr_ioctl(struct file *file, unsigned int cmd, 11 | unsigned long arg); 12 | #else 13 | #define compat_ptr_ioctl NULL 14 | #endif 15 | #endif /* < 5.5 */ 16 | 17 | #if LINUX_VERSION_IS_LESS(5,6,0) 18 | #define proc_ops file_operations 19 | #define proc_open open 20 | #define proc_read read 21 | #define proc_lseek llseek 22 | #define proc_release release 23 | #define proc_write write 24 | #endif /* < 5.6 */ 25 | 26 | #endif /* _COMPAT_LINUX_FS_H */ 27 | -------------------------------------------------------------------------------- /backport/Kconfig.package: -------------------------------------------------------------------------------- 1 | mainmenu "Backports from $BACKPORTED_KERNEL_NAME $BACKPORTED_KERNEL_VERSION (backports $BACKPORTS_VERSION)" 2 | 3 | config BACKPORT_DIR 4 | string 5 | option env="BACKPORT_DIR" 6 | config BACKPORTS_VERSION 7 | string 8 | option env="BACKPORTS_VERSION" 9 | config BACKPORTED_KERNEL_VERSION 10 | string 11 | option env="BACKPORTED_KERNEL_VERSION" 12 | config BACKPORTED_KERNEL_NAME 13 | string 14 | option env="BACKPORTED_KERNEL_NAME" 15 | 16 | # Packaging hacks 17 | source "$BACKPORT_DIR/Kconfig.package.hacks" 18 | 19 | # Code we backport 20 | source "$BACKPORT_DIR/Kconfig.sources" 21 | 22 | # these will be generated 23 | source "$BACKPORT_DIR/Kconfig.kernel" 24 | source "$BACKPORT_DIR/Kconfig.versions" 25 | source "$BACKPORT_DIR/Kconfig.local" 26 | -------------------------------------------------------------------------------- /backport/backport-include/linux/mmc/core.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_MMC_CORE_H 2 | #define __BACKPORT_LINUX_MMC_CORE_H 3 | 4 | #include_next 5 | #include_next 6 | #include 7 | 8 | #if LINUX_VERSION_IS_LESS(5,19,0) 9 | #if LINUX_VERSION_IS_GEQ(4,18,0) 10 | static inline int backport_mmc_sw_reset(struct mmc_card *card) 11 | { 12 | return mmc_sw_reset(card->host); 13 | } 14 | #define mmc_sw_reset LINUX_BACKPORT(mmc_sw_reset) 15 | #endif /* >4.18 */ 16 | #endif /* <5.19 */ 17 | 18 | #if LINUX_VERSION_IS_LESS(5,18,0) 19 | static inline int backport_mmc_hw_reset(struct mmc_card *card) 20 | { 21 | return mmc_hw_reset(card->host); 22 | } 23 | #define mmc_hw_reset LINUX_BACKPORT(mmc_hw_reset) 24 | #endif /* <5.18 */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /backport/backport-include/net/dropreason-core.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_DROPREASON_CORE_H 2 | #define __BACKPORT_DROPREASON_CORE_H 3 | 4 | #include 5 | 6 | #if LINUX_VERSION_IS_GEQ(6,4,0) 7 | #include_next 8 | #elif LINUX_VERSION_IS_GEQ(6,0,0) 9 | #include 10 | #else 11 | #include 12 | #endif 13 | 14 | #include 15 | 16 | #if LINUX_VERSION_IS_LESS(5,18,0) 17 | #define SKB_NOT_DROPPED_YET SKB_DROP_REASON_MAX 18 | #endif 19 | 20 | #if LINUX_VERSION_IS_LESS(6,2,0) 21 | #define SKB_CONSUMED SKB_DROP_REASON_NOT_SPECIFIED 22 | #endif 23 | 24 | #if LINUX_VERSION_IS_LESS(6,4,0) 25 | #define SKB_DROP_REASON_SUBSYS_MASK 0xffff0000 26 | #define SKB_DROP_REASON_SUBSYS_SHIFT 16 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /backport/backport-include/linux/scatterlist.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_SCATTERLIST_H 2 | #define __BACKPORT_SCATTERLIST_H 3 | #include_next 4 | 5 | #if LINUX_VERSION_IS_LESS(4, 17, 0) 6 | 7 | #define sg_init_marker LINUX_BACKPORT(sg_init_marker) 8 | /** 9 | * sg_init_marker - Initialize markers in sg table 10 | * @sgl: The SG table 11 | * @nents: Number of entries in table 12 | * 13 | **/ 14 | static inline void sg_init_marker(struct scatterlist *sgl, 15 | unsigned int nents) 16 | { 17 | #ifdef CONFIG_DEBUG_SG 18 | unsigned int i; 19 | 20 | for (i = 0; i < nents; i++) 21 | sgl[i].sg_magic = SG_MAGIC; 22 | #endif 23 | sg_mark_end(&sgl[nents - 1]); 24 | } 25 | 26 | #endif /* LINUX_VERSION_IS_LESS(4, 17, 0) */ 27 | 28 | #endif /* __BACKPORT_SCATTERLIST_H */ 29 | -------------------------------------------------------------------------------- /backport/backport-include/linux/of_net.h: -------------------------------------------------------------------------------- 1 | #ifndef _BP_OF_NET_H 2 | #define _BP_OF_NET_H 3 | #include_next 4 | #include 5 | #include 6 | 7 | /* The behavior of of_get_mac_address() changed in kernel 5.2, it now 8 | * returns an error code and not NULL in case of an error. 9 | */ 10 | #if LINUX_VERSION_IS_LESS(5,13,0) 11 | static inline int backport_of_get_mac_address(struct device_node *np, u8 *mac_out) 12 | { 13 | const void *mac = of_get_mac_address(np); 14 | 15 | if (!mac) 16 | return -ENODEV; 17 | if (IS_ERR(mac)) 18 | return PTR_ERR(mac); 19 | ether_addr_copy(mac_out, mac); 20 | 21 | return 0; 22 | } 23 | #define of_get_mac_address LINUX_BACKPORT(of_get_mac_address) 24 | #endif /* < 5.2 */ 25 | 26 | #endif /* _BP_OF_NET_H */ 27 | -------------------------------------------------------------------------------- /backport/backport-include/linux/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_BITOPS_H 2 | #define __BACKPORT_BITOPS_H 3 | #include_next 4 | #include 5 | #include 6 | 7 | #ifndef GENMASK 8 | 9 | /* 10 | * Create a contiguous bitmask starting at bit position @l and ending at 11 | * position @h. For example 12 | * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. 13 | */ 14 | #define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) 15 | #define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l)) 16 | 17 | #endif 18 | 19 | #ifndef BIT_ULL 20 | #define BIT_ULL(nr) (1ULL << (nr)) 21 | #endif 22 | 23 | #ifndef BITS_PER_TYPE 24 | #define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) 25 | #endif 26 | 27 | #endif /* __BACKPORT_BITOPS_H */ 28 | -------------------------------------------------------------------------------- /backport/backport-include/asm/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_ASM_ERRNO_H 2 | #define __BACKPORT_ASM_ERRNO_H 3 | #include_next 4 | 5 | #ifndef ERFKILL 6 | #if !defined(CONFIG_ALPHA) && !defined(CONFIG_MIPS) && !defined(CONFIG_PARISC) && !defined(CONFIG_SPARC) 7 | #define ERFKILL 132 /* Operation not possible due to RF-kill */ 8 | #endif 9 | #ifdef CONFIG_ALPHA 10 | #define ERFKILL 138 /* Operation not possible due to RF-kill */ 11 | #endif 12 | #ifdef CONFIG_MIPS 13 | #define ERFKILL 167 /* Operation not possible due to RF-kill */ 14 | #endif 15 | #ifdef CONFIG_PARISC 16 | #define ERFKILL 256 /* Operation not possible due to RF-kill */ 17 | #endif 18 | #ifdef CONFIG_SPARC 19 | #define ERFKILL 134 /* Operation not possible due to RF-kill */ 20 | #endif 21 | #endif 22 | 23 | #endif /* __BACKPORT_ASM_ERRNO_H */ 24 | -------------------------------------------------------------------------------- /backport/backport-include/linux/dma-mapping.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_DMA_MAPPING_H 2 | #define __BACKPORT_LINUX_DMA_MAPPING_H 3 | #include_next 4 | 5 | #ifndef DMA_MAPPING_ERROR 6 | /* 7 | * A dma_addr_t can hold any valid DMA or bus address for the platform. It can 8 | * be given to a device to use as a DMA source or target. It is specific to a 9 | * given device and there may be a translation between the CPU physical address 10 | * space and the bus address space. 11 | * 12 | * DMA_MAPPING_ERROR is the magic error code if a mapping failed. It should not 13 | * be used directly in drivers, but checked for using dma_mapping_error() 14 | * instead. 15 | */ 16 | #define DMA_MAPPING_ERROR (~(dma_addr_t)0) 17 | #endif /* DMA_MAPPING_ERROR */ 18 | 19 | #endif /* __BACKPORT_LINUX_DMA_MAPPING_H */ 20 | -------------------------------------------------------------------------------- /patches/0112-remove-IRQF_NO_AUTOEN/p54.patch: -------------------------------------------------------------------------------- 1 | --- a/drivers/net/wireless/intersil/p54/p54spi.c 2 | +++ b/drivers/net/wireless/intersil/p54/p54spi.c 3 | @@ -623,13 +623,21 @@ static int p54spi_probe(struct spi_devic 4 | gpio_direction_input(p54spi_gpio_irq); 5 | 6 | ret = request_irq(gpio_to_irq(p54spi_gpio_irq), 7 | +#ifndef IRQF_NO_AUTOEN 8 | + p54spi_interrupt, 0, "p54spi", 9 | +#else 10 | p54spi_interrupt, IRQF_NO_AUTOEN, "p54spi", 11 | +#endif 12 | priv->spi); 13 | if (ret < 0) { 14 | dev_err(&priv->spi->dev, "request_irq() failed"); 15 | goto err_free_gpio_irq; 16 | } 17 | 18 | +#ifndef IRQF_NO_AUTOEN 19 | + disable_irq(gpio_to_irq(p54spi_gpio_irq)); 20 | +#endif 21 | + 22 | irq_set_irq_type(gpio_to_irq(p54spi_gpio_irq), IRQ_TYPE_EDGE_RISING); 23 | 24 | INIT_WORK(&priv->work, p54spi_work); 25 | -------------------------------------------------------------------------------- /backport/backport-include/pcmcia/device_id.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_PCMCIA_DEVICE_ID_H 2 | #define __BACKPORT_PCMCIA_DEVICE_ID_H 3 | #include_next 4 | 5 | #ifndef PCMCIA_DEVICE_MANF_CARD_PROD_ID3 6 | #define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \ 7 | .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \ 8 | PCMCIA_DEV_ID_MATCH_CARD_ID| \ 9 | PCMCIA_DEV_ID_MATCH_PROD_ID3, \ 10 | .manf_id = (manf), \ 11 | .card_id = (card), \ 12 | .prod_id = { NULL, NULL, (v3), NULL }, \ 13 | .prod_id_hash = { 0, 0, (vh3), 0 }, } 14 | #endif 15 | 16 | #ifndef PCMCIA_DEVICE_PROD_ID3 17 | #define PCMCIA_DEVICE_PROD_ID3(v3, vh3) { \ 18 | .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID3, \ 19 | .prod_id = { NULL, NULL, (v3), NULL }, \ 20 | .prod_id_hash = { 0, 0, (vh3), 0 }, } 21 | #endif 22 | 23 | #endif /* __BACKPORT_PCMCIA_DEVICE_ID_H */ 24 | -------------------------------------------------------------------------------- /backport/compat/Makefile: -------------------------------------------------------------------------------- 1 | ccflags-y += -I$(src) -Wframe-larger-than=1280 2 | ifeq ($(CONFIG_BACKPORT_INTEGRATE),) 3 | obj-m += compat.o 4 | else 5 | obj-y += compat.o 6 | endif 7 | compat-y += main.o 8 | 9 | # Kernel backport compatibility code 10 | compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o 11 | compat-$(CPTCFG_KERNEL_4_19) += backport-4.19.o 12 | compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o 13 | compat-$(CPTCFG_KERNEL_5_3) += backport-5.3.o 14 | compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o 15 | compat-$(CPTCFG_KERNEL_5_9) += backport-5.9.o 16 | compat-$(CPTCFG_KERNEL_5_10) += backport-5.10.o 17 | compat-$(CPTCFG_KERNEL_5_11) += backport-5.11.o 18 | compat-$(CPTCFG_KERNEL_5_13) += backport-5.13.o 19 | compat-$(CPTCFG_KERNEL_5_15) += backport-5.15.o 20 | compat-$(CPTCFG_KERNEL_6_4) += backport-6.4.o 21 | compat-$(CPTCFG_KERNEL_6_11) += backport-6.11.o 22 | 23 | -------------------------------------------------------------------------------- /patches/0112-remove-IRQF_NO_AUTOEN/mwifiex.patch: -------------------------------------------------------------------------------- 1 | --- a/drivers/net/wireless/marvell/mwifiex/main.c 2 | +++ b/drivers/net/wireless/marvell/mwifiex/main.c 3 | @@ -1650,7 +1650,11 @@ static void mwifiex_probe_of(struct mwif 4 | 5 | ret = devm_request_irq(dev, adapter->irq_wakeup, 6 | mwifiex_irq_wakeup_handler, 7 | +#ifndef IRQF_NO_AUTOEN 8 | + IRQF_TRIGGER_LOW, 9 | +#else 10 | IRQF_TRIGGER_LOW | IRQF_NO_AUTOEN, 11 | +#endif 12 | "wifi_wake", adapter); 13 | if (ret) { 14 | dev_err(dev, "Failed to request irq_wakeup %d (%d)\n", 15 | @@ -1658,6 +1662,9 @@ static void mwifiex_probe_of(struct mwif 16 | goto err_exit; 17 | } 18 | 19 | +#ifndef IRQF_NO_AUTOEN 20 | + disable_irq(adapter->irq_wakeup); 21 | +#endif 22 | if (device_init_wakeup(dev, true)) { 23 | dev_err(dev, "fail to init wakeup for mwifiex\n"); 24 | goto err_exit; 25 | -------------------------------------------------------------------------------- /patches/0010-add-wext-handlers-to-netdev/INFO: -------------------------------------------------------------------------------- 1 | The patch "wext: refactor" by Johannes Berg refactored 2 | wext code so that new kernels no longer get the wext 3 | handlers through struct netdevice, instead they get 4 | it through the struct wiphy which is cfg80211 specific. 5 | 6 | For old kernels this means you get not wext handlers 7 | anymore when backporting code, this adds the wext handler 8 | back to the netdevice wireless_handlers to let compat 9 | users use wext again. 10 | 11 | We do this for every kernel version because the struct wiphy 12 | is changing from kernel version to version. At least the 13 | struct from kernel 2.6.33 and 2.6.34 are incompatible and 14 | the kernel would dereference some wrong type in the struct 15 | and oops. The old interface is not affected by this. This 16 | will cause that CONFIG_CFG80211_WEXT still depends on 17 | CONFIG_WIRELESS_EXT in compat-drivers. 18 | 19 | -------------------------------------------------------------------------------- /lib/tempdir.py: -------------------------------------------------------------------------------- 1 | # simple tempdir wrapper object for 'with' statement 2 | # 3 | # Usage: 4 | # with tempdir.tempdir() as tmpdir: 5 | # os.chdir(tmpdir) 6 | # do something 7 | # 8 | 9 | import tempfile, shutil 10 | 11 | class tempdir(object): 12 | def __init__(self, suffix='', prefix='', dir=None, nodelete=False): 13 | self.suffix = '' 14 | self.prefix = '' 15 | self.dir = dir 16 | self.nodelete = nodelete 17 | 18 | def __enter__(self): 19 | self._name = tempfile.mkdtemp(suffix=self.suffix, 20 | prefix=self.prefix, 21 | dir=self.dir) 22 | return self._name 23 | 24 | def __exit__(self, type, value, traceback): 25 | if self.nodelete: 26 | print('not deleting directory %s!' % self._name) 27 | else: 28 | shutil.rmtree(self._name) 29 | -------------------------------------------------------------------------------- /devel/gplizer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | gplizer 4 | ========= 5 | 6 | This modifies C files with EXPORT_SYMBOL() to EXPORT_SYMBOL_GPL(). 7 | We use this as Python code here as we may use it later for broader 8 | substitutions. We keep it in backports as typically we forget to 9 | use EXPORT_SYMBOL_GPL() when backporting kernel symbols. 10 | 11 | In short this does this but in Python: 12 | 13 | for i in $(find ./ -type f -name \*.c); do 14 | perl -pi -e'$_ =~ s|EXPORT_SYMBOL\(|EXPORT_SYMBOL_GPL\(|gs;' $i 15 | done 16 | """ 17 | 18 | import os, fileinput 19 | 20 | def gplize(f): 21 | for line in fileinput.input(f, inplace=1): 22 | print line.replace('EXPORT_SYMBOL(','EXPORT_SYMBOL_GPL('), 23 | 24 | if __name__ == '__main__': 25 | for root, dirs, files in os.walk(os.getcwd()): 26 | for f in files: 27 | if f.endswith('.c'): 28 | gplize(os.path.join(root, f)) 29 | -------------------------------------------------------------------------------- /patches/0004-disable-wext-kconfig.patch: -------------------------------------------------------------------------------- 1 | There's no way to build wireless extensions out of tree 2 | so remove the Kconfig options for them. 3 | 4 | --- a/net/wireless/Kconfig 5 | +++ b/net/wireless/Kconfig 6 | @@ -1,19 +1,4 @@ 7 | # SPDX-License-Identifier: GPL-2.0-only 8 | -config WIRELESS_EXT 9 | - bool 10 | - 11 | -config WEXT_CORE 12 | - def_bool y 13 | - depends on CFG80211_WEXT || WIRELESS_EXT 14 | - 15 | -config WEXT_PROC 16 | - def_bool y 17 | - depends on PROC_FS 18 | - depends on WEXT_CORE 19 | - 20 | -config WEXT_PRIV 21 | - bool 22 | - 23 | config CFG80211 24 | tristate "cfg80211 - wireless configuration API" 25 | depends on RFKILL || !RFKILL 26 | @@ -189,7 +171,7 @@ config CFG80211_CRDA_SUPPORT 27 | 28 | config CFG80211_WEXT 29 | bool "cfg80211 wireless extensions compatibility" 30 | - select WEXT_CORE 31 | + depends on WEXT_CORE 32 | help 33 | Enable this option if you need old userspace for wireless 34 | 35 | -------------------------------------------------------------------------------- /backport/backport-include/generated/utsrelease.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_GENERATED_UTS_RELEASE_H 2 | #define __BACKPORT_GENERATED_UTS_RELEASE_H 3 | #include_next 4 | 5 | /* 6 | * We only want the UTS_UBUNTU_RELEASE_ABI var when we are on a normal 7 | * Ubuntu distribution kernel and not when we are on a Ubuntu mainline 8 | * kernel. Some of the Ubuntu mainline kernel do have an invalid octal 9 | * number in this field like 031418 and we do not want to evaluate this 10 | * at all on the Ubuntu mainline kernels. All Ubuntu distribution 11 | * kernel have CONFIG_VERSION_SIGNATURE set so this way we can detect 12 | * the which type of kernel we are on. 13 | */ 14 | #ifndef UTS_UBUNTU_RELEASE_ABI 15 | #define UTS_UBUNTU_RELEASE_ABI 0 16 | #elif !defined(CONFIG_VERSION_SIGNATURE) 17 | #undef UTS_UBUNTU_RELEASE_ABI 18 | #define UTS_UBUNTU_RELEASE_ABI 0 19 | #endif 20 | 21 | #endif /* __BACKPORT_GENERATED_UTS_RELEASE_H */ 22 | -------------------------------------------------------------------------------- /backport/backport-include/linux/leds.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_LEDS_H 2 | #define __BACKPORT_LINUX_LEDS_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(6,5,0) 7 | static inline void 8 | LINUX_BACKPORT(led_trigger_blink_oneshot)(struct led_trigger *trigger, 9 | unsigned long delay_on, 10 | unsigned long delay_off, 11 | int invert) 12 | { 13 | led_trigger_blink_oneshot(trigger, &delay_on, &delay_off, invert); 14 | } 15 | #define led_trigger_blink_oneshot LINUX_BACKPORT(led_trigger_blink_oneshot) 16 | 17 | static inline void 18 | LINUX_BACKPORT(led_trigger_blink)(struct led_trigger *trigger, 19 | unsigned long delay_on, 20 | unsigned long delay_off) 21 | { 22 | led_trigger_blink(trigger, &delay_on, &delay_off); 23 | } 24 | #define led_trigger_blink LINUX_BACKPORT(led_trigger_blink) 25 | 26 | #endif /* < 6.5 */ 27 | 28 | #endif /* __BACKPORT_LINUX_LEDS_H */ 29 | -------------------------------------------------------------------------------- /backport/backport-include/linux/rfkill.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_UAPI__RFKILL_H 2 | #define __BACKPORT_UAPI__RFKILL_H 3 | #include_next 4 | 5 | 6 | #if LINUX_VERSION_IS_LESS(5,11,0) 7 | 8 | /* This should come from uapi/linux/rfkill.h, but it was much easier 9 | * to do it this way. 10 | */ 11 | enum rfkill_hard_block_reasons { 12 | RFKILL_HARD_BLOCK_SIGNAL = 1 << 0, 13 | RFKILL_HARD_BLOCK_NOT_OWNER = 1 << 1, 14 | }; 15 | 16 | static inline bool rfkill_set_hw_state_reason(struct rfkill *rfkill, 17 | bool blocked, unsigned long reason) 18 | { 19 | return rfkill_set_hw_state(rfkill, blocked); 20 | } 21 | 22 | #endif /* 5.11 */ 23 | 24 | #if LINUX_VERSION_IS_LESS(5,17,0) && !defined(CONFIG_WLAN_VENDOR_INTEL_MEI) 25 | 26 | static inline bool rfkill_soft_blocked(struct rfkill *rfkill) 27 | { 28 | return rfkill_blocked(rfkill); 29 | } 30 | 31 | #endif /* 5.17 */ 32 | 33 | #endif /* __BACKPORT_UAPI__RFKILL_H */ 34 | -------------------------------------------------------------------------------- /backport/backport-include/linux/time.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_TIME_H 2 | #define __BACKPORT_LINUX_TIME_H 3 | #include_next 4 | 5 | #include 6 | 7 | #ifndef time_after32 8 | /** 9 | * time_after32 - compare two 32-bit relative times 10 | * @a: the time which may be after @b 11 | * @b: the time which may be before @a 12 | * 13 | * time_after32(a, b) returns true if the time @a is after time @b. 14 | * time_before32(b, a) returns true if the time @b is before time @a. 15 | * 16 | * Similar to time_after(), compare two 32-bit timestamps for relative 17 | * times. This is useful for comparing 32-bit seconds values that can't 18 | * be converted to 64-bit values (e.g. due to disk format or wire protocol 19 | * issues) when it is known that the times are less than 68 years apart. 20 | */ 21 | #define time_after32(a, b) ((s32)((u32)(b) - (u32)(a)) < 0) 22 | #endif 23 | 24 | #endif /* __BACKPORT_LINUX_TIME_H */ 25 | -------------------------------------------------------------------------------- /backport/backport-include/linux/pm_runtime.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_PM_RUNTIME_H 2 | #define __BACKPORT_PM_RUNTIME_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(5,10,0) 7 | #define pm_runtime_resume_and_get LINUX_BACKPORT(pm_runtime_resume_and_get) 8 | 9 | /** 10 | * pm_runtime_resume_and_get - Bump up usage counter of a device and resume it. 11 | * @dev: Target device. 12 | * 13 | * Resume @dev synchronously and if that is successful, increment its runtime 14 | * PM usage counter. Return 0 if the runtime PM usage counter of @dev has been 15 | * incremented or a negative error code otherwise. 16 | */ 17 | static inline int pm_runtime_resume_and_get(struct device *dev) 18 | { 19 | int ret; 20 | 21 | ret = __pm_runtime_resume(dev, RPM_GET_PUT); 22 | if (ret < 0) { 23 | pm_runtime_put_noidle(dev); 24 | return ret; 25 | } 26 | 27 | return 0; 28 | } 29 | #endif /* < 5.10 */ 30 | 31 | #endif /* __BACKPORT_PM_RUNTIME_H */ -------------------------------------------------------------------------------- /backport/backport-include/linux/mod_devicetable.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_MOD_DEVICETABLE_H 2 | #define __BACKPORT_MOD_DEVICETABLE_H 3 | #include_next 4 | 5 | #ifndef HID_BUS_ANY 6 | #define HID_BUS_ANY 0xffff 7 | #endif 8 | 9 | #ifndef HID_GROUP_ANY 10 | #define HID_GROUP_ANY 0x0000 11 | #endif 12 | 13 | #ifndef HID_ANY_ID 14 | #define HID_ANY_ID (~0) 15 | #endif 16 | 17 | #if LINUX_VERSION_IS_LESS(5,7,0) 18 | #define MHI_DEVICE_MODALIAS_FMT "mhi:%s" 19 | #define MHI_NAME_SIZE 32 20 | 21 | /** 22 | * struct mhi_device_id - MHI device identification 23 | * @chan: MHI channel name 24 | * @driver_data: driver data; 25 | */ 26 | struct mhi_device_id { 27 | const char chan[MHI_NAME_SIZE]; 28 | kernel_ulong_t driver_data; 29 | }; 30 | #endif 31 | 32 | #if LINUX_VERSION_IS_LESS(4,17,0) 33 | #define DMI_OEM_STRING (DMI_STRING_MAX + 1) 34 | #endif /* < 4.17.0 */ 35 | 36 | #endif /* __BACKPORT_MOD_DEVICETABLE_H */ 37 | -------------------------------------------------------------------------------- /patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch: -------------------------------------------------------------------------------- 1 | --- a/net/wireless/core.c 2 | +++ b/net/wireless/core.c 3 | @@ -539,10 +539,6 @@ use_default_name: 4 | INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); 5 | INIT_DELAYED_WORK(&rdev->dfs_update_channels_wk, 6 | cfg80211_dfs_channels_update_work); 7 | -#ifdef CONFIG_CFG80211_WEXT 8 | - rdev->wiphy.wext = &cfg80211_wext_handler; 9 | -#endif 10 | - 11 | device_initialize(&rdev->wiphy.dev); 12 | rdev->wiphy.dev.class = &ieee80211_class; 13 | rdev->wiphy.dev.platform_data = rdev; 14 | @@ -1395,6 +1391,10 @@ void cfg80211_init_wdev(struct wireless_ 15 | INIT_WORK(&wdev->pmsr_free_wk, cfg80211_pmsr_free_wk); 16 | 17 | #ifdef CONFIG_CFG80211_WEXT 18 | +#ifdef CONFIG_WIRELESS_EXT 19 | + if (!wdev->netdev->wireless_handlers) 20 | + wdev->netdev->wireless_handlers = &cfg80211_wext_handler; 21 | +#endif 22 | wdev->wext.default_key = -1; 23 | wdev->wext.default_mgmt_key = -1; 24 | wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; 25 | -------------------------------------------------------------------------------- /backport/scripts/blacklist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BLACKLIST_CONF="/etc/modprobe.d/backports.conf" 4 | BLACKLIST_MAP=".blacklist.map" 5 | 6 | MODULE_DIR=$1 7 | MODULE_UPDATES=$2 8 | 9 | if [[ ! -d $MODULE_DIR ]]; then 10 | exit 11 | fi 12 | 13 | if [[ ! -d $MODULE_UPDATES ]]; then 14 | exit 15 | fi 16 | 17 | mkdir -p $(dirname $BLACKLIST_CONF) 18 | rm -f $BLACKLIST_CONF 19 | 20 | echo "# To be used when using backported drivers" > $BLACKLIST_CONF 21 | 22 | for i in $(grep -v ^# $BLACKLIST_MAP | awk '{print $2}'); do 23 | MODULE="${i}.ko" 24 | MODULE_UPDATE="$(grep -v ^# $BLACKLIST_MAP | grep $i | awk '{print $1}' | head -1).ko" 25 | 26 | COUNT=$(find $MODULE_DIR -type f -name ${MODULE} -or -name ${MODULE}.gz | wc -l) 27 | COUNT_REPLACE=$(find $MODULE_UPDATES -type f -name ${MODULE_UPDATE} -or -name ${MODULE_UPDATE}.gz | wc -l) 28 | 29 | if [ $COUNT -ne 0 ]; then 30 | if [ $COUNT_REPLACE -ne 0 ]; then 31 | echo "Blacklisting $MODULE ..." 32 | echo blacklist $i >> $BLACKLIST_CONF 33 | fi 34 | fi 35 | done 36 | -------------------------------------------------------------------------------- /backport/backport-include/uapi/linux/eventpoll.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_EVENTPOLL_H 2 | #define __BACKPORT_LINUX_EVENTPOLL_H 3 | #include_next 4 | 5 | #ifndef EPOLLIN 6 | #define EPOLLIN 0x00000001 7 | #endif 8 | 9 | #ifndef EPOLLPRI 10 | #define EPOLLPRI 0x00000002 11 | #endif 12 | 13 | #ifndef EPOLLOUT 14 | #define EPOLLOUT 0x00000004 15 | #endif 16 | 17 | #ifndef EPOLLERR 18 | #define EPOLLERR 0x00000008 19 | #endif 20 | 21 | #ifndef EPOLLHUP 22 | #define EPOLLHUP 0x00000010 23 | #endif 24 | 25 | #ifndef EPOLLRDNORM 26 | #define EPOLLRDNORM 0x00000040 27 | #endif 28 | 29 | #ifndef EPOLLRDBAND 30 | #define EPOLLRDBAND 0x00000080 31 | #endif 32 | 33 | #ifndef EPOLLWRNORM 34 | #define EPOLLWRNORM 0x00000100 35 | #endif 36 | 37 | #ifndef EPOLLWRBAND 38 | #define EPOLLWRBAND 0x00000200 39 | #endif 40 | 41 | #ifndef EPOLLMSG 42 | #define EPOLLMSG 0x00000400 43 | #endif 44 | 45 | #ifndef EPOLLRDHUP 46 | #define EPOLLRDHUP 0x00002000 47 | #endif 48 | 49 | #endif /* __BACKPORT_LINUX_EVENTPOLL_H */ 50 | -------------------------------------------------------------------------------- /backport/backport-include/linux/bitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __BP_LINUX_BITMAP_H 2 | #define __BP_LINUX_BITMAP_H 3 | #include_next 4 | 5 | #if LINUX_VERSION_IS_LESS(4,19,0) 6 | #define bitmap_alloc LINUX_BACKPORT(bitmap_alloc) 7 | unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags); 8 | 9 | #define bitmap_zalloc LINUX_BACKPORT(bitmap_zalloc) 10 | unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags); 11 | 12 | #define bitmap_free LINUX_BACKPORT(bitmap_free) 13 | void bitmap_free(const unsigned long *bitmap); 14 | #endif 15 | 16 | #if LINUX_VERSION_IS_LESS(5,13,0) 17 | struct device; 18 | /* Managed variants of the above. */ 19 | #define devm_bitmap_alloc LINUX_BACKPORT(devm_bitmap_alloc) 20 | unsigned long *devm_bitmap_alloc(struct device *dev, 21 | unsigned int nbits, gfp_t flags); 22 | 23 | #define devm_bitmap_zalloc LINUX_BACKPORT(devm_bitmap_zalloc) 24 | unsigned long *devm_bitmap_zalloc(struct device *dev, 25 | unsigned int nbits, gfp_t flags); 26 | 27 | #endif 28 | 29 | #endif /* __BP_LINUX_BITMAP_H */ 30 | -------------------------------------------------------------------------------- /backport/backport-include/pcmcia/ds.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_PCMCIA_DS_H 2 | #define __BACKPORT_PCMCIA_DS_H 3 | #include_next 4 | 5 | #ifndef module_pcmcia_driver 6 | /** 7 | * backport of: 8 | * 9 | * commit 6ed7ffddcf61f668114edb676417e5fb33773b59 10 | * Author: H Hartley Sweeten 11 | * Date: Wed Mar 6 11:24:44 2013 -0700 12 | * 13 | * pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate 14 | */ 15 | 16 | /** 17 | * module_pcmcia_driver() - Helper macro for registering a pcmcia driver 18 | * @__pcmcia_driver: pcmcia_driver struct 19 | * 20 | * Helper macro for pcmcia drivers which do not do anything special in module 21 | * init/exit. This eliminates a lot of boilerplate. Each module may only use 22 | * this macro once, and calling it replaces module_init() and module_exit(). 23 | */ 24 | #define module_pcmcia_driver(__pcmcia_driver) \ 25 | module_driver(__pcmcia_driver, pcmcia_register_driver, \ 26 | pcmcia_unregister_driver) 27 | #endif 28 | 29 | #endif /* __BACKPORT_PCMCIA_DS_H */ 30 | -------------------------------------------------------------------------------- /backport/backport-include/linux/build_bug.h: -------------------------------------------------------------------------------- 1 | #ifndef __BP_BUILD_BUG_H 2 | #define __BP_BUILD_BUG_H 3 | 4 | #include_next 5 | 6 | #ifndef static_assert 7 | /** 8 | * static_assert - check integer constant expression at build time 9 | * 10 | * static_assert() is a wrapper for the C11 _Static_assert, with a 11 | * little macro magic to make the message optional (defaulting to the 12 | * stringification of the tested expression). 13 | * 14 | * Contrary to BUILD_BUG_ON(), static_assert() can be used at global 15 | * scope, but requires the expression to be an integer constant 16 | * expression (i.e., it is not enough that __builtin_constant_p() is 17 | * true for expr). 18 | * 19 | * Also note that BUILD_BUG_ON() fails the build if the condition is 20 | * true, while static_assert() fails the build if the expression is 21 | * false. 22 | */ 23 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) 24 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) 25 | #endif 26 | 27 | #endif /* __BP_BUILD_BUG_H */ 28 | -------------------------------------------------------------------------------- /backport/backport-include/linux/rculist.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_RCULIST_H 2 | #define __BACKPORT_RCULIST_H 3 | #include_next 4 | #include 5 | 6 | 7 | #if LINUX_VERSION_IS_LESS(5,4,0) 8 | /** 9 | * list_for_each_entry_rcu - iterate over rcu list of given type 10 | * @pos: the type * to use as a loop cursor. 11 | * @head: the head for your list. 12 | * @member: the name of the list_head within the struct. 13 | * @cond...: optional lockdep expression if called from non-RCU protection. 14 | * 15 | * This list-traversal primitive may safely run concurrently with 16 | * the _rcu list-mutation primitives such as list_add_rcu() 17 | * as long as the traversal is guarded by rcu_read_lock(). 18 | */ 19 | #undef list_for_each_entry_rcu 20 | #define list_for_each_entry_rcu(pos, head, member, cond...) \ 21 | for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \ 22 | &pos->member != (head); \ 23 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) 24 | #endif /* < 5.4 */ 25 | 26 | #endif /* __BACKPORT_RCULIST_H */ 27 | -------------------------------------------------------------------------------- /backport/backport-include/linux/u64_stats_sync.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_U64_STATS_SYNC_H 2 | #define __BACKPORT_LINUX_U64_STATS_SYNC_H 3 | 4 | #include 5 | #include 6 | #include_next 7 | 8 | #if LINUX_VERSION_IS_LESS(4,16,0) && \ 9 | !LINUX_VERSION_IN_RANGE(4,14,44, 4,15,0) && \ 10 | !(LINUX_VERSION_IS_GEQ(4,15,18) && UTS_UBUNTU_RELEASE_ABI >= 33) 11 | static inline unsigned long 12 | u64_stats_update_begin_irqsave(struct u64_stats_sync *syncp) 13 | { 14 | unsigned long flags = 0; 15 | 16 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) 17 | local_irq_save(flags); 18 | write_seqcount_begin(&syncp->seq); 19 | #endif 20 | return flags; 21 | } 22 | 23 | static inline void 24 | u64_stats_update_end_irqrestore(struct u64_stats_sync *syncp, 25 | unsigned long flags) 26 | { 27 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) 28 | write_seqcount_end(&syncp->seq); 29 | local_irq_restore(flags); 30 | #endif 31 | } 32 | #endif /* < 4.16 */ 33 | 34 | #endif /* __BACKPORT_LINUX_U64_STATS_SYNC_H */ 35 | -------------------------------------------------------------------------------- /backport/backport-include/net/sock.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_NET_SOCK_H 2 | #define __BACKPORT_NET_SOCK_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(4,16,0) 7 | #define sk_pacing_shift_update LINUX_BACKPORT(sk_pacing_shift_update) 8 | static inline void sk_pacing_shift_update(struct sock *sk, int val) 9 | { 10 | #if LINUX_VERSION_IS_GEQ(4,15,0) 11 | if (!sk || !sk_fullsock(sk) || sk->sk_pacing_shift == val) 12 | return; 13 | sk->sk_pacing_shift = val; 14 | #endif /* >= 4.15 */ 15 | } 16 | #endif /* < 4.16 */ 17 | 18 | #if LINUX_VERSION_IS_LESS(5,14,0) 19 | static inline void backport_sk_error_report(struct sock *sk) 20 | { 21 | sk->sk_error_report(sk); 22 | } 23 | #define sk_error_report(sk) LINUX_BACKPORT(sk_error_report(sk)) 24 | #endif /* <= 5.14 */ 25 | 26 | #if LINUX_VERSION_IS_LESS(6,16,0) 27 | static inline bool 28 | sk_requests_wifi_status(struct sock *sk) 29 | { 30 | return sk && sk_fullsock(sk) && sock_flag(sk, SOCK_WIFI_STATUS); 31 | } 32 | #endif /* <= 6.16 */ 33 | 34 | #endif /* __BACKPORT_NET_SOCK_H */ 35 | -------------------------------------------------------------------------------- /backport/backport-include/linux/usb.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_USB_H 2 | #define __BACKPORT_LINUX_USB_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(6,3,5) && \ 7 | !LINUX_VERSION_IN_RANGE(6,1,31, 6,2,0) && \ 8 | !LINUX_VERSION_IN_RANGE(5,15,114, 5,16,0) && \ 9 | !LINUX_VERSION_IN_RANGE(5,10,181, 5,11,0) && \ 10 | !LINUX_VERSION_IN_RANGE(5,4,244, 5,5,0) 11 | #define usb_check_bulk_endpoints LINUX_BACKPORT(usb_check_bulk_endpoints) 12 | bool usb_check_bulk_endpoints( 13 | const struct usb_interface *intf, const u8 *ep_addrs); 14 | #define usb_check_int_endpoints LINUX_BACKPORT(usb_check_int_endpoints) 15 | bool usb_check_int_endpoints( 16 | const struct usb_interface *intf, const u8 *ep_addrs); 17 | #endif /* < 5.15 */ 18 | 19 | #if LINUX_VERSION_IS_LESS(5,19,0) 20 | static inline u16 backport_usb_maxpacket(struct usb_device *udev, int pipe) 21 | { 22 | return usb_maxpacket(udev, pipe, usb_pipeout(pipe)); 23 | } 24 | #define usb_maxpacket LINUX_BACKPORT(usb_maxpacket) 25 | #endif /* <5.19 */ 26 | 27 | #endif /* __BACKPORT_LINUX_USB_H */ 28 | -------------------------------------------------------------------------------- /backport/backport-include/linux/lockdep.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_LOCKDEP_H 2 | #define __BACKPORT_LINUX_LOCKDEP_H 3 | #include_next 4 | #include 5 | 6 | #if LINUX_VERSION_IS_LESS(4,15,0) 7 | #ifndef CONFIG_LOCKDEP 8 | struct lockdep_map { }; 9 | #endif /* CONFIG_LOCKDEP */ 10 | #endif /* LINUX_VERSION_IS_LESS(4,15,0) */ 11 | 12 | #if LINUX_VERSION_IS_LESS(5,11,0) 13 | #if !defined(CONFIG_LOCKDEP) && !defined(lockdep_is_held) 14 | /* upstream since 5.11 in this exact same way - calls compile away */ 15 | int lockdep_is_held(const void *); 16 | #endif 17 | #endif 18 | 19 | #ifndef lockdep_assert_not_held 20 | #ifdef CONFIG_LOCKDEP 21 | #ifndef LOCK_STATE_HELD 22 | #define LOCK_STATE_HELD 1 23 | #endif /* LOCK_STATE_HELD */ 24 | #define lockdep_assert_not_held(l) do { \ 25 | WARN_ON(debug_locks && \ 26 | lockdep_is_held(l) == LOCK_STATE_HELD); \ 27 | } while (0) 28 | #else 29 | #define lockdep_assert_not_held(l) do { (void)(l); } while (0) 30 | #endif /* CONFIG_LOCKDEP */ 31 | #endif /* lockdep_assert_not_held */ 32 | 33 | #endif /* __BACKPORT_LINUX_LOCKDEP_H */ 34 | -------------------------------------------------------------------------------- /backport/backport-include/linux/pm_qos.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPAT_LINUX_PM_QOS_H 2 | #define _COMPAT_LINUX_PM_QOS_H 1 3 | 4 | #include 5 | #include_next 6 | 7 | #if LINUX_VERSION_IS_LESS(5,7,0) 8 | static inline void cpu_latency_qos_add_request(struct pm_qos_request *req, 9 | s32 value) 10 | { 11 | pm_qos_add_request(req, PM_QOS_CPU_DMA_LATENCY, value); 12 | } 13 | 14 | static inline void cpu_latency_qos_update_request(struct pm_qos_request *req, 15 | s32 new_value) 16 | { 17 | pm_qos_update_request(req, new_value); 18 | } 19 | 20 | static inline void cpu_latency_qos_remove_request(struct pm_qos_request *req) 21 | { 22 | pm_qos_remove_request(req); 23 | } 24 | 25 | static inline bool cpu_latency_qos_request_active(struct pm_qos_request *req) 26 | { 27 | return pm_qos_request_active(req); 28 | } 29 | 30 | static inline s32 cpu_latency_qos_limit(void) 31 | { 32 | return pm_qos_request(PM_QOS_CPU_DMA_LATENCY); 33 | } 34 | #endif /* < 5.7 */ 35 | 36 | #endif /* _COMPAT_LINUX_PM_QOS_H */ 37 | -------------------------------------------------------------------------------- /backport/compat/backport-5.9.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | u64 mul_u64_u64_div_u64(u64 a, u64 b, u64 c) 8 | { 9 | u64 res = 0, div, rem; 10 | int shift; 11 | 12 | /* can a * b overflow ? */ 13 | if (ilog2(a) + ilog2(b) > 62) { 14 | /* 15 | * (b * a) / c is equal to 16 | * 17 | * (b / c) * a + 18 | * (b % c) * a / c 19 | * 20 | * if nothing overflows. Can the 1st multiplication 21 | * overflow? Yes, but we do not care: this can only 22 | * happen if the end result can't fit in u64 anyway. 23 | * 24 | * So the code below does 25 | * 26 | * res = (b / c) * a; 27 | * b = b % c; 28 | */ 29 | div = div64_u64_rem(b, c, &rem); 30 | res = div * a; 31 | b = rem; 32 | 33 | shift = ilog2(a) + ilog2(b) - 62; 34 | if (shift > 0) { 35 | /* drop precision */ 36 | b >>= shift; 37 | c >>= shift; 38 | if (!c) 39 | return res; 40 | } 41 | } 42 | 43 | return res + div64_u64(a * b, c); 44 | } 45 | EXPORT_SYMBOL_GPL(mul_u64_u64_div_u64); 46 | -------------------------------------------------------------------------------- /backport/backport-include/linux/spinlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_SPINLOCK_H 2 | #define __BACKPORT_SPINLOCK_H 3 | #include_next 4 | 5 | 6 | #if LINUX_VERSION_IS_LESS(4,16,0) 7 | int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, 8 | size_t max_size, unsigned int cpu_mult, 9 | gfp_t gfp); 10 | 11 | void free_bucket_spinlocks(spinlock_t *locks); 12 | #endif /* LINUX_VERSION_IS_LESS(4,16,0) */ 13 | 14 | #if LINUX_VERSION_IS_LESS(4,19,0) 15 | int __alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, 16 | size_t max_size, unsigned int cpu_mult, 17 | gfp_t gfp, const char *name, 18 | struct lock_class_key *key); 19 | 20 | #define alloc_bucket_spinlocks(locks, lock_mask, max_size, cpu_mult, gfp) \ 21 | ({ \ 22 | static struct lock_class_key key; \ 23 | int ret; \ 24 | \ 25 | ret = __alloc_bucket_spinlocks(locks, lock_mask, max_size, \ 26 | cpu_mult, gfp, #locks, &key); \ 27 | ret; \ 28 | }) 29 | #endif /* LINUX_VERSION_IS_LESS(4,19,0) */ 30 | 31 | #endif /* __BACKPORT_SPINLOCK_H */ 32 | -------------------------------------------------------------------------------- /backport/Kconfig.integrate: -------------------------------------------------------------------------------- 1 | config BACKPORT_INTEGRATE 2 | bool 3 | def_bool y 4 | 5 | config BACKPORT_DIR 6 | string 7 | default "%%BACKPORT_DIR%%" 8 | 9 | config BACKPORT_VERSION 10 | string 11 | default "%%BACKPORTS_VERSION%%" 12 | 13 | config BACKPORT_KERNEL_VERSION 14 | string 15 | default "%%BACKPORTED_KERNEL_VERSION%%" 16 | 17 | config BACKPORT_KERNEL_NAME 18 | string 19 | default "%%BACKPORTED_KERNEL_NAME%%" 20 | 21 | menuconfig BACKPORT_LINUX 22 | bool "Backport %%BACKPORTED_KERNEL_NAME%% %%BACKPORTED_KERNEL_VERSION%% (backports %%BACKPORTS_VERSION%%)" 23 | default n 24 | ---help--- 25 | Enabling this will let give you the opportunity to use features and 26 | drivers backported from %%BACKPORTED_KERNEL_NAME%% %%BACKPORTED_KERNEL_VERSION%% 27 | on the kernel your are using. This is experimental and you should 28 | say no unless you'd like to help test things or want to help debug 29 | this should we run into any issues. 30 | 31 | if BACKPORT_LINUX 32 | 33 | source "$BACKPORT_DIR/Kconfig.versions" 34 | source "$BACKPORT_DIR/Kconfig.sources" 35 | source "$BACKPORT_DIR/Kconfig.local" 36 | 37 | endif # BACKPORT_LINUX 38 | -------------------------------------------------------------------------------- /backport/backport-include/linux/hrtimer.h: -------------------------------------------------------------------------------- 1 | #ifndef __BACKPORT_LINUX_HRTIMER_H 2 | #define __BACKPORT_LINUX_HRTIMER_H 3 | #include 4 | #include_next 5 | 6 | #if LINUX_VERSION_IS_LESS(4,16,0) 7 | 8 | #define HRTIMER_MODE_ABS_SOFT HRTIMER_MODE_ABS 9 | #define HRTIMER_MODE_REL_SOFT HRTIMER_MODE_REL 10 | 11 | #endif /* < 4.16 */ 12 | 13 | #if LINUX_VERSION_IS_LESS(6,13,0) 14 | 15 | static inline enum hrtimer_restart hrtimer_dummy_timeout(struct hrtimer *unused) 16 | { 17 | return HRTIMER_NORESTART; 18 | } 19 | 20 | static inline void 21 | hrtimer_update_function(struct hrtimer *timer, 22 | enum hrtimer_restart (*function)(struct hrtimer *)) 23 | { 24 | timer->function = function; 25 | } 26 | 27 | static inline void 28 | hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)(struct hrtimer *), 29 | clockid_t clock_id, enum hrtimer_mode mode) 30 | { 31 | hrtimer_init(timer, clock_id, mode); 32 | if (WARN_ON_ONCE(!function)) 33 | timer->function = hrtimer_dummy_timeout; 34 | else 35 | timer->function = function; 36 | } 37 | 38 | #endif 39 | 40 | #endif /* __BACKPORT_LINUX_HRTIMER_H */ 41 | -------------------------------------------------------------------------------- /backport/backport-include/linux/compiler_attributes.h: -------------------------------------------------------------------------------- 1 | #ifndef _BACKPORTS_LINUX_COMPILER_ATTRIBUTES_H 2 | #define _BACKPORTS_LINUX_COMPILER_ATTRIBUTES_H 1 3 | 4 | #if LINUX_VERSION_IS_GEQ(4,20,0) 5 | #include_next 6 | #endif 7 | 8 | #ifndef __has_attribute 9 | # define __has_attribute(x) __GCC4_has_attribute_##x 10 | #endif 11 | 12 | #ifndef __GCC4_has_attribute___fallthrough__ 13 | # define __GCC4_has_attribute___fallthrough__ 0 14 | #endif /* __GCC4_has_attribute___fallthrough__ */ 15 | 16 | #ifndef fallthrough 17 | /* 18 | * Add the pseudo keyword 'fallthrough' so case statement blocks 19 | * must end with any of these keywords: 20 | * break; 21 | * fallthrough; 22 | * goto