diff --git a/.github/labeler.yml b/.github/labeler.yml index 8ef3088678..99a7c665df 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -39,22 +39,18 @@ - any-glob-to-any-file: - "target/linux/bcm4908/**" - "package/boot/uboot-bcm4908/**" + - "package/boot/arm-trusted-firmware-bcm63xx/**" "target/bcm53xx": - changed-files: - any-glob-to-any-file: - "target/linux/bcm53xx/**" - "package/boot/uboot-bcm53xx/**" -"target/bcm63xx": -- changed-files: - - any-glob-to-any-file: - - "target/linux/bcm63xx/**" - - "package/kernel/bcm63xx-cfe/**" - - "package/boot/arm-trusted-firmware-bcm63xx/**" "target/bmips": - changed-files: - any-glob-to-any-file: - "target/linux/bmips/**" - "package/boot/uboot-bmips/**" + - "package/kernel/bcm63xx-cfe/**" "target/d1": - changed-files: - any-glob-to-any-file: @@ -83,6 +79,12 @@ - changed-files: - any-glob-to-any-file: - "target/linux/qualcommax/**" +"target/ixp4xx": +- changed-files: + - any-glob-to-any-file: + - "target/linux/ixp4xx/**" + - "package/boot/apex/Makefile/**" + - "package/firmware/ixp4xx-microcode/**" "target/kirkwood": - changed-files: - any-glob-to-any-file: @@ -103,6 +105,10 @@ - "package/boot/tfa-layerscape/**" - "package/boot/uboot-layerscape/**" - "package/network/utils/layerscape/**" +"target/loongarch64": +- changed-files: + - any-glob-to-any-file: + - "target/linux/loongarch64/**" "target/malta": - changed-files: - any-glob-to-any-file: @@ -165,6 +171,14 @@ - "target/linux/sifiveu/**" - "package/boot/uboot-sifiveu/**" - "package/boot/opensbi/**" +"target/siflower": +- changed-files: + - any-glob-to-any-file: + - "target/linux/siflower/**" +"target/starfive": +- changed-files: + - any-glob-to-any-file: + - "target/linux/starfive/**" "target/sunxi": - changed-files: - any-glob-to-any-file: diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 094066fe77..d096bfabd0 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .52 -LINUX_KERNEL_HASH-6.6.52 = 1591ab348399d4aa53121158525056a69c8cf0fe0e90935b0095e9a58e37b4b8 +LINUX_VERSION-6.6 = .53 +LINUX_KERNEL_HASH-6.6.53 = 285d181d1b252b0bf905f040d094215cf183ac98c31a17f9cce9f3537ef4d779 diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index be21d0079a..9d1968ce20 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -341,6 +341,11 @@ generate_static_system() { uci -q set "system.@system[-1].compat_version=1.0" fi + local timezone + if json_get_var timezone timezone; then + uci -q set "system.@system[-1].timezone=$timezone" + fi + if json_is_a ntpserver array; then local keys key json_get_keys keys ntpserver diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index d17754d087..c7d1d4af3a 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -10,7 +10,6 @@ uci_apply_defaults() { cd /etc/uci-defaults || return 0 files="$(ls)" [ -z "$files" ] && return 0 - mkdir -p /tmp/.uci for file in $files; do ( . "./$(basename $file)" ) && rm -f "$file" done @@ -47,6 +46,8 @@ boot() { sleep 1 } + mkdir -p /tmp/.uci + [ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools) /bin/config_generate rm -f /tmp/.config_pending /sbin/wifi config diff --git a/package/base-files/files/etc/uci-defaults/50-root-passwd b/package/base-files/files/etc/uci-defaults/50-root-passwd new file mode 100644 index 0000000000..9eddf1559b --- /dev/null +++ b/package/base-files/files/etc/uci-defaults/50-root-passwd @@ -0,0 +1,12 @@ +. /usr/share/libubox/jshn.sh + +json_init +json_load "$(cat /etc/board.json)" + +json_select credentials + json_get_vars root_password_hash root_password_hash + [ -z "$root_password_hash" ] || sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow + + json_get_vars root_password_plain root_password_plain + [ -z "$root_password_plain" ] || { (echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root } +json_select .. diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index b89cc8e9e3..8355099c35 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -642,6 +642,92 @@ ucidef_set_hostname() { json_select .. } +ucidef_set_timezone() { + local timezone="$1" + json_select_object system + json_add_string timezone "$timezone" + json_select .. +} + +ucidef_set_wireless() { + local band="$1" + local ssid="$2" + local encryption="$3" + local key="$4" + + case "$band" in + all|2g|5g|6g) ;; + *) return;; + esac + [ -z "$ssid" ] && return + + json_select_object wlan + json_select_object defaults + json_select_object ssids + json_select_object "$band" + json_add_string ssid "$ssid" + [ -n "$encryption" ] && json_add_string encryption "$encryption" + [ -n "$key" ] && json_add_string key "$key" + json_select .. + json_select .. + json_select .. + json_select .. +} + +ucidef_set_country() { + local country="$1" + + json_select_object wlan + json_select_object defaults + json_add_string country "$country" + json_select .. + json_select .. +} + +ucidef_set_wireless_mac_count() { + local band="$1" + local mac_count="$2" + + case "$band" in + 2g|5g|6g) ;; + *) return;; + esac + [ -z "$mac_count" ] && return + + json_select_object wlan + json_select_object defaults + json_select_object ssids + json_select_object "$band" + json_add_string mac_count "$mac_count" + json_select .. + json_select .. + json_select .. + json_select .. +} + +ucidef_set_root_password_plain() { + local passwd="$1" + json_select_object credentials + json_add_string root_password_plain "$passwd" + json_select .. +} + +ucidef_set_root_password_hash() { + local passwd="$1" + json_select_object credentials + json_add_string root_password_hash "$passwd" + json_select .. +} + +ucidef_set_ssh_authorized_key() { + local ssh_key="$1" + json_select_object credentials + json_select_array ssh_authorized_keys + json_add_string "" "$ssh_key" + json_select .. + json_select .. +} + ucidef_set_ntpserver() { local server diff --git a/package/base-files/files/lib/upgrade/emmc.sh b/package/base-files/files/lib/upgrade/emmc.sh index 49cffe1c65..78e398d6d5 100644 --- a/package/base-files/files/lib/upgrade/emmc.sh +++ b/package/base-files/files/lib/upgrade/emmc.sh @@ -16,15 +16,22 @@ emmc_upgrade_tar() { tar tf "$tar_file" ${board_dir}/kernel 1>/dev/null 2>/dev/null && has_kernel=1 tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1 - [ "$has_kernel" = 1 -a "$EMMC_KERN_DEV" ] && - export EMMC_KERNEL_BLOCKS=$(($(tar xf "$tar_file" ${board_dir}/kernel -O | dd of="$EMMC_KERN_DEV" bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) - [ "$has_rootfs" = 1 -a "$EMMC_ROOT_DEV" ] && { + # Invalidate kernel image while rootfs is being written + [ "$has_kernel" = 1 -a "$EMMC_KERN_DEV" ] && { + dd if=/dev/zero of="$EMMC_KERN_DEV" bs=512 count=8 + sync + } + export EMMC_ROOTFS_BLOCKS=$(($(tar xf "$tar_file" ${board_dir}/root -O | dd of="$EMMC_ROOT_DEV" bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) # Account for 64KiB ROOTDEV_OVERLAY_ALIGN in libfstools EMMC_ROOTFS_BLOCKS=$(((EMMC_ROOTFS_BLOCKS + 127) & ~127)) + sync } + [ "$has_kernel" = 1 -a "$EMMC_KERN_DEV" ] && + export EMMC_KERNEL_BLOCKS=$(($(tar xf "$tar_file" ${board_dir}/kernel -O | dd of="$EMMC_KERN_DEV" bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) + if [ -z "$UPGRADE_BACKUP" ]; then if [ "$EMMC_DATA_DEV" ]; then dd if=/dev/zero of="$EMMC_DATA_DEV" bs=512 count=8 diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 19c3073c74..61939be6de 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -71,6 +71,9 @@ define Package/uboot-envtools/install $(LN) fw_printenv $(1)/usr/sbin/fw_setenv $(INSTALL_BIN) ./files/fw_printsys $(1)/usr/sbin $(INSTALL_BIN) ./files/fw_setsys $(1)/usr/sbin + $(INSTALL_BIN) ./files/fw_loadenv $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/board.d + $(INSTALL_DATA) ./files/fw_defaults $(1)/etc/board.d/05_fw_defaults $(INSTALL_DIR) $(1)/lib $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib $(INSTALL_DIR) $(1)/etc/uci-defaults diff --git a/package/boot/uboot-envtools/files/fw_defaults b/package/boot/uboot-envtools/files/fw_defaults new file mode 100644 index 0000000000..42558aaa88 --- /dev/null +++ b/package/boot/uboot-envtools/files/fw_defaults @@ -0,0 +1,17 @@ +. /lib/functions/uci-defaults.sh + +fw_loadenv + +board_config_update + +[ -f /var/run/uboot-env/owrt_ssid -a -f /var/run/uboot-env/owrt_wifi_key ] && + ucidef_set_wireless all "$(cat /var/run/uboot-env/owrt_ssid)" sae-mixed "$(cat /var/run/uboot-env/owrt_wifi_key)" +[ -f /var/run/uboot-env/owrt_country ] && ucidef_set_country "$(cat /var/run/uboot-env/owrt_country)" +[ -f /var/run/uboot-env/owrt_ssh_auth_key ] && ucidef_set_ssh_authorized_key "$(cat /var/run/uboot-env/owrt_ssh_auth_key)" +[ -f /var/run/uboot-env/owrt_root_password_plain ] && ucidef_set_root_password_plain "$(cat /var/run/uboot-env/owrt_root_password_plain)" +[ -f /var/run/uboot-env/owrt_root_password_hash ] && ucidef_set_root_password_hash "$(cat /var/run/uboot-env/owrt_root_password_hash)" +[ -f /var/run/uboot-env/owrt_timezone ] && ucidef_set_timezone "$(cat /var/run/uboot-env/owrt_timezone)" + +board_config_flush + +exit 0 diff --git a/package/boot/uboot-envtools/files/fw_loadenv b/package/boot/uboot-envtools/files/fw_loadenv new file mode 100644 index 0000000000..9fe302ce89 --- /dev/null +++ b/package/boot/uboot-envtools/files/fw_loadenv @@ -0,0 +1,26 @@ +#!/usr/bin/ucode + +'use strict'; + +const path = '/var/run/uboot-env/'; + +import * as fs from 'fs'; + +if (fs.lsdir(path)) { + warn(`env has already been loaded to ${path}\n`); + exit(0); +} + +let fp = fs.popen('fw_printenv'); +let raw = fp.read('all'); +fp.close(); + +if (!length(raw)) + exit(0); + +fs.mkdir(path); +for (let line in split(raw, '\n')) { + let vals = split(line, '='); + if (vals[0] && vals[1]) + fs.writefile(path + vals[0], vals[1]); +} diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 7338e5d868..afeee805a0 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_VERSION:=2020.04 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 diff --git a/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch b/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch index c6aced4221..bdf82ebea5 100644 --- a/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch +++ b/package/boot/uboot-kirkwood/patches/180-netgear-stora.patch @@ -230,7 +230,7 @@ + --- /dev/null +++ b/board/Marvell/netgear_ms2110/netgear_ms2110.c -@@ -0,0 +1,151 @@ +@@ -0,0 +1,152 @@ +/* + * Copyright (C) 2014-2017 bodhi + * @@ -264,6 +264,7 @@ +#include +#include +#include "netgear_ms2110.h" ++#include +#include + +DECLARE_GLOBAL_DATA_PTR; diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 4cf874b368..00bc29f13e 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,6 +1,6 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -111,4 +111,7 @@ source "board/alliedtelesis/SBx81LIFXCAT +@@ -115,4 +115,7 @@ source "board/alliedtelesis/SBx81LIFXCAT source "board/Marvell/db-88f6281-bp/Kconfig" source "board/checkpoint/l-50/Kconfig" diff --git a/package/kernel/ath10k-ct/patches/010-api_update.patch b/package/kernel/ath10k-ct/patches/010-api_update.patch new file mode 100644 index 0000000000..c0d2574748 --- /dev/null +++ b/package/kernel/ath10k-ct/patches/010-api_update.patch @@ -0,0 +1,11 @@ +--- a/ath10k-6.9/mac.c ++++ b/ath10k-6.9/mac.c +@@ -6238,7 +6238,7 @@ err: + return ret; + } + +-static void ath10k_stop(struct ieee80211_hw *hw) ++static void ath10k_stop(struct ieee80211_hw *hw, bool suspend) + { + struct ath10k *ar = hw->priv; + u32 opt; diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 099bdae46f..026d3e5f82 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=6.9.9 +PKG_VERSION:=6.11 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -PKG_HASH:=3417da091a57c7b1c145d44c1fae9f1e0bac6d0c8ad61b37e57b0a802eeb2837 +PKG_HASH:=2c091ce9520c2e4c8a9c91a294f3c040f90cd76222674928e61542ead06cfa41 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch index 0f6a570cb0..5f5ac20ddb 100644 --- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch @@ -82,7 +82,7 @@ help --- a/local-symbols +++ b/local-symbols -@@ -94,6 +94,7 @@ ADM8211= +@@ -96,6 +96,7 @@ ADM8211= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch index c41bfa8888..10d95d36bf 100644 --- a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch +++ b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/Kconfig +++ b/drivers/net/wireless/ath/ath10k/Kconfig -@@ -88,6 +88,12 @@ config ATH10K_TRACING +@@ -94,6 +94,12 @@ config ATH10K_TRACING help Select this to ath10k use tracing infrastructure. @@ -21,9 +21,9 @@ ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o -ath10k_core-$(CONFIG_THERMAL) += thermal.o +ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o + ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o ath10k_core-$(CONFIG_PM) += wow.o - ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o --- a/drivers/net/wireless/ath/ath10k/thermal.h +++ b/drivers/net/wireless/ath/ath10k/thermal.h @@ -25,7 +25,7 @@ struct ath10k_thermal { @@ -37,9 +37,9 @@ void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); --- a/local-symbols +++ b/local-symbols -@@ -153,6 +153,7 @@ ATH10K_SNOC= - ATH10K_DEBUG= +@@ -156,6 +156,7 @@ ATH10K_DEBUG= ATH10K_DEBUGFS= + ATH10K_LEDS= ATH10K_SPECTRAL= +ATH10K_THERMAL= ATH10K_TRACING= diff --git a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch index 479c74e473..a7e11679a3 100644 --- a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3527,6 +3527,16 @@ int ath10k_core_register(struct ath10k * +@@ -3539,6 +3539,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch index c9ad4018c8..b13bc33498 100644 --- a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9918,6 +9918,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -9919,6 +9919,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -10280,6 +10295,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -10281,6 +10296,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch deleted file mode 100644 index a9eb38e576..0000000000 --- a/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch +++ /dev/null @@ -1,626 +0,0 @@ -From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 -From: Sebastian Gottschall -Date: Mon, 13 May 2024 17:22:25 +0300 -Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for - various chipsets - -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 -based chipsets with on chipset connected led's using WMI Firmware API. -The LED device will get available named as "ath10k-phyX" at sysfs and -can be controlled with various triggers. -Adds also debugfs interface for gpio control. - -Signed-off-by: Sebastian Gottschall -Reviewed-by: Steve deRosier -[kvalo: major reorg and cleanup] -Signed-off-by: Kalle Valo -[ansuel: rebase and small cleanup] -Signed-off-by: Christian Marangi -Tested-by: Stefan Lippers-Hollmann -Signed-off-by: Kalle Valo -Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com ---- - drivers/net/wireless/ath/ath10k/Kconfig | 6 ++ - drivers/net/wireless/ath/ath10k/Makefile | 1 + - drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++ - drivers/net/wireless/ath/ath10k/core.h | 8 ++ - drivers/net/wireless/ath/ath10k/hw.h | 1 + - drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++ - drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++ - drivers/net/wireless/ath/ath10k/mac.c | 1 + - drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++ - drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + - drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++ - drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++ - 12 files changed, 296 insertions(+) - create mode 100644 drivers/net/wireless/ath/ath10k/leds.c - create mode 100644 drivers/net/wireless/ath/ath10k/leds.h - ---- a/drivers/net/wireless/ath/ath10k/Kconfig -+++ b/drivers/net/wireless/ath/ath10k/Kconfig -@@ -73,6 +73,12 @@ config ATH10K_DEBUGFS - - If unsure, say Y to make it easier to debug problems. - -+config ATH10K_LEDS -+ bool -+ depends on ATH10K -+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 -+ default y -+ - config ATH10K_SPECTRAL - bool "Atheros ath10k spectral scan support" - depends on ATH10K_DEBUGFS ---- a/drivers/net/wireless/ath/ath10k/Makefile -+++ b/drivers/net/wireless/ath/ath10k/Makefile -@@ -19,6 +19,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += - ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o - ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o - ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o -+ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o - ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o - ath10k_core-$(CONFIG_PM) += wow.o - ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o ---- a/local-symbols -+++ b/local-symbols -@@ -154,6 +154,7 @@ ATH10K_DEBUG= - ATH10K_DEBUGFS= - ATH10K_SPECTRAL= - ATH10K_THERMAL= -+ATH10K_LEDS= - ATH10K_TRACING= - ATH10K_DFS_CERTIFIED= - WCN36XX= ---- a/drivers/net/wireless/ath/ath10k/core.c -+++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -27,6 +27,7 @@ - #include "testmode.h" - #include "wmi-ops.h" - #include "coredump.h" -+#include "leds.h" - - unsigned int ath10k_debug_mask; - EXPORT_SYMBOL(ath10k_debug_mask); -@@ -68,6 +69,7 @@ static const struct ath10k_hw_params ath - .name = "qca988x hw2.0", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -109,6 +111,7 @@ static const struct ath10k_hw_params ath - .name = "qca988x hw2.0 ubiquiti", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -151,6 +154,7 @@ static const struct ath10k_hw_params ath - .name = "qca9887 hw1.0", - .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -193,6 +197,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.2 sdio", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -230,6 +235,7 @@ static const struct ath10k_hw_params ath - .name = "qca6164 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -271,6 +277,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -312,6 +319,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.0", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -353,6 +361,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.2", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -398,6 +407,7 @@ static const struct ath10k_hw_params ath - .name = "qca99x0 hw2.0", - .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, - .cck_rate_map_rev2 = true, -@@ -445,6 +455,7 @@ static const struct ath10k_hw_params ath - .name = "qca9984/qca9994 hw1.0", - .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -499,6 +510,7 @@ static const struct ath10k_hw_params ath - .name = "qca9888 hw2.0", - .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -550,6 +562,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.0", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -591,6 +604,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.1", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -634,6 +648,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.1 sdio", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -668,6 +683,7 @@ static const struct ath10k_hw_params ath - .name = "qca4019 hw1.0", - .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x0010000, - .continuous_frag_desc = true, -@@ -714,6 +730,7 @@ static const struct ath10k_hw_params ath - .dev_id = 0, - .bus = ATH10K_BUS_SNOC, - .name = "wcn3990 hw1.0", -+ .led_pin = 0, - .continuous_frag_desc = true, - .tx_chain_mask = 0x7, - .rx_chain_mask = 0x7, -@@ -3242,6 +3259,10 @@ int ath10k_core_start(struct ath10k *ar, - goto err_hif_stop; - } - -+ status = ath10k_leds_start(ar); -+ if (status) -+ goto err_hif_stop; -+ - return 0; - - err_hif_stop: -@@ -3500,9 +3521,18 @@ static void ath10k_core_register_work(st - goto err_spectral_destroy; - } - -+ status = ath10k_leds_register(ar); -+ if (status) { -+ ath10k_err(ar, "could not register leds: %d\n", -+ status); -+ goto err_thermal_unregister; -+ } -+ - set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags); - return; - -+err_thermal_unregister: -+ ath10k_thermal_unregister(ar); - err_spectral_destroy: - ath10k_spectral_destroy(ar); - err_debug_destroy: -@@ -3548,6 +3578,8 @@ void ath10k_core_unregister(struct ath10 - if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) - return; - -+ ath10k_leds_unregister(ar); -+ - ath10k_thermal_unregister(ar); - /* Stop spectral before unregistering from mac80211 to remove the - * relayfs debugfs file cleanly. Otherwise the parent debugfs tree ---- a/drivers/net/wireless/ath/ath10k/core.h -+++ b/drivers/net/wireless/ath/ath10k/core.h -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "htt.h" - #include "htc.h" -@@ -1257,6 +1258,13 @@ struct ath10k { - } testmode; - - struct { -+ struct gpio_led wifi_led; -+ struct led_classdev cdev; -+ char label[48]; -+ u32 gpio_state_pin; -+ } leds; -+ -+ struct { - /* protected by data_lock */ - u32 rx_crc_err_drop; - u32 fw_crash_counter; ---- a/drivers/net/wireless/ath/ath10k/hw.h -+++ b/drivers/net/wireless/ath/ath10k/hw.h -@@ -521,6 +521,7 @@ struct ath10k_hw_params { - const char *name; - u32 patch_load_addr; - int uart_pin; -+ int led_pin; - u32 otp_exe_param; - - /* Type of hw cycle counter wraparound logic, for more info ---- /dev/null -+++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -0,0 +1,90 @@ -+// SPDX-License-Identifier: ISC -+/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. -+ */ -+ -+#include -+ -+#include "core.h" -+#include "wmi.h" -+#include "wmi-ops.h" -+ -+#include "leds.h" -+ -+static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev, -+ enum led_brightness brightness) -+{ -+ struct ath10k *ar = container_of(led_cdev, struct ath10k, -+ leds.cdev); -+ struct gpio_led *led = &ar->leds.wifi_led; -+ -+ mutex_lock(&ar->conf_mutex); -+ -+ if (ar->state != ATH10K_STATE_ON) -+ goto out; -+ -+ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low; -+ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin); -+ -+out: -+ mutex_unlock(&ar->conf_mutex); -+ -+ return 0; -+} -+ -+int ath10k_leds_start(struct ath10k *ar) -+{ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return 0; -+ -+ /* under some circumstances, the gpio pin gets reconfigured -+ * to default state by the firmware, so we need to -+ * reconfigure it this behaviour has only ben seen on -+ * QCA9984 and QCA99XX devices so far -+ */ -+ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0, -+ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE); -+ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1); -+ -+ return 0; -+} -+ -+int ath10k_leds_register(struct ath10k *ar) -+{ -+ int ret; -+ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return 0; -+ -+ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s", -+ wiphy_name(ar->hw->wiphy)); -+ ar->leds.wifi_led.active_low = 1; -+ ar->leds.wifi_led.gpio = ar->hw_params.led_pin; -+ ar->leds.wifi_led.name = ar->leds.label; -+ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP; -+ -+ ar->leds.cdev.name = ar->leds.label; -+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; -+ -+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+void ath10k_leds_unregister(struct ath10k *ar) -+{ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return; -+ -+ led_classdev_unregister(&ar->leds.cdev); -+} -+ ---- /dev/null -+++ b/drivers/net/wireless/ath/ath10k/leds.h -@@ -0,0 +1,34 @@ -+/* SPDX-License-Identifier: ISC */ -+/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. -+ */ -+ -+#ifndef _LEDS_H_ -+#define _LEDS_H_ -+ -+#include "core.h" -+ -+#ifdef CPTCFG_ATH10K_LEDS -+void ath10k_leds_unregister(struct ath10k *ar); -+int ath10k_leds_start(struct ath10k *ar); -+int ath10k_leds_register(struct ath10k *ar); -+#else -+static inline void ath10k_leds_unregister(struct ath10k *ar) -+{ -+} -+ -+static inline int ath10k_leds_start(struct ath10k *ar) -+{ -+ return 0; -+} -+ -+static inline int ath10k_leds_register(struct ath10k *ar) -+{ -+ return 0; -+} -+ -+#endif -+#endif /* _LEDS_H_ */ ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -25,6 +25,7 @@ - #include "wmi-tlv.h" - #include "wmi-ops.h" - #include "wow.h" -+#include "leds.h" - - /*********/ - /* Rates */ ---- a/drivers/net/wireless/ath/ath10k/wmi-ops.h -+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h -@@ -226,7 +226,10 @@ struct wmi_ops { - const struct wmi_bb_timing_cfg_arg *arg); - struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, - const struct wmi_per_peer_per_tid_cfg_arg *arg); -+ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num, -+ u32 input, u32 pull_type, u32 intr_mode); - -+ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set); - }; - - int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); -@@ -1122,6 +1125,35 @@ ath10k_wmi_force_fw_hang(struct ath10k * - return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); - } - -+static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num, -+ u32 input, u32 pull_type, u32 intr_mode) -+{ -+ struct sk_buff *skb; -+ -+ if (!ar->wmi.ops->gen_gpio_config) -+ return -EOPNOTSUPP; -+ -+ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode); -+ if (IS_ERR(skb)) -+ return PTR_ERR(skb); -+ -+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid); -+} -+ -+static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set) -+{ -+ struct sk_buff *skb; -+ -+ if (!ar->wmi.ops->gen_gpio_config) -+ return -EOPNOTSUPP; -+ -+ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set); -+ if (IS_ERR(skb)) -+ return PTR_ERR(skb); -+ -+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid); -+} -+ - static inline int - ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) - { ---- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c -+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -4606,6 +4606,8 @@ static const struct wmi_ops wmi_tlv_ops - .gen_echo = ath10k_wmi_tlv_op_gen_echo, - .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, - .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, -+ /* .gen_gpio_config not implemented */ -+ /* .gen_gpio_output not implemented */ - }; - - static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { ---- a/drivers/net/wireless/ath/ath10k/wmi.c -+++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7493,6 +7493,49 @@ ath10k_wmi_op_gen_peer_set_param(struct - return skb; - } - -+static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar, -+ u32 gpio_num, u32 input, -+ u32 pull_type, u32 intr_mode) -+{ -+ struct wmi_gpio_config_cmd *cmd; -+ struct sk_buff *skb; -+ -+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ cmd = (struct wmi_gpio_config_cmd *)skb->data; -+ cmd->pull_type = __cpu_to_le32(pull_type); -+ cmd->gpio_num = __cpu_to_le32(gpio_num); -+ cmd->input = __cpu_to_le32(input); -+ cmd->intr_mode = __cpu_to_le32(intr_mode); -+ -+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n", -+ gpio_num, input, pull_type, intr_mode); -+ -+ return skb; -+} -+ -+static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar, -+ u32 gpio_num, u32 set) -+{ -+ struct wmi_gpio_output_cmd *cmd; -+ struct sk_buff *skb; -+ -+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ cmd = (struct wmi_gpio_output_cmd *)skb->data; -+ cmd->gpio_num = __cpu_to_le32(gpio_num); -+ cmd->set = __cpu_to_le32(set); -+ -+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n", -+ gpio_num, set); -+ -+ return skb; -+} -+ - static struct sk_buff * - ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, - enum wmi_sta_ps_mode psmode) -@@ -9157,6 +9200,9 @@ static const struct wmi_ops wmi_ops = { - .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, - .gen_echo = ath10k_wmi_op_gen_echo, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, -+ - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9227,6 +9273,8 @@ static const struct wmi_ops wmi_10_1_ops - .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, - .gen_echo = ath10k_wmi_op_gen_echo, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9299,6 +9347,8 @@ static const struct wmi_ops wmi_10_2_ops - .gen_delba_send = ath10k_wmi_op_gen_delba_send, - .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_pdev_enable_adaptive_cca not implemented */ - }; - -@@ -9370,6 +9420,8 @@ static const struct wmi_ops wmi_10_2_4_o - ath10k_wmi_op_gen_pdev_enable_adaptive_cca, - .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, - .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9451,6 +9503,8 @@ static const struct wmi_ops wmi_10_4_ops - .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, - .gen_echo = ath10k_wmi_op_gen_echo, - .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - }; - - int ath10k_wmi_attach(struct ath10k *ar) ---- a/drivers/net/wireless/ath/ath10k/wmi.h -+++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -3034,6 +3034,41 @@ enum wmi_10_4_feature_mask { - - }; - -+/* WMI_GPIO_CPTCFG_CMDID */ -+enum { -+ WMI_GPIO_PULL_NONE, -+ WMI_GPIO_PULL_UP, -+ WMI_GPIO_PULL_DOWN, -+}; -+ -+enum { -+ WMI_GPIO_INTTYPE_DISABLE, -+ WMI_GPIO_INTTYPE_RISING_EDGE, -+ WMI_GPIO_INTTYPE_FALLING_EDGE, -+ WMI_GPIO_INTTYPE_BOTH_EDGE, -+ WMI_GPIO_INTTYPE_LEVEL_LOW, -+ WMI_GPIO_INTTYPE_LEVEL_HIGH -+}; -+ -+/* WMI_GPIO_CPTCFG_CMDID */ -+struct wmi_gpio_config_cmd { -+ __le32 gpio_num; /* GPIO number to be setup */ -+ __le32 input; /* 0 - Output/ 1 - Input */ -+ __le32 pull_type; /* Pull type defined above */ -+ __le32 intr_mode; /* Interrupt mode defined above (Input) */ -+} __packed; -+ -+/* WMI_GPIO_OUTPUT_CMDID */ -+struct wmi_gpio_output_cmd { -+ __le32 gpio_num; /* GPIO number to be setup */ -+ __le32 set; /* Set the GPIO pin*/ -+} __packed; -+ -+/* WMI_GPIO_INPUT_EVENTID */ -+struct wmi_gpio_input_event { -+ __le32 gpio_num; /* GPIO number which changed state */ -+} __packed; -+ - struct wmi_ext_resource_config_10_4_cmd { - /* contains enum wmi_host_platform_type */ - __le32 host_platform_config; diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch index 5bd9186d19..fc41f5f151 100644 --- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch @@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h -@@ -1313,6 +1313,10 @@ struct ath10k { +@@ -1315,6 +1315,10 @@ struct ath10k { s32 tx_power_2g_limit; s32 tx_power_5g_limit; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index 5d70df15ad..beec6a95ea 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3429,6 +3430,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3411,6 +3412,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr); diff --git a/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch b/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch index f1583b6e96..272876288b 100644 --- a/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch +++ b/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch @@ -93,9 +93,9 @@ Signed-off-by: Robert Marko default: return "UNKNOWN"; } -@@ -282,27 +312,14 @@ static void ath11k_mhi_op_status_cb(stru - if (!(test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags))) +@@ -290,6 +320,9 @@ static void ath11k_mhi_op_status_cb(stru queue_work(ab->workqueue_aux, &ab->reset_work); + break; + case MHI_CB_EE_SBL_MODE: + ath11k_mhi_qrtr_instance_set(mhi_cntrl); @@ -103,6 +103,8 @@ Signed-off-by: Robert Marko default: break; } +@@ -297,22 +330,6 @@ static void ath11k_mhi_op_status_cb(stru + ab_pci->mhi_pre_cb = cb; } -static int ath11k_mhi_op_read_reg(struct mhi_controller *mhi_cntrl, diff --git a/package/kernel/mac80211/patches/ath11k/101-wifi-ath11k-add-support-DT-ieee80211-freq-limit.patch b/package/kernel/mac80211/patches/ath11k/101-wifi-ath11k-add-support-DT-ieee80211-freq-limit.patch deleted file mode 100644 index 6088b26e6b..0000000000 --- a/package/kernel/mac80211/patches/ath11k/101-wifi-ath11k-add-support-DT-ieee80211-freq-limit.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 1338da257f299d35b4d954b9fda2cc7e0a54a69d Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Sun, 11 Jun 2023 14:37:32 +0200 -Subject: [PATCH] wifi: ath11k: add support DT ieee80211-freq-limit - -The common DT property can be used to limit the available -channels/frequencies. But ath11k has to manually call -wiphy_read_of_freq_limits(). - -Signed-off-by: Christian Lamparter ---- - drivers/net/wireless/ath/ath11k/mac.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -10034,6 +10034,7 @@ static int __ath11k_mac_register(struct - if (ret) - goto err; - -+ wiphy_read_of_freq_limits(ar->hw->wiphy); - ath11k_mac_setup_ht_vht_cap(ar, cap, &ht_cap); - ath11k_mac_setup_he_cap(ar, cap); - diff --git a/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch b/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch index 6b351cc81d..6a0e4ff77e 100644 --- a/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch +++ b/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch @@ -21,7 +21,7 @@ Signed-off-by: Robert Marko --- a/drivers/net/wireless/ath/ath11k/Kconfig +++ b/drivers/net/wireless/ath/ath11k/Kconfig -@@ -61,3 +61,10 @@ config ATH11K_SPECTRAL +@@ -62,3 +62,10 @@ config ATH11K_SPECTRAL Enable ath11k spectral scan support Say Y to enable access to the FFT/spectral data via debugfs. @@ -34,7 +34,7 @@ Signed-off-by: Robert Marko + Enable ath11k thermal sensors and throttling support. --- a/drivers/net/wireless/ath/ath11k/Makefile +++ b/drivers/net/wireless/ath/ath11k/Makefile -@@ -23,7 +23,7 @@ ath11k-y += core.o \ +@@ -24,7 +24,7 @@ ath11k-y += core.o \ ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o ath11k-$(CPTCFG_NL80211_TESTMODE) += testmode.o ath11k-$(CPTCFG_ATH11K_TRACING) += trace.o @@ -56,11 +56,11 @@ Signed-off-by: Robert Marko int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state); --- a/local-symbols +++ b/local-symbols -@@ -166,6 +166,7 @@ ATH11K_DEBUG= +@@ -168,6 +168,7 @@ ATH11K_DEBUG= ATH11K_DEBUGFS= ATH11K_TRACING= ATH11K_SPECTRAL= +ATH11K_THERMAL= ATH12K= ATH12K_DEBUG= - ATH12K_TRACING= + ATH12K_DEBUGFS= diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch index dcf1f5f276..1250147e2b 100644 --- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch +++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko { .hw_rev = ATH11K_HW_IPQ8074, .name = "ipq8074 hw2.0", -@@ -2138,7 +2138,8 @@ static void ath11k_core_reset(struct wor +@@ -2147,7 +2147,8 @@ static void ath11k_core_reset(struct wor static int ath11k_init_hw_params(struct ath11k_base *ab) { const struct ath11k_hw_params *hw_params = NULL; @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) { hw_params = &ath11k_hw_params[i]; -@@ -2154,7 +2155,31 @@ static int ath11k_init_hw_params(struct +@@ -2163,7 +2164,31 @@ static int ath11k_init_hw_params(struct ab->hw_params = *hw_params; diff --git a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch index 19f4e7dbe2..f30e03475f 100644 --- a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch +++ b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch @@ -23,7 +23,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -363,134 +363,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p +@@ -361,134 +361,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p return flags; } @@ -158,7 +158,7 @@ Signed-off-by: Aditya Kumar Singh static const char * ath11k_reg_get_regdom_str(enum nl80211_dfs_regions dfs_region) { -@@ -641,11 +513,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211 +@@ -639,11 +511,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211 struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -172,7 +172,7 @@ Signed-off-by: Aditya Kumar Singh struct cur_reg_rule *reg_rule, *reg_rule_6ghz; u8 i = 0, j = 0, k = 0; u8 num_rules; -@@ -688,26 +560,26 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -686,26 +558,26 @@ ath11k_reg_build_regd(struct ath11k_base } if (!num_rules) @@ -206,7 +206,7 @@ Signed-off-by: Aditya Kumar Singh reg_info->dfs_region, num_rules); /* Update reg_rules[] below. Firmware is expected to * send these rules in order(2 GHz rules first and then 5 GHz) -@@ -746,7 +618,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -744,7 +616,7 @@ ath11k_reg_build_regd(struct ath11k_base flags |= ath11k_map_fw_reg_flags(reg_rule->flags); flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); @@ -215,7 +215,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, -@@ -761,7 +633,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -759,7 +631,7 @@ ath11k_reg_build_regd(struct ath11k_base reg_info->dfs_region == ATH11K_DFS_REG_ETSI && (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_LOW && reg_rule->start_freq < ETSI_WEATHER_RADAR_BAND_HIGH)){ @@ -224,7 +224,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule, &i, flags, max_bw); continue; -@@ -772,51 +644,23 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -770,51 +642,23 @@ ath11k_reg_build_regd(struct ath11k_base "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n", i + 1, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, @@ -279,7 +279,7 @@ Signed-off-by: Aditya Kumar Singh static enum wmi_vdev_type ath11k_reg_get_ar_vdev_type(struct ath11k *ar) { struct ath11k_vif *arvif; -@@ -839,7 +683,6 @@ int ath11k_reg_handle_chan_list(struct a +@@ -837,7 +681,6 @@ int ath11k_reg_handle_chan_list(struct a enum ieee80211_ap_reg_power power_type) { struct ieee80211_regdomain *regd; @@ -287,7 +287,7 @@ Signed-off-by: Aditya Kumar Singh int pdev_idx; struct ath11k *ar; enum wmi_vdev_type vdev_type; -@@ -891,24 +734,14 @@ int ath11k_reg_handle_chan_list(struct a +@@ -889,24 +732,14 @@ int ath11k_reg_handle_chan_list(struct a (char *)reg_info->alpha2, 2)) goto retfail; diff --git a/package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch index 3abf16b03e..d806782889 100644 --- a/package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch +++ b/package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -89,7 +89,7 @@ int ath_descdma_setup(struct ath_softc * +@@ -90,7 +90,7 @@ int ath_descdma_setup(struct ath_softc * (_l) &= ((_sz) - 1); \ } while (0) diff --git a/package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch index a085e3a1fb..6b60d3c089 100644 --- a/package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch +++ b/package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch @@ -20,7 +20,7 @@ #define AR9160_DEVID_PCI 0x0027 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -774,6 +774,7 @@ static const struct pci_device_id ath_pc +@@ -772,6 +772,7 @@ static const struct pci_device_id ath_pc .driver_data = ATH9K_PCI_BT_ANT_DIV }, #endif diff --git a/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch index 1b2d4cb5d4..71a6dd9f00 100644 --- a/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -844,6 +844,9 @@ static inline int ath9k_dump_btcoex(stru +@@ -845,6 +845,9 @@ static inline int ath9k_dump_btcoex(stru #ifdef CPTCFG_MAC80211_LEDS void ath_init_leds(struct ath_softc *sc); void ath_deinit_leds(struct ath_softc *sc); @@ -10,7 +10,7 @@ #else static inline void ath_init_leds(struct ath_softc *sc) { -@@ -980,6 +983,13 @@ void ath_ant_comb_scan(struct ath_softc +@@ -981,6 +984,13 @@ void ath_ant_comb_scan(struct ath_softc #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */ @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1033,9 +1043,8 @@ struct ath_softc { +@@ -1034,9 +1044,8 @@ struct ath_softc { spinlock_t chan_lock; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch index 643d51285b..9fb549cc19 100644 --- a/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch +++ b/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau #include "common.h" #include "debug.h" -@@ -990,6 +991,14 @@ struct ath_led { +@@ -991,6 +992,14 @@ struct ath_led { struct led_classdev cdev; }; @@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1045,6 +1054,9 @@ struct ath_softc { +@@ -1046,6 +1055,9 @@ struct ath_softc { #ifdef CPTCFG_MAC80211_LEDS const char *led_default_trigger; struct list_head leds; @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau #ifdef CPTCFG_ATH9K_DEBUGFS --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c -@@ -16,13 +16,139 @@ +@@ -16,13 +16,135 @@ #include "ath9k.h" #include @@ -127,11 +127,7 @@ Signed-off-by: Felix Fietkau + snprintf(gc->label, sizeof(gc->label), "ath9k-%s", + wiphy_name(sc->hw->wiphy)); +#ifdef CONFIG_OF -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) + gc->gchip.parent = sc->dev; -+#else -+ gc->gchip.dev = sc->dev; -+#endif +#endif + gc->gchip.label = gc->label; + gc->gchip.base = -1; /* determine base automatically */ @@ -187,7 +183,7 @@ Signed-off-by: Felix Fietkau static void ath_fill_led_pin(struct ath_softc *sc) { struct ath_hw *ah = sc->sc_ah; -@@ -80,6 +206,12 @@ static int ath_add_led(struct ath_softc +@@ -80,6 +202,12 @@ static int ath_add_led(struct ath_softc else ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); @@ -200,7 +196,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -136,17 +268,24 @@ void ath_deinit_leds(struct ath_softc *s +@@ -136,17 +264,24 @@ void ath_deinit_leds(struct ath_softc *s while (!list_empty(&sc->leds)) { led = list_first_entry(&sc->leds, struct ath_led, list); @@ -225,7 +221,7 @@ Signed-off-by: Felix Fietkau char led_name[32]; const char *trigger; int i; -@@ -156,6 +295,15 @@ void ath_init_leds(struct ath_softc *sc) +@@ -156,6 +291,15 @@ void ath_init_leds(struct ath_softc *sc) if (AR_SREV_9100(sc->sc_ah)) return; @@ -241,7 +237,7 @@ Signed-off-by: Felix Fietkau ath_fill_led_pin(sc); if (pdata && pdata->leds && pdata->num_leds) -@@ -180,6 +328,7 @@ void ath_init_leds(struct ath_softc *sc) +@@ -180,6 +324,7 @@ void ath_init_leds(struct ath_softc *sc) ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); } diff --git a/package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch index 0b2acf8af1..d164d89031 100644 --- a/package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch +++ b/package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -1056,6 +1056,7 @@ struct ath_softc { +@@ -1057,6 +1057,7 @@ struct ath_softc { struct list_head leds; #ifdef CONFIG_GPIOLIB struct ath9k_gpio_chip *gpiochip; @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau #ifdef CPTCFG_MAC80211_LEDS -@@ -133,6 +135,67 @@ static void ath9k_unregister_gpio_chip(s +@@ -129,6 +131,67 @@ static void ath9k_unregister_gpio_chip(s sc->gpiochip = NULL; } @@ -97,7 +97,7 @@ Signed-off-by: Felix Fietkau #else /* CONFIG_GPIOLIB */ static inline void ath9k_register_gpio_chip(struct ath_softc *sc) -@@ -143,6 +206,14 @@ static inline void ath9k_unregister_gpio +@@ -139,6 +202,14 @@ static inline void ath9k_unregister_gpio { } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau #endif /* CONFIG_GPIOLIB */ /********************************/ -@@ -266,6 +337,7 @@ void ath_deinit_leds(struct ath_softc *s +@@ -262,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s { struct ath_led *led; @@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau while (!list_empty(&sc->leds)) { led = list_first_entry(&sc->leds, struct ath_led, list); #ifdef CONFIG_GPIOLIB -@@ -305,6 +377,7 @@ void ath_init_leds(struct ath_softc *sc) +@@ -301,6 +373,7 @@ void ath_init_leds(struct ath_softc *sc) } ath_fill_led_pin(sc); diff --git a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch index 4e4cab986b..3ccd3fc487 100644 --- a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch @@ -371,7 +371,7 @@ --- a/local-symbols +++ b/local-symbols -@@ -121,6 +121,7 @@ ATH9K_WOW= +@@ -123,6 +123,7 @@ ATH9K_WOW= ATH9K_RFKILL= ATH9K_CHANNEL_CONTEXT= ATH9K_PCOEM= diff --git a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch index a4efdcd1bc..3adc8bb8d6 100644 --- a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch +++ b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch @@ -272,7 +272,7 @@ #include "common.h" #include "debug.h" -@@ -1012,6 +1013,9 @@ struct ath_softc { +@@ -1013,6 +1014,9 @@ struct ath_softc { struct ath_hw *sc_ah; void __iomem *mem; int irq; diff --git a/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch index f873528e26..25f0d254c0 100644 --- a/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch +++ b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch @@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct brcmf_mp_device *settings) { -@@ -113,6 +143,8 @@ void brcmf_of_probe(struct device *dev, +@@ -114,6 +144,8 @@ void brcmf_of_probe(struct device *dev, of_node_put(root); } diff --git a/package/kernel/mac80211/patches/brcm/865-brcmfmac-disable-dump_survey-on-bcm2835.patch b/package/kernel/mac80211/patches/brcm/865-brcmfmac-disable-dump_survey-on-bcm2835.patch index 975647444f..275f0aa166 100644 --- a/package/kernel/mac80211/patches/brcm/865-brcmfmac-disable-dump_survey-on-bcm2835.patch +++ b/package/kernel/mac80211/patches/brcm/865-brcmfmac-disable-dump_survey-on-bcm2835.patch @@ -9,7 +9,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -7979,6 +7979,7 @@ static s32 brcmf_translate_country_code( +@@ -7986,6 +7986,7 @@ static s32 brcmf_translate_country_code( return 0; } @@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas static int brcmf_parse_dump_obss(char *buf, struct brcmf_dump_survey *survey) { -@@ -8201,6 +8202,7 @@ exit: +@@ -8208,6 +8209,7 @@ exit: brcmf_set_mpc(ifp, 1); return err; } @@ -25,7 +25,7 @@ Signed-off-by: Álvaro Fernández Rojas static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, struct regulatory_request *req) -@@ -8353,8 +8355,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -8360,8 +8362,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802 if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK)) ops->set_rekey_data = brcmf_cfg80211_set_rekey_data; #endif diff --git a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch deleted file mode 100644 index 0dad745b4f..0000000000 --- a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch +++ /dev/null @@ -1,314 +0,0 @@ ---- a/local-symbols -+++ b/local-symbols -@@ -471,43 +471,6 @@ USB_VL600= - USB_NET_CH9200= - USB_NET_AQC111= - USB_RTL8153_ECM= --SSB_POSSIBLE= --SSB= --SSB_SPROM= --SSB_BLOCKIO= --SSB_PCIHOST_POSSIBLE= --SSB_PCIHOST= --SSB_B43_PCI_BRIDGE= --SSB_PCMCIAHOST_POSSIBLE= --SSB_PCMCIAHOST= --SSB_SDIOHOST_POSSIBLE= --SSB_SDIOHOST= --SSB_HOST_SOC= --SSB_SERIAL= --SSB_DRIVER_PCICORE_POSSIBLE= --SSB_DRIVER_PCICORE= --SSB_PCICORE_HOSTMODE= --SSB_DRIVER_MIPS= --SSB_SFLASH= --SSB_EMBEDDED= --SSB_DRIVER_EXTIF= --SSB_DRIVER_GIGE= --SSB_DRIVER_GPIO= --BCMA_POSSIBLE= --BCMA= --BCMA_BLOCKIO= --BCMA_HOST_PCI_POSSIBLE= --BCMA_HOST_PCI= --BCMA_HOST_SOC= --BCMA_DRIVER_PCI= --BCMA_DRIVER_PCI_HOSTMODE= --BCMA_DRIVER_MIPS= --BCMA_PFLASH= --BCMA_SFLASH= --BCMA_NFLASH= --BCMA_DRIVER_GMAC_CMN= --BCMA_DRIVER_GPIO= --BCMA_DEBUG= - USB_ACM= - USB_PRINTER= - USB_WDM= ---- a/drivers/net/wireless/broadcom/b43/Kconfig -+++ b/drivers/net/wireless/broadcom/b43/Kconfig -@@ -63,21 +63,21 @@ endchoice - config B43_PCI_AUTOSELECT - bool - depends on B43 && SSB_PCIHOST_POSSIBLE -- select SSB_PCIHOST -- select SSB_B43_PCI_BRIDGE -+ depends on SSB_PCIHOST -+ depends on SSB_B43_PCI_BRIDGE - default y - - # Auto-select SSB PCICORE driver, if possible - config B43_PCICORE_AUTOSELECT - bool - depends on B43 && SSB_DRIVER_PCICORE_POSSIBLE -- select SSB_DRIVER_PCICORE -+ depends on SSB_DRIVER_PCICORE - default y - - config B43_SDIO - bool "Broadcom 43xx SDIO device support" - depends on B43 && B43_SSB && SSB_SDIOHOST_POSSIBLE -- select SSB_SDIOHOST -+ depends on SSB_SDIOHOST - help - Broadcom 43xx device support for Soft-MAC SDIO devices. - -@@ -96,13 +96,13 @@ config B43_SDIO - config B43_BCMA_PIO - bool - depends on B43 && B43_BCMA -- select BCMA_BLOCKIO -+ depends on BCMA_BLOCKIO - default y - - config B43_PIO - bool - depends on B43 && B43_SSB -- select SSB_BLOCKIO -+ depends on SSB_BLOCKIO - default y - - config B43_PHY_G ---- a/drivers/net/wireless/broadcom/b43/main.c -+++ b/drivers/net/wireless/broadcom/b43/main.c -@@ -2854,7 +2854,7 @@ static struct ssb_device *b43_ssb_gpio_d - { - struct ssb_bus *bus = dev->dev->sdev->bus; - --#ifdef CPTCFG_SSB_DRIVER_PCICORE -+#ifdef CONFIG_SSB_DRIVER_PCICORE - return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev); - #else - return bus->chipco.dev; -@@ -4873,7 +4873,7 @@ static int b43_wireless_core_init(struct - } - if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW) - hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */ --#if defined(CPTCFG_B43_SSB) && defined(CPTCFG_SSB_DRIVER_PCICORE) -+#if defined(CPTCFG_B43_SSB) && defined(CONFIG_SSB_DRIVER_PCICORE) - if (dev->dev->bus_type == B43_BUS_SSB && - dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI && - dev->dev->sdev->bus->pcicore.dev->id.revision <= 10) ---- a/drivers/net/wireless/broadcom/b43legacy/Kconfig -+++ b/drivers/net/wireless/broadcom/b43legacy/Kconfig -@@ -3,7 +3,7 @@ config B43LEGACY - tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)" - depends on m - depends on SSB_POSSIBLE && MAC80211 && HAS_DMA -- select SSB -+ depends on SSB - depends on FW_LOADER - help - b43legacy is a driver for 802.11b devices from Broadcom (BCM4301 and -@@ -25,15 +25,15 @@ config B43LEGACY - config B43LEGACY_PCI_AUTOSELECT - bool - depends on B43LEGACY && SSB_PCIHOST_POSSIBLE -- select SSB_PCIHOST -- select SSB_B43_PCI_BRIDGE -+ depends on SSB_PCIHOST -+ depends on SSB_B43_PCI_BRIDGE - default y - - # Auto-select SSB PCICORE driver, if possible - config B43LEGACY_PCICORE_AUTOSELECT - bool - depends on B43LEGACY && SSB_DRIVER_PCICORE_POSSIBLE -- select SSB_DRIVER_PCICORE -+ depends on SSB_DRIVER_PCICORE - default y - - # LED support ---- a/drivers/net/wireless/broadcom/b43legacy/main.c -+++ b/drivers/net/wireless/broadcom/b43legacy/main.c -@@ -1907,7 +1907,7 @@ static int b43legacy_gpio_init(struct b4 - if (dev->dev->id.revision >= 2) - mask |= 0x0010; /* FIXME: This is redundant. */ - --#ifdef CPTCFG_SSB_DRIVER_PCICORE -+#ifdef CONFIG_SSB_DRIVER_PCICORE - pcidev = bus->pcicore.dev; - #endif - gpiodev = bus->chipco.dev ? : pcidev; -@@ -1926,7 +1926,7 @@ static void b43legacy_gpio_cleanup(struc - struct ssb_bus *bus = dev->dev->bus; - struct ssb_device *gpiodev, *pcidev = NULL; - --#ifdef CPTCFG_SSB_DRIVER_PCICORE -+#ifdef CONFIG_SSB_DRIVER_PCICORE - pcidev = bus->pcicore.dev; - #endif - gpiodev = bus->chipco.dev ? : pcidev; ---- a/drivers/net/wireless/broadcom/brcm80211/Kconfig -+++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig -@@ -8,7 +8,7 @@ config BRCMSMAC - depends on m - depends on MAC80211 - depends on BCMA_POSSIBLE -- select BCMA -+ depends on BCMA - select BRCMUTIL - depends on FW_LOADER - depends on CORDIC ---- a/Kconfig.local -+++ b/Kconfig.local -@@ -1417,117 +1417,6 @@ config BACKPORTED_USB_NET_AQC111 - config BACKPORTED_USB_RTL8153_ECM - tristate - default USB_RTL8153_ECM --config BACKPORTED_SSB_POSSIBLE -- tristate -- default SSB_POSSIBLE --config BACKPORTED_SSB -- tristate -- default SSB --config BACKPORTED_SSB_SPROM -- tristate -- default SSB_SPROM --config BACKPORTED_SSB_BLOCKIO -- tristate -- default SSB_BLOCKIO --config BACKPORTED_SSB_PCIHOST_POSSIBLE -- tristate -- default SSB_PCIHOST_POSSIBLE --config BACKPORTED_SSB_PCIHOST -- tristate -- default SSB_PCIHOST --config BACKPORTED_SSB_B43_PCI_BRIDGE -- tristate -- default SSB_B43_PCI_BRIDGE --config BACKPORTED_SSB_PCMCIAHOST_POSSIBLE -- tristate -- default SSB_PCMCIAHOST_POSSIBLE --config BACKPORTED_SSB_PCMCIAHOST -- tristate -- default SSB_PCMCIAHOST --config BACKPORTED_SSB_SDIOHOST_POSSIBLE -- tristate -- default SSB_SDIOHOST_POSSIBLE --config BACKPORTED_SSB_SDIOHOST -- tristate -- default SSB_SDIOHOST --config BACKPORTED_SSB_HOST_SOC -- tristate -- default SSB_HOST_SOC --config BACKPORTED_SSB_SERIAL -- tristate -- default SSB_SERIAL --config BACKPORTED_SSB_DRIVER_PCICORE_POSSIBLE -- tristate -- default SSB_DRIVER_PCICORE_POSSIBLE --config BACKPORTED_SSB_DRIVER_PCICORE -- tristate -- default SSB_DRIVER_PCICORE --config BACKPORTED_SSB_PCICORE_HOSTMODE -- tristate -- default SSB_PCICORE_HOSTMODE --config BACKPORTED_SSB_DRIVER_MIPS -- tristate -- default SSB_DRIVER_MIPS --config BACKPORTED_SSB_SFLASH -- tristate -- default SSB_SFLASH --config BACKPORTED_SSB_EMBEDDED -- tristate -- default SSB_EMBEDDED --config BACKPORTED_SSB_DRIVER_EXTIF -- tristate -- default SSB_DRIVER_EXTIF --config BACKPORTED_SSB_DRIVER_GIGE -- tristate -- default SSB_DRIVER_GIGE --config BACKPORTED_SSB_DRIVER_GPIO -- tristate -- default SSB_DRIVER_GPIO --config BACKPORTED_BCMA_POSSIBLE -- tristate -- default BCMA_POSSIBLE --config BACKPORTED_BCMA -- tristate -- default BCMA --config BACKPORTED_BCMA_BLOCKIO -- tristate -- default BCMA_BLOCKIO --config BACKPORTED_BCMA_HOST_PCI_POSSIBLE -- tristate -- default BCMA_HOST_PCI_POSSIBLE --config BACKPORTED_BCMA_HOST_PCI -- tristate -- default BCMA_HOST_PCI --config BACKPORTED_BCMA_HOST_SOC -- tristate -- default BCMA_HOST_SOC --config BACKPORTED_BCMA_DRIVER_PCI -- tristate -- default BCMA_DRIVER_PCI --config BACKPORTED_BCMA_DRIVER_PCI_HOSTMODE -- tristate -- default BCMA_DRIVER_PCI_HOSTMODE --config BACKPORTED_BCMA_DRIVER_MIPS -- tristate -- default BCMA_DRIVER_MIPS --config BACKPORTED_BCMA_PFLASH -- tristate -- default BCMA_PFLASH --config BACKPORTED_BCMA_SFLASH -- tristate -- default BCMA_SFLASH --config BACKPORTED_BCMA_NFLASH -- tristate -- default BCMA_NFLASH --config BACKPORTED_BCMA_DRIVER_GMAC_CMN -- tristate -- default BCMA_DRIVER_GMAC_CMN --config BACKPORTED_BCMA_DRIVER_GPIO -- tristate -- default BCMA_DRIVER_GPIO --config BACKPORTED_BCMA_DEBUG -- tristate -- default BCMA_DEBUG - config BACKPORTED_USB_ACM - tristate - default USB_ACM ---- a/Kconfig.sources -+++ b/Kconfig.sources -@@ -10,9 +10,6 @@ source "$BACKPORT_DIR/drivers/soc/qcom/K - source "$BACKPORT_DIR/drivers/net/wireless/Kconfig" - source "$BACKPORT_DIR/drivers/net/usb/Kconfig" - --source "$BACKPORT_DIR/drivers/ssb/Kconfig" --source "$BACKPORT_DIR/drivers/bcma/Kconfig" -- - source "$BACKPORT_DIR/drivers/usb/class/Kconfig" - - source "$BACKPORT_DIR/drivers/staging/Kconfig" ---- a/Makefile.kernel -+++ b/Makefile.kernel -@@ -42,8 +42,6 @@ obj-$(CPTCFG_QRTR) += net/qrtr/ - obj-$(CPTCFG_QCOM_QMI_HELPERS) += drivers/soc/qcom/ - obj-$(CPTCFG_MHI_BUS) += drivers/bus/mhi/ - obj-$(CPTCFG_WLAN) += drivers/net/wireless/ --obj-$(CPTCFG_SSB) += drivers/ssb/ --obj-$(CPTCFG_BCMA) += drivers/bcma/ - obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/ - - obj-$(CPTCFG_USB_WDM) += drivers/usb/class/ diff --git a/package/kernel/mac80211/patches/build/090-bcma-otp.patch b/package/kernel/mac80211/patches/build/090-bcma-otp.patch deleted file mode 100644 index 3974776124..0000000000 --- a/package/kernel/mac80211/patches/build/090-bcma-otp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- /dev/null -+++ b/backport-include/linux/bcma/bcma_driver_chipcommon.h -@@ -0,0 +1,10 @@ -+#ifndef __BACKPORT_BCMA_DRIVER_CHIPCOMMON_H -+#define __BACKPORT_BCMA_DRIVER_CHIPCOMMON_H -+ -+#include_next -+ -+#ifndef BCMA_CC_SROM_CONTROL_OTP_PRESENT -+#define BCMA_CC_SROM_CONTROL_OTP_PRESENT 0x00000020 -+#endif -+ -+#endif diff --git a/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch b/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch index a3a65c2d2a..f4dc5508b1 100644 --- a/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch +++ b/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch @@ -54,9 +54,9 @@ Signed-off-by: Robert Marko + depends on MHI_BUS + depends on QRTR + depends on QRTR_MHI + select PCI_PWRCTL_PWRSEQ if HAVE_PWRCTL help This module adds support for PCIE bus - --- a/local-symbols +++ b/local-symbols @@ -59,14 +59,6 @@ MAC80211_MESH_PS_DEBUG= diff --git a/package/kernel/mac80211/patches/build/110-backport_namepace_const.patch b/package/kernel/mac80211/patches/build/110-backport_namepace_const.patch deleted file mode 100644 index 6dca708edf..0000000000 --- a/package/kernel/mac80211/patches/build/110-backport_namepace_const.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/wireless/sysfs.c -+++ b/net/wireless/sysfs.c -@@ -154,7 +154,11 @@ static SIMPLE_DEV_PM_OPS(wiphy_pm_ops, w - #define WIPHY_PM_OPS NULL - #endif - -+#if LINUX_VERSION_IS_GEQ(6,2,0) - static const void *wiphy_namespace(const struct device *d) -+#else -+static const void *wiphy_namespace(struct device *d) -+#endif - { - struct wiphy *wiphy = container_of(d, struct wiphy, dev); - diff --git a/package/kernel/mac80211/patches/build/120-headers_version_fix.patch b/package/kernel/mac80211/patches/build/120-headers_version_fix.patch index 21cf0b3134..29f500a4d0 100644 --- a/package/kernel/mac80211/patches/build/120-headers_version_fix.patch +++ b/package/kernel/mac80211/patches/build/120-headers_version_fix.patch @@ -1,14 +1,3 @@ ---- a/backport-include/linux/random.h -+++ b/backport-include/linux/random.h -@@ -15,7 +15,7 @@ static inline u16 get_random_u16(void) - } - #endif - --#if LINUX_VERSION_IS_LESS(6,2,0) -+#if LINUX_VERSION_IS_LESS(6,1,4) - static inline u32 __get_random_u32_below(u32 ceil) - { - /* --- a/backport-include/net/dropreason.h +++ b/backport-include/net/dropreason.h @@ -3,10 +3,9 @@ diff --git a/package/kernel/mac80211/patches/build/130-iommu_backport.patch b/package/kernel/mac80211/patches/build/130-iommu_backport.patch deleted file mode 100644 index 2d3ef88d64..0000000000 --- a/package/kernel/mac80211/patches/build/130-iommu_backport.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- /dev/null -+++ b/backport-include/linux/iommu.h -@@ -0,0 +1,23 @@ -+#ifndef __BACKPORT_LINUX_IOMMU_H -+#define __BACKPORT_LINUX_IOMMU_H -+ -+#include_next -+#include -+ -+#if LINUX_VERSION_IS_LESS(6,3,0) -+ -+static inline int LINUX_BACKPORT(iommu_map)(struct iommu_domain *domain, -+ unsigned long iova, -+ phys_addr_t paddr, size_t size, -+ int prot, gfp_t gfp) -+{ -+ if (gfp == GFP_ATOMIC) -+ return iommu_map_atomic(domain, iova, paddr, size, prot); -+ -+ return iommu_map(domain, iova, paddr, size, prot); -+} -+#define iommu_map LINUX_BACKPORT(iommu_map) -+ -+#endif /* < 6.3 */ -+ -+#endif diff --git a/package/kernel/mac80211/patches/build/140-trace_backport.patch b/package/kernel/mac80211/patches/build/140-trace_backport.patch new file mode 100644 index 0000000000..00ee47e1a4 --- /dev/null +++ b/package/kernel/mac80211/patches/build/140-trace_backport.patch @@ -0,0 +1,541 @@ +--- a/drivers/bus/mhi/host/trace.h ++++ b/drivers/bus/mhi/host/trace.h +@@ -103,7 +103,7 @@ TRACE_EVENT(mhi_gen_tre, + ), + + TP_fast_assign( +- __assign_str(name); ++ __assign_str(name, mhi_cntrl->mhi_dev->name); + __entry->ch_num = mhi_chan->chan; + __entry->wp = mhi_tre; + __entry->tre_ptr = mhi_tre->ptr; +@@ -131,7 +131,7 @@ TRACE_EVENT(mhi_intvec_states, + ), + + TP_fast_assign( +- __assign_str(name); ++ __assign_str(name, mhi_cntrl->mhi_dev->name); + __entry->local_ee = mhi_cntrl->ee; + __entry->state = mhi_cntrl->dev_state; + __entry->dev_ee = dev_ee; +@@ -158,7 +158,7 @@ TRACE_EVENT(mhi_tryset_pm_state, + ), + + TP_fast_assign( +- __assign_str(name); ++ __assign_str(name, mhi_cntrl->mhi_dev->name); + if (pm_state) + pm_state = __fls(pm_state); + __entry->pm_state = pm_state; +@@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(mhi_process_event_ri + ), + + TP_fast_assign( +- __assign_str(name); ++ __assign_str(name, mhi_cntrl->mhi_dev->name); + __entry->rp = rp; + __entry->ptr = rp->ptr; + __entry->dword0 = rp->dword[0]; +@@ -226,7 +226,7 @@ DECLARE_EVENT_CLASS(mhi_update_channel_s + ), + + TP_fast_assign( +- __assign_str(name); ++ __assign_str(name, mhi_cntrl->mhi_dev->name); + __entry->ch_num = mhi_chan->chan; + __entry->state = state; + __entry->reason = reason; +@@ -265,7 +265,7 @@ TRACE_EVENT(mhi_pm_st_transition, + ), + + TP_fast_assign( +- __assign_str(name); ++ __assign_str(name, mhi_cntrl->mhi_dev->name); + __entry->state = state; + ), + +--- a/drivers/net/wireless/ath/ath10k/trace.h ++++ b/drivers/net/wireless/ath/ath10k/trace.h +@@ -55,8 +55,8 @@ DECLARE_EVENT_CLASS(ath10k_log_event, + __vstring(msg, vaf->fmt, vaf->va) + ), + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + TP_printk( +@@ -92,8 +92,8 @@ TRACE_EVENT(ath10k_log_dbg, + __vstring(msg, vaf->fmt, vaf->va) + ), + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->level = level; + __assign_vstr(msg, vaf->fmt, vaf->va); + ), +@@ -121,10 +121,10 @@ TRACE_EVENT(ath10k_log_dbg_dump, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); +- __assign_str(msg); +- __assign_str(prefix); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); ++ __assign_str(msg, msg); ++ __assign_str(prefix, prefix); + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); + ), +@@ -152,8 +152,8 @@ TRACE_EVENT(ath10k_wmi_cmd, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->id = id; + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); +@@ -182,8 +182,8 @@ TRACE_EVENT(ath10k_wmi_event, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->id = id; + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); +@@ -211,8 +211,8 @@ TRACE_EVENT(ath10k_htt_stats, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); + ), +@@ -239,8 +239,8 @@ TRACE_EVENT(ath10k_wmi_dbglog, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->hw_type = ar->hw_rev; + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); +@@ -269,8 +269,8 @@ TRACE_EVENT(ath10k_htt_pktlog, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->hw_type = ar->hw_rev; + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(pktlog), buf, buf_len); +@@ -301,8 +301,8 @@ TRACE_EVENT(ath10k_htt_tx, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->msdu_id = msdu_id; + __entry->msdu_len = msdu_len; + __entry->vdev_id = vdev_id; +@@ -332,8 +332,8 @@ TRACE_EVENT(ath10k_txrx_tx_unref, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->msdu_id = msdu_id; + ), + +@@ -358,8 +358,8 @@ DECLARE_EVENT_CLASS(ath10k_hdr_event, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->len = ath10k_frm_hdr_len(data, len); + memcpy(__get_dynamic_array(data), data, __entry->len); + ), +@@ -386,8 +386,8 @@ DECLARE_EVENT_CLASS(ath10k_payload_event + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->len = len - ath10k_frm_hdr_len(data, len); + memcpy(__get_dynamic_array(payload), + data + ath10k_frm_hdr_len(data, len), __entry->len); +@@ -435,8 +435,8 @@ TRACE_EVENT(ath10k_htt_rx_desc, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->hw_type = ar->hw_rev; + __entry->len = len; + memcpy(__get_dynamic_array(rxdesc), data, len); +@@ -472,8 +472,8 @@ TRACE_EVENT(ath10k_wmi_diag_container, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->type = type; + __entry->timestamp = timestamp; + __entry->code = code; +@@ -505,8 +505,8 @@ TRACE_EVENT(ath10k_wmi_diag, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->dev)); ++ __assign_str(driver, dev_driver_string(ar->dev)); + __entry->len = len; + memcpy(__get_dynamic_array(data), data, len); + ), +--- a/drivers/net/wireless/ath/ath11k/trace.h ++++ b/drivers/net/wireless/ath/ath11k/trace.h +@@ -48,8 +48,8 @@ TRACE_EVENT(ath11k_htt_pktlog, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + __entry->buf_len = buf_len; + __entry->pktlog_checksum = pktlog_checksum; + memcpy(__get_dynamic_array(pktlog), buf, buf_len); +@@ -77,8 +77,8 @@ TRACE_EVENT(ath11k_htt_ppdu_stats, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + __entry->len = len; + memcpy(__get_dynamic_array(ppdu), data, len); + ), +@@ -105,8 +105,8 @@ TRACE_EVENT(ath11k_htt_rxdesc, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + __entry->len = len; + __entry->log_type = log_type; + memcpy(__get_dynamic_array(rxdesc), data, len); +@@ -130,8 +130,8 @@ DECLARE_EVENT_CLASS(ath11k_log_event, + __vstring(msg, vaf->fmt, vaf->va) + ), + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + TP_printk( +@@ -171,8 +171,8 @@ TRACE_EVENT(ath11k_wmi_cmd, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); + __entry->id = id; + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); +@@ -201,8 +201,8 @@ TRACE_EVENT(ath11k_wmi_event, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); + __entry->id = id; + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); +@@ -230,8 +230,8 @@ TRACE_EVENT(ath11k_log_dbg, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); + __entry->level = level; + WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), + ATH11K_MSG_MAX, vaf->fmt, +@@ -262,10 +262,10 @@ TRACE_EVENT(ath11k_log_dbg_dump, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); +- __assign_str(msg); +- __assign_str(prefix); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); ++ __assign_str(msg, msg); ++ __assign_str(prefix, prefix); + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); + ), +@@ -292,8 +292,8 @@ TRACE_EVENT(ath11k_wmi_diag, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); + __entry->len = len; + memcpy(__get_dynamic_array(data), data, len); + ), +@@ -318,8 +318,8 @@ TRACE_EVENT(ath11k_ps_timekeeper, + __field(u32, peer_ps_timestamp) + ), + +- TP_fast_assign(__assign_str(device); +- __assign_str(driver); ++ TP_fast_assign(__assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + memcpy(__get_dynamic_array(peer_addr), peer_addr, + ETH_ALEN); + __entry->peer_ps_state = peer_ps_state; +--- a/drivers/net/wireless/ath/ath12k/trace.h ++++ b/drivers/net/wireless/ath/ath12k/trace.h +@@ -36,8 +36,8 @@ TRACE_EVENT(ath12k_htt_pktlog, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + __entry->buf_len = buf_len; + __entry->pktlog_checksum = pktlog_checksum; + memcpy(__get_dynamic_array(pktlog), buf, buf_len); +@@ -73,8 +73,8 @@ TRACE_EVENT(ath12k_htt_ppdu_stats, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + __entry->len = len; + __entry->info = ar->pdev->timestamp.info; + __entry->sync_tstmp_lo_us = ar->pdev->timestamp.sync_timestamp_hi_us; +@@ -117,8 +117,8 @@ TRACE_EVENT(ath12k_htt_rxdesc, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ar->ab->dev)); ++ __assign_str(driver, dev_driver_string(ar->ab->dev)); + __entry->len = len; + __entry->type = type; + __entry->info = ar->pdev->timestamp.info; +@@ -153,8 +153,8 @@ TRACE_EVENT(ath12k_wmi_diag, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, dev_name(ab->dev)); ++ __assign_str(driver, dev_driver_string(ab->dev)); + __entry->len = len; + memcpy(__get_dynamic_array(data), data, len); + ), +--- a/drivers/net/wireless/ath/ath6kl/trace.h ++++ b/drivers/net/wireless/ath/ath6kl/trace.h +@@ -304,8 +304,8 @@ TRACE_EVENT(ath6kl_log_dbg_dump, + ), + + TP_fast_assign( +- __assign_str(msg); +- __assign_str(prefix); ++ __assign_str(msg, msg); ++ __assign_str(prefix, prefix); + __entry->buf_len = buf_len; + memcpy(__get_dynamic_array(buf), buf, buf_len); + ), +--- a/drivers/net/wireless/ath/trace.h ++++ b/drivers/net/wireless/ath/trace.h +@@ -44,8 +44,8 @@ TRACE_EVENT(ath_log, + ), + + TP_fast_assign( +- __assign_str(device); +- __assign_str(driver); ++ __assign_str(device, wiphy_name(wiphy)); ++ __assign_str(driver, KBUILD_MODNAME); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.h +@@ -41,7 +41,7 @@ TRACE_EVENT(brcmf_err, + __vstring(msg, vaf->fmt, vaf->va) + ), + TP_fast_assign( +- __assign_str(func); ++ __assign_str(func, func); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + TP_printk("%s: %s", __get_str(func), __get_str(msg)) +@@ -57,7 +57,7 @@ TRACE_EVENT(brcmf_dbg, + ), + TP_fast_assign( + __entry->level = level; +- __assign_str(func); ++ __assign_str(func, func); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + TP_printk("%s: %s", __get_str(func), __get_str(msg)) +--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcms_trace_brcmsmac.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcms_trace_brcmsmac.h +@@ -81,7 +81,7 @@ TRACE_EVENT(brcms_macintstatus, + __field(u32, mask) + ), + TP_fast_assign( +- __assign_str(dev); ++ __assign_str(dev, dev_name(dev)); + __entry->in_isr = in_isr; + __entry->macintstatus = macintstatus; + __entry->mask = mask; +--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h +@@ -71,7 +71,7 @@ TRACE_EVENT(brcms_dbg, + ), + TP_fast_assign( + __entry->level = level; +- __assign_str(func); ++ __assign_str(func, func); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + TP_printk("%s: %s", __get_str(func), __get_str(msg)) +--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcms_trace_brcmsmac_tx.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcms_trace_brcmsmac_tx.h +@@ -31,7 +31,7 @@ TRACE_EVENT(brcms_txdesc, + __dynamic_array(u8, txh, txh_len) + ), + TP_fast_assign( +- __assign_str(dev); ++ __assign_str(dev, dev_name(dev)); + memcpy(__get_dynamic_array(txh), txh, txh_len); + ), + TP_printk("[%s] txdesc", __get_str(dev)) +@@ -54,7 +54,7 @@ TRACE_EVENT(brcms_txstatus, + __field(u16, ackphyrxsh) + ), + TP_fast_assign( +- __assign_str(dev); ++ __assign_str(dev, dev_name(dev)); + __entry->framelen = framelen; + __entry->frameid = frameid; + __entry->status = status; +@@ -85,7 +85,7 @@ TRACE_EVENT(brcms_ampdu_session, + __field(u16, dma_len) + ), + TP_fast_assign( +- __assign_str(dev); ++ __assign_str(dev, dev_name(dev)); + __entry->max_ampdu_len = max_ampdu_len; + __entry->max_ampdu_frames = max_ampdu_frames; + __entry->ampdu_len = ampdu_len; +--- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-msg.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-msg.h +@@ -57,7 +57,7 @@ TRACE_EVENT(iwlwifi_dbg, + ), + TP_fast_assign( + __entry->level = level; +- __assign_str(function); ++ __assign_str(function, function); + __assign_vstr(msg, vaf->fmt, vaf->va); + ), + TP_printk("%s", __get_str(msg)) +--- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h +@@ -87,7 +87,7 @@ static inline void trace_ ## name(proto) + #endif + + #define DEV_ENTRY __string(dev, dev_name(dev)) +-#define DEV_ASSIGN __assign_str(dev) ++#define DEV_ASSIGN __assign_str(dev, dev_name(dev)) + + #include "iwl-devtrace-io.h" + #include "iwl-devtrace-ucode.h" +--- a/include/trace/events/qrtr.h ++++ b/include/trace/events/qrtr.h +@@ -102,7 +102,7 @@ TRACE_EVENT(qrtr_ns_message, + ), + + TP_fast_assign( +- __assign_str(ctrl_pkt_str); ++ __assign_str(ctrl_pkt_str, ctrl_pkt_str); + __entry->sq_node = sq_node; + __entry->sq_port = sq_port; + ), +--- a/net/mac80211/trace.h ++++ b/net/mac80211/trace.h +@@ -33,7 +33,7 @@ + __string(vif_name, sdata->name) + #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \ + __entry->p2p = sdata->vif.p2p; \ +- __assign_str(vif_name) ++ __assign_str(vif_name, sdata->name) + #define VIF_PR_FMT " vif:%s(%d%s)" + #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : "" + +--- a/net/wireless/trace.h ++++ b/net/wireless/trace.h +@@ -446,7 +446,7 @@ TRACE_EVENT(rdev_add_virtual_intf, + ), + TP_fast_assign( + WIPHY_ASSIGN; +- __assign_str(vir_intf_name); ++ __assign_str(vir_intf_name, name ? name : ""); + __entry->type = type; + ), + TP_printk(WIPHY_PR_FMT ", virtual intf name: %s, type: %d", diff --git a/package/kernel/mac80211/patches/build/150-ath_iommu_paging_domain_revert.patch b/package/kernel/mac80211/patches/build/150-ath_iommu_paging_domain_revert.patch new file mode 100644 index 0000000000..2c5235e49f --- /dev/null +++ b/package/kernel/mac80211/patches/build/150-ath_iommu_paging_domain_revert.patch @@ -0,0 +1,32 @@ +--- a/drivers/net/wireless/ath/ath10k/snoc.c ++++ b/drivers/net/wireless/ath/ath10k/snoc.c +@@ -1635,10 +1635,10 @@ static int ath10k_fw_init(struct ath10k + + ar_snoc->fw.dev = &pdev->dev; + +- iommu_dom = iommu_paging_domain_alloc(ar_snoc->fw.dev); +- if (IS_ERR(iommu_dom)) { ++ iommu_dom = iommu_domain_alloc(&platform_bus_type); ++ if (!iommu_dom) { + ath10k_err(ar, "failed to allocate iommu domain\n"); +- ret = PTR_ERR(iommu_dom); ++ ret = -ENOMEM; + goto err_unregister; + } + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -1031,10 +1031,10 @@ static int ath11k_ahb_fw_resources_init( + + ab_ahb->fw.dev = &pdev->dev; + +- iommu_dom = iommu_paging_domain_alloc(ab_ahb->fw.dev); +- if (IS_ERR(iommu_dom)) { ++ iommu_dom = iommu_domain_alloc(&platform_bus_type); ++ if (!iommu_dom) { + ath11k_err(ab, "failed to allocate iommu domain\n"); +- ret = PTR_ERR(iommu_dom); ++ ret = -ENOMEM; + goto err_unregister; + } + diff --git a/package/kernel/mac80211/patches/build/200-iwlwifi_thermal_backport.patch b/package/kernel/mac80211/patches/build/200-iwlwifi_thermal_backport.patch index ad398d4d9d..a8ffce1e30 100644 --- a/package/kernel/mac80211/patches/build/200-iwlwifi_thermal_backport.patch +++ b/package/kernel/mac80211/patches/build/200-iwlwifi_thermal_backport.patch @@ -1,6 +1,20 @@ --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c -@@ -689,13 +689,23 @@ static void iwl_mvm_thermal_zone_registe +@@ -638,8 +638,13 @@ static int iwl_mvm_tzone_get_temp(struct + return 0; + } + ++#if LINUX_VERSION_IS_GEQ(6,11,0) + static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device, + const struct thermal_trip *trip, int temp) ++#else ++static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device, ++ int trip, int temp) ++#endif + { + struct iwl_mvm *mvm = thermal_zone_device_priv(device); + +@@ -682,13 +687,23 @@ static void iwl_mvm_thermal_zone_registe for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++) { mvm->tz_device.trips[i].temperature = THERMAL_TEMP_INVALID; mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE; diff --git a/package/kernel/mac80211/patches/build/210-backport_genl_split_ops.patch b/package/kernel/mac80211/patches/build/210-backport_genl_split_ops.patch deleted file mode 100644 index d9d6b8a75b..0000000000 --- a/package/kernel/mac80211/patches/build/210-backport_genl_split_ops.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -16383,9 +16383,14 @@ static u32 nl80211_internal_flags[] = { - #undef SELECTOR - }; - -+#if LINUX_VERSION_IS_LESS(6,2,0) -+static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb, -+ struct genl_info *info) -+#else - static int nl80211_pre_doit(const struct genl_split_ops *ops, - struct sk_buff *skb, - struct genl_info *info) -+#endif - { - struct cfg80211_registered_device *rdev = NULL; - struct wireless_dev *wdev = NULL; -@@ -16485,9 +16490,14 @@ out_unlock: - return err; - } - -+#if LINUX_VERSION_IS_LESS(6,2,0) -+static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, -+ struct genl_info *info) -+#else - static void nl80211_post_doit(const struct genl_split_ops *ops, - struct sk_buff *skb, - struct genl_info *info) -+#endif - { - u32 internal_flags = nl80211_internal_flags[ops->internal_flags]; - diff --git a/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch b/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch deleted file mode 100644 index 6d3000278b..0000000000 --- a/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 15 Dec 2023 10:17:21 +0100 -Subject: [PATCH] list: don't backport list_count_nodes() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It's redundant in OpenWrt as it backports it on its own. This fixes: -backport-include/linux/list.h:11:22: error: redefinition of 'list_count_nodes' - -Signed-off-by: Rafał Miłecki ---- - backport-include/linux/list.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/backport-include/linux/list.h -+++ b/backport-include/linux/list.h -@@ -3,7 +3,7 @@ - #include_next - #include - --#if LINUX_VERSION_IS_LESS(6,3,0) -+#if 0 /* OpenWrt backports list_count_nodes() on its own */ - /** - * list_count_nodes - count nodes in the list - * @head: the head for your list. diff --git a/package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch b/package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch index daeea38372..25dab46905 100644 --- a/package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch +++ b/package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c -@@ -1581,7 +1581,11 @@ static int brcmf_usb_reset_device(struct +@@ -1574,7 +1574,11 @@ static int brcmf_usb_reset_device(struct void brcmf_usb_exit(void) { diff --git a/package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch b/package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch new file mode 100644 index 0000000000..4b0fe6003f --- /dev/null +++ b/package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch @@ -0,0 +1,30 @@ +--- a/drivers/net/wireless/virtual/mac80211_hwsim.c ++++ b/drivers/net/wireless/virtual/mac80211_hwsim.c +@@ -6629,6 +6629,7 @@ static void hwsim_virtio_rx_done(struct + + static int init_vqs(struct virtio_device *vdev) + { ++#if LINUX_VERSION_IS_GEQ(6,11,0) + struct virtqueue_info vqs_info[HWSIM_NUM_VQS] = { + [HWSIM_VQ_TX] = { "tx", hwsim_virtio_tx_done }, + [HWSIM_VQ_RX] = { "rx", hwsim_virtio_rx_done }, +@@ -6636,6 +6637,19 @@ static int init_vqs(struct virtio_device + + return virtio_find_vqs(vdev, HWSIM_NUM_VQS, + hwsim_vqs, vqs_info, NULL); ++#else /* Using the old ABI, copied from kernel 6.6 */ ++ vq_callback_t *callbacks[HWSIM_NUM_VQS] = { ++ [HWSIM_VQ_TX] = hwsim_virtio_tx_done, ++ [HWSIM_VQ_RX] = hwsim_virtio_rx_done, ++ }; ++ const char *names[HWSIM_NUM_VQS] = { ++ [HWSIM_VQ_TX] = "tx", ++ [HWSIM_VQ_RX] = "rx", ++ }; ++ ++ return virtio_find_vqs(vdev, HWSIM_NUM_VQS, ++ hwsim_vqs, callbacks, names, NULL); ++#endif + } + + static int fill_vq(struct virtqueue *vq) diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch index fb774b5201..c3324f4289 100644 --- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch +++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -5707,6 +5707,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") +@@ -5709,6 +5709,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); static const struct pci_device_id mwl8k_pci_id_table[] = { diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch index 06edc441ec..062b0600d0 100644 --- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -6293,6 +6293,8 @@ static int mwl8k_probe(struct pci_dev *p +@@ -6295,6 +6295,8 @@ static int mwl8k_probe(struct pci_dev *p priv->running_bsses = 0; @@ -9,7 +9,7 @@ return rc; err_stop_firmware: -@@ -6326,8 +6328,6 @@ static void mwl8k_remove(struct pci_dev +@@ -6328,8 +6330,6 @@ static void mwl8k_remove(struct pci_dev return; priv = hw->priv; diff --git a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch index 1516c6cb43..b6b1e0da96 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch @@ -21,7 +21,7 @@ Signed-off-by: Christian Marangi --- a/local-symbols +++ b/local-symbols -@@ -334,6 +334,7 @@ RT2X00_LIB_FIRMWARE= +@@ -339,6 +339,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= @@ -100,7 +100,7 @@ Signed-off-by: Christian Marangi .drv_init_registers = rt2800mmio_init_registers, --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h -@@ -703,6 +703,7 @@ enum rt2x00_capability_flags { +@@ -693,6 +693,7 @@ enum rt2x00_capability_flags { REQUIRE_HT_TX_DESC, REQUIRE_PS_AUTOWAKE, REQUIRE_DELAYED_RFKILL, diff --git a/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch index ab09a68297..a554707bda 100644 --- a/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch +++ b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch @@ -37,7 +37,7 @@ num_rates += 4; --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h -@@ -408,6 +408,7 @@ struct hw_mode_spec { +@@ -398,6 +398,7 @@ struct hw_mode_spec { unsigned int supported_bands; #define SUPPORT_BAND_2GHZ 0x00000001 #define SUPPORT_BAND_5GHZ 0x00000002 diff --git a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch index 5b950539b9..bb3f819702 100644 --- a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch @@ -83,7 +83,7 @@ Signed-off-by: Daniel Golle #include #include -@@ -1027,6 +1028,11 @@ struct rt2x00_dev { +@@ -1017,6 +1018,11 @@ struct rt2x00_dev { /* Clock for System On Chip devices. */ struct clk *clk; diff --git a/package/kernel/mac80211/patches/rtl/001-v6.10-wifi-rtw88-usb-schedule-rx-work-after-everything-is-.patch b/package/kernel/mac80211/patches/rtl/001-v6.10-wifi-rtw88-usb-schedule-rx-work-after-everything-is-.patch deleted file mode 100644 index 2fa581f288..0000000000 --- a/package/kernel/mac80211/patches/rtl/001-v6.10-wifi-rtw88-usb-schedule-rx-work-after-everything-is-.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 25eaef533bf3ccc6fee5067aac16f41f280e343e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= -Date: Tue, 28 May 2024 13:02:46 +0200 -Subject: [PATCH] wifi: rtw88: usb: schedule rx work after everything is set up -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -[ Upstream commit adc539784c98a7cc602cbf557debfc2e7b9be8b3 ] - -Right now it's possible to hit NULL pointer dereference in -rtw_rx_fill_rx_status on hw object and/or its fields because -initialization routine can start getting USB replies before -rtw_dev is fully setup. - -The stack trace looks like this: - -rtw_rx_fill_rx_status -rtw8821c_query_rx_desc -rtw_usb_rx_handler -... -queue_work -rtw_usb_read_port_complete -... -usb_submit_urb -rtw_usb_rx_resubmit -rtw_usb_init_rx -rtw_usb_probe - -So while we do the async stuff rtw_usb_probe continues and calls -rtw_register_hw, which does all kinds of initialization (e.g. -via ieee80211_register_hw) that rtw_rx_fill_rx_status relies on. - -Fix this by moving the first usb_submit_urb after everything -is set up. - -For me, this bug manifested as: -[ 8.893177] rtw_8821cu 1-1:1.2: band wrong, packet dropped -[ 8.910904] rtw_8821cu 1-1:1.2: hw->conf.chandef.chan NULL in rtw_rx_fill_rx_status -because I'm using Larry's backport of rtw88 driver with the NULL -checks in rtw_rx_fill_rx_status. - -Link: https://lore.kernel.org/linux-wireless/CA+shoWQ7P49jhQasofDcTdQhiuarPTjYEDa--NiVVx494WcuQw@mail.gmail.com/ -Signed-off-by: Marcin Ślusarz -Cc: Tim K -Cc: Ping-Ke Shih -Cc: Larry Finger -Cc: Kalle Valo -Cc: linux-wireless@vger.kernel.org -Cc: linux-kernel@vger.kernel.org -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240528110246.477321-1-marcin.slusarz@gmail.com -Signed-off-by: Sasha Levin ---- - drivers/net/wireless/realtek/rtw88/usb.c | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -740,7 +740,6 @@ static struct rtw_hci_ops rtw_usb_ops = - static int rtw_usb_init_rx(struct rtw_dev *rtwdev) - { - struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -- int i; - - rtwusb->rxwq = create_singlethread_workqueue("rtw88_usb: rx wq"); - if (!rtwusb->rxwq) { -@@ -752,13 +751,19 @@ static int rtw_usb_init_rx(struct rtw_de - - INIT_WORK(&rtwusb->rx_work, rtw_usb_rx_handler); - -+ return 0; -+} -+ -+static void rtw_usb_setup_rx(struct rtw_dev *rtwdev) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ int i; -+ - for (i = 0; i < RTW_USB_RXCB_NUM; i++) { - struct rx_usb_ctrl_block *rxcb = &rtwusb->rx_cb[i]; - - rtw_usb_rx_resubmit(rtwusb, rxcb); - } -- -- return 0; - } - - static void rtw_usb_deinit_rx(struct rtw_dev *rtwdev) -@@ -895,6 +900,8 @@ int rtw_usb_probe(struct usb_interface * - goto err_destroy_rxwq; - } - -+ rtw_usb_setup_rx(rtwdev); -+ - return 0; - - err_destroy_rxwq: diff --git a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch index c71f1f2ffc..68534f4e7b 100644 --- a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch @@ -9,7 +9,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1647,12 +1647,6 @@ static int ieee80211_stop_ap(struct wiph +@@ -1649,12 +1649,6 @@ static int ieee80211_stop_ap(struct wiph __sta_info_flush(sdata, true, link_id); diff --git a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch index d4341a1350..eea165ccca 100644 --- a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch +++ b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -1564,24 +1564,6 @@ int ieee80211_register_hw(struct ieee802 +@@ -1581,24 +1581,6 @@ int ieee80211_register_hw(struct ieee802 ieee80211_check_wbrf_support(local); diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch index a1f96cb3a0..ca4ac8adb6 100644 --- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch @@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey) --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2844,6 +2844,8 @@ static int ieee80211_scan(struct wiphy * +@@ -2863,6 +2863,8 @@ static int ieee80211_scan(struct wiphy * */ fallthrough; case NL80211_IFTYPE_AP: diff --git a/package/kernel/mac80211/patches/subsys/400-allow-ibss-mixed.patch b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch similarity index 95% rename from package/kernel/mac80211/patches/subsys/400-allow-ibss-mixed.patch rename to package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch index 7a96f9f2be..55376362a5 100644 --- a/package/kernel/mac80211/patches/subsys/400-allow-ibss-mixed.patch +++ b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch @@ -16,7 +16,7 @@ and we should ignore this. --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -651,21 +651,6 @@ static int wiphy_verify_combinations(str +@@ -654,21 +654,6 @@ static int wiphy_verify_combinations(str c->limits[j].max > 1)) return -EINVAL; diff --git a/package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch b/package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch similarity index 93% rename from package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch rename to package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch index e64ca1753b..9e9e3844b7 100644 --- a/package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch +++ b/package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch @@ -18,7 +18,7 @@ Signed-off-by: David Bauer --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -2459,6 +2459,13 @@ static void sta_stats_decode_rate(struct +@@ -2439,6 +2439,13 @@ static void sta_stats_decode_rate(struct sband = local->hw.wiphy->bands[band]; diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch index d576661bd2..edec97cce9 100644 --- a/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch +++ b/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch @@ -28,15 +28,11 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -565,6 +565,11 @@ __sta_info_alloc(struct ieee80211_sub_if +@@ -565,6 +565,7 @@ __sta_info_alloc(struct ieee80211_sub_if spin_lock_init(&sta->ps_lock); INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); wiphy_work_init(&sta->ampdu_mlme.work, ieee80211_ba_session_work); -+#if LINUX_VERSION_IS_LESS(6,2,0) -+ sta->ampdu_mlme.dialog_token_allocator = prandom_u32_max(U8_MAX); -+#else + sta->ampdu_mlme.dialog_token_allocator = get_random_u32_below(U8_MAX); -+#endif #ifdef CPTCFG_MAC80211_MESH if (ieee80211_vif_is_mesh(&sdata->vif)) { sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch index 71ce340d31..6cf46ce7e5 100644 --- a/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch +++ b/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -101,6 +101,8 @@ ieee80211_sta_keep_active(struct sta_inf +@@ -103,6 +103,8 @@ ieee80211_sta_keep_active(struct sta_inf return time_before_eq(jiffies, sta->airtime[ac].last_active + HZ / 10); } @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4082,7 +4082,7 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -4081,7 +4081,7 @@ struct ieee80211_txq *ieee80211_next_txq if (deficit < 0) sta->airtime[txqi->txq.ac].deficit += @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau if (deficit < 0 || !aql_check) { list_move_tail(&txqi->schedule_order, -@@ -4225,7 +4225,8 @@ bool ieee80211_txq_may_transmit(struct i +@@ -4224,7 +4224,8 @@ bool ieee80211_txq_may_transmit(struct i } sta = container_of(iter->txq.sta, struct sta_info, sta); if (ieee80211_sta_deficit(sta, ac) < 0) @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau list_move_tail(&iter->schedule_order, &local->active_txqs[ac]); } -@@ -4233,7 +4234,7 @@ bool ieee80211_txq_may_transmit(struct i +@@ -4232,7 +4233,7 @@ bool ieee80211_txq_may_transmit(struct i if (sta->airtime[ac].deficit >= 0) goto out; diff --git a/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-clear-vif-drv_priv-after-calling-remov.patch b/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-clear-vif-drv_priv-after-calling-remov.patch deleted file mode 100644 index b0119988d3..0000000000 --- a/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-clear-vif-drv_priv-after-calling-remov.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Felix Fietkau -Date: Wed, 3 Jul 2024 12:10:01 +0200 -Subject: [PATCH] wifi: mac80211: clear vif drv_priv after calling - remove_interface - -Avoid reusing stale driver data when an interface is brought down and up -again. In order to avoid having to duplicate the memset in every single -driver, do it here. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -693,8 +693,12 @@ static void ieee80211_do_stop(struct iee - - fallthrough; - default: -- if (going_down) -- drv_remove_interface(local, sdata); -+ if (!going_down) -+ break; -+ drv_remove_interface(local, sdata); -+ -+ /* Clear private driver data to prevent reuse */ -+ memset(sdata->vif.drv_priv, 0, local->hw.vif_data_size); - } - - ieee80211_recalc_ps(local); diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch similarity index 95% rename from package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch rename to package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch index 39f23f7839..7e9be59e04 100644 --- a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch +++ b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -189,6 +189,8 @@ enum ieee80211_channel_flags { +@@ -187,6 +187,8 @@ enum ieee80211_channel_flags { * @dfs_state: current state of this channel. Only relevant if radar is required * on this channel. * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered. @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau * @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels. * @psd: power spectral density (in dBm) */ -@@ -206,6 +208,7 @@ struct ieee80211_channel { +@@ -204,6 +206,7 @@ struct ieee80211_channel { int orig_mag, orig_mpwr; enum nl80211_dfs_state dfs_state; unsigned long dfs_state_entered; @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau --- a/net/wireless/chan.c +++ b/net/wireless/chan.c -@@ -560,6 +560,8 @@ static void cfg80211_set_chans_dfs_state +@@ -598,6 +598,8 @@ static void cfg80211_set_chans_dfs_state c->dfs_state = dfs_state; c->dfs_state_entered = jiffies; @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau } } -@@ -1049,6 +1051,49 @@ static bool cfg80211_get_chans_dfs_avail +@@ -1087,6 +1089,49 @@ static bool cfg80211_get_chans_dfs_avail return true; } diff --git a/package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch similarity index 92% rename from package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch rename to package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch index d822e45357..3b6cba48e7 100644 --- a/package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch +++ b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -3416,6 +3416,7 @@ enum wiphy_params_flags { +@@ -3423,6 +3423,7 @@ enum wiphy_params_flags { /* The per TXQ device queue limit in airtime */ #define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000 #define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000 @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1338,10 +1338,12 @@ struct ieee80211_local { +@@ -1351,10 +1351,12 @@ struct ieee80211_local { spinlock_t handle_wake_tx_queue_lock; u16 airtime_flags; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau const struct ieee80211_ops *ops; --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -944,6 +944,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -952,6 +952,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ spin_lock_init(&local->rx_path_lock); spin_lock_init(&local->queue_stop_reason_lock); @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau spin_lock_init(&local->active_txq_lock[i]); --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -2357,13 +2357,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre +@@ -2353,13 +2353,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local, struct sta_info *sta, u8 ac, @@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau spin_unlock_irqrestore(&local->ack_status_lock, flags); if (id >= 0) { -@@ -3983,20 +3983,20 @@ begin: +@@ -3982,20 +3982,20 @@ begin: encap_out: info->control.vif = vif; @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau } return skb; -@@ -4048,6 +4048,7 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -4047,6 +4047,7 @@ struct ieee80211_txq *ieee80211_next_txq struct ieee80211_txq *ret = NULL; struct txq_info *txqi = NULL, *head = NULL; bool found_eligible_txq = false; @@ -175,7 +175,7 @@ Signed-off-by: Felix Fietkau spin_lock_bh(&local->active_txq_lock[ac]); -@@ -4071,26 +4072,26 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -4070,26 +4071,26 @@ struct ieee80211_txq *ieee80211_next_txq if (!head) head = txqi; @@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau if (txqi->schedule_round == local->schedule_round[ac]) goto out; -@@ -4155,7 +4156,8 @@ bool ieee80211_txq_airtime_check(struct +@@ -4154,7 +4155,8 @@ bool ieee80211_txq_airtime_check(struct return true; if (!txq->sta) @@ -224,7 +224,7 @@ Signed-off-by: Felix Fietkau if (unlikely(txq->tid == IEEE80211_NUM_TIDS)) return true; -@@ -4204,15 +4206,15 @@ bool ieee80211_txq_may_transmit(struct i +@@ -4203,15 +4205,15 @@ bool ieee80211_txq_may_transmit(struct i spin_lock_bh(&local->active_txq_lock[ac]); @@ -245,7 +245,7 @@ Signed-off-by: Felix Fietkau if (iter == txqi) --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1180,8 +1180,8 @@ struct ieee80211_tx_info { +@@ -1221,8 +1221,8 @@ struct ieee80211_tx_info { status_data_idr:1, status_data:13, hw_queue:4, @@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -717,7 +717,7 @@ static void ieee80211_report_used_skb(st +@@ -734,7 +734,7 @@ static void ieee80211_report_used_skb(st ieee80211_sta_update_pending_airtime(local, sta, skb_get_queue_mapping(skb), tx_time_est, @@ -278,7 +278,7 @@ Signed-off-by: Felix Fietkau rcu_read_unlock(); } -@@ -1138,10 +1138,11 @@ void ieee80211_tx_status_ext(struct ieee +@@ -1158,10 +1158,11 @@ void ieee80211_tx_status_ext(struct ieee /* Do this here to avoid the expensive lookup of the sta * in ieee80211_report_used_skb(). */ diff --git a/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch b/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch new file mode 100644 index 0000000000..f48fa38e5e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch @@ -0,0 +1,24 @@ +From: Felix Fietkau +Date: Wed, 2 Oct 2024 11:45:35 +0200 +Subject: [PATCH] wifi: mac80211: do not pass a stopped vif to the driver in + .get_txpower + +Avoid potentially crashing in the driver because of uninitialized private data + +Fixes: 5b3dc42b1b0d ("mac80211: add support for driver tx power reporting") +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -3134,7 +3134,8 @@ static int ieee80211_get_tx_power(struct + struct ieee80211_local *local = wiphy_priv(wiphy); + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + +- if (local->ops->get_txpower) ++ if (local->ops->get_txpower && ++ (sdata->flags & IEEE80211_SDATA_IN_DRIVER)) + return drv_get_txpower(local, sdata, dbm); + + if (local->emulate_chanctx) diff --git a/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch b/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/350-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch rename to package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch diff --git a/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-extend-IEEE80211_KEY_FLAG_GENERATE_MMI.patch b/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-extend-IEEE80211_KEY_FLAG_GENERATE_MMI.patch deleted file mode 100644 index 5c202c26c2..0000000000 --- a/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-extend-IEEE80211_KEY_FLAG_GENERATE_MMI.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Michael-CY Lee -Date: Tue, 26 Mar 2024 08:30:36 +0800 -Subject: [PATCH] wifi: mac80211: extend IEEE80211_KEY_FLAG_GENERATE_MMIE to - other ciphers - -Extend the flag IEEE80211_KEY_FLAG_GENERATE_MMIE to BIP-CMAC-256, -BIP-GMAC-128 and BIP-GMAC-256 for the same reason and in the same -way that the flag was added originally in commit a0b4496a4368 -("mac80211: add IEEE80211_KEY_FLAG_GENERATE_MMIE to ieee80211_key_flags"). - -Signed-off-by: Michael-CY Lee -Link: https://msgid.link/20240326003036.15215-1-michael-cy.lee@mediatek.com -Signed-off-by: Johannes Berg ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -2123,8 +2123,8 @@ static inline bool lockdep_vif_wiphy_mut - * @IEEE80211_KEY_FLAG_GENERATE_MMIC on the same key. - * @IEEE80211_KEY_FLAG_NO_AUTO_TX: Key needs explicit Tx activation. - * @IEEE80211_KEY_FLAG_GENERATE_MMIE: This flag should be set by the driver -- * for a AES_CMAC key to indicate that it requires sequence number -- * generation only -+ * for a AES_CMAC or a AES_GMAC key to indicate that it requires sequence -+ * number generation only - * @IEEE80211_KEY_FLAG_SPP_AMSDU: SPP A-MSDUs can be used with this key - * (set by mac80211 from the sta->spp_amsdu flag) - */ ---- a/net/mac80211/wpa.c -+++ b/net/mac80211/wpa.c -@@ -895,7 +895,8 @@ ieee80211_crypto_aes_cmac_256_encrypt(st - - info = IEEE80211_SKB_CB(skb); - -- if (info->control.hw_key) -+ if (info->control.hw_key && -+ !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIE)) - return TX_CONTINUE; - - if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) -@@ -911,6 +912,9 @@ ieee80211_crypto_aes_cmac_256_encrypt(st - - bip_ipn_set64(mmie->sequence_number, pn64); - -+ if (info->control.hw_key) -+ return TX_CONTINUE; -+ - bip_aad(skb, aad); - - /* MIC = AES-256-CMAC(IGTK, AAD || Management Frame Body || MMIE, 128) -@@ -1040,7 +1044,8 @@ ieee80211_crypto_aes_gmac_encrypt(struct - - info = IEEE80211_SKB_CB(skb); - -- if (info->control.hw_key) -+ if (info->control.hw_key && -+ !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIE)) - return TX_CONTINUE; - - if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) -@@ -1056,6 +1061,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct - - bip_ipn_set64(mmie->sequence_number, pn64); - -+ if (info->control.hw_key) -+ return TX_CONTINUE; -+ - bip_aad(skb, aad); - - hdr = (struct ieee80211_hdr *)skb->data; diff --git a/package/kernel/mac80211/patches/subsys/340-wifi-nl80211-split-helper-function-from-nl80211_put_.patch b/package/kernel/mac80211/patches/subsys/340-wifi-nl80211-split-helper-function-from-nl80211_put_.patch deleted file mode 100644 index 40757e3777..0000000000 --- a/package/kernel/mac80211/patches/subsys/340-wifi-nl80211-split-helper-function-from-nl80211_put_.patch +++ /dev/null @@ -1,145 +0,0 @@ -From: Felix Fietkau -Date: Tue, 4 Jun 2024 14:31:09 +0200 -Subject: [PATCH] wifi: nl80211: split helper function from - nl80211_put_iface_combinations - -Create a helper function that puts the data from struct -ieee80211_iface_combination to a nl80211 message. -This will be used for adding per-radio interface combination data. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -1620,71 +1620,78 @@ nla_put_failure: - return -ENOBUFS; - } - --static int nl80211_put_iface_combinations(struct wiphy *wiphy, -- struct sk_buff *msg, -- bool large) -+static int nl80211_put_ifcomb_data(struct sk_buff *msg, bool large, int idx, -+ const struct ieee80211_iface_combination *c) - { -- struct nlattr *nl_combis; -- int i, j; -+ struct nlattr *nl_combi, *nl_limits; -+ int i; - -- nl_combis = nla_nest_start_noflag(msg, -- NL80211_ATTR_INTERFACE_COMBINATIONS); -- if (!nl_combis) -+ nl_combi = nla_nest_start_noflag(msg, idx); -+ if (!nl_combi) - goto nla_put_failure; - -- for (i = 0; i < wiphy->n_iface_combinations; i++) { -- const struct ieee80211_iface_combination *c; -- struct nlattr *nl_combi, *nl_limits; -+ nl_limits = nla_nest_start_noflag(msg, NL80211_IFACE_COMB_LIMITS); -+ if (!nl_limits) -+ goto nla_put_failure; - -- c = &wiphy->iface_combinations[i]; -+ for (i = 0; i < c->n_limits; i++) { -+ struct nlattr *nl_limit; - -- nl_combi = nla_nest_start_noflag(msg, i + 1); -- if (!nl_combi) -+ nl_limit = nla_nest_start_noflag(msg, i + 1); -+ if (!nl_limit) - goto nla_put_failure; -- -- nl_limits = nla_nest_start_noflag(msg, -- NL80211_IFACE_COMB_LIMITS); -- if (!nl_limits) -+ if (nla_put_u32(msg, NL80211_IFACE_LIMIT_MAX, c->limits[i].max)) - goto nla_put_failure; -+ if (nl80211_put_iftypes(msg, NL80211_IFACE_LIMIT_TYPES, -+ c->limits[i].types)) -+ goto nla_put_failure; -+ nla_nest_end(msg, nl_limit); -+ } - -- for (j = 0; j < c->n_limits; j++) { -- struct nlattr *nl_limit; -+ nla_nest_end(msg, nl_limits); - -- nl_limit = nla_nest_start_noflag(msg, j + 1); -- if (!nl_limit) -- goto nla_put_failure; -- if (nla_put_u32(msg, NL80211_IFACE_LIMIT_MAX, -- c->limits[j].max)) -- goto nla_put_failure; -- if (nl80211_put_iftypes(msg, NL80211_IFACE_LIMIT_TYPES, -- c->limits[j].types)) -- goto nla_put_failure; -- nla_nest_end(msg, nl_limit); -- } -+ if (c->beacon_int_infra_match && -+ nla_put_flag(msg, NL80211_IFACE_COMB_STA_AP_BI_MATCH)) -+ goto nla_put_failure; -+ if (nla_put_u32(msg, NL80211_IFACE_COMB_NUM_CHANNELS, -+ c->num_different_channels) || -+ nla_put_u32(msg, NL80211_IFACE_COMB_MAXNUM, -+ c->max_interfaces)) -+ goto nla_put_failure; -+ if (large && -+ (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, -+ c->radar_detect_widths) || -+ nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, -+ c->radar_detect_regions))) -+ goto nla_put_failure; -+ if (c->beacon_int_min_gcd && -+ nla_put_u32(msg, NL80211_IFACE_COMB_BI_MIN_GCD, -+ c->beacon_int_min_gcd)) -+ goto nla_put_failure; - -- nla_nest_end(msg, nl_limits); -+ nla_nest_end(msg, nl_combi); - -- if (c->beacon_int_infra_match && -- nla_put_flag(msg, NL80211_IFACE_COMB_STA_AP_BI_MATCH)) -- goto nla_put_failure; -- if (nla_put_u32(msg, NL80211_IFACE_COMB_NUM_CHANNELS, -- c->num_different_channels) || -- nla_put_u32(msg, NL80211_IFACE_COMB_MAXNUM, -- c->max_interfaces)) -- goto nla_put_failure; -- if (large && -- (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, -- c->radar_detect_widths) || -- nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, -- c->radar_detect_regions))) -- goto nla_put_failure; -- if (c->beacon_int_min_gcd && -- nla_put_u32(msg, NL80211_IFACE_COMB_BI_MIN_GCD, -- c->beacon_int_min_gcd)) -- goto nla_put_failure; -+ return 0; -+nla_put_failure: -+ return -ENOBUFS; -+} - -- nla_nest_end(msg, nl_combi); -- } -+static int nl80211_put_iface_combinations(struct wiphy *wiphy, -+ struct sk_buff *msg, -+ bool large) -+{ -+ struct nlattr *nl_combis; -+ int i; -+ -+ nl_combis = nla_nest_start_noflag(msg, -+ NL80211_ATTR_INTERFACE_COMBINATIONS); -+ if (!nl_combis) -+ goto nla_put_failure; -+ -+ for (i = 0; i < wiphy->n_iface_combinations; i++) -+ if (nl80211_put_ifcomb_data(msg, large, i + 1, -+ &wiphy->iface_combinations[i])) -+ goto nla_put_failure; - - nla_nest_end(msg, nl_combis); - diff --git a/package/kernel/mac80211/patches/subsys/341-wifi-cfg80211-add-support-for-advertising-multiple-r.patch b/package/kernel/mac80211/patches/subsys/341-wifi-cfg80211-add-support-for-advertising-multiple-r.patch deleted file mode 100644 index 45349891b6..0000000000 --- a/package/kernel/mac80211/patches/subsys/341-wifi-cfg80211-add-support-for-advertising-multiple-r.patch +++ /dev/null @@ -1,348 +0,0 @@ -From: Felix Fietkau -Date: Wed, 22 May 2024 11:42:57 +0200 -Subject: [PATCH] wifi: cfg80211: add support for advertising multiple - radios belonging to a wiphy - -The prerequisite for MLO support in cfg80211/mac80211 is that all the links -participating in MLO must be from the same wiphy/ieee80211_hw. To meet this -expectation, some drivers may need to group multiple discrete hardware each -acting as a link in MLO under single wiphy. - -With this change, supported frequencies and interface combinations of each -individual radio are reported to user space. This allows user space to figure -out the limitations of what combination of channels can be used concurrently. - -Even for non-MLO devices, this improves support for devices capable of -running on multiple channels at the same time. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -5045,7 +5045,9 @@ struct ieee80211_iface_limit { - * struct ieee80211_iface_combination - possible interface combination - * - * With this structure the driver can describe which interface -- * combinations it supports concurrently. -+ * combinations it supports concurrently. When set in a struct wiphy_radio, -+ * the combinations refer to combinations of interfaces currently active on -+ * that radio. - * - * Examples: - * -@@ -5403,6 +5405,38 @@ struct wiphy_iftype_akm_suites { - int n_akm_suites; - }; - -+/** -+ * struct wiphy_radio_freq_range - wiphy frequency range -+ * @start_freq: start range edge frequency (kHz) -+ * @end_freq: end range edge frequency (kHz) -+ */ -+struct wiphy_radio_freq_range { -+ u32 start_freq; -+ u32 end_freq; -+}; -+ -+ -+/** -+ * struct wiphy_radio - physical radio of a wiphy -+ * This structure describes a physical radio belonging to a wiphy. -+ * It is used to describe concurrent-channel capabilities. Only one channel -+ * can be active on the radio described by struct wiphy_radio. -+ * -+ * @freq_range: frequency range that the radio can operate on. -+ * @n_freq_range: number of elements in @freq_range -+ * -+ * @iface_combinations: Valid interface combinations array, should not -+ * list single interface types. -+ * @n_iface_combinations: number of entries in @iface_combinations array. -+ */ -+struct wiphy_radio { -+ const struct wiphy_radio_freq_range *freq_range; -+ int n_freq_range; -+ -+ const struct ieee80211_iface_combination *iface_combinations; -+ int n_iface_combinations; -+}; -+ - #define CFG80211_HW_TIMESTAMP_ALL_PEERS 0xffff - - /** -@@ -5621,6 +5655,9 @@ struct wiphy_iftype_akm_suites { - * A value of %CFG80211_HW_TIMESTAMP_ALL_PEERS indicates the driver - * supports enabling HW timestamping for all peers (i.e. no need to - * specify a mac address). -+ * -+ * @radio: radios belonging to this wiphy -+ * @n_radio: number of radios - */ - struct wiphy { - struct mutex mtx; -@@ -5771,6 +5808,9 @@ struct wiphy { - - u16 hw_timestamp_max_peers; - -+ int n_radio; -+ const struct wiphy_radio *radio; -+ - char priv[] __aligned(NETDEV_ALIGN); - }; - ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -2061,6 +2061,10 @@ enum nl80211_commands { - * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported - * interface combinations. In each nested item, it contains attributes - * defined in &enum nl80211_if_combination_attrs. -+ * If the wiphy uses multiple radios (@NL80211_ATTR_WIPHY_RADIOS is set), -+ * this attribute contains the interface combinations of the first radio. -+ * See @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS for the global wiphy -+ * combinations for the sum of all radios. - * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like - * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that - * are managed in software: interfaces of these types aren't subject to -@@ -2856,6 +2860,14 @@ enum nl80211_commands { - * %NL80211_CMD_ASSOCIATE indicating the SPP A-MSDUs - * are used on this connection - * -+ * @NL80211_ATTR_WIPHY_RADIOS: Nested attribute describing physical radios -+ * belonging to this wiphy. See &enum nl80211_wiphy_radio_attrs. -+ * -+ * @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS: Nested attribute listing the -+ * supported interface combinations for all radios combined. In each -+ * nested item, it contains attributes defined in -+ * &enum nl80211_if_combination_attrs. -+ * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3401,6 +3413,9 @@ enum nl80211_attrs { - - NL80211_ATTR_ASSOC_SPP_AMSDU, - -+ NL80211_ATTR_WIPHY_RADIOS, -+ NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS, -+ - /* add attributes here, update the policy in nl80211.c */ - - __NL80211_ATTR_AFTER_LAST, -@@ -7987,4 +8002,54 @@ enum nl80211_ap_settings_flags { - NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1, - }; - -+/** -+ * enum nl80211_wiphy_radio_attrs - wiphy radio attributes -+ * -+ * @__NL80211_WIPHY_RADIO_ATTR_INVALID: Invalid -+ * -+ * @NL80211_WIPHY_RADIO_ATTR_INDEX: Index of this radio (u32) -+ * @NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE: Frequency range supported by this -+ * radio. Attribute may be present multiple times. -+ * @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface -+ * combination for this radio. Attribute may be present multiple times -+ * and contains attributes defined in &enum nl80211_if_combination_attrs. -+ * -+ * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal -+ * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute -+ */ -+enum nl80211_wiphy_radio_attrs { -+ __NL80211_WIPHY_RADIO_ATTR_INVALID, -+ -+ NL80211_WIPHY_RADIO_ATTR_INDEX, -+ NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE, -+ NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION, -+ -+ /* keep last */ -+ __NL80211_WIPHY_RADIO_ATTR_LAST, -+ NL80211_WIPHY_RADIO_ATTR_MAX = __NL80211_WIPHY_RADIO_ATTR_LAST - 1, -+}; -+ -+/** -+ * enum nl80211_wiphy_radio_freq_range - wiphy radio frequency range -+ * -+ * @__NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID: Invalid -+ * -+ * @NL80211_WIPHY_RADIO_FREQ_ATTR_START: Frequency range start (u32). -+ * The unit is kHz. -+ * @NL80211_WIPHY_RADIO_FREQ_ATTR_END: Frequency range end (u32). -+ * The unit is kHz. -+ * -+ * @__NL80211_WIPHY_RADIO_FREQ_ATTR_LAST: Internal -+ * @NL80211_WIPHY_RADIO_FREQ_ATTR_MAX: Highest attribute -+ */ -+enum nl80211_wiphy_radio_freq_range { -+ __NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID, -+ -+ NL80211_WIPHY_RADIO_FREQ_ATTR_START, -+ NL80211_WIPHY_RADIO_FREQ_ATTR_END, -+ -+ __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST, -+ NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1, -+}; -+ - #endif /* __LINUX_NL80211_H */ ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -1621,16 +1621,18 @@ nla_put_failure: - } - - static int nl80211_put_ifcomb_data(struct sk_buff *msg, bool large, int idx, -- const struct ieee80211_iface_combination *c) -+ const struct ieee80211_iface_combination *c, -+ u16 nested) - { - struct nlattr *nl_combi, *nl_limits; - int i; - -- nl_combi = nla_nest_start_noflag(msg, idx); -+ nl_combi = nla_nest_start_noflag(msg, idx | nested); - if (!nl_combi) - goto nla_put_failure; - -- nl_limits = nla_nest_start_noflag(msg, NL80211_IFACE_COMB_LIMITS); -+ nl_limits = nla_nest_start_noflag(msg, NL80211_IFACE_COMB_LIMITS | -+ nested); - if (!nl_limits) - goto nla_put_failure; - -@@ -1678,19 +1680,26 @@ nla_put_failure: - - static int nl80211_put_iface_combinations(struct wiphy *wiphy, - struct sk_buff *msg, -- bool large) -+ int attr, int radio, -+ bool large, u16 nested) - { -+ const struct ieee80211_iface_combination *c; - struct nlattr *nl_combis; -- int i; -+ int i, n; - -- nl_combis = nla_nest_start_noflag(msg, -- NL80211_ATTR_INTERFACE_COMBINATIONS); -+ nl_combis = nla_nest_start_noflag(msg, attr | nested); - if (!nl_combis) - goto nla_put_failure; - -- for (i = 0; i < wiphy->n_iface_combinations; i++) -- if (nl80211_put_ifcomb_data(msg, large, i + 1, -- &wiphy->iface_combinations[i])) -+ if (radio >= 0) { -+ c = wiphy->radio[0].iface_combinations; -+ n = wiphy->radio[0].n_iface_combinations; -+ } else { -+ c = wiphy->iface_combinations; -+ n = wiphy->n_iface_combinations; -+ } -+ for (i = 0; i < n; i++) -+ if (nl80211_put_ifcomb_data(msg, large, i + 1, &c[i], nested)) - goto nla_put_failure; - - nla_nest_end(msg, nl_combis); -@@ -2397,6 +2406,80 @@ fail: - return -ENOBUFS; - } - -+static int nl80211_put_radio(struct wiphy *wiphy, struct sk_buff *msg, int idx) -+{ -+ const struct wiphy_radio *r = &wiphy->radio[idx]; -+ struct nlattr *radio, *freq; -+ int i; -+ -+ radio = nla_nest_start(msg, idx); -+ if (!radio) -+ return -ENOBUFS; -+ -+ if (nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_INDEX, idx)) -+ goto nla_put_failure; -+ -+ for (i = 0; i < r->n_freq_range; i++) { -+ const struct wiphy_radio_freq_range *range = &r->freq_range[i]; -+ -+ freq = nla_nest_start(msg, NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE); -+ if (!freq) -+ goto nla_put_failure; -+ -+ if (nla_put_u32(msg, NL80211_WIPHY_RADIO_FREQ_ATTR_START, -+ range->start_freq) || -+ nla_put_u32(msg, NL80211_WIPHY_RADIO_FREQ_ATTR_END, -+ range->end_freq)) -+ goto nla_put_failure; -+ -+ nla_nest_end(msg, freq); -+ } -+ -+ for (i = 0; i < r->n_iface_combinations; i++) -+ if (nl80211_put_ifcomb_data(msg, true, -+ NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION, -+ &r->iface_combinations[i], -+ NLA_F_NESTED)) -+ goto nla_put_failure; -+ -+ nla_nest_end(msg, radio); -+ -+ return 0; -+ -+nla_put_failure: -+ return -ENOBUFS; -+} -+ -+static int nl80211_put_radios(struct wiphy *wiphy, struct sk_buff *msg) -+{ -+ struct nlattr *radios; -+ int i; -+ -+ if (!wiphy->n_radio) -+ return 0; -+ -+ radios = nla_nest_start(msg, NL80211_ATTR_WIPHY_RADIOS); -+ if (!radios) -+ return -ENOBUFS; -+ -+ for (i = 0; i < wiphy->n_radio; i++) -+ if (nl80211_put_radio(wiphy, msg, i)) -+ goto fail; -+ -+ nla_nest_end(msg, radios); -+ -+ if (nl80211_put_iface_combinations(wiphy, msg, -+ NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS, -+ -1, true, NLA_F_NESTED)) -+ return -ENOBUFS; -+ -+ return 0; -+ -+fail: -+ nla_nest_cancel(msg, radios); -+ return -ENOBUFS; -+} -+ - struct nl80211_dump_wiphy_state { - s64 filter_wiphy; - long start; -@@ -2692,7 +2775,9 @@ static int nl80211_send_wiphy(struct cfg - goto nla_put_failure; - - if (nl80211_put_iface_combinations(&rdev->wiphy, msg, -- state->split)) -+ NL80211_ATTR_INTERFACE_COMBINATIONS, -+ rdev->wiphy.n_radio ? 0 : -1, -+ state->split, 0)) - goto nla_put_failure; - - state->split_start++; -@@ -3006,6 +3091,12 @@ static int nl80211_send_wiphy(struct cfg - rdev->wiphy.hw_timestamp_max_peers)) - goto nla_put_failure; - -+ state->split_start++; -+ break; -+ case 17: -+ if (nl80211_put_radios(&rdev->wiphy, msg)) -+ goto nla_put_failure; -+ - /* done */ - state->split_start = 0; - break; diff --git a/package/kernel/mac80211/patches/subsys/342-wifi-cfg80211-extend-interface-combination-check-for.patch b/package/kernel/mac80211/patches/subsys/342-wifi-cfg80211-extend-interface-combination-check-for.patch deleted file mode 100644 index 0ba97a2c0f..0000000000 --- a/package/kernel/mac80211/patches/subsys/342-wifi-cfg80211-extend-interface-combination-check-for.patch +++ /dev/null @@ -1,172 +0,0 @@ -From: Felix Fietkau -Date: Tue, 4 Jun 2024 21:01:50 +0200 -Subject: [PATCH] wifi: cfg80211: extend interface combination check for - multi-radio - -Add a field in struct iface_combination_params to check per-radio -interface combinations instead of per-wiphy ones. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -1598,6 +1598,7 @@ struct cfg80211_color_change_settings { - * - * Used to pass interface combination parameters - * -+ * @radio_idx: wiphy radio index or -1 for global - * @num_different_channels: the number of different channels we want - * to use for verification - * @radar_detect: a bitmap where each bit corresponds to a channel -@@ -1611,6 +1612,7 @@ struct cfg80211_color_change_settings { - * the verification - */ - struct iface_combination_params { -+ int radio_idx; - int num_different_channels; - u8 radar_detect; - int iftype_num[NUM_NL80211_IFTYPES]; -@@ -4579,6 +4581,8 @@ struct mgmt_frame_regs { - * - * @set_hw_timestamp: Enable/disable HW timestamping of TM/FTM frames. - * @set_ttlm: set the TID to link mapping. -+ * @get_radio_mask: get bitmask of radios in use. -+ * (invoked with the wiphy mutex held) - */ - struct cfg80211_ops { - int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); -@@ -4940,6 +4944,7 @@ struct cfg80211_ops { - struct cfg80211_set_hw_timestamp *hwts); - int (*set_ttlm)(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_ttlm_params *params); -+ u32 (*get_radio_mask)(struct wiphy *wiphy, struct net_device *dev); - }; - - /* ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3930,6 +3930,7 @@ int ieee80211_check_combinations(struct - int total = 1; - struct iface_combination_params params = { - .radar_detect = radar_detect, -+ .radio_idx = -1, - }; - - lockdep_assert_wiphy(local->hw.wiphy); -@@ -4020,7 +4021,9 @@ int ieee80211_max_num_channels(struct ie - struct ieee80211_chanctx *ctx; - u32 max_num_different_channels = 1; - int err; -- struct iface_combination_params params = {0}; -+ struct iface_combination_params params = { -+ .radio_idx = -1, -+ }; - - lockdep_assert_wiphy(local->hw.wiphy); - ---- a/net/wireless/rdev-ops.h -+++ b/net/wireless/rdev-ops.h -@@ -1542,4 +1542,16 @@ rdev_set_ttlm(struct cfg80211_registered - - return ret; - } -+ -+static inline u32 -+rdev_get_radio_mask(struct cfg80211_registered_device *rdev, -+ struct net_device *dev) -+{ -+ struct wiphy *wiphy = &rdev->wiphy; -+ -+ if (!rdev->ops->get_radio_mask) -+ return 0; -+ -+ return rdev->ops->get_radio_mask(wiphy, dev); -+} - #endif /* __CFG80211_RDEV_OPS */ ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -2305,13 +2305,16 @@ static int cfg80211_wdev_bi(struct wirel - - static void cfg80211_calculate_bi_data(struct wiphy *wiphy, u32 new_beacon_int, - u32 *beacon_int_gcd, -- bool *beacon_int_different) -+ bool *beacon_int_different, -+ int radio_idx) - { -+ struct cfg80211_registered_device *rdev; - struct wireless_dev *wdev; - - *beacon_int_gcd = 0; - *beacon_int_different = false; - -+ rdev = wiphy_to_rdev(wiphy); - list_for_each_entry(wdev, &wiphy->wdev_list, list) { - int wdev_bi; - -@@ -2319,6 +2322,11 @@ static void cfg80211_calculate_bi_data(s - if (wdev->valid_links) - continue; - -+ /* skip wdevs not active on the given wiphy radio */ -+ if (radio_idx >= 0 && -+ !(rdev_get_radio_mask(rdev, wdev->netdev) & BIT(radio_idx))) -+ continue; -+ - wdev_bi = cfg80211_wdev_bi(wdev); - - if (!wdev_bi) -@@ -2366,14 +2374,19 @@ int cfg80211_iter_combinations(struct wi - void *data), - void *data) - { -+ const struct wiphy_radio *radio = NULL; -+ const struct ieee80211_iface_combination *c, *cs; - const struct ieee80211_regdomain *regdom; - enum nl80211_dfs_regions region = 0; -- int i, j, iftype; -+ int i, j, n, iftype; - int num_interfaces = 0; - u32 used_iftypes = 0; - u32 beacon_int_gcd; - bool beacon_int_different; - -+ if (params->radio_idx >= 0) -+ radio = &wiphy->radio[params->radio_idx]; -+ - /* - * This is a bit strange, since the iteration used to rely only on - * the data given by the driver, but here it now relies on context, -@@ -2385,7 +2398,8 @@ int cfg80211_iter_combinations(struct wi - * interfaces (while being brought up) and channel/radar data. - */ - cfg80211_calculate_bi_data(wiphy, params->new_beacon_int, -- &beacon_int_gcd, &beacon_int_different); -+ &beacon_int_gcd, &beacon_int_different, -+ params->radio_idx); - - if (params->radar_detect) { - rcu_read_lock(); -@@ -2402,13 +2416,18 @@ int cfg80211_iter_combinations(struct wi - used_iftypes |= BIT(iftype); - } - -- for (i = 0; i < wiphy->n_iface_combinations; i++) { -- const struct ieee80211_iface_combination *c; -+ if (radio) { -+ cs = radio->iface_combinations; -+ n = radio->n_iface_combinations; -+ } else { -+ cs = wiphy->iface_combinations; -+ n = wiphy->n_iface_combinations; -+ } -+ for (i = 0; i < n; i++) { - struct ieee80211_iface_limit *limits; - u32 all_iftypes = 0; - -- c = &wiphy->iface_combinations[i]; -- -+ c = &cs[i]; - if (num_interfaces > c->max_interfaces) - continue; - if (params->num_different_channels > c->num_different_channels) diff --git a/package/kernel/mac80211/patches/subsys/343-wifi-cfg80211-add-helper-for-checking-if-a-chandef-i.patch b/package/kernel/mac80211/patches/subsys/343-wifi-cfg80211-add-helper-for-checking-if-a-chandef-i.patch deleted file mode 100644 index d115dd2e54..0000000000 --- a/package/kernel/mac80211/patches/subsys/343-wifi-cfg80211-add-helper-for-checking-if-a-chandef-i.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Felix Fietkau -Date: Fri, 7 Jun 2024 17:58:54 +0200 -Subject: [PATCH] wifi: cfg80211: add helper for checking if a chandef is - valid on a radio - -Check if the full channel width is in the radio's frequency range. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6485,6 +6485,15 @@ static inline bool cfg80211_channel_is_p - } - - /** -+ * cfg80211_radio_chandef_valid - Check if the radio supports the chandef -+ * -+ * @radio: wiphy radio -+ * @chandef: chandef for current channel -+ */ -+bool cfg80211_radio_chandef_valid(const struct wiphy_radio *radio, -+ const struct cfg80211_chan_def *chandef); -+ -+/** - * ieee80211_get_response_rate - get basic rate for a given rate - * - * @sband: the band to look for rates in ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -2884,3 +2884,38 @@ cfg80211_get_iftype_ext_capa(struct wiph - return NULL; - } - EXPORT_SYMBOL(cfg80211_get_iftype_ext_capa); -+ -+static bool -+ieee80211_radio_freq_range_valid(const struct wiphy_radio *radio, -+ u32 freq, u32 width) -+{ -+ const struct wiphy_radio_freq_range *r; -+ int i; -+ -+ for (i = 0; i < radio->n_freq_range; i++) { -+ r = &radio->freq_range[i]; -+ if (freq - width / 2 >= r->start_freq && -+ freq + width / 2 <= r->end_freq) -+ return true; -+ } -+ -+ return false; -+} -+ -+bool cfg80211_radio_chandef_valid(const struct wiphy_radio *radio, -+ const struct cfg80211_chan_def *chandef) -+{ -+ u32 freq, width; -+ -+ freq = ieee80211_chandef_to_khz(chandef); -+ width = nl80211_chan_width_to_mhz(chandef->width); -+ if (!ieee80211_radio_freq_range_valid(radio, freq, width)) -+ return false; -+ -+ freq = MHZ_TO_KHZ(chandef->center_freq2); -+ if (freq && !ieee80211_radio_freq_range_valid(radio, freq, width)) -+ return false; -+ -+ return true; -+} -+EXPORT_SYMBOL(cfg80211_radio_chandef_valid); diff --git a/package/kernel/mac80211/patches/subsys/344-wifi-mac80211-add-support-for-DFS-with-multiple-radi.patch b/package/kernel/mac80211/patches/subsys/344-wifi-mac80211-add-support-for-DFS-with-multiple-radi.patch deleted file mode 100644 index 18634fe146..0000000000 --- a/package/kernel/mac80211/patches/subsys/344-wifi-mac80211-add-support-for-DFS-with-multiple-radi.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Felix Fietkau -Date: Thu, 6 Jun 2024 12:19:08 +0200 -Subject: [PATCH] wifi: mac80211: add support for DFS with multiple - radios - -DFS can be supported with multi-channel combinations, as long as each DFS -capable radio only supports one channel. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -1084,6 +1084,27 @@ static int ieee80211_init_cipher_suites( - return 0; - } - -+static bool -+ieee80211_ifcomb_check(const struct ieee80211_iface_combination *c, int n_comb) -+{ -+ int i, j; -+ -+ for (i = 0; i < n_comb; i++, c++) { -+ /* DFS is not supported with multi-channel combinations yet */ -+ if (c->radar_detect_widths && -+ c->num_different_channels > 1) -+ return false; -+ -+ /* mac80211 doesn't support more than one IBSS interface */ -+ for (j = 0; j < c->n_limits; j++) -+ if ((c->limits[j].types & BIT(NL80211_IFTYPE_ADHOC)) && -+ c->limits[j].max > 1) -+ return false; -+ } -+ -+ return true; -+} -+ - int ieee80211_register_hw(struct ieee80211_hw *hw) - { - struct ieee80211_local *local = hw_to_local(hw); -@@ -1173,17 +1194,20 @@ int ieee80211_register_hw(struct ieee802 - if (comb->num_different_channels > 1) - return -EINVAL; - } -- } else { -- /* DFS is not supported with multi-channel combinations yet */ -- for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { -- const struct ieee80211_iface_combination *comb; -+ } - -- comb = &local->hw.wiphy->iface_combinations[i]; -+ if (hw->wiphy->n_radio) { -+ for (i = 0; i < hw->wiphy->n_radio; i++) { -+ const struct wiphy_radio *radio = &hw->wiphy->radio[i]; - -- if (comb->radar_detect_widths && -- comb->num_different_channels > 1) -+ if (!ieee80211_ifcomb_check(radio->iface_combinations, -+ radio->n_iface_combinations)) - return -EINVAL; - } -+ } else { -+ if (!ieee80211_ifcomb_check(hw->wiphy->iface_combinations, -+ hw->wiphy->n_iface_combinations)) -+ return -EINVAL; - } - - /* Only HW csum features are currently compatible with mac80211 */ -@@ -1313,18 +1337,6 @@ int ieee80211_register_hw(struct ieee802 - hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); - hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); - -- /* mac80211 doesn't support more than one IBSS interface right now */ -- for (i = 0; i < hw->wiphy->n_iface_combinations; i++) { -- const struct ieee80211_iface_combination *c; -- int j; -- -- c = &hw->wiphy->iface_combinations[i]; -- -- for (j = 0; j < c->n_limits; j++) -- if ((c->limits[j].types & BIT(NL80211_IFTYPE_ADHOC)) && -- c->limits[j].max > 1) -- return -EINVAL; -- } - - local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + - sizeof(void *) * channels, GFP_KERNEL); diff --git a/package/kernel/mac80211/patches/subsys/345-wifi-mac80211-add-radio-index-to-ieee80211_chanctx_c.patch b/package/kernel/mac80211/patches/subsys/345-wifi-mac80211-add-radio-index-to-ieee80211_chanctx_c.patch deleted file mode 100644 index b832a2a124..0000000000 --- a/package/kernel/mac80211/patches/subsys/345-wifi-mac80211-add-radio-index-to-ieee80211_chanctx_c.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Felix Fietkau -Date: Wed, 5 Jun 2024 10:41:34 +0200 -Subject: [PATCH] wifi: mac80211: add radio index to - ieee80211_chanctx_conf - -Will be used to explicitly assign a channel context to a wiphy radio. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -250,6 +250,7 @@ struct ieee80211_chan_req { - * @min_def: the minimum channel definition currently required. - * @ap: the channel definition the AP actually is operating as, - * for use with (wider bandwidth) OFDMA -+ * @radio_idx: index of the wiphy radio used used for this channel - * @rx_chains_static: The number of RX chains that must always be - * active on the channel to receive MIMO transmissions - * @rx_chains_dynamic: The number of RX chains that must be enabled -@@ -264,6 +265,7 @@ struct ieee80211_chanctx_conf { - struct cfg80211_chan_def min_def; - struct cfg80211_chan_def ap; - -+ int radio_idx; - u8 rx_chains_static, rx_chains_dynamic; - - bool radar_enabled; ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -623,7 +623,8 @@ ieee80211_chanctx_radar_required(struct - static struct ieee80211_chanctx * - ieee80211_alloc_chanctx(struct ieee80211_local *local, - const struct ieee80211_chan_req *chanreq, -- enum ieee80211_chanctx_mode mode) -+ enum ieee80211_chanctx_mode mode, -+ int radio_idx) - { - struct ieee80211_chanctx *ctx; - -@@ -641,6 +642,7 @@ ieee80211_alloc_chanctx(struct ieee80211 - ctx->conf.rx_chains_dynamic = 1; - ctx->mode = mode; - ctx->conf.radar_enabled = false; -+ ctx->conf.radio_idx = radio_idx; - _ieee80211_recalc_chanctx_min_def(local, ctx, NULL); - - return ctx; -@@ -680,7 +682,7 @@ ieee80211_new_chanctx(struct ieee80211_l - - lockdep_assert_wiphy(local->hw.wiphy); - -- ctx = ieee80211_alloc_chanctx(local, chanreq, mode); -+ ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1); - if (!ctx) - return ERR_PTR(-ENOMEM); - -@@ -1098,7 +1100,7 @@ int ieee80211_link_reserve_chanctx(struc - !list_empty(&curr_ctx->reserved_links)) - return -EBUSY; - -- new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode); -+ new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1); - if (!new_ctx) - return -ENOMEM; - diff --git a/package/kernel/mac80211/patches/subsys/346-wifi-mac80211-extend-ifcomb-check-functions-for-mult.patch b/package/kernel/mac80211/patches/subsys/346-wifi-mac80211-extend-ifcomb-check-functions-for-mult.patch deleted file mode 100644 index 168cf6fad0..0000000000 --- a/package/kernel/mac80211/patches/subsys/346-wifi-mac80211-extend-ifcomb-check-functions-for-mult.patch +++ /dev/null @@ -1,322 +0,0 @@ -From: Felix Fietkau -Date: Tue, 4 Jun 2024 21:48:48 +0200 -Subject: [PATCH] wifi: mac80211: extend ifcomb check functions for - multi-radio - -Add support for counting global and per-radio max/current number of -channels, as well as checking radio-specific interface combinations. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -263,7 +263,7 @@ static int ieee80211_start_p2p_device(st - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - -- ret = ieee80211_check_combinations(sdata, NULL, 0, 0); -+ ret = ieee80211_check_combinations(sdata, NULL, 0, 0, -1); - if (ret < 0) - return ret; - -@@ -285,7 +285,7 @@ static int ieee80211_start_nan(struct wi - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - -- ret = ieee80211_check_combinations(sdata, NULL, 0, 0); -+ ret = ieee80211_check_combinations(sdata, NULL, 0, 0, -1); - if (ret < 0) - return ret; - -@@ -3992,7 +3992,7 @@ __ieee80211_channel_switch(struct wiphy - goto out; - - /* if reservation is invalid then this will fail */ -- err = ieee80211_check_combinations(sdata, NULL, chanctx->mode, 0); -+ err = ieee80211_check_combinations(sdata, NULL, chanctx->mode, 0, -1); - if (err) { - ieee80211_link_unreserve_chanctx(link_data); - goto out; -@@ -5161,4 +5161,5 @@ const struct cfg80211_ops mac80211_confi - .del_link_station = ieee80211_del_link_station, - .set_hw_timestamp = ieee80211_set_hw_timestamp, - .set_ttlm = ieee80211_set_ttlm, -+ .get_radio_mask = ieee80211_get_radio_mask, - }; ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -47,24 +47,29 @@ int ieee80211_chanctx_refcount(struct ie - ieee80211_chanctx_num_reserved(local, ctx); - } - --static int ieee80211_num_chanctx(struct ieee80211_local *local) -+static int ieee80211_num_chanctx(struct ieee80211_local *local, int radio_idx) - { - struct ieee80211_chanctx *ctx; - int num = 0; - - lockdep_assert_wiphy(local->hw.wiphy); - -- list_for_each_entry(ctx, &local->chanctx_list, list) -+ list_for_each_entry(ctx, &local->chanctx_list, list) { -+ if (radio_idx >= 0 && ctx->conf.radio_idx != radio_idx) -+ continue; - num++; -+ } - - return num; - } - --static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local) -+static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local, -+ int radio_idx) - { - lockdep_assert_wiphy(local->hw.wiphy); - -- return ieee80211_num_chanctx(local) < ieee80211_max_num_channels(local); -+ return ieee80211_num_chanctx(local, radio_idx) < -+ ieee80211_max_num_channels(local, radio_idx); - } - - static struct ieee80211_chanctx * -@@ -1045,7 +1050,7 @@ int ieee80211_link_reserve_chanctx(struc - - new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); - if (!new_ctx) { -- if (ieee80211_can_create_new_chanctx(local)) { -+ if (ieee80211_can_create_new_chanctx(local, -1)) { - new_ctx = ieee80211_new_chanctx(local, chanreq, mode); - if (IS_ERR(new_ctx)) - return PTR_ERR(new_ctx); -@@ -1736,7 +1741,7 @@ int ieee80211_link_use_channel(struct ie - link->radar_required = ret; - - ret = ieee80211_check_combinations(sdata, &chanreq->oper, mode, -- radar_detect_width); -+ radar_detect_width, -1); - if (ret < 0) - goto out; - ---- a/net/mac80211/ibss.c -+++ b/net/mac80211/ibss.c -@@ -1745,7 +1745,7 @@ int ieee80211_ibss_join(struct ieee80211 - IEEE80211_CHANCTX_SHARED : IEEE80211_CHANCTX_EXCLUSIVE; - - ret = ieee80211_check_combinations(sdata, ¶ms->chandef, chanmode, -- radar_detect_width); -+ radar_detect_width, -1); - if (ret < 0) - return ret; - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -2596,8 +2596,9 @@ void ieee80211_recalc_dtim(struct ieee80 - int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata, - const struct cfg80211_chan_def *chandef, - enum ieee80211_chanctx_mode chanmode, -- u8 radar_detect); --int ieee80211_max_num_channels(struct ieee80211_local *local); -+ u8 radar_detect, int radio_idx); -+int ieee80211_max_num_channels(struct ieee80211_local *local, int radio_idx); -+u32 ieee80211_get_radio_mask(struct wiphy *wiphy, struct net_device *dev); - void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, - struct ieee80211_chanctx *ctx); - ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -397,7 +397,7 @@ static int ieee80211_check_concurrent_if - } - } - -- return ieee80211_check_combinations(sdata, NULL, 0, 0); -+ return ieee80211_check_combinations(sdata, NULL, 0, 0, -1); - } - - static int ieee80211_check_queues(struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3918,20 +3918,103 @@ static u8 ieee80211_chanctx_radar_detect - return radar_detect; - } - -+static u32 -+__ieee80211_get_radio_mask(struct ieee80211_sub_if_data *sdata) -+{ -+ struct ieee80211_bss_conf *link_conf; -+ struct ieee80211_chanctx_conf *conf; -+ unsigned int link_id; -+ u32 mask = 0; -+ -+ for_each_vif_active_link(&sdata->vif, link_conf, link_id) { -+ conf = sdata_dereference(link_conf->chanctx_conf, sdata); -+ if (!conf || conf->radio_idx < 0) -+ continue; -+ -+ mask |= BIT(conf->radio_idx); -+ } -+ -+ return mask; -+} -+ -+u32 ieee80211_get_radio_mask(struct wiphy *wiphy, struct net_device *dev) -+{ -+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); -+ -+ return __ieee80211_get_radio_mask(sdata); -+} -+ -+static bool -+ieee80211_sdata_uses_radio(struct ieee80211_sub_if_data *sdata, int radio_idx) -+{ -+ if (radio_idx < 0) -+ return true; -+ -+ return __ieee80211_get_radio_mask(sdata) & BIT(radio_idx); -+} -+ -+static int -+ieee80211_fill_ifcomb_params(struct ieee80211_local *local, -+ struct iface_combination_params *params, -+ const struct cfg80211_chan_def *chandef, -+ struct ieee80211_sub_if_data *sdata) -+{ -+ struct ieee80211_sub_if_data *sdata_iter; -+ struct ieee80211_chanctx *ctx; -+ int total = !!sdata; -+ -+ list_for_each_entry(ctx, &local->chanctx_list, list) { -+ if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED) -+ continue; -+ -+ if (params->radio_idx >= 0 && -+ ctx->conf.radio_idx != params->radio_idx) -+ continue; -+ -+ params->radar_detect |= -+ ieee80211_chanctx_radar_detect(local, ctx); -+ -+ if (chandef && ctx->mode != IEEE80211_CHANCTX_EXCLUSIVE && -+ cfg80211_chandef_compatible(chandef, &ctx->conf.def)) -+ continue; -+ -+ params->num_different_channels++; -+ } -+ -+ list_for_each_entry(sdata_iter, &local->interfaces, list) { -+ struct wireless_dev *wdev_iter; -+ -+ wdev_iter = &sdata_iter->wdev; -+ -+ if (sdata_iter == sdata || -+ !ieee80211_sdata_running(sdata_iter) || -+ cfg80211_iftype_allowed(local->hw.wiphy, -+ wdev_iter->iftype, 0, 1)) -+ continue; -+ -+ if (!ieee80211_sdata_uses_radio(sdata_iter, params->radio_idx)) -+ continue; -+ -+ params->iftype_num[wdev_iter->iftype]++; -+ total++; -+ } -+ -+ return total; -+} -+ - int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata, - const struct cfg80211_chan_def *chandef, - enum ieee80211_chanctx_mode chanmode, -- u8 radar_detect) -+ u8 radar_detect, int radio_idx) - { -+ bool shared = chanmode == IEEE80211_CHANCTX_SHARED; - struct ieee80211_local *local = sdata->local; -- struct ieee80211_sub_if_data *sdata_iter; - enum nl80211_iftype iftype = sdata->wdev.iftype; -- struct ieee80211_chanctx *ctx; -- int total = 1; - struct iface_combination_params params = { - .radar_detect = radar_detect, -- .radio_idx = -1, -+ .radio_idx = radio_idx, - }; -+ int total; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -3968,37 +4051,9 @@ int ieee80211_check_combinations(struct - if (iftype != NL80211_IFTYPE_UNSPECIFIED) - params.iftype_num[iftype] = 1; - -- list_for_each_entry(ctx, &local->chanctx_list, list) { -- if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED) -- continue; -- params.radar_detect |= -- ieee80211_chanctx_radar_detect(local, ctx); -- if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) { -- params.num_different_channels++; -- continue; -- } -- if (chandef && chanmode == IEEE80211_CHANCTX_SHARED && -- cfg80211_chandef_compatible(chandef, -- &ctx->conf.def)) -- continue; -- params.num_different_channels++; -- } -- -- list_for_each_entry_rcu(sdata_iter, &local->interfaces, list) { -- struct wireless_dev *wdev_iter; -- -- wdev_iter = &sdata_iter->wdev; -- -- if (sdata_iter == sdata || -- !ieee80211_sdata_running(sdata_iter) || -- cfg80211_iftype_allowed(local->hw.wiphy, -- wdev_iter->iftype, 0, 1)) -- continue; -- -- params.iftype_num[wdev_iter->iftype]++; -- total++; -- } -- -+ total = ieee80211_fill_ifcomb_params(local, ¶ms, -+ shared ? chandef : NULL, -+ sdata); - if (total == 1 && !params.radar_detect) - return 0; - -@@ -4015,30 +4070,17 @@ ieee80211_iter_max_chans(const struct ie - c->num_different_channels); - } - --int ieee80211_max_num_channels(struct ieee80211_local *local) -+int ieee80211_max_num_channels(struct ieee80211_local *local, int radio_idx) - { -- struct ieee80211_sub_if_data *sdata; -- struct ieee80211_chanctx *ctx; - u32 max_num_different_channels = 1; - int err; - struct iface_combination_params params = { -- .radio_idx = -1, -+ .radio_idx = radio_idx, - }; - - lockdep_assert_wiphy(local->hw.wiphy); - -- list_for_each_entry(ctx, &local->chanctx_list, list) { -- if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED) -- continue; -- -- params.num_different_channels++; -- -- params.radar_detect |= -- ieee80211_chanctx_radar_detect(local, ctx); -- } -- -- list_for_each_entry_rcu(sdata, &local->interfaces, list) -- params.iftype_num[sdata->wdev.iftype]++; -+ ieee80211_fill_ifcomb_params(local, ¶ms, NULL, NULL); - - err = cfg80211_iter_combinations(local->hw.wiphy, ¶ms, - ieee80211_iter_max_chans, diff --git a/package/kernel/mac80211/patches/subsys/347-wifi-mac80211-move-code-in-ieee80211_link_reserve_ch.patch b/package/kernel/mac80211/patches/subsys/347-wifi-mac80211-move-code-in-ieee80211_link_reserve_ch.patch deleted file mode 100644 index 9a85067602..0000000000 --- a/package/kernel/mac80211/patches/subsys/347-wifi-mac80211-move-code-in-ieee80211_link_reserve_ch.patch +++ /dev/null @@ -1,175 +0,0 @@ -From: Felix Fietkau -Date: Wed, 5 Jun 2024 10:49:22 +0200 -Subject: [PATCH] wifi: mac80211: move code in - ieee80211_link_reserve_chanctx to a helper - -Reduces indentation in preparation for further changes - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -1033,6 +1033,71 @@ int ieee80211_link_unreserve_chanctx(str - return 0; - } - -+static struct ieee80211_chanctx * -+ieee80211_replace_chanctx(struct ieee80211_local *local, -+ const struct ieee80211_chan_req *chanreq, -+ enum ieee80211_chanctx_mode mode, -+ struct ieee80211_chanctx *curr_ctx) -+{ -+ struct ieee80211_chanctx *new_ctx, *ctx; -+ -+ if (!curr_ctx || (curr_ctx->replace_state == -+ IEEE80211_CHANCTX_WILL_BE_REPLACED) || -+ !list_empty(&curr_ctx->reserved_links)) { -+ /* -+ * Another link already requested this context for a -+ * reservation. Find another one hoping all links assigned -+ * to it will also switch soon enough. -+ * -+ * TODO: This needs a little more work as some cases -+ * (more than 2 chanctx capable devices) may fail which could -+ * otherwise succeed provided some channel context juggling was -+ * performed. -+ * -+ * Consider ctx1..3, link1..6, each ctx has 2 links. link1 and -+ * link2 from ctx1 request new different chandefs starting 2 -+ * in-place reserations with ctx4 and ctx5 replacing ctx1 and -+ * ctx2 respectively. Next link5 and link6 from ctx3 reserve -+ * ctx4. If link3 and link4 remain on ctx2 as they are then this -+ * fails unless `replace_ctx` from ctx5 is replaced with ctx3. -+ */ -+ list_for_each_entry(ctx, &local->chanctx_list, list) { -+ if (ctx->replace_state != -+ IEEE80211_CHANCTX_REPLACE_NONE) -+ continue; -+ -+ if (!list_empty(&ctx->reserved_links)) -+ continue; -+ -+ curr_ctx = ctx; -+ break; -+ } -+ } -+ -+ /* -+ * If that's true then all available contexts already have reservations -+ * and cannot be used. -+ */ -+ if (!curr_ctx || (curr_ctx->replace_state == -+ IEEE80211_CHANCTX_WILL_BE_REPLACED) || -+ !list_empty(&curr_ctx->reserved_links)) -+ return ERR_PTR(-EBUSY); -+ -+ new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1); -+ if (!new_ctx) -+ return ERR_PTR(-ENOMEM); -+ -+ new_ctx->replace_ctx = curr_ctx; -+ new_ctx->replace_state = IEEE80211_CHANCTX_REPLACES_OTHER; -+ -+ curr_ctx->replace_ctx = new_ctx; -+ curr_ctx->replace_state = IEEE80211_CHANCTX_WILL_BE_REPLACED; -+ -+ list_add_rcu(&new_ctx->list, &local->chanctx_list); -+ -+ return new_ctx; -+} -+ - int ieee80211_link_reserve_chanctx(struct ieee80211_link_data *link, - const struct ieee80211_chan_req *chanreq, - enum ieee80211_chanctx_mode mode, -@@ -1040,7 +1105,7 @@ int ieee80211_link_reserve_chanctx(struc - { - struct ieee80211_sub_if_data *sdata = link->sdata; - struct ieee80211_local *local = sdata->local; -- struct ieee80211_chanctx *new_ctx, *curr_ctx, *ctx; -+ struct ieee80211_chanctx *new_ctx, *curr_ctx; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -1050,75 +1115,13 @@ int ieee80211_link_reserve_chanctx(struc - - new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); - if (!new_ctx) { -- if (ieee80211_can_create_new_chanctx(local, -1)) { -+ if (ieee80211_can_create_new_chanctx(local, -1)) - new_ctx = ieee80211_new_chanctx(local, chanreq, mode); -- if (IS_ERR(new_ctx)) -- return PTR_ERR(new_ctx); -- } else { -- if (!curr_ctx || -- (curr_ctx->replace_state == -- IEEE80211_CHANCTX_WILL_BE_REPLACED) || -- !list_empty(&curr_ctx->reserved_links)) { -- /* -- * Another link already requested this context -- * for a reservation. Find another one hoping -- * all links assigned to it will also switch -- * soon enough. -- * -- * TODO: This needs a little more work as some -- * cases (more than 2 chanctx capable devices) -- * may fail which could otherwise succeed -- * provided some channel context juggling was -- * performed. -- * -- * Consider ctx1..3, link1..6, each ctx has 2 -- * links. link1 and link2 from ctx1 request new -- * different chandefs starting 2 in-place -- * reserations with ctx4 and ctx5 replacing -- * ctx1 and ctx2 respectively. Next link5 and -- * link6 from ctx3 reserve ctx4. If link3 and -- * link4 remain on ctx2 as they are then this -- * fails unless `replace_ctx` from ctx5 is -- * replaced with ctx3. -- */ -- list_for_each_entry(ctx, &local->chanctx_list, -- list) { -- if (ctx->replace_state != -- IEEE80211_CHANCTX_REPLACE_NONE) -- continue; -- -- if (!list_empty(&ctx->reserved_links)) -- continue; -- -- curr_ctx = ctx; -- break; -- } -- } -- -- /* -- * If that's true then all available contexts already -- * have reservations and cannot be used. -- */ -- if (!curr_ctx || -- (curr_ctx->replace_state == -- IEEE80211_CHANCTX_WILL_BE_REPLACED) || -- !list_empty(&curr_ctx->reserved_links)) -- return -EBUSY; -- -- new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1); -- if (!new_ctx) -- return -ENOMEM; -- -- new_ctx->replace_ctx = curr_ctx; -- new_ctx->replace_state = -- IEEE80211_CHANCTX_REPLACES_OTHER; -- -- curr_ctx->replace_ctx = new_ctx; -- curr_ctx->replace_state = -- IEEE80211_CHANCTX_WILL_BE_REPLACED; -- -- list_add_rcu(&new_ctx->list, &local->chanctx_list); -- } -+ else -+ new_ctx = ieee80211_replace_chanctx(local, chanreq, -+ mode, curr_ctx); -+ if (IS_ERR(new_ctx)) -+ return PTR_ERR(new_ctx); - } - - list_add(&link->reserved_chanctx_list, &new_ctx->reserved_links); diff --git a/package/kernel/mac80211/patches/subsys/348-wifi-mac80211-add-wiphy-radio-assignment-and-validat.patch b/package/kernel/mac80211/patches/subsys/348-wifi-mac80211-add-wiphy-radio-assignment-and-validat.patch deleted file mode 100644 index c559f070e8..0000000000 --- a/package/kernel/mac80211/patches/subsys/348-wifi-mac80211-add-wiphy-radio-assignment-and-validat.patch +++ /dev/null @@ -1,132 +0,0 @@ -From: Felix Fietkau -Date: Wed, 5 Jun 2024 18:39:55 +0200 -Subject: [PATCH] wifi: mac80211: add wiphy radio assignment and - validation - -Validate number of channels and interface combinations per radio. -Assign each channel context to a radio. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -680,14 +680,15 @@ static int ieee80211_add_chanctx(struct - static struct ieee80211_chanctx * - ieee80211_new_chanctx(struct ieee80211_local *local, - const struct ieee80211_chan_req *chanreq, -- enum ieee80211_chanctx_mode mode) -+ enum ieee80211_chanctx_mode mode, -+ int radio_idx) - { - struct ieee80211_chanctx *ctx; - int err; - - lockdep_assert_wiphy(local->hw.wiphy); - -- ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1); -+ ctx = ieee80211_alloc_chanctx(local, chanreq, mode, radio_idx); - if (!ctx) - return ERR_PTR(-ENOMEM); - -@@ -1040,6 +1041,8 @@ ieee80211_replace_chanctx(struct ieee802 - struct ieee80211_chanctx *curr_ctx) - { - struct ieee80211_chanctx *new_ctx, *ctx; -+ struct wiphy *wiphy = local->hw.wiphy; -+ const struct wiphy_radio *radio; - - if (!curr_ctx || (curr_ctx->replace_state == - IEEE80211_CHANCTX_WILL_BE_REPLACED) || -@@ -1069,6 +1072,12 @@ ieee80211_replace_chanctx(struct ieee802 - if (!list_empty(&ctx->reserved_links)) - continue; - -+ if (ctx->conf.radio_idx >= 0) { -+ radio = &wiphy->radio[ctx->conf.radio_idx]; -+ if (!cfg80211_radio_chandef_valid(radio, &chanreq->oper)) -+ continue; -+ } -+ - curr_ctx = ctx; - break; - } -@@ -1098,6 +1107,34 @@ ieee80211_replace_chanctx(struct ieee802 - return new_ctx; - } - -+static bool -+ieee80211_find_available_radio(struct ieee80211_local *local, -+ const struct ieee80211_chan_req *chanreq, -+ int *radio_idx) -+{ -+ struct wiphy *wiphy = local->hw.wiphy; -+ const struct wiphy_radio *radio; -+ int i; -+ -+ *radio_idx = -1; -+ if (!wiphy->n_radio) -+ return true; -+ -+ for (i = 0; i < wiphy->n_radio; i++) { -+ radio = &wiphy->radio[i]; -+ if (!cfg80211_radio_chandef_valid(radio, &chanreq->oper)) -+ continue; -+ -+ if (!ieee80211_can_create_new_chanctx(local, i)) -+ continue; -+ -+ *radio_idx = i; -+ return true; -+ } -+ -+ return false; -+} -+ - int ieee80211_link_reserve_chanctx(struct ieee80211_link_data *link, - const struct ieee80211_chan_req *chanreq, - enum ieee80211_chanctx_mode mode, -@@ -1106,6 +1143,7 @@ int ieee80211_link_reserve_chanctx(struc - struct ieee80211_sub_if_data *sdata = link->sdata; - struct ieee80211_local *local = sdata->local; - struct ieee80211_chanctx *new_ctx, *curr_ctx; -+ int radio_idx; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -1115,8 +1153,10 @@ int ieee80211_link_reserve_chanctx(struc - - new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); - if (!new_ctx) { -- if (ieee80211_can_create_new_chanctx(local, -1)) -- new_ctx = ieee80211_new_chanctx(local, chanreq, mode); -+ if (ieee80211_can_create_new_chanctx(local, -1) && -+ ieee80211_find_available_radio(local, chanreq, &radio_idx)) -+ new_ctx = ieee80211_new_chanctx(local, chanreq, mode, -+ radio_idx); - else - new_ctx = ieee80211_replace_chanctx(local, chanreq, - mode, curr_ctx); -@@ -1724,6 +1764,7 @@ int ieee80211_link_use_channel(struct ie - struct ieee80211_local *local = sdata->local; - struct ieee80211_chanctx *ctx; - u8 radar_detect_width = 0; -+ int radio_idx; - int ret; - - lockdep_assert_wiphy(local->hw.wiphy); -@@ -1751,8 +1792,12 @@ int ieee80211_link_use_channel(struct ie - __ieee80211_link_release_channel(link); - - ctx = ieee80211_find_chanctx(local, chanreq, mode); -- if (!ctx) -- ctx = ieee80211_new_chanctx(local, chanreq, mode); -+ if (!ctx) { -+ if (!ieee80211_find_available_radio(local, chanreq, &radio_idx)) -+ ctx = ERR_PTR(-EBUSY); -+ else -+ ctx = ieee80211_new_chanctx(local, chanreq, mode, radio_idx); -+ } - if (IS_ERR(ctx)) { - ret = PTR_ERR(ctx); - goto out; diff --git a/package/kernel/mac80211/patches/subsys/349-wifi-mac80211_hwsim-add-support-for-multi-radio-wiph.patch b/package/kernel/mac80211/patches/subsys/349-wifi-mac80211_hwsim-add-support-for-multi-radio-wiph.patch deleted file mode 100644 index 91fe6d83d9..0000000000 --- a/package/kernel/mac80211/patches/subsys/349-wifi-mac80211_hwsim-add-support-for-multi-radio-wiph.patch +++ /dev/null @@ -1,199 +0,0 @@ -From: Felix Fietkau -Date: Tue, 11 Jun 2024 09:02:55 +0200 -Subject: [PATCH] wifi: mac80211_hwsim: add support for multi-radio wiphy - -This registers one wiphy radio per supported band. Number of different -channels is set per radio. - -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/wireless/virtual/mac80211_hwsim.c -+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c -@@ -69,6 +69,10 @@ static bool mlo; - module_param(mlo, bool, 0444); - MODULE_PARM_DESC(mlo, "Support MLO"); - -+static bool multi_radio; -+module_param(multi_radio, bool, 0444); -+MODULE_PARM_DESC(mlo, "Support Multiple Radios per wiphy"); -+ - /** - * enum hwsim_regtest - the type of regulatory tests we offer - * -@@ -669,6 +673,10 @@ struct mac80211_hwsim_data { - struct ieee80211_iface_limit if_limits[3]; - int n_if_limits; - -+ struct ieee80211_iface_combination if_combination_radio; -+ struct wiphy_radio_freq_range radio_range[NUM_NL80211_BANDS]; -+ struct wiphy_radio radio[NUM_NL80211_BANDS]; -+ - u32 ciphers[ARRAY_SIZE(hwsim_ciphers)]; - - struct mac_address addresses[2]; -@@ -917,6 +925,7 @@ static const struct nla_policy hwsim_gen - [HWSIM_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG }, - [HWSIM_ATTR_PMSR_SUPPORT] = NLA_POLICY_NESTED(hwsim_pmsr_capa_policy), - [HWSIM_ATTR_PMSR_RESULT] = NLA_POLICY_NESTED(hwsim_pmsr_peers_result_policy), -+ [HWSIM_ATTR_MULTI_RADIO] = { .type = NLA_FLAG }, - }; - - #if IS_REACHABLE(CONFIG_VIRTIO) -@@ -4007,6 +4016,7 @@ struct hwsim_new_radio_params { - bool reg_strict; - bool p2p_device; - bool use_chanctx; -+ bool multi_radio; - bool destroy_on_close; - const char *hwname; - bool no_vif; -@@ -4083,6 +4093,12 @@ static int append_radio_msg(struct sk_bu - return ret; - } - -+ if (param->multi_radio) { -+ ret = nla_put_flag(skb, HWSIM_ATTR_MULTI_RADIO); -+ if (ret < 0) -+ return ret; -+ } -+ - if (param->hwname) { - ret = nla_put(skb, HWSIM_ATTR_RADIO_NAME, - strlen(param->hwname), param->hwname); -@@ -5099,6 +5115,7 @@ static int mac80211_hwsim_new_radio(stru - struct net *net; - int idx, i; - int n_limits = 0; -+ int n_bands = 0; - - if (WARN_ON(param->channels > 1 && !param->use_chanctx)) - return -EINVAL; -@@ -5202,22 +5219,22 @@ static int mac80211_hwsim_new_radio(stru - n_limits++; - } - -+ data->if_combination.radar_detect_widths = -+ BIT(NL80211_CHAN_WIDTH_5) | -+ BIT(NL80211_CHAN_WIDTH_10) | -+ BIT(NL80211_CHAN_WIDTH_20_NOHT) | -+ BIT(NL80211_CHAN_WIDTH_20) | -+ BIT(NL80211_CHAN_WIDTH_40) | -+ BIT(NL80211_CHAN_WIDTH_80) | -+ BIT(NL80211_CHAN_WIDTH_160); -+ - if (data->use_chanctx) { - hw->wiphy->max_scan_ssids = 255; - hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; - hw->wiphy->max_remain_on_channel_duration = 1000; -- data->if_combination.radar_detect_widths = 0; - data->if_combination.num_different_channels = data->channels; - } else { - data->if_combination.num_different_channels = 1; -- data->if_combination.radar_detect_widths = -- BIT(NL80211_CHAN_WIDTH_5) | -- BIT(NL80211_CHAN_WIDTH_10) | -- BIT(NL80211_CHAN_WIDTH_20_NOHT) | -- BIT(NL80211_CHAN_WIDTH_20) | -- BIT(NL80211_CHAN_WIDTH_40) | -- BIT(NL80211_CHAN_WIDTH_80) | -- BIT(NL80211_CHAN_WIDTH_160); - } - - if (!n_limits) { -@@ -5333,6 +5350,9 @@ static int mac80211_hwsim_new_radio(stru - - for (band = NL80211_BAND_2GHZ; band < NUM_NL80211_BANDS; band++) { - struct ieee80211_supported_band *sband = &data->bands[band]; -+ struct wiphy_radio_freq_range *radio_range; -+ const struct ieee80211_channel *c; -+ struct wiphy_radio *radio; - - sband->band = band; - -@@ -5406,8 +5426,36 @@ static int mac80211_hwsim_new_radio(stru - mac80211_hwsim_sband_capab(sband); - - hw->wiphy->bands[band] = sband; -+ -+ if (!param->multi_radio) -+ continue; -+ -+ c = sband->channels; -+ radio_range = &data->radio_range[n_bands]; -+ radio_range->start_freq = ieee80211_channel_to_khz(c) - 10000; -+ -+ c += sband->n_channels - 1; -+ radio_range->end_freq = ieee80211_channel_to_khz(c) + 10000; -+ -+ radio = &data->radio[n_bands++]; -+ radio->freq_range = radio_range; -+ radio->n_freq_range = 1; -+ radio->iface_combinations = &data->if_combination_radio; -+ radio->n_iface_combinations = 1; - } - -+ if (param->multi_radio) { -+ hw->wiphy->radio = data->radio; -+ hw->wiphy->n_radio = n_bands; -+ -+ memcpy(&data->if_combination_radio, &data->if_combination, -+ sizeof(data->if_combination)); -+ data->if_combination.num_different_channels *= n_bands; -+ } -+ -+ if (data->use_chanctx) -+ data->if_combination.radar_detect_widths = 0; -+ - /* By default all radios belong to the first group */ - data->group = 1; - mutex_init(&data->mutex); -@@ -6025,6 +6073,9 @@ static int hwsim_new_radio_nl(struct sk_ - else - param.use_chanctx = (param.channels > 1); - -+ if (info->attrs[HWSIM_ATTR_MULTI_RADIO]) -+ param.multi_radio = true; -+ - if (info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]) - param.reg_alpha2 = - nla_data(info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]); -@@ -6105,7 +6156,7 @@ static int hwsim_new_radio_nl(struct sk_ - - param.mlo = info->attrs[HWSIM_ATTR_MLO_SUPPORT]; - -- if (param.mlo) -+ if (param.mlo || param.multi_radio) - param.use_chanctx = true; - - if (info->attrs[HWSIM_ATTR_RADIO_NAME]) { -@@ -6802,7 +6853,8 @@ static int __init init_mac80211_hwsim(vo - - param.p2p_device = support_p2p_device; - param.mlo = mlo; -- param.use_chanctx = channels > 1 || mlo; -+ param.multi_radio = multi_radio; -+ param.use_chanctx = channels > 1 || mlo || multi_radio; - param.iftypes = HWSIM_IFTYPE_SUPPORT_MASK; - if (param.p2p_device) - param.iftypes |= BIT(NL80211_IFTYPE_P2P_DEVICE); ---- a/drivers/net/wireless/virtual/mac80211_hwsim.h -+++ b/drivers/net/wireless/virtual/mac80211_hwsim.h -@@ -157,6 +157,9 @@ enum hwsim_commands { - * to provide details about peer measurement request (nl80211_peer_measurement_attrs) - * @HWSIM_ATTR_PMSR_RESULT: nested attributed used with %HWSIM_CMD_REPORT_PMSR - * to provide peer measurement result (nl80211_peer_measurement_attrs) -+ * @HWSIM_ATTR_MULTI_RADIO: Register multiple wiphy radios (flag). -+ * Adds one radio for each band. Number of supported channels will be set for -+ * each radio instead of for the wiphy. - * @__HWSIM_ATTR_MAX: enum limit - */ - enum hwsim_attrs { -@@ -189,6 +192,7 @@ enum hwsim_attrs { - HWSIM_ATTR_PMSR_SUPPORT, - HWSIM_ATTR_PMSR_REQUEST, - HWSIM_ATTR_PMSR_RESULT, -+ HWSIM_ATTR_MULTI_RADIO, - __HWSIM_ATTR_MAX, - }; - #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1) diff --git a/package/kernel/mac80211/patches/subsys/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/package/kernel/mac80211/patches/subsys/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch deleted file mode 100644 index 26af6a2fb9..0000000000 --- a/package/kernel/mac80211/patches/subsys/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/backport-include/linux/of_net.h -+++ /dev/null -@@ -1,26 +0,0 @@ --#ifndef _BP_OF_NET_H --#define _BP_OF_NET_H --#include_next --#include --#include -- --/* The behavior of of_get_mac_address() changed in kernel 5.2, it now -- * returns an error code and not NULL in case of an error. -- */ --#if LINUX_VERSION_IS_LESS(5,13,0) --static inline int backport_of_get_mac_address(struct device_node *np, u8 *mac_out) --{ -- const void *mac = of_get_mac_address(np); -- -- if (!mac) -- return -ENODEV; -- if (IS_ERR(mac)) -- return PTR_ERR(mac); -- ether_addr_copy(mac_out, mac); -- -- return 0; --} --#define of_get_mac_address LINUX_BACKPORT(of_get_mac_address) --#endif /* < 5.2 */ -- --#endif /* _BP_OF_NET_H */ diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 221158bee6..5aeddb99bc 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -1,10 +1,10 @@ PKG_DRIVERS += \ - rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \ + rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common rtl8192d-common \ rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723-common rtl8723be rtl8723bs rtl8821ae \ rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-sdio rtw88-8821c rtw88-8822b rtw88-8822c \ - rtw88-8723d rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu \ + rtw88-8723x rtw88-8723d rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu \ rtw88-8822ce rtw88-8822cu rtw88-8723de rtw88-8723ds rtw88-8723du \ - rtw89 rtw89-pci rtw89-8851be rtw89-8852ae rtw89-8852be rtw89-8852ce + rtw89 rtw89-pci rtw89-8851be rtw89-8852ae rtw89-8852b-common rtw89-8852be rtw89-8852ce config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI @@ -13,6 +13,7 @@ config-$(call config_package,rtlwifi-usb) += RTLWIFI_USB config-$(call config_package,rtl8192c-common) += RTL8192C_COMMON config-$(call config_package,rtl8192ce) += RTL8192CE config-$(call config_package,rtl8192se) += RTL8192SE +config-$(call config_package,rtl8192d-common) += RTL8192D_COMMON config-$(call config_package,rtl8192de) += RTL8192DE config-$(call config_package,rtl8192cu) += RTL8192CU config-$(call config_package,rtl8821ae) += RTL8821AE @@ -40,6 +41,7 @@ config-$(call config_package,rtw88-8822bu) += RTW88_8822BU config-$(call config_package,rtw88-8822c) += RTW88_8822C config-$(call config_package,rtw88-8822ce) += RTW88_8822CE config-$(call config_package,rtw88-8822cu) += RTW88_8822CU +config-$(call config_package,rtw88-8723x) += RTW88_8723X config-$(call config_package,rtw88-8723d) += RTW88_8723D config-$(call config_package,rtw88-8723de) += RTW88_8723DE config-$(call config_package,rtw88-8723ds) += RTW88_8723DS @@ -51,6 +53,7 @@ config-$(call config_package,rtw89) += RTW89 RTW89_CORE config-$(call config_package,rtw89-pci) += RTW89_PCI config-$(call config_package,rtw89-8851be) += RTW89_8851B RTW89_8851BE config-$(call config_package,rtw89-8852ae) += RTW89_8852A RTW89_8852AE +config-$(call config_package,rtw89-8852b-common) += RTW89_8852B_COMMON config-$(call config_package,rtw89-8852be) += RTW89_8852B RTW89_8852BE config-$(call config_package,rtw89-8852ce) += RTW89_8852C RTW89_8852CE config-$(CONFIG_PACKAGE_RTW89_DEBUG) += RTW89_DEBUG @@ -125,10 +128,18 @@ define KernelPackage/rtl8192se AUTOLOAD:=$(call AutoProbe,rtl8192se) endef +define KernelPackage/rtl8192d-common + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8192DE/RTL8192DU common support module + DEPENDS+= +kmod-rtlwifi + FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192d/rtl8192d-common.ko + HIDDEN:=1 +endef + define KernelPackage/rtl8192de $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8192DE/RTL8188DE support - DEPENDS+= +kmod-rtlwifi-pci +rtl8192de-firmware + DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192d-common +rtl8192de-firmware FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rtl8192de.ko AUTOLOAD:=$(call AutoProbe,rtl8192de) endef @@ -260,10 +271,19 @@ define KernelPackage/rtw88-8822c HIDDEN:=1 endef +define KernelPackage/rtw88-8723x + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8723x family support + DEPENDS+= +kmod-rtw88 + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723x.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8723x) + HIDDEN:=1 +endef + define KernelPackage/rtw88-8723d $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8723D family support - DEPENDS+= +kmod-rtw88 +rtl8723de-firmware + DEPENDS+= +kmod-rtw88-8723x +rtl8723de-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko AUTOLOAD:=$(call AutoProbe,rtw88_8723d) HIDDEN:=1 @@ -431,10 +451,20 @@ define KernelPackage/rtw89-8852ae AUTOLOAD:=$(call AutoProbe,rtw89_8852ae) endef +define KernelPackage/rtw89-8852b-common + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8852B family support + DEPENDS+= +kmod-rtw89-pci + FILES:= \ + $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw89/rtw89_8852b_common.ko + AUTOLOAD:=$(call AutoProbe,rtw89_8852b_common) + HIDDEN:=1 +endef + define KernelPackage/rtw89-8852be $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8852BE support - DEPENDS+= +kmod-rtw89-pci +rtl8852be-firmware + DEPENDS+= +kmod-rtw89-8852b-common +rtl8852be-firmware FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw89/rtw89_8852b.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw89/rtw89_8852be.ko diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 4d808c96b3..8c3bf3e76b 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-09-05 -PKG_SOURCE_VERSION:=65cc3daf2a332cc658e9f7438cdadde4392e672e -PKG_MIRROR_HASH:=c29c4f883051a6360119156a03e010ac11573011b23d9e873f83c720600970e7 +PKG_SOURCE_DATE:=2024-09-29 +PKG_SOURCE_VERSION:=680bc70f161fde0f167e2ae50c771be4775eb50a +PKG_MIRROR_HASH:=bcdb95e40cfceba56a565ad6b6d9f92a122e7230d0f7f950b3d39e4280723cca PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 @@ -318,15 +318,40 @@ endef define KernelPackage/mt7996e $(KernelPackage/mt76-default) TITLE:=MediaTek MT7996E wireless driver - DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY + DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +@DRIVER_11AX_SUPPORT \ + +@KERNEL_RELAY +@DRIVER_11BE_SUPPORT FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko AUTOLOAD:=$(call AutoProbe,mt7996e) endef +define KernelPackage/mt7992-firmware + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7992 firmware + DEPENDS+=+kmod-mt7996e +endef + +define KernelPackage/mt7992-23-firmware + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7996 firmware (2+3 antenna variant) + DEPENDS+=+kmod-mt7996e +endef + +define KernelPackage/mt7996-firmware-common + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7996 firmware (common files) + HIDDEN:=1 +endef + define KernelPackage/mt7996-firmware $(KernelPackage/mt76-default) TITLE:=MediaTek MT7996 firmware - DEPENDS+=+kmod-mt7996e + DEPENDS+=+kmod-mt7996e +kmod-mt7996-firmware-common +endef + +define KernelPackage/mt7996-233-firmware + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7996 firmware (2+3+3 antenna variant) + DEPENDS+=+kmod-mt7996e +kmod-mt7996-firmware-common endef define KernelPackage/mt7925-firmware @@ -630,17 +655,59 @@ define KernelPackage/mt7925-firmware/install $(1)/lib/firmware/mediatek/mt7925 endef -define KernelPackage/mt7996-firmware/install +define KernelPackage/mt7992-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 + cp \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_dsp.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_2i5i.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_rom_patch.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wa.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wm.bin \ + $(1)/lib/firmware/mediatek/mt7996 +endef + +define KernelPackage/mt7992-23-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 + cp \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_dsp_23.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_23.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_23_2i5i.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_rom_patch_23.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wa_23.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wm_23.bin \ + $(1)/lib/firmware/mediatek/mt7996 +endef + +define KernelPackage/mt7996-firmware-common/install $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 cp \ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_dsp.bin \ + $(1)/lib/firmware/mediatek/mt7996 +endef + +define KernelPackage/mt7996-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 + cp \ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom_2i5i6i.bin \ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \ $(1)/lib/firmware/mediatek/mt7996 endef +define KernelPackage/mt7996-233-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 + cp \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom_233.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom_233_2i5i6i.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch_233.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa_233.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm_233.bin \ + $(1)/lib/firmware/mediatek/mt7996 +endef + define Package/mt76-test/install mkdir -p $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin @@ -691,6 +758,10 @@ $(eval $(call KernelPackage,mt7921e)) $(eval $(call KernelPackage,mt7925u)) $(eval $(call KernelPackage,mt7925e)) $(eval $(call KernelPackage,mt7996e)) +$(eval $(call KernelPackage,mt7992-firmware)) +$(eval $(call KernelPackage,mt7992-23-firmware)) +$(eval $(call KernelPackage,mt7996-firmware-common)) $(eval $(call KernelPackage,mt7996-firmware)) +$(eval $(call KernelPackage,mt7996-233-firmware)) $(eval $(call KernelPackage,mt76)) $(eval $(call BuildPackage,mt76-test)) diff --git a/package/kernel/mwlwifi/patches/005-mac80211_update.patch b/package/kernel/mwlwifi/patches/005-mac80211_update.patch index 877053fdf1..54dc4db783 100644 --- a/package/kernel/mwlwifi/patches/005-mac80211_update.patch +++ b/package/kernel/mwlwifi/patches/005-mac80211_update.patch @@ -358,6 +358,15 @@ +} --- a/mac80211.c +++ b/mac80211.c +@@ -159,7 +159,7 @@ fwcmd_fail: + return rc; + } + +-static void mwl_mac80211_stop(struct ieee80211_hw *hw) ++static void mwl_mac80211_stop(struct ieee80211_hw *hw, bool suspend) + { + mwl_fwcmd_radio_disable(hw); + @@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change } } diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 554cde7a2d..959424ce12 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -17,13 +17,9 @@ PKG_BUILD_PARALLEL:=1 PKG_BASE:=$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(PKG_VERSION)))) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= \ - http://www.openssl.org/source/ \ - http://www.openssl.org/source/old/$(PKG_BASE)/ \ - https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ \ - http://ftp.fi.muni.cz/pub/openssl/source/ \ - http://ftp.fi.muni.cz/pub/openssl/source/old/$(PKG_BASE)/ \ - ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ - ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ + https://www.openssl.org/source/ \ + https://www.openssl.org/source/old/$(PKG_BASE)/ \ + https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ PKG_HASH:=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533 @@ -74,7 +70,7 @@ endif define Package/openssl/Default TITLE:=Open source SSL toolkit - URL:=http://www.openssl.org/ + URL:=https://www.openssl.org/ SECTION:=libs CATEGORY:=Libraries endef diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh index 11b11c411f..23e557105b 100755 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh @@ -159,77 +159,79 @@ mac80211_hostapd_setup_base() { chan_ofs=0 [ "$band" = "6g" ] && chan_ofs=1 - ieee80211n=1 - ht_capab= - case "$htmode" in - VHT20|HT20|HE20) ;; - HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160) - case "$hwmode" in - a) - case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in - 1) ht_capab="[HT40+]";; - 0) ht_capab="[HT40-]";; - esac - ;; - *) - case "$htmode" in - HT40+) ht_capab="[HT40+]";; - HT40-) ht_capab="[HT40-]";; - *) - if [ "$channel" -lt 7 ]; then - ht_capab="[HT40+]" - else - ht_capab="[HT40-]" - fi - ;; - esac - ;; - esac - [ "$auto_channel" -gt 0 ] && ht_capab="[HT40+]" - ;; - *) ieee80211n= ;; - esac + if [ "$band" != "6g" ]; then + ieee80211n=1 + ht_capab= + case "$htmode" in + VHT20|HT20|HE20|EHT20) ;; + HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160|EHT40|EHT80|EHT160) + case "$hwmode" in + a) + case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in + 1) ht_capab="[HT40+]";; + 0) ht_capab="[HT40-]";; + esac + ;; + *) + case "$htmode" in + HT40+) ht_capab="[HT40+]";; + HT40-) ht_capab="[HT40-]";; + *) + if [ "$channel" -lt 7 ]; then + ht_capab="[HT40+]" + else + ht_capab="[HT40-]" + fi + ;; + esac + ;; + esac + [ "$auto_channel" -gt 0 ] && ht_capab="[HT40+]" + ;; + *) ieee80211n= ;; + esac - [ -n "$ieee80211n" ] && { - append base_cfg "ieee80211n=1" "$N" + [ -n "$ieee80211n" ] && { + append base_cfg "ieee80211n=1" "$N" - set_default ht_coex 0 - append base_cfg "ht_coex=$ht_coex" "$N" + set_default ht_coex 0 + append base_cfg "ht_coex=$ht_coex" "$N" - json_get_vars \ - ldpc:1 \ - greenfield:0 \ - short_gi_20:1 \ - short_gi_40:1 \ - tx_stbc:1 \ - rx_stbc:3 \ - max_amsdu:1 \ - dsss_cck_40:1 + json_get_vars \ + ldpc:1 \ + greenfield:0 \ + short_gi_20:1 \ + short_gi_40:1 \ + tx_stbc:1 \ + rx_stbc:3 \ + max_amsdu:1 \ + dsss_cck_40:1 - ht_cap_mask=0 - for cap in $(iw phy "$phy" info | grep 'Capabilities:' | cut -d: -f2); do - ht_cap_mask="$(($ht_cap_mask | $cap))" - done + ht_cap_mask=0 + for cap in $(iw phy "$phy" info | grep 'Capabilities:' | cut -d: -f2); do + ht_cap_mask="$(($ht_cap_mask | $cap))" + done - cap_rx_stbc=$((($ht_cap_mask >> 8) & 3)) - [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc" - ht_cap_mask="$(( ($ht_cap_mask & ~(0x300)) | ($cap_rx_stbc << 8) ))" + cap_rx_stbc=$((($ht_cap_mask >> 8) & 3)) + [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc" + ht_cap_mask="$(( ($ht_cap_mask & ~(0x300)) | ($cap_rx_stbc << 8) ))" - mac80211_add_capabilities ht_capab_flags $ht_cap_mask \ - LDPC:0x1::$ldpc \ - GF:0x10::$greenfield \ - SHORT-GI-20:0x20::$short_gi_20 \ - SHORT-GI-40:0x40::$short_gi_40 \ - TX-STBC:0x80::$tx_stbc \ - RX-STBC1:0x300:0x100:1 \ - RX-STBC12:0x300:0x200:1 \ - RX-STBC123:0x300:0x300:1 \ - MAX-AMSDU-7935:0x800::$max_amsdu \ - DSSS_CCK-40:0x1000::$dsss_cck_40 + mac80211_add_capabilities ht_capab_flags $ht_cap_mask \ + LDPC:0x1::$ldpc \ + GF:0x10::$greenfield \ + SHORT-GI-20:0x20::$short_gi_20 \ + SHORT-GI-40:0x40::$short_gi_40 \ + TX-STBC:0x80::$tx_stbc \ + RX-STBC1:0x300:0x100:1 \ + RX-STBC12:0x300:0x200:1 \ + RX-STBC123:0x300:0x300:1 \ + MAX-AMSDU-7935:0x800::$max_amsdu \ + DSSS_CCK-40:0x1000::$dsss_cck_40 - ht_capab="$ht_capab$ht_capab_flags" - [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N" - } + ht_capab="$ht_capab$ht_capab_flags" + [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N" + } + fi # 802.11ac enable_ac=0 @@ -238,8 +240,8 @@ mac80211_hostapd_setup_base() { idx="$channel" case "$htmode" in - VHT20|HE20) enable_ac=1;; - VHT40|HE40) + VHT20|HE20|EHT20) enable_ac=1;; + VHT40|HE40|EHT40) case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in 1) idx=$(($channel + 2));; 0) idx=$(($channel - 2));; @@ -247,7 +249,7 @@ mac80211_hostapd_setup_base() { enable_ac=1 vht_center_seg0=$idx ;; - VHT80|HE80) + VHT80|HE80|EHT80) case "$(( (($channel / 4) + $chan_ofs) % 4 ))" in 1) idx=$(($channel + 6));; 2) idx=$(($channel + 2));; @@ -258,7 +260,7 @@ mac80211_hostapd_setup_base() { vht_oper_chwidth=1 vht_center_seg0=$idx ;; - VHT160|HE160) + VHT160|HE160|EHT160|EHT320) if [ "$band" = "6g" ]; then case "$channel" in 1|5|9|13|17|21|25|29) idx=15;; @@ -286,15 +288,32 @@ mac80211_hostapd_setup_base() { [ "$background_radar" -eq 1 ] && append base_cfg "enable_background_radar=1" "$N" } + + eht_oper_chwidth=$vht_oper_chwidth + eht_center_seg0=$vht_center_seg0 + [ "$band" = "6g" ] && { op_class= case "$htmode" in - HE20) op_class=131;; - HE*) op_class=$((132 + $vht_oper_chwidth)) + HE20|EHT20) op_class=131;; + EHT320) + case "$channel" in + 1|5|9|13|17|21|25|29|33|37|41|45|49|53|57|61) idx=31;; + 65|69|73|77|81|85|89|93|97|101|105|109|113|117|121|125) idx=95;; + 129|133|137|141|145|149|153|157|161|165|169|173|177|181|185|189) idx=159;; + 193|197|201|205|209|213|217|221) idx=191;; + esac + + op_class=137 + eht_center_seg0=$idx + eht_oper_chwidth=9 + ;; + HE*|EHT*) op_class=$((132 + $vht_oper_chwidth));; esac [ -n "$op_class" ] && append base_cfg "op_class=$op_class" "$N" } [ "$hwmode" = "a" ] || enable_ac=0 + [ "$band" = "6g" ] && enable_ac=0 if [ "$enable_ac" != "0" ]; then json_get_vars \ @@ -417,8 +436,10 @@ mac80211_hostapd_setup_base() { # 802.11ax enable_ax=0 + enable_be=0 case "$htmode" in HE*) enable_ax=1 ;; + EHT*) enable_ax=1; enable_be=1 ;; esac if [ "$enable_ax" != "0" ]; then @@ -492,6 +513,14 @@ mac80211_hostapd_setup_base() { append base_cfg "he_mu_edca_ac_vo_timer=255" "$N" fi + if [ "$enable_be" != "0" ]; then + append base_cfg "ieee80211be=1" "$N" + [ "$hwmode" = "a" ] && { + append base_cfg "eht_oper_chwidth=$eht_oper_chwidth" "$N" + append base_cfg "eht_oper_centr_freq_seg0_idx=$eht_center_seg0" "$N" + } + fi + hostapd_prepare_device_config "$hostapd_conf_file" nl80211 cat >> "$hostapd_conf_file" < 0) band_info.vht = true; let he_phy_cap = 0; + let eht_phy_cap = 0; for (let ift in band.iftype_data) { if (!ift.he_cap_phy) @@ -117,7 +121,12 @@ function wiphy_detect() { band_info.he = true; he_phy_cap |= ift.he_cap_phy[0]; - /* TODO: EHT */ + + if (!ift.eht_cap_phy) + continue; + + band_info.eht = true; + eht_phy_cap |= ift.eht_cap_phy[0]; } if (band_name != "2G" && @@ -138,14 +147,19 @@ function wiphy_detect() { push(modes, "VHT20"); if (band_info.he) push(modes, "HE20"); + if (band_info.eht) + push(modes, "EHT20"); if (band.ht_capa & 0x2) { push(modes, "HT40"); if (band_info.vht) push(modes, "VHT40") } - if (he_phy_cap & 0x2) + if (he_phy_cap & 2) push(modes, "HE40"); + if (eht_phy_cap && he_phy_cap & 2) + push(modes, "EHT40"); + for (let freq in band.freqs) { if (freq.disabled) continue; @@ -158,14 +172,26 @@ function wiphy_detect() { if (band_name == "2G") continue; + + if (he_phy_cap & 4) + push(modes, "HE40"); + if (eht_phy_cap && he_phy_cap & 4) + push(modes, "EHT40"); if (band_info.vht) push(modes, "VHT80"); if (he_phy_cap & 4) push(modes, "HE80"); + if (eht_phy_cap && he_phy_cap & 4) + push(modes, "EHT80"); if ((band.vht_capa >> 2) & 0x3) push(modes, "VHT160"); if (he_phy_cap & 0x18) push(modes, "HE160"); + if (eht_phy_cap && he_phy_cap & 0x18) + push(modes, "EHT160"); + + if (eht_phy_cap & 2) + push(modes, "ETH320"); } let entry = wiphy_get_entry(name, path); diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 3367fd7f74..e9f3bd693c 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -227,6 +227,8 @@ define Package/dropbear/install $(INSTALL_DIR) $(1)/etc/dropbear $(INSTALL_DIR) $(1)/lib/preinit $(INSTALL_DATA) ./files/dropbear.failsafe $(1)/lib/preinit/99_10_failsafe_dropbear + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DATA) ./files/dropbear.defaults $(1)/etc/uci-defaults/50-dropbear $(foreach f,$(filter /etc/dropbear/%,$(Package/dropbear/conffiles)),$(if $(wildcard $(TOPDIR)/files/$(f)),chmod 0600 $(TOPDIR)/files/$(f) || :; )) endef diff --git a/package/network/services/dropbear/files/dropbear.defaults b/package/network/services/dropbear/files/dropbear.defaults new file mode 100644 index 0000000000..e679bee5db --- /dev/null +++ b/package/network/services/dropbear/files/dropbear.defaults @@ -0,0 +1,20 @@ +[ ! -s /etc/dropbear/authorized_keys ] || exit 0 + +. /usr/share/libubox/jshn.sh + +json_init +json_load "$(cat /etc/board.json)" +json_select credentials + json_get_keys keys ssh_authorized_keys + [ -z "$keys" ] || { + touch /etc/dropbear/authorized_keys + uci set dropbear.@dropbear[-1].PasswordAuth='off' + uci set dropbear.@dropbear[-1].RootPasswordAuth='off' + } + json_select ssh_authorized_keys + for key in $keys; do + json_get_var val "$key" + echo "$val" >> /etc/dropbear/authorized_keys + done + json_select .. +json_select .. diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index 1fff4f8acd..742cd78a14 100644 --- a/package/network/services/hostapd/Config.in +++ b/package/network/services/hostapd/Config.in @@ -40,6 +40,10 @@ config DRIVER_11AX_SUPPORT default n select WPA_MBO_SUPPORT +config DRIVER_11BE_SUPPORT + bool + default n + config WPA_ENABLE_WEP bool "Enable support for unsecure and obsolete WEP" depends on PACKAGE_hostapd-common diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 1c0b654866..0e3396262d 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -27,6 +27,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_WPA_RFKILL_SUPPORT \ CONFIG_DRIVER_11AC_SUPPORT \ CONFIG_DRIVER_11AX_SUPPORT \ + CONFIG_DRIVER_11BE_SUPPORT \ CONFIG_WPA_ENABLE_WEP PKG_BUILD_FLAGS:=gc-sections lto @@ -79,6 +80,10 @@ ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),) HOSTAPD_IEEE80211AX:=y endif +ifneq ($(CONFIG_DRIVER_11BE_SUPPORT),) + HOSTAPD_IEEE80211BE:=y +endif + CORE_DEPENDS = +ucode +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json +libudebug OPENSSL_DEPENDS = +PACKAGE_$(1):libopenssl +PACKAGE_$(1):libopenssl-legacy @@ -86,6 +91,7 @@ DRIVER_MAKEOPTS= \ CONFIG_ACS=y CONFIG_DRIVER_NL80211=y \ CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \ CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \ + CONFIG_IEEE80211BE=$(HOSTAPD_IEEE80211BE) \ CONFIG_MBO=$(CONFIG_WPA_MBO_SUPPORT) \ CONFIG_UCODE=y CONFIG_APUP=y diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index fb3bfb0120..256d1cfcc4 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -116,6 +116,14 @@ probe/assoc/auth requests via object subscribe. #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); +@@ -1369,6 +1379,7 @@ void hostapd_event_ch_switch(struct host + + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED + "freq=%d dfs=%d", freq, is_dfs); ++ hostapd_ubus_notify_csa(hapd, freq); + } else if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) { + /* Complete AP configuration for the first bring up. */ + if (is_dfs0 > 0 && --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -475,6 +475,7 @@ void hostapd_free_hapd_data(struct hosta diff --git a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch new file mode 100644 index 0000000000..55c6e63581 --- /dev/null +++ b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch @@ -0,0 +1,53 @@ +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c +@@ -1836,3 +1836,22 @@ void ap_sta_free_sta_profile(struct mld_ + } + } + #endif /* CONFIG_IEEE80211BE */ ++ ++bool ap_sta_is_mld(struct hostapd_data *hapd, ++ struct sta_info *sta) ++{ ++#ifdef CONFIG_IEEE80211BE ++ return hapd->conf->mld_ap && sta && sta->mld_info.mld_sta; ++#else /* CONFIG_IEEE80211BE */ ++ return false; ++#endif /* CONFIG_IEEE80211BE */ ++} ++ ++void ap_sta_set_mld(struct sta_info *sta, bool mld) ++{ ++#ifdef CONFIG_IEEE80211BE ++ if (sta) ++ sta->mld_info.mld_sta = mld; ++#endif /* CONFIG_IEEE80211BE */ ++} ++ +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -417,23 +417,8 @@ int ap_sta_re_add(struct hostapd_data *h + + void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta); + +-static inline bool ap_sta_is_mld(struct hostapd_data *hapd, +- struct sta_info *sta) +-{ +-#ifdef CONFIG_IEEE80211BE +- return hapd->conf->mld_ap && sta && sta->mld_info.mld_sta; +-#else /* CONFIG_IEEE80211BE */ +- return false; +-#endif /* CONFIG_IEEE80211BE */ +-} +- +-static inline void ap_sta_set_mld(struct sta_info *sta, bool mld) +-{ +-#ifdef CONFIG_IEEE80211BE +- if (sta) +- sta->mld_info.mld_sta = mld; +-#endif /* CONFIG_IEEE80211BE */ +-} ++bool ap_sta_is_mld(struct hostapd_data *hapd, struct sta_info *sta); ++void ap_sta_set_mld(struct sta_info *sta, bool mld); + + void ap_sta_free_sta_profile(struct mld_info *info); + diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index f21516fc3c..2256720755 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -1783,6 +1783,7 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req blob_buf_init(&b, 0); blobmsg_add_macaddr(&b, "address", addr); + blobmsg_add_string(&b, "ifname", hapd->conf->iface); if (req->mgmt_frame) blobmsg_add_macaddr(&b, "target", req->mgmt_frame->da); if (req->ssi_signal) @@ -1857,6 +1858,7 @@ void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 * blob_buf_init(&b, 0); blobmsg_add_macaddr(&b, "address", addr); + blobmsg_add_string(&b, "ifname", hapd->conf->iface); ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); } @@ -1869,6 +1871,9 @@ void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info * blob_buf_init(&b, 0); blobmsg_add_macaddr(&b, "address", sta->addr); + if (sta->vlan_id) + blobmsg_add_u32(&b, "vlan", sta->vlan_id); + blobmsg_add_string(&b, "ifname", hapd->conf->iface); if (auth_alg) blobmsg_add_string(&b, "auth-alg", auth_alg); @@ -2019,3 +2024,16 @@ void hostapd_ubus_notify_apup_newpeer( ubus_notify(ctx, &hapd->ubus.obj, "apup-newpeer", b.head, -1); } #endif // def CONFIG_APUP + +void hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq) +{ + if (!hapd->ubus.obj.has_subscribers) + return; + + blob_buf_init(&b, 0); + blobmsg_add_string(&b, "ifname", hapd->conf->iface); + blobmsg_add_u32(&b, "freq", freq); + blobmsg_printf(&b, "bssid", MACSTR, MAC2STR(hapd->conf->bssid)); + + ubus_notify(ctx, &hapd->ubus.obj, "channel-switch", b.head, -1); +} diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index 5c03cb90ad..055a18c092 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -68,6 +68,7 @@ int hostapd_ubus_notify_bss_transition_query( const u8 *candidate_list, u16 candidate_list_len); void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta, const char *auth_alg); +void hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq); #ifdef CONFIG_APUP void hostapd_ubus_notify_apup_newpeer( @@ -155,6 +156,11 @@ hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta, { } +static inline void +hostapd_ubus_notify_csa(struct hostapd_data *hapd, int freq) +{ +} + #endif #endif diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index 553769eceb..cc8831535c 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -15,6 +15,10 @@ static inline int has_feature(const char *feat) if (!strcmp(feat, "11ax")) return 1; #endif +#ifdef CONFIG_IEEE80211BE + if (!strcmp(feat, "11be")) + return 1; +#endif #ifdef CONFIG_IEEE80211R if (!strcmp(feat, "11r")) return 1; diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index 2491126bf6..606dc7274f 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-01-08 -PKG_SOURCE_VERSION:=e91ed406ecebb4bc08c346929e25f1b819c19edd -PKG_MIRROR_HASH:=f667e939520f0ce27b63ddcab64eb079d84fd2c61beaad5399bfc5f9276ca62e +PKG_SOURCE_DATE:=2024-09-17 +PKG_SOURCE_VERSION:=fbaca4b6f530d4b2f361ee15c266aa19a708242b +PKG_MIRROR_HASH:=e3fc47a019ea54722b8d7dfc8158307a9fb4a9d18945a1a6794616e3b80d5d3b PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 53f8d44f46..0d7de10226 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2024-09-17 -PKG_SOURCE_VERSION:=268a662421fa03798881b34658a3d6bd6a30d97d -PKG_MIRROR_HASH:=2ea07521149fb45665184f80ee99595c8b4f06aaf2c1004b74c944da632778de +PKG_SOURCE_DATE:=2024-10-01 +PKG_SOURCE_VERSION:=714e419919d00dd1b3cdce08d9f28a28b2de69ed +PKG_MIRROR_HASH:=e70c179f45ab075dc9216d9cf64e0c0161a89444ae9bd7622e5f877b36adf6d3 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index 9dcd5ff3ab..6ee0cf2a1d 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/jow-/ucode.git -PKG_SOURCE_DATE:=2024-07-11 -PKG_SOURCE_VERSION:=1a8a0bcf725520820802ad433db22d8f64fbed6c -PKG_MIRROR_HASH:=0a859c97457a019adc73b028c19e2b334271b2c4de28337f1a18fd35438af3d3 +PKG_SOURCE_DATE:=2024-07-22 +PKG_SOURCE_VERSION:=b610860dd4a0591ff586dd71a50f556a0ddafced +PKG_MIRROR_HASH:=a5ec51dd989174422d3b19b022ff4f863d57eb559c9f08d54c0d10651f598357 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/scripts/config.guess b/scripts/config.guess index dc0a6b2997..48a684601b 100755 --- a/scripts/config.guess +++ b/scripts/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. -timestamp='2021-05-24' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2024-07-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -32,12 +34,20 @@ timestamp='2021-05-24' # Please send patches to . -me=$(echo "$0" | sed -e 's,.*/,,') +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -50,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -84,13 +94,16 @@ if test $# != 0; then exit 1 fi +# Just in case it came from the environment. +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -102,17 +115,17 @@ set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -131,10 +144,10 @@ if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown -UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown -UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown -UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) @@ -142,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -156,8 +174,10 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && @@ -188,10 +208,10 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - echo unknown)) + echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; @@ -200,11 +220,11 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') - endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') - machine="${arch}${endian}"-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. @@ -232,7 +252,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -245,76 +265,76 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in release='-gnu' ;; *) - release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; *:SecBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS=$UNAME_MACHINE-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; @@ -352,65 +372,69 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "$( (/bin/universe) 2>/dev/null)" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case $(/usr/bin/uname -p) in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 @@ -419,47 +443,50 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case $(/usr/bin/arch -k) in + case `/usr/bin/arch -k` in Series*|S4*) - UNAME_RELEASE=$(uname -v) + UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" - exit ;; + # Japanese Language versions have a version number like '4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case $(/bin/arch) in + case `/bin/arch` in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -469,41 +496,41 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -528,85 +555,87 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && - SYSTEM_NAME=$("$dummy" "$dummyarg") && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then - IBM_REV=$(/usr/bin/oslevel) + IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -614,63 +643,63 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) - IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then - IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then - sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) - sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 @@ -690,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -717,7 +747,7 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac @@ -742,12 +772,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -775,38 +805,38 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -814,17 +844,18 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -832,114 +863,155 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; arm:FreeBSD:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -950,63 +1022,72 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1051,138 +1132,150 @@ EOF #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) set_cc_for_build + CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null - then - LIBCABI="$LIBC"x32 - fi + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" - exit ;; + GUESS=$CPU-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; i*86:*:4.*:*) - UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case $(/bin/uname -X | grep "^Machine") in + case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1190,11 +1283,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1202,37 +1295,37 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1243,7 +1336,7 @@ EOF NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1251,118 +1344,121 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=$( (uname -p) 2>/dev/null) - echo "$UNAME_MACHINE"-sni-sysv4 + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - echo mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=i586-pc-haiku + ;; + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; arm64:Darwin:*:*) - echo aarch64-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac @@ -1396,43 +1492,43 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1440,64 +1536,78 @@ EOF if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then - UNAME_MACHINE="$cputype" + UNAME_MACHINE=$cputype fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) - UNAME_MACHINE=$( (uname -p) 2>/dev/null) + UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; *:AROS:*:*) - echo "$UNAME_MACHINE"-unknown-aros - exit ;; + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < "$dummy.c" </dev/null); + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else @@ -1629,7 +1740,7 @@ main () } EOF -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1659,9 +1770,11 @@ and https://git.savannah.gnu.org/cgit/config.git/plain/config.sub EOF -year=$(echo $timestamp | sed 's,-.*,,') +our_year=`echo $timestamp | sed 's,-.*,,'` +thisyear=`date +%Y` # shellcheck disable=SC2003 -if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then +script_age=`expr "$thisyear" - "$our_year"` +if test "$script_age" -lt 3 ; then cat >&2 </dev/null || echo unknown) -uname -r = $( (uname -r) 2>/dev/null || echo unknown) -uname -s = $( (uname -s) 2>/dev/null || echo unknown) -uname -v = $( (uname -v) 2>/dev/null || echo unknown) +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) -/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` -hostinfo = $( (hostinfo) 2>/dev/null) -/bin/universe = $( (/bin/universe) 2>/dev/null) -/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) -/bin/arch = $( (/bin/arch) 2>/dev/null) -/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) -/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" diff --git a/scripts/config.sub b/scripts/config.sub index 7384e9198b..4aaae46f6f 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. -timestamp='2021-04-30' +# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale + +timestamp='2024-05-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -50,7 +52,14 @@ timestamp='2021-04-30' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -me=$(echo "$0" | sed -e 's,.*/,,') +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS @@ -67,13 +76,13 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -111,15 +120,16 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 +saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -131,10 +141,21 @@ case $1 in # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -149,8 +170,12 @@ case $1 in esac ;; *-*) - # A lone config we happen to match not fitting any pattern case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; decstation-3100) basic_machine=mips-dec basic_os= @@ -158,24 +183,88 @@ case $1 in *-*) # Second component is usually, but not always the OS case $field2 in - # Prevent following clause from handling this valid os + # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | siemens \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) basic_machine=$field1-$field2 basic_os= ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; *) basic_machine=$field1 basic_os=$field2 @@ -256,26 +345,6 @@ case $1 in basic_machine=arm-unknown basic_os=cegcc ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; cray) basic_machine=j90-cray basic_os=unicos @@ -698,15 +767,26 @@ case $basic_machine in vendor=dec basic_os=tops20 ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; - dpx2*) + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull - basic_os=sysv3 + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull ;; encore | umax | mmax) cpu=ns32k @@ -769,22 +849,22 @@ case $basic_machine in vendor=hp ;; i*86v32) - cpu=$(echo "$1" | sed -e 's/86.*/86/') + cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) - cpu=$(echo "$1" | sed -e 's/86.*/86/') + cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) - cpu=$(echo "$1" | sed -e 's/86.*/86/') + cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) - cpu=$(echo "$1" | sed -e 's/86.*/86/') + cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; @@ -821,18 +901,6 @@ case $basic_machine in next | m*-next) cpu=m68k vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac ;; np1) cpu=np1 @@ -917,16 +985,17 @@ case $basic_machine in ;; leon-*|leon[3-9]-*) cpu=sparc - vendor=$(echo "$basic_machine" | sed 's/-.*//') + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) - # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read cpu vendor <&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1284,38 +1491,44 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then -# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux - os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 - os=$(echo $basic_os | sed -e 's|os2-emx|emx|') + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto - os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) - # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read kernel os <&2 + fi + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) ;; - uclinux-uclibc* ) + uclinux-uclibc*- | uclinux-gnu*- ) ;; - -dietlibc* | -newlib* | -musl* | -uclibc* ) + managarm-mlibc*- | managarm-kernel*- ) + ;; + windows*-msvc*-) + ;; + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 ;; - nto-qnx*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - os2-emx) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; - *-eabi* | *-gnueabi*) + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; - -*) + nto-qnx*-) + ;; + os2-emx-) + ;; + rtmk-nova-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1783,7 +2273,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1853,7 +2343,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index 8f53974e46..70f091b79f 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -110,7 +110,6 @@ static int gpio_latch_probe(struct platform_device *pdev) struct gpio_latch_chip *glc; struct gpio_chip *gc; struct device *dev = &pdev->dev; - struct fwnode_handle *fwnode = dev->fwnode; int i, n; glc = devm_kzalloc(dev, sizeof(*glc), GFP_KERNEL); @@ -121,24 +120,19 @@ static int gpio_latch_probe(struct platform_device *pdev) mutex_init(&glc->latch_mutex); n = gpiod_count(dev, NULL); - if (n <= 0) { - dev_err(dev, "failed to get gpios: %d\n", n); - return n; - } else if (n != GPIO_LATCH_LINES) { - dev_err(dev, "expected %d gpios\n", GPIO_LATCH_LINES); + if (n <= 0) + return dev_err_probe(dev, n, "failed to get gpios"); + if (n != GPIO_LATCH_LINES) { + dev_err(dev, "expected %d gpios", GPIO_LATCH_LINES); return -EINVAL; } for (i = 0; i < n; i++) { glc->gpios[i] = devm_gpiod_get_index_optional(dev, NULL, i, GPIOD_OUT_LOW); - if (IS_ERR(glc->gpios[i])) { - if (PTR_ERR(glc->gpios[i]) != -EPROBE_DEFER) { - dev_err(dev, "failed to get gpio %d: %ld\n", i, - PTR_ERR(glc->gpios[i])); - } - return PTR_ERR(glc->gpios[i]); - } + if (IS_ERR(glc->gpios[i])) + return dev_err_probe(dev, PTR_ERR(glc->gpios[i]), + "failed to get gpio %d", i); } glc->le_gpio = 8; @@ -152,31 +146,15 @@ static int gpio_latch_probe(struct platform_device *pdev) gc = &glc->gc; gc->label = GPIO_LATCH_DRIVER_NAME; + gc->parent = dev; gc->can_sleep = true; gc->base = -1; gc->ngpio = GPIO_LATCH_LINES; gc->get = gpio_latch_get; gc->set = gpio_latch_set; gc->direction_output = gpio_latch_direction_output; - gc->fwnode = fwnode; - platform_set_drvdata(pdev, glc); - - i = gpiochip_add(&glc->gc); - if (i) { - dev_err(dev, "gpiochip_add() failed: %d\n", i); - return i; - } - - return 0; -} - -static int gpio_latch_remove(struct platform_device *pdev) -{ - struct gpio_latch_chip *glc = platform_get_drvdata(pdev); - - gpiochip_remove(&glc->gc); - return 0; + return devm_gpiochip_add_data(dev, gc, glc); } static const struct of_device_id gpio_latch_match[] = { @@ -188,7 +166,6 @@ MODULE_DEVICE_TABLE(of, gpio_latch_match); static struct platform_driver gpio_latch_driver = { .probe = gpio_latch_probe, - .remove = gpio_latch_remove, .driver = { .name = GPIO_LATCH_DRIVER_NAME, .owner = THIS_MODULE, diff --git a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch index 46811ab21c..720c3bfcdd 100644 --- a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch @@ -867,7 +867,7 @@ SVN-Revision: 35130 iph->daddr == iph2->daddr && iph->saddr == iph2->saddr) return segs; -@@ -258,7 +258,7 @@ struct sk_buff *tcp_gro_lookup(struct li +@@ -264,7 +264,7 @@ struct sk_buff *tcp_gro_lookup(struct li continue; th2 = tcp_hdr(p); @@ -876,7 +876,7 @@ SVN-Revision: 35130 NAPI_GRO_CB(p)->same_flow = 0; continue; } -@@ -324,8 +324,8 @@ struct sk_buff *tcp_gro_receive(struct l +@@ -330,8 +330,8 @@ struct sk_buff *tcp_gro_receive(struct l ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH)); flush |= (__force int)(th->ack_seq ^ th2->ack_seq); for (i = sizeof(*th); i < thlen; i += 4) diff --git a/target/linux/bcm27xx/patches-6.6/950-0070-spi-spidev-Completely-disable-the-spidev-warning.patch b/target/linux/bcm27xx/patches-6.6/950-0070-spi-spidev-Completely-disable-the-spidev-warning.patch index 47d727af5b..a83a51eae2 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0070-spi-spidev-Completely-disable-the-spidev-warning.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0070-spi-spidev-Completely-disable-the-spidev-warning.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c -@@ -720,7 +720,7 @@ MODULE_DEVICE_TABLE(spi, spidev_spi_ids) +@@ -721,7 +721,7 @@ MODULE_DEVICE_TABLE(spi, spidev_spi_ids) */ static int spidev_of_check(struct device *dev) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0320-spi-spidev-Restore-loading-from-Device-Tree.patch b/target/linux/bcm27xx/patches-6.6/950-0320-spi-spidev-Restore-loading-from-Device-Tree.patch index a45389d9ef..da1bbb7886 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0320-spi-spidev-Restore-loading-from-Device-Tree.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0320-spi-spidev-Restore-loading-from-Device-Tree.patch @@ -22,4 +22,4 @@ Signed-off-by: Phil Elwell + { .name = "spidev" }, { .name = "bh2228fv" }, { .name = "dh2228fv" }, - { .name = "ltc2488" }, + { .name = "jg10309-01" }, diff --git a/target/linux/bmips/dts/bcm6358.dtsi b/target/linux/bmips/dts/bcm6358.dtsi index d5dee7d150..fe14055ef7 100644 --- a/target/linux/bmips/dts/bcm6358.dtsi +++ b/target/linux/bmips/dts/bcm6358.dtsi @@ -42,7 +42,7 @@ cpus { #address-cells = <1>; #size-cells = <0>; - mips-cbr-reg = <0xff400000>; + brcm,bmips-cbr-reg = <0xff400000>; mips-hpt-frequency = <150000000>; cpu@0 { diff --git a/target/linux/bmips/dts/bcm6368.dtsi b/target/linux/bmips/dts/bcm6368.dtsi index 84300c980a..e50f7a1b0c 100644 --- a/target/linux/bmips/dts/bcm6368.dtsi +++ b/target/linux/bmips/dts/bcm6368.dtsi @@ -43,7 +43,7 @@ cpus { #address-cells = <1>; #size-cells = <0>; - mips-cbr-reg = <0xff400000>; + brcm,bmips-cbr-reg = <0xff400000>; mips-hpt-frequency = <200000000>; cpu@0 { diff --git a/target/linux/generic/backport-6.6/817-v6.9-of-property-Make-no-port-node-found-output-a-debug.patch b/target/linux/generic/backport-6.6/817-v6.9-of-property-Make-no-port-node-found-output-a-debug.patch new file mode 100644 index 0000000000..bc4e5e743f --- /dev/null +++ b/target/linux/generic/backport-6.6/817-v6.9-of-property-Make-no-port-node-found-output-a-debug.patch @@ -0,0 +1,33 @@ +From e20cd62b1f1708a4dec7ff4beb9e748a0bdb5716 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Wed, 17 Jan 2024 09:32:06 +0100 +Subject: [PATCH] of: property: Make 'no port node found' output a debug + message + +There are cases where an unavailable port is not an error, making this +error message a false-positive. Since commit d56de8c9a17d8 ("usb: typec: +tcpm: try to get role switch from tcpc fwnode") the role switch is tried +on the port dev first and tcpc fwnode afterwards. If using the latter +bindings getting from port dev fails every time. The kernel log is flooded +with the messages like: + OF: graph: no port node found in /soc@0/bus@42000000/i2c@42530000/usb-typec@50 +Silence this message by making it a debug message. + +Signed-off-by: Alexander Stein +Link: https://lore.kernel.org/r/20240117083206.2901534-1-alexander.stein@ew.tq-group.com +Signed-off-by: Rob Herring +--- + drivers/of/property.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/of/property.c ++++ b/drivers/of/property.c +@@ -664,7 +664,7 @@ struct device_node *of_graph_get_next_en + of_node_put(node); + + if (!port) { +- pr_err("graph: no port node found in %pOF\n", parent); ++ pr_debug("graph: no port node found in %pOF\n", parent); + return NULL; + } + } else { diff --git a/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch b/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch new file mode 100644 index 0000000000..826b39b518 --- /dev/null +++ b/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch @@ -0,0 +1,140 @@ +--- a/drivers/bus/mhi/host/init.c ++++ b/drivers/bus/mhi/host/init.c +@@ -43,6 +43,7 @@ const char * const dev_state_tran_str[DE + [DEV_ST_TRANSITION_FP] = "FLASH PROGRAMMER", + [DEV_ST_TRANSITION_SYS_ERR] = "SYS ERROR", + [DEV_ST_TRANSITION_DISABLE] = "DISABLE", ++ [DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE] = "DISABLE (DESTROY DEVICE)", + }; + + const char * const mhi_ch_state_type_str[MHI_CH_STATE_TYPE_MAX] = { +--- a/drivers/bus/mhi/host/internal.h ++++ b/drivers/bus/mhi/host/internal.h +@@ -69,6 +69,7 @@ enum dev_st_transition { + DEV_ST_TRANSITION_FP, + DEV_ST_TRANSITION_SYS_ERR, + DEV_ST_TRANSITION_DISABLE, ++ DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE, + DEV_ST_TRANSITION_MAX, + }; + +--- a/drivers/bus/mhi/host/pm.c ++++ b/drivers/bus/mhi/host/pm.c +@@ -466,7 +466,8 @@ error_mission_mode: + } + + /* Handle shutdown transitions */ +-static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) ++static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl, ++ bool destroy_device) + { + enum mhi_pm_state cur_state; + struct mhi_event *mhi_event; +@@ -528,8 +529,16 @@ skip_mhi_reset: + dev_dbg(dev, "Waiting for all pending threads to complete\n"); + wake_up_all(&mhi_cntrl->state_event); + +- dev_dbg(dev, "Reset all active channels and remove MHI devices\n"); +- device_for_each_child(&mhi_cntrl->mhi_dev->dev, NULL, mhi_destroy_device); ++ /* ++ * Only destroy the 'struct device' for channels if indicated by the ++ * 'destroy_device' flag. Because, during system suspend or hibernation ++ * state, there is no need to destroy the 'struct device' as the endpoint ++ * device would still be physically attached to the machine. ++ */ ++ if (destroy_device) { ++ dev_dbg(dev, "Reset all active channels and remove MHI devices\n"); ++ device_for_each_child(&mhi_cntrl->mhi_dev->dev, NULL, mhi_destroy_device); ++ } + + mutex_lock(&mhi_cntrl->pm_mutex); + +@@ -820,7 +829,10 @@ void mhi_pm_st_worker(struct work_struct + mhi_pm_sys_error_transition(mhi_cntrl); + break; + case DEV_ST_TRANSITION_DISABLE: +- mhi_pm_disable_transition(mhi_cntrl); ++ mhi_pm_disable_transition(mhi_cntrl, false); ++ break; ++ case DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE: ++ mhi_pm_disable_transition(mhi_cntrl, true); + break; + default: + break; +@@ -1174,7 +1186,8 @@ error_exit: + } + EXPORT_SYMBOL_GPL(mhi_async_power_up); + +-void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful) ++static void __mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful, ++ bool destroy_device) + { + enum mhi_pm_state cur_state, transition_state; + struct device *dev = &mhi_cntrl->mhi_dev->dev; +@@ -1210,15 +1223,32 @@ void mhi_power_down(struct mhi_controlle + write_unlock_irq(&mhi_cntrl->pm_lock); + mutex_unlock(&mhi_cntrl->pm_mutex); + +- mhi_queue_state_transition(mhi_cntrl, DEV_ST_TRANSITION_DISABLE); ++ if (destroy_device) ++ mhi_queue_state_transition(mhi_cntrl, ++ DEV_ST_TRANSITION_DISABLE_DESTROY_DEVICE); ++ else ++ mhi_queue_state_transition(mhi_cntrl, ++ DEV_ST_TRANSITION_DISABLE); + + /* Wait for shutdown to complete */ + flush_work(&mhi_cntrl->st_worker); + + disable_irq(mhi_cntrl->irq[0]); + } ++ ++void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful) ++{ ++ __mhi_power_down(mhi_cntrl, graceful, true); ++} + EXPORT_SYMBOL_GPL(mhi_power_down); + ++void mhi_power_down_keep_dev(struct mhi_controller *mhi_cntrl, ++ bool graceful) ++{ ++ __mhi_power_down(mhi_cntrl, graceful, false); ++} ++EXPORT_SYMBOL_GPL(mhi_power_down_keep_dev); ++ + int mhi_sync_power_up(struct mhi_controller *mhi_cntrl) + { + int ret = mhi_async_power_up(mhi_cntrl); +--- a/include/linux/mhi.h ++++ b/include/linux/mhi.h +@@ -649,13 +649,29 @@ int mhi_async_power_up(struct mhi_contro + int mhi_sync_power_up(struct mhi_controller *mhi_cntrl); + + /** +- * mhi_power_down - Start MHI power down sequence ++ * mhi_power_down - Power down the MHI device and also destroy the ++ * 'struct device' for the channels associated with it. ++ * See also mhi_power_down_keep_dev() which is a variant ++ * of this API that keeps the 'struct device' for channels ++ * (useful during suspend/hibernation). + * @mhi_cntrl: MHI controller + * @graceful: Link is still accessible, so do a graceful shutdown process + */ + void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful); + + /** ++ * mhi_power_down_keep_dev - Power down the MHI device but keep the 'struct ++ * device' for the channels associated with it. ++ * This is a variant of 'mhi_power_down()' and ++ * useful in scenarios such as suspend/hibernation ++ * where destroying of the 'struct device' is not ++ * needed. ++ * @mhi_cntrl: MHI controller ++ * @graceful: Link is still accessible, so do a graceful shutdown process ++ */ ++void mhi_power_down_keep_dev(struct mhi_controller *mhi_cntrl, bool graceful); ++ ++/** + * mhi_unprepare_after_power_down - Free any allocated memory after power down + * @mhi_cntrl: MHI controller + */ diff --git a/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch b/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch new file mode 100644 index 0000000000..31beb11d54 --- /dev/null +++ b/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch @@ -0,0 +1,35 @@ +From f8d05679fb3faae478d604177b0c188b340371cd Mon Sep 17 00:00:00 2001 +From: Breno Leitao +Date: Mon, 22 Apr 2024 05:38:55 -0700 +Subject: [PATCH] net: free_netdev: exit earlier if dummy + +For dummy devices, exit earlier at free_netdev() instead of executing +the whole function. This is necessary, because dummy devices are +special, and shouldn't have the second part of the function executed. + +Otherwise reg_state, which is NETREG_DUMMY, will be overwritten and +there will be no way to identify that this is a dummy device. Also, this +device do not need the final put_device(), since dummy devices are not +registered (through register_netdevice()), where the device reference is +increased (at netdev_register_kobject()/device_add()). + +Suggested-by: Jakub Kicinski +Signed-off-by: Breno Leitao +Reviewed-by: Ido Schimmel +Signed-off-by: David S. Miller +--- + net/core/dev.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -10966,7 +10966,8 @@ void free_netdev(struct net_device *dev) + dev->xdp_bulkq = NULL; + + /* Compatibility with error handling in drivers */ +- if (dev->reg_state == NETREG_UNINITIALIZED) { ++ if (dev->reg_state == NETREG_UNINITIALIZED || ++ dev->reg_state == NETREG_DUMMY) { + netdev_freemem(dev); + return; + } diff --git a/target/linux/generic/pending-6.6/684-gso-fix-gso-fraglist-segmentation-after-pull-from-fr.patch b/target/linux/generic/pending-6.6/684-gso-fix-gso-fraglist-segmentation-after-pull-from-fr.patch new file mode 100644 index 0000000000..5a7ba07fd0 --- /dev/null +++ b/target/linux/generic/pending-6.6/684-gso-fix-gso-fraglist-segmentation-after-pull-from-fr.patch @@ -0,0 +1,53 @@ +From: Willem de Bruijn +Date: Sun, 22 Sep 2024 11:03:45 -0400 +Subject: [PATCH] gso: fix gso fraglist segmentation after pull from + frag_list + +Detect gso fraglist skbs with corrupted geometry (see below) and +pass these to skb_segment instead of skb_segment_list, as the first +can segment them correctly. + +Valid SKB_GSO_FRAGLIST skbs +- consist of two or more segments +- the head_skb holds the protocol headers plus first gso_size +- one or more frag_list skbs hold exactly one segment +- all but the last must be gso_size + +Optional datapath hooks such as NAT and BPF (bpf_skb_pull_data) can +modify these skbs, breaking these invariants. + +In extreme cases they pull all data into skb linear. For UDP, this +causes a NULL ptr deref in __udpv4_gso_segment_list_csum at +udp_hdr(seg->next)->dest. + +Detect invalid geometry due to pull, by checking head_skb size. +Don't just drop, as this may blackhole a destination. Convert to be +able to pass to regular skb_segment. + +Link: https://lore.kernel.org/netdev/20240428142913.18666-1-shiming.cheng@mediatek.com/ +Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.") +Signed-off-by: Willem de Bruijn +Cc: stable@vger.kernel.org +--- + +--- a/net/ipv4/udp_offload.c ++++ b/net/ipv4/udp_offload.c +@@ -296,8 +296,16 @@ struct sk_buff *__udp_gso_segment(struct + return NULL; + } + +- if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) +- return __udp_gso_segment_list(gso_skb, features, is_ipv6); ++ if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) { ++ /* Detect modified geometry and pass these to skb_segment. */ ++ if (skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size) ++ return __udp_gso_segment_list(gso_skb, features, is_ipv6); ++ ++ /* Setup csum, as fraglist skips this in udp4_gro_receive. */ ++ gso_skb->csum_start = skb_transport_header(gso_skb) - gso_skb->head; ++ gso_skb->csum_offset = offsetof(struct udphdr, check); ++ gso_skb->ip_summed = CHECKSUM_PARTIAL; ++ } + + skb_pull(gso_skb, sizeof(*uh)); + diff --git a/target/linux/generic/pending-6.6/685-net-gso-fix-tcp-fraglist-segmentation-after-pull-fro.patch b/target/linux/generic/pending-6.6/685-net-gso-fix-tcp-fraglist-segmentation-after-pull-fro.patch new file mode 100644 index 0000000000..235762b5c0 --- /dev/null +++ b/target/linux/generic/pending-6.6/685-net-gso-fix-tcp-fraglist-segmentation-after-pull-fro.patch @@ -0,0 +1,74 @@ +From: Felix Fietkau +Date: Thu, 26 Sep 2024 10:41:30 +0200 +Subject: [PATCH] net: gso: fix tcp fraglist segmentation after pull from + frag_list + +Detect tcp gso fraglist skbs with corrupted geometry (see below) and +pass these to skb_segment instead of skb_segment_list, as the first +can segment them correctly. + +Valid SKB_GSO_FRAGLIST skbs +- consist of two or more segments +- the head_skb holds the protocol headers plus first gso_size +- one or more frag_list skbs hold exactly one segment +- all but the last must be gso_size + +Optional datapath hooks such as NAT and BPF (bpf_skb_pull_data) can +modify these skbs, breaking these invariants. + +In extreme cases they pull all data into skb linear. For TCP, this +causes a NULL ptr deref in __tcpv4_gso_segment_list_csum at +tcp_hdr(seg->next). + +Detect invalid geometry due to pull, by checking head_skb size. +Don't just drop, as this may blackhole a destination. Convert to be +able to pass to regular skb_segment. + +Approach and description based on a patch by Willem de Bruijn. + +Link: https://lore.kernel.org/netdev/20240428142913.18666-1-shiming.cheng@mediatek.com/ +Link: https://lore.kernel.org/netdev/20240922150450.3873767-1-willemdebruijn.kernel@gmail.com/ +Fixes: bee88cd5bd83 ("net: add support for segmenting TCP fraglist GSO packets") +Cc: stable@vger.kernel.org +Cc: Willem de Bruijn +Signed-off-by: Felix Fietkau +--- + +--- a/net/ipv4/tcp_offload.c ++++ b/net/ipv4/tcp_offload.c +@@ -101,8 +101,14 @@ static struct sk_buff *tcp4_gso_segment( + if (!pskb_may_pull(skb, sizeof(struct tcphdr))) + return ERR_PTR(-EINVAL); + +- if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST) +- return __tcp4_gso_segment_list(skb, features); ++ if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST) { ++ struct tcphdr *th = tcp_hdr(skb); ++ ++ if (skb_pagelen(skb) - th->doff * 4 == skb_shinfo(skb)->gso_size) ++ return __tcp4_gso_segment_list(skb, features); ++ ++ skb->ip_summed = CHECKSUM_NONE; ++ } + + if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { + const struct iphdr *iph = ip_hdr(skb); +--- a/net/ipv6/tcpv6_offload.c ++++ b/net/ipv6/tcpv6_offload.c +@@ -158,8 +158,14 @@ static struct sk_buff *tcp6_gso_segment( + if (!pskb_may_pull(skb, sizeof(*th))) + return ERR_PTR(-EINVAL); + +- if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST) +- return __tcp6_gso_segment_list(skb, features); ++ if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST) { ++ struct tcphdr *th = tcp_hdr(skb); ++ ++ if (skb_pagelen(skb) - th->doff * 4 == skb_shinfo(skb)->gso_size) ++ return __tcp6_gso_segment_list(skb, features); ++ ++ skb->ip_summed = CHECKSUM_NONE; ++ } + + if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { + const struct ipv6hdr *ipv6h = ipv6_hdr(skb); diff --git a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index 827ceff18b..be7405c1a2 100644 --- a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -8322,7 +8322,7 @@ static int nft_register_flowtable_net_ho +@@ -8327,7 +8327,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/lantiq/patches-6.6/0025-v6.12-net-ethernet-lantiq_etop-fix-memory-disclosure.patch b/target/linux/lantiq/patches-6.6/0025-v6.12-net-ethernet-lantiq_etop-fix-memory-disclosure.patch new file mode 100644 index 0000000000..3b2ac25065 --- /dev/null +++ b/target/linux/lantiq/patches-6.6/0025-v6.12-net-ethernet-lantiq_etop-fix-memory-disclosure.patch @@ -0,0 +1,42 @@ +From 45c0de18ff2dc9af01236380404bbd6a46502c69 Mon Sep 17 00:00:00 2001 +From: Aleksander Jan Bajkowski +Date: Mon, 23 Sep 2024 23:49:49 +0200 +Subject: net: ethernet: lantiq_etop: fix memory disclosure + +When applying padding, the buffer is not zeroed, which results in memory +disclosure. The mentioned data is observed on the wire. This patch uses +skb_put_padto() to pad Ethernet frames properly. The mentioned function +zeroes the expanded buffer. + +In case the packet cannot be padded it is silently dropped. Statistics +are also not incremented. This driver does not support statistics in the +old 32-bit format or the new 64-bit format. These will be added in the +future. In its current form, the patch should be easily backported to +stable versions. + +Ethernet MACs on Amazon-SE and Danube cannot do padding of the packets +in hardware, so software padding must be applied. + +Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver") +Signed-off-by: Aleksander Jan Bajkowski +Reviewed-by: Jacob Keller +Reviewed-by: Florian Fainelli +Link: https://patch.msgid.link/20240923214949.231511-2-olek2@wp.pl +Signed-off-by: Paolo Abeni +--- + drivers/net/ethernet/lantiq_etop.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/lantiq_etop.c ++++ b/drivers/net/ethernet/lantiq_etop.c +@@ -482,7 +482,9 @@ ltq_etop_tx(struct sk_buff *skb, struct + unsigned long flags; + u32 byte_offset; + +- len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; ++ if (skb_put_padto(skb, ETH_ZLEN)) ++ return NETDEV_TX_OK; ++ len = skb->len; + + if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) { + netdev_err(dev, "tx ring full\n"); diff --git a/target/linux/lantiq/patches-6.6/0026-v6.12-net-ethernet-lantiq_etop-remove-unused-variable.patch b/target/linux/lantiq/patches-6.6/0026-v6.12-net-ethernet-lantiq_etop-remove-unused-variable.patch new file mode 100644 index 0000000000..94f961d2c8 --- /dev/null +++ b/target/linux/lantiq/patches-6.6/0026-v6.12-net-ethernet-lantiq_etop-remove-unused-variable.patch @@ -0,0 +1,24 @@ +From 1f803c95693f140bed46cd5581b97592e20b723e Mon Sep 17 00:00:00 2001 +From: Aleksander Jan Bajkowski +Date: Thu, 15 Aug 2024 09:49:56 +0200 +Subject: [PATCH] net: ethernet: lantiq_etop: remove unused variable + +Remove a variable that has never been used. + +Signed-off-by: Aleksander Jan Bajkowski +Link: https://patch.msgid.link/20240815074956.155224-1-olek2@wp.pl +Signed-off-by: Jakub Kicinski +--- + drivers/net/ethernet/lantiq_etop.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/ethernet/lantiq_etop.c ++++ b/drivers/net/ethernet/lantiq_etop.c +@@ -95,7 +95,6 @@ struct ltq_etop_priv { + struct mii_bus *mii_bus; + + struct ltq_etop_chan ch[MAX_DMA_CHAN]; +- int tx_free[MAX_DMA_CHAN >> 1]; + + int tx_burst_len; + int rx_burst_len; diff --git a/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch b/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch index abaef6c3a8..b2e06b8634 100644 --- a/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch +++ b/target/linux/lantiq/patches-6.6/0027-v6.11-net-ethernet-lantiq_etop-remove-redundant-device-nam.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c -@@ -675,7 +675,6 @@ ltq_etop_probe(struct platform_device *p +@@ -676,7 +676,6 @@ ltq_etop_probe(struct platform_device *p err = -ENOMEM; goto err_out; } diff --git a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch index 788a34d61a..c761757c1c 100644 --- a/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch @@ -5,8 +5,8 @@ Subject: [PATCH 28/36] NET: lantiq: various etop fixes Signed-off-by: John Crispin --- - drivers/net/ethernet/lantiq_etop.c | 530 ++++++++++++++++++++--------- - 1 file changed, 375 insertions(+), 155 deletions(-) + drivers/net/ethernet/lantiq_etop.c | 534 ++++++++++++++++++++--------- + 1 file changed, 379 insertions(+), 155 deletions(-) --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -153,7 +153,7 @@ Signed-off-by: John Crispin struct net_device *netdev; struct napi_struct napi; struct ltq_dma_channel dma; -@@ -89,26 +141,39 @@ struct ltq_etop_chan { +@@ -89,25 +141,39 @@ struct ltq_etop_chan { struct ltq_etop_priv { struct net_device *netdev; struct platform_device *pdev; @@ -163,7 +163,6 @@ Signed-off-by: John Crispin struct mii_bus *mii_bus; - struct ltq_etop_chan ch[MAX_DMA_CHAN]; -- int tx_free[MAX_DMA_CHAN >> 1]; + struct ltq_etop_chan txch; + struct ltq_etop_chan rxch; @@ -197,7 +196,7 @@ Signed-off-by: John Crispin if (!ch->skb[ch->dma.desc]) return -ENOMEM; ch->dma.desc_base[ch->dma.desc].addr = -@@ -143,8 +208,11 @@ ltq_etop_hw_receive(struct ltq_etop_chan +@@ -142,8 +208,11 @@ ltq_etop_hw_receive(struct ltq_etop_chan spin_unlock_irqrestore(&priv->lock, flags); skb_put(skb, len); @@ -209,7 +208,7 @@ Signed-off-by: John Crispin } static int -@@ -152,7 +220,9 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -151,7 +220,9 @@ ltq_etop_poll_rx(struct napi_struct *nap { struct ltq_etop_chan *ch = container_of(napi, struct ltq_etop_chan, napi); @@ -219,7 +218,7 @@ Signed-off-by: John Crispin while (work_done < budget) { struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; -@@ -164,7 +234,9 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -163,7 +234,9 @@ ltq_etop_poll_rx(struct napi_struct *nap } if (work_done < budget) { napi_complete_done(&ch->napi, work_done); @@ -229,7 +228,7 @@ Signed-off-by: John Crispin } return work_done; } -@@ -176,12 +248,14 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -175,12 +248,14 @@ ltq_etop_poll_tx(struct napi_struct *nap container_of(napi, struct ltq_etop_chan, napi); struct ltq_etop_priv *priv = netdev_priv(ch->netdev); struct netdev_queue *txq = @@ -245,7 +244,7 @@ Signed-off-by: John Crispin dev_kfree_skb_any(ch->skb[ch->tx_free]); ch->skb[ch->tx_free] = NULL; memset(&ch->dma.desc_base[ch->tx_free], 0, -@@ -194,7 +268,9 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -193,7 +268,9 @@ ltq_etop_poll_tx(struct napi_struct *nap if (netif_tx_queue_stopped(txq)) netif_tx_start_queue(txq); napi_complete(&ch->napi); @@ -255,7 +254,7 @@ Signed-off-by: John Crispin return 1; } -@@ -202,9 +278,11 @@ static irqreturn_t +@@ -201,9 +278,11 @@ static irqreturn_t ltq_etop_dma_irq(int irq, void *_priv) { struct ltq_etop_priv *priv = _priv; @@ -269,7 +268,7 @@ Signed-off-by: John Crispin return IRQ_HANDLED; } -@@ -216,7 +294,7 @@ ltq_etop_free_channel(struct net_device +@@ -215,7 +294,7 @@ ltq_etop_free_channel(struct net_device ltq_dma_free(&ch->dma); if (ch->dma.irq) free_irq(ch->dma.irq, priv); @@ -278,7 +277,7 @@ Signed-off-by: John Crispin struct ltq_dma_channel *dma = &ch->dma; for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++) -@@ -228,80 +306,137 @@ static void +@@ -227,80 +306,137 @@ static void ltq_etop_hw_exit(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -465,7 +464,7 @@ Signed-off-by: John Crispin } static void -@@ -320,6 +455,39 @@ static const struct ethtool_ops ltq_etop +@@ -319,6 +455,39 @@ static const struct ethtool_ops ltq_etop }; static int @@ -505,7 +504,7 @@ Signed-off-by: John Crispin ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data) { u32 val = MDIO_REQUEST | -@@ -327,9 +495,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in +@@ -326,9 +495,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET) | phy_data; @@ -517,7 +516,7 @@ Signed-off-by: John Crispin return 0; } -@@ -340,12 +508,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in +@@ -339,12 +508,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in ((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) | ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET); @@ -534,7 +533,7 @@ Signed-off-by: John Crispin return val; } -@@ -361,7 +529,10 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -360,7 +529,10 @@ ltq_etop_mdio_probe(struct net_device *d struct ltq_etop_priv *priv = netdev_priv(dev); struct phy_device *phydev; @@ -546,7 +545,7 @@ Signed-off-by: John Crispin if (!phydev) { netdev_err(dev, "no PHY found\n"); -@@ -369,14 +540,17 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -368,14 +540,17 @@ ltq_etop_mdio_probe(struct net_device *d } phydev = phy_connect(dev, phydev_name(phydev), @@ -566,7 +565,7 @@ Signed-off-by: John Crispin phy_attached_info(phydev); -@@ -397,8 +571,13 @@ ltq_etop_mdio_init(struct net_device *de +@@ -396,8 +571,13 @@ ltq_etop_mdio_init(struct net_device *de } priv->mii_bus->priv = dev; @@ -582,7 +581,7 @@ Signed-off-by: John Crispin priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); -@@ -435,18 +614,21 @@ static int +@@ -434,18 +614,21 @@ static int ltq_etop_open(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -614,7 +613,7 @@ Signed-off-by: John Crispin netif_tx_start_all_queues(dev); return 0; } -@@ -455,18 +637,19 @@ static int +@@ -454,18 +637,19 @@ static int ltq_etop_stop(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -644,7 +643,7 @@ Signed-off-by: John Crispin return 0; } -@@ -476,15 +659,16 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -475,17 +659,21 @@ ltq_etop_tx(struct sk_buff *skb, struct int queue = skb_get_queue_mapping(skb); struct netdev_queue *txq = netdev_get_tx_queue(dev, queue); struct ltq_etop_priv *priv = netdev_priv(dev); @@ -657,7 +656,13 @@ Signed-off-by: John Crispin u32 byte_offset; + int len; - len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; +- if (skb_put_padto(skb, ETH_ZLEN)) ++ if (skb_put_padto(skb, ETH_ZLEN)) { ++ dev->stats.tx_dropped++; + return NETDEV_TX_OK; ++ } ++ + len = skb->len; - if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) { + if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || @@ -665,7 +670,7 @@ Signed-off-by: John Crispin netdev_err(dev, "tx ring full\n"); netif_tx_stop_queue(txq); return NETDEV_TX_BUSY; -@@ -492,7 +676,7 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -493,7 +681,7 @@ ltq_etop_tx(struct sk_buff *skb, struct /* dma needs to start on a burst length value aligned address */ byte_offset = CPHYSADDR(skb->data) % (priv->tx_burst_len * 4); @@ -674,7 +679,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); -@@ -503,11 +687,11 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -504,11 +692,11 @@ ltq_etop_tx(struct sk_buff *skb, struct wmb(); desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK); @@ -689,7 +694,7 @@ Signed-off-by: John Crispin netif_tx_stop_queue(txq); return NETDEV_TX_OK; -@@ -518,11 +702,14 @@ ltq_etop_change_mtu(struct net_device *d +@@ -519,11 +707,14 @@ ltq_etop_change_mtu(struct net_device *d { struct ltq_etop_priv *priv = netdev_priv(dev); unsigned long flags; @@ -705,7 +710,7 @@ Signed-off-by: John Crispin spin_unlock_irqrestore(&priv->lock, flags); return 0; -@@ -575,6 +762,9 @@ ltq_etop_init(struct net_device *dev) +@@ -576,6 +767,9 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; ltq_etop_change_mtu(dev, 1500); @@ -715,7 +720,7 @@ Signed-off-by: John Crispin memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr)); if (!is_valid_ether_addr(mac.sa_data)) { -@@ -592,9 +782,10 @@ ltq_etop_init(struct net_device *dev) +@@ -593,9 +787,10 @@ ltq_etop_init(struct net_device *dev) dev->addr_assign_type = NET_ADDR_RANDOM; ltq_etop_set_multicast_list(dev); @@ -729,7 +734,7 @@ Signed-off-by: John Crispin return 0; err_netdev: -@@ -614,6 +805,9 @@ ltq_etop_tx_timeout(struct net_device *d +@@ -615,6 +810,9 @@ ltq_etop_tx_timeout(struct net_device *d err = ltq_etop_hw_init(dev); if (err) goto err_hw; @@ -739,7 +744,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); netif_wake_queue(dev); return; -@@ -637,14 +831,18 @@ static const struct net_device_ops ltq_e +@@ -638,14 +836,18 @@ static const struct net_device_ops ltq_e .ndo_tx_timeout = ltq_etop_tx_timeout, }; @@ -762,7 +767,7 @@ Signed-off-by: John Crispin res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { -@@ -670,18 +868,54 @@ ltq_etop_probe(struct platform_device *p +@@ -671,18 +873,54 @@ ltq_etop_probe(struct platform_device *p goto err_out; } @@ -823,7 +828,7 @@ Signed-off-by: John Crispin spin_lock_init(&priv->lock); SET_NETDEV_DEV(dev, &pdev->dev); -@@ -697,15 +931,10 @@ ltq_etop_probe(struct platform_device *p +@@ -698,15 +936,10 @@ ltq_etop_probe(struct platform_device *p goto err_free; } @@ -843,7 +848,7 @@ Signed-off-by: John Crispin err = register_netdev(dev); if (err) -@@ -734,31 +963,22 @@ ltq_etop_remove(struct platform_device * +@@ -735,31 +968,22 @@ ltq_etop_remove(struct platform_device * return 0; } diff --git a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index 3e349d4c32..8bb6e5a0da 100644 --- a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -203,7 +203,7 @@ Signed-off-by: John Crispin +early_param("ethaddr", setup_ethaddr); --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c -@@ -766,7 +766,11 @@ ltq_etop_init(struct net_device *dev) +@@ -771,7 +771,11 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; diff --git a/target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch b/target/linux/lantiq/patches-6.6/0050-v6.11-usb-dwc2-add-support-for-other-Lantiq-SoCs.patch similarity index 84% rename from target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch rename to target/linux/lantiq/patches-6.6/0050-v6.11-usb-dwc2-add-support-for-other-Lantiq-SoCs.patch index 5099c0bb9e..cb453ff048 100644 --- a/target/linux/lantiq/patches-6.6/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch +++ b/target/linux/lantiq/patches-6.6/0050-v6.11-usb-dwc2-add-support-for-other-Lantiq-SoCs.patch @@ -1,7 +1,7 @@ -From de2cad82c4d0872066f83ce59462603852b47f03 Mon Sep 17 00:00:00 2001 +From 5af43708d21c30e2f418cb25d337779c56d235f6 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens -Date: Fri, 6 Jan 2017 17:55:24 +0100 -Subject: [PATCH 2/2] usb: dwc2: add support for other Lantiq SoCs +Date: Tue, 9 Jul 2024 00:20:54 +0200 +Subject: [PATCH] usb: dwc2: add support for other Lantiq SoCs The size of the internal RAM of the DesignWare USB controller changed between the different Lantiq SoCs. We have the following sizes: @@ -16,10 +16,15 @@ and for the xrx200 and xrx300 SCs a little bit bigger periodic fifo. The auto detection of max_transfer_size and max_packet_count should work, so remove it. +This patch is included in OpenWrt for many years. + Signed-off-by: Hauke Mehrtens +Acked-by: Minas Harutyunyan +Link: https://lore.kernel.org/r/20240708222054.2727789-1-hauke@hauke-m.de +Signed-off-by: Greg Kroah-Hartman --- - drivers/usb/dwc2/platform.c | 46 ++++++++++++++++++++++++++++++++++++++------- - 1 file changed, 39 insertions(+), 7 deletions(-) + drivers/usb/dwc2/params.c | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c diff --git a/target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch b/target/linux/lantiq/patches-6.6/0051-v6.11-MIPS-lantiq-improve-USB-initialization.patch similarity index 79% rename from target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch rename to target/linux/lantiq/patches-6.6/0051-v6.11-MIPS-lantiq-improve-USB-initialization.patch index 29d696af27..558a7fbc25 100644 --- a/target/linux/lantiq/patches-6.6/0051-MIPS-lantiq-improve-USB-initialization.patch +++ b/target/linux/lantiq/patches-6.6/0051-v6.11-MIPS-lantiq-improve-USB-initialization.patch @@ -1,17 +1,19 @@ -From 14909c4e4e836925668e74fc6e0e85ba0283cbf9 Mon Sep 17 00:00:00 2001 +From 9c7a86c935074525f24cc20e78a7d5150e4600e3 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens -Date: Fri, 6 Jan 2017 17:40:12 +0100 -Subject: [PATCH 2/2] MIPS: lantiq: improve USB initialization +Date: Tue, 9 Jul 2024 00:23:04 +0200 +Subject: [PATCH] MIPS: lantiq: improve USB initialization This adds code to initialize the USB controller and PHY also on Danube, Amazon SE and AR10. This code is based on the Vendor driver from different UGW versions and compared to the hardware documentation. -Signed-off-by: Hauke Mehrtens ---- - arch/mips/lantiq/xway/sysctrl.c | 20 +++++++ - 2 files changed, 110 insertions(+), 30 deletions(-) +This patch is included in OpenWrt for many years. +Signed-off-by: Hauke Mehrtens +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/lantiq/xway/sysctrl.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c diff --git a/target/linux/mediatek/Makefile b/target/linux/mediatek/Makefile index f667081253..478b00488b 100644 --- a/target/linux/mediatek/Makefile +++ b/target/linux/mediatek/Makefile @@ -4,8 +4,8 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=mediatek -BOARDNAME:=MediaTek Ralink ARM -SUBTARGETS:=mt7622 mt7623 mt7629 filogic +BOARDNAME:=MediaTek ARM +SUBTARGETS:=filogic mt7622 mt7623 mt7629 FEATURES:=dt-overlay emmc fpu gpio nand pci pcie rootfs-part separate_ramdisk squashfs usb KERNEL_PATCHVER:=6.6 diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index bd8fcb16b6..3e10003e4c 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -212,7 +212,7 @@ define Device/smartrg_sdg-8733a $(call Device/adtran_smartrg) DEVICE_MODEL := SDG-8733A DEVICE_DTS := mt7988d-smartrg-SDG-8733A - DEVICE_PACKAGES += mt7988-2p5g-phy-firmware kmod-mt7996-firmware kmod-phy-aquantia + DEVICE_PACKAGES += mt7988-2p5g-phy-firmware kmod-mt7996-233-firmware kmod-phy-aquantia endef TARGET_DEVICES += smartrg_sdg-8733a @@ -373,7 +373,7 @@ define Device/bananapi_bpi-r4-common DEVICE_DTS_LOADADDR := 0x45f00000 DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd mt7988a-bananapi-bpi-r4-wifi-mt7996a DEVICE_DTC_FLAGS := --pad 4096 - DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware \ + DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \ kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs IMAGES := sysupgrade.itb KERNEL_LOADADDR := 0x46000000 diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index c7e074aaa5..d8d27fda3b 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -1522,7 +1522,6 @@ static void fe_pending_work(struct work_struct *work) static int fe_probe(struct platform_device *pdev) { - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); const struct of_device_id *match; struct fe_soc_data *soc; struct net_device *netdev; @@ -1542,17 +1541,14 @@ static int fe_probe(struct platform_device *pdev) else soc->reg_table = fe_reg_table; - fe_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(fe_base)) { - err = -EADDRNOTAVAIL; - goto err_out; - } + fe_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(fe_base)) + return PTR_ERR(fe_base); - netdev = alloc_etherdev(sizeof(*priv)); + netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv)); if (!netdev) { dev_err(&pdev->dev, "alloc_etherdev failed\n"); - err = -ENOMEM; - goto err_iounmap; + return -ENOMEM; } SET_NETDEV_DEV(netdev, &pdev->dev); @@ -1562,16 +1558,15 @@ static int fe_probe(struct platform_device *pdev) netdev->irq = platform_get_irq(pdev, 0); if (netdev->irq < 0) { dev_err(&pdev->dev, "no IRQ resource found\n"); - err = -ENXIO; - goto err_free_dev; + return -ENXIO; } priv = netdev_priv(netdev); spin_lock_init(&priv->page_lock); - priv->resets = devm_reset_control_array_get_exclusive(&pdev->dev); + priv->resets = devm_reset_control_array_get_optional_exclusive(&pdev->dev); if (IS_ERR(priv->resets)) { dev_err(&pdev->dev, "Failed to get resets for FE and ESW cores: %pe\n", priv->resets); - priv->resets = NULL; + return PTR_ERR(priv->resets); } if (soc->init_data) @@ -1589,11 +1584,9 @@ static int fe_probe(struct platform_device *pdev) netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; if (fe_reg_table[FE_REG_FE_COUNTER_BASE]) { - priv->hw_stats = kzalloc(sizeof(*priv->hw_stats), GFP_KERNEL); - if (!priv->hw_stats) { - err = -ENOMEM; - goto err_free_dev; - } + priv->hw_stats = devm_kzalloc(&pdev->dev, sizeof(*priv->hw_stats), GFP_KERNEL); + if (!priv->hw_stats) + return -ENOMEM; spin_lock_init(&priv->hw_stats->stats_lock); u64_stats_init(&priv->hw_stats->syncp); } @@ -1603,15 +1596,13 @@ static int fe_probe(struct platform_device *pdev) priv->sysclk = clk_get_rate(sysclk); } else if ((priv->flags & FE_FLAG_CALIBRATE_CLK)) { dev_err(&pdev->dev, "this soc needs a clk for calibration\n"); - err = -ENXIO; - goto err_free_dev; + return -ENXIO; } priv->switch_np = of_parse_phandle(pdev->dev.of_node, "mediatek,switch", 0); if ((priv->flags & FE_FLAG_HAS_SWITCH) && !priv->switch_np) { dev_err(&pdev->dev, "failed to read switch phandle\n"); - err = -ENODEV; - goto err_free_dev; + return -ENODEV; } priv->netdev = netdev; @@ -1633,10 +1624,10 @@ static int fe_probe(struct platform_device *pdev) netif_napi_add_weight(netdev, &priv->rx_napi, fe_poll, napi_weight); fe_set_ethtool_ops(netdev); - err = register_netdev(netdev); + err = devm_register_netdev(&pdev->dev, netdev); if (err) { dev_err(&pdev->dev, "error bringing up device\n"); - goto err_free_dev; + return err; } platform_set_drvdata(pdev, netdev); @@ -1645,13 +1636,6 @@ static int fe_probe(struct platform_device *pdev) netdev->base_addr, netdev->irq); return 0; - -err_free_dev: - free_netdev(netdev); -err_iounmap: - devm_iounmap(&pdev->dev, fe_base); -err_out: - return err; } static int fe_remove(struct platform_device *pdev) @@ -1660,12 +1644,9 @@ static int fe_remove(struct platform_device *pdev) struct fe_priv *priv = netdev_priv(dev); netif_napi_del(&priv->rx_napi); - kfree(priv->hw_stats); cancel_work_sync(&priv->pending_work); - unregister_netdev(dev); - free_netdev(dev); platform_set_drvdata(pdev, NULL); return 0; diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index 2c35adfa8f..50c3888b64 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -30,7 +30,12 @@ HOST_CONFIGURE_ARGS += \ --disable-tls \ --disable-nls \ --enable-threads=pth \ - --disable-fuse2fs + --disable-fuse2fs \ + --with-crond-dir=no + +# The following uses pkg-config the wrong way around. Just override it. +HOST_CONFIGURE_VARS += \ + ac_cv_lib_uuid_uuid_generate=yes define Host/Prepare $(call Host/Prepare/Default) diff --git a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch deleted file mode 100644 index c94c609160..0000000000 --- a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/e2fsck/e2fsck.h -+++ b/e2fsck/e2fsck.h -@@ -81,7 +81,7 @@ - * Exit codes used by fsck-type programs - */ - #define FSCK_OK 0 /* No errors */ --#define FSCK_NONDESTRUCT 1 /* File system errors corrected */ -+#define FSCK_NONDESTRUCT 0 /* File system errors corrected */ - #define FSCK_REBOOT 2 /* System should be rebooted */ - #define FSCK_UNCORRECTED 4 /* File system errors left uncorrected */ - #define FSCK_ERROR 8 /* Operational error */ diff --git a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch deleted file mode 100644 index f59cd317a1..0000000000 --- a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/misc/Makefile.in -+++ b/misc/Makefile.in -@@ -12,7 +12,7 @@ MKDIR_P = @MKDIR_P@ - - @MCONFIG@ - --@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= e4defrag -+@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= - @DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_MAN= e4defrag.8 - - @LINUX_CMT@E4CRYPT_PROG = e4crypt diff --git a/tools/e2fsprogs/patches/003-no-crond.patch b/tools/e2fsprogs/patches/003-no-crond.patch deleted file mode 100644 index 67ddd4ab0c..0000000000 --- a/tools/e2fsprogs/patches/003-no-crond.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure -+++ b/configure -@@ -15259,7 +15259,7 @@ then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5 - printf "%s\n" "${crond_dir}" >&6; } -- have_crond="yes" -+ have_crond="no"; with_crond_dir="" - - else $as_nop - diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch index be97f95faa..2cc8a4c56e 100644 --- a/tools/elfutils/patches/100-portability.patch +++ b/tools/elfutils/patches/100-portability.patch @@ -288,3 +288,13 @@ /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -92,6 +92,7 @@ strings_LDADD = $(libelf) $(libeu) $(arg + ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) + unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) + stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib) ++EXTRA_stack_DEPENDENCIES = $(if $(findstring srcfiles,$(bin_PROGRAMS)),$(srcfiles_OBJECTS)) + elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) + elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD) + srcfiles_SOURCES = srcfiles.cxx diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index 699675bdc3..22b2c8f24f 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.33 +PKG_VERSION:=1.36 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot -PKG_HASH:=e157d8e5c64d3a755707791e9be93296c6d249d5c4478bf941b675d49c47757d +PKG_HASH:=7fe3cf3daf95ee93b47e568e85f4d341a1f9ae91766b4f9a9cdc29737dea4988 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf diff --git a/tools/fakeroot/patches/300-time64-hack.patch b/tools/fakeroot/patches/300-time64-hack.patch index 540724fb5a..46132cdd3d 100644 --- a/tools/fakeroot/patches/300-time64-hack.patch +++ b/tools/fakeroot/patches/300-time64-hack.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -386,7 +386,7 @@ dnl Digital Unix: stat +@@ -390,7 +390,7 @@ dnl Digital Unix: stat time64_hack=no AH_TEMPLATE([TIME64_HACK], [time64 shuffle]) AC_MSG_CHECKING([if we need to cope with time64]) diff --git a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch index f740b120a1..5936034911 100644 --- a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch +++ b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch @@ -21,14 +21,3 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif -@@ -142,8 +144,9 @@ - - /* 10.10 uses id_t in getpriority/setpriority calls, so pretend - id_t is used everywhere, just happens to be int on some OSes */ --#ifndef _ID_T -+#if !defined(_ID_T) && !defined(__DEFINED_id_t) - #define _ID_T -+#define __DEFINED_id_t - typedef int id_t; - #endif - #endif diff --git a/tools/util-linux/patches/110-pkgconfig-static.patch b/tools/util-linux/patches/110-pkgconfig-static.patch new file mode 100644 index 0000000000..d61ae313bf --- /dev/null +++ b/tools/util-linux/patches/110-pkgconfig-static.patch @@ -0,0 +1,24 @@ +From 81ea117e0396274808a77d40bf11af44ea047285 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Mon, 23 Sep 2024 12:01:40 +0200 +Subject: [PATCH] pkgconfig: adjust for static libraries + +OpenWrt builds only static libuuid for tools. Adjust the pkgconfig file +accordingly. + +Addresses: https://github.com/util-linux/util-linux/issues/3210 +Signed-off-by: Rosen Penev +--- + libuuid/uuid.pc.in | 2 +- + 1 file changed, 1 insertions(+), 2 deletions(-) + +--- a/libuuid/uuid.pc.in ++++ b/libuuid/uuid.pc.in +@@ -6,6 +6,5 @@ includedir=@includedir@ + Name: uuid + Description: Universally unique id library + Version: @LIBUUID_VERSION@ +-Requires: + Cflags: -I${includedir}/uuid +-Libs: -L${libdir} -luuid ++Libs: -L${libdir} -luuid -lpthread diff --git a/tools/yafut/patches/100-portability.patch b/tools/yafut/patches/100-portability.patch new file mode 100644 index 0000000000..18fda407af --- /dev/null +++ b/tools/yafut/patches/100-portability.patch @@ -0,0 +1,289 @@ +--- a/lib/yaffs2/direct/yportenv.h ++++ b/lib/yaffs2/direct/yportenv.h +@@ -32,10 +32,13 @@ + #define CONFIG_YAFFS_DEFINES_TYPES 1 + #define CONFIG_YAFFS_USE_32_BIT_TIME_T 1 + #define NO_Y_INLINE 1 +-#define loff_t off_t + + #endif /* __rtems__ */ + ++#ifndef linux ++#define loff_t off_t ++#endif ++ + /* Definition of types */ + #ifdef CONFIG_YAFFS_DEFINES_TYPES + typedef unsigned char u8; +--- a/src/ioctl.c ++++ b/src/ioctl.c +@@ -21,5 +21,9 @@ + * integer overflow when building against e.g. musl. + */ + int linux_ioctl(int fd, unsigned long request, void *ptr) { ++#ifdef linux + return syscall(SYS_ioctl, fd, request, ptr); ++#else ++ return -1; ++#endif + } +--- a/src/ioctl.h ++++ b/src/ioctl.h +@@ -12,7 +12,9 @@ int linux_ioctl(int fd, unsigned long re + * time, as the definition of the MEMREAD ioctl trickles down into kernel + * headers distributed out there. + */ ++#ifdef linux + #include ++ + #ifndef MEMREAD + #include + +@@ -35,3 +37,4 @@ struct mtd_read_req { + + #define MEMREAD _IOWR('M', 26, struct mtd_read_req) + #endif /* MEMREAD */ ++#endif +--- a/src/mtd.c ++++ b/src/mtd.c +@@ -4,7 +4,9 @@ + + #include + #include ++#ifdef linux + #include ++#endif + #include + #include + #include +@@ -82,6 +84,7 @@ static void mtd_debug_location(const cha + va_end(args); + } + ++#ifdef linux + /* + * Read the raw contents of the sysfs attribute at the provided 'sysfs_path' + * into 'buf', which is 'buf_len' bytes large. The given sysfs attribute is +@@ -179,6 +182,7 @@ static int discover_mtd_parameters(const + + return 0; + } ++#endif + + /* + * Initialize 'geometry' with 'chunk_size' and 'block_size' set to the default +@@ -203,6 +207,7 @@ static void init_yaffs_geometry_default( + * Initialize 'geometry' with 'chunk_size' and 'block_size' set to the relevant + * MTD parameters provided in 'mtd' and 'mtd_type' set to the provided value. + */ ++#ifdef linux + static void init_yaffs_geometry_autodetected(const struct mtd_ctx *ctx, + const struct mtd_info_user *mtd, + struct mtd_geometry *geometry, +@@ -217,6 +222,7 @@ static void init_yaffs_geometry_autodete + .block_size = mtd->erasesize, + }; + } ++#endif + + /* + * Update 'chunk_size' and 'block_size' in 'geometry' to the values provided in +@@ -280,6 +286,7 @@ static int init_yaffs_geometry_file(cons + * 2. If -C and/or -B were used, override any default values with those + * provided on the command line. + */ ++#ifdef linux + static void init_yaffs_geometry_nand_or_nor(const struct mtd_ctx *ctx, + const struct mtd_info_user *mtd, + const struct opts *opts, +@@ -297,6 +304,7 @@ static void init_yaffs_geometry_nand_or_ + + geometry->block_count = mtd->size / geometry->block_size; + } ++#endif + + /* + * Determine the type of the provided MTD (which can be either NAND/NOR flash +@@ -317,6 +325,7 @@ static int init_yaffs_geometry(const str + geometry->oob_size = 0; + geometry->oobavail = 0; + } else { ++#ifdef linux + struct mtd_info_user mtd; + unsigned int oobavail; + +@@ -329,6 +338,9 @@ static int init_yaffs_geometry(const str + + geometry->oob_size = mtd.oobsize; + geometry->oobavail = oobavail; ++#else ++ return -1; ++#endif + } + + return 0; +--- a/src/ydrv.c ++++ b/src/ydrv.c +@@ -3,7 +3,9 @@ + // SPDX-License-Identifier: GPL-2.0-only + + #include ++#ifdef linux + #include ++#endif + #include + #include + #include +@@ -122,6 +124,7 @@ static long long ydrv_get_data_offset_fo + /* + * Check whether the given MTD block is a bad one on NAND or NOR flash. + */ ++#ifdef linux + static int ydrv_check_bad_nand_or_nor(const struct ydrv_ctx *ctx, + int block_no) { + long long offset = block_no * ctx->block_size; +@@ -139,6 +142,7 @@ static int ydrv_check_bad_nand_or_nor(co + + return (ret == 0 ? YAFFS_OK : YAFFS_FAIL); + } ++#endif + + /* + * Check whether the given MTD block is a bad one. +@@ -154,9 +158,11 @@ static int ydrv_check_bad(struct yaffs_d + } + + switch (ctx->mtd_type) { ++#ifdef linux + case MTD_TYPE_NAND: + case MTD_TYPE_NOR: + return ydrv_check_bad_nand_or_nor(ctx, block_no); ++#endif + case MTD_TYPE_FILE: + ydrv_debug("file is assumed to only contain good blocks"); + return YAFFS_OK; +@@ -169,6 +175,7 @@ static int ydrv_check_bad(struct yaffs_d + /* + * Erase the given MTD block on NAND or NOR flash. + */ ++#ifdef linux + static int ydrv_erase_block_nand_or_nor(const struct ydrv_ctx *ctx, + int block_no) { + long long offset = block_no * ctx->block_size; +@@ -196,6 +203,7 @@ static int ydrv_erase_block_nand_or_nor( + + return YAFFS_OK; + } ++#endif + + /* + * Erase the given MTD block in a file. +@@ -247,9 +255,11 @@ static int ydrv_erase_block(struct yaffs + } + + switch (ctx->mtd_type) { ++#ifdef linux + case MTD_TYPE_NAND: + case MTD_TYPE_NOR: + return ydrv_erase_block_nand_or_nor(ctx, block_no); ++#endif + case MTD_TYPE_FILE: + return ydrv_erase_block_file(ctx, block_no); + default: +@@ -261,6 +271,7 @@ static int ydrv_erase_block(struct yaffs + /* + * Mark the given MTD block as bad on NAND or NOR flash. + */ ++#ifdef linux + static int ydrv_mark_bad_nand_or_nor(const struct ydrv_ctx *ctx, int block_no) { + long long offset = block_no * ctx->block_size; + int err = 0; +@@ -281,6 +292,7 @@ static int ydrv_mark_bad_nand_or_nor(con + + return YAFFS_OK; + } ++#endif + + /* + * Mark the given MTD block as bad. +@@ -296,9 +308,11 @@ static int ydrv_mark_bad(struct yaffs_de + } + + switch (ctx->mtd_type) { ++#ifdef linux + case MTD_TYPE_NAND: + case MTD_TYPE_NOR: + return ydrv_mark_bad_nand_or_nor(ctx, block_no); ++#endif + case MTD_TYPE_FILE: + ydrv_debug("file is assumed to only contain good blocks"); + return YAFFS_FAIL; +@@ -315,9 +329,11 @@ static int ydrv_mark_bad(struct yaffs_de + */ + static int ydrv_ecc_result(int read_result, enum yaffs_ecc_result *ecc_result) { + switch (read_result) { ++#ifdef linux + case -EUCLEAN: + *ecc_result = YAFFS_ECC_RESULT_FIXED; + return YAFFS_OK; ++#endif + case -EBADMSG: + *ecc_result = YAFFS_ECC_RESULT_UNFIXED; + return YAFFS_FAIL; +@@ -333,6 +349,7 @@ static int ydrv_ecc_result(int read_resu + /* + * Read a data+OOB chunk from NAND flash. + */ ++#ifdef linux + static int ydrv_read_chunk_nand(const struct ydrv_ctx *ctx, int chunk, u8 *data, + int data_len, u8 *oob, int oob_len, + enum yaffs_ecc_result *ecc_result_out, +@@ -371,6 +388,7 @@ static int ydrv_read_chunk_nand(const st + + return ret; + } ++#endif + + /* + * Read a data chunk from NOR flash. +@@ -420,10 +438,12 @@ static int ydrv_read_chunk(struct yaffs_ + } + + switch (ctx->mtd_type) { ++#ifdef linux + case MTD_TYPE_NAND: + return ydrv_read_chunk_nand(ctx, chunk, data, data_len, oob, + oob_len, ecc_result_out, + dev->param.is_yaffs2); ++#endif + case MTD_TYPE_NOR: + case MTD_TYPE_FILE: + return ydrv_read_chunk_nor_or_file(ctx, chunk, data, data_len, +@@ -438,6 +458,7 @@ static int ydrv_read_chunk(struct yaffs_ + /* + * Write a data+OOB chunk to NAND flash. + */ ++#ifdef linux + static int ydrv_write_chunk_nand(const struct ydrv_ctx *ctx, int chunk, + const u8 *data, int data_len, const u8 *oob, + int oob_len, bool is_yaffs2) { +@@ -472,6 +493,7 @@ static int ydrv_write_chunk_nand(const s + + return YAFFS_OK; + } ++#endif + + /* + * Write a data chunk to NOR flash. +@@ -516,9 +538,11 @@ static int ydrv_write_chunk(struct yaffs + } + + switch (ctx->mtd_type) { ++#ifdef linux + case MTD_TYPE_NAND: + return ydrv_write_chunk_nand(ctx, chunk, data, data_len, oob, + oob_len, dev->param.is_yaffs2); ++#endif + case MTD_TYPE_NOR: + case MTD_TYPE_FILE: + return ydrv_write_chunk_nor_or_file(ctx, chunk, data, data_len);