Merge branch 'openwrt:master' into master

This commit is contained in:
Hayzam Sherif 2023-02-02 09:13:26 +05:30 committed by GitHub
commit bfecf65b6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
195 changed files with 6438 additions and 5132 deletions

View file

@ -1,3 +1,4 @@
FROM registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
COPY --chown=buildbot:buildbot tools.tar /tools.tar
COPY --chown=buildbot staging_dir/host /prebuilt_tools/staging_dir/host
COPY --chown=buildbot build_dir/host /prebuilt_tools/build_dir/host

View file

@ -61,7 +61,7 @@ jobs:
if: inputs.generate_prebuilt_artifacts == true
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host dl
run: tar -cf tools.tar staging_dir/host build_dir/host
- name: Upload prebuilt tools
if: inputs.generate_prebuilt_artifacts == true

View file

@ -22,6 +22,9 @@ on:
type: boolean
build_all_boards:
type: boolean
use_openwrt_container:
type: boolean
default: true
permissions:
contents: read
@ -44,6 +47,11 @@ jobs:
run: |
OWNER_LC=$(echo "${{ github.repository_owner }}" \
| tr '[:upper:]' '[:lower:]')
if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
OWNER_LC=openwrt
fi
echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
- name: Generate ccache hash
@ -137,6 +145,16 @@ jobs:
echo "TARGET=$TARGET" >> "$GITHUB_ENV"
echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
- name: Prepare prebuilt tools
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: |
mkdir -p staging_dir build_dir
ln -s /prebuilt_tools/staging_dir/host staging_dir/host
ln -s /prebuilt_tools/build_dir/host build_dir/host
./scripts/ext-tools.sh --refresh
- name: Update & Install feeds
if: inputs.include_feeds == true
shell: su buildbot -c "sh -e {0}"
@ -221,11 +239,6 @@ jobs:
wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \
| tar --xz -xf -
- name: Extract prebuilt tools
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: ./scripts/ext-tools.sh --tools /tools.tar
- name: Configure testing kernel
if: inputs.testing == true
shell: su buildbot -c "sh -e {0}"

View file

@ -8,6 +8,9 @@ on:
type: string
testing:
type: boolean
use_openwrt_container:
type: boolean
default: true
permissions:
contents: read
@ -26,6 +29,11 @@ jobs:
run: |
OWNER_LC=$(echo "${{ github.repository_owner }}" \
| tr '[:upper:]' '[:lower:]')
if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
OWNER_LC=openwrt
fi
echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
# Per branch tools container tag
@ -84,10 +92,15 @@ jobs:
echo "TARGET=$TARGET" >> "$GITHUB_ENV"
echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
- name: Extract prebuilt tools
- name: Prepare prebuilt tools
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: ./scripts/ext-tools.sh --tools /tools.tar
run: |
mkdir -p staging_dir build_dir
ln -sf /prebuilt_tools/staging_dir/host staging_dir/host
ln -sf /prebuilt_tools/build_dir/host build_dir/host
./scripts/ext-tools.sh --refresh
- name: Configure testing kernel
if: inputs.testing == true

View file

@ -8,7 +8,7 @@ on:
- '.github/workflows/kernel.yml'
- 'include/kernel*'
- 'package/kernel/**'
- 'target/linux/generic/**'
- 'target/linux/**'
push:
paths:
- '.github/workflows/check-kernel-patches.yml'

45
.github/workflows/label-kernel.yml vendored Normal file
View file

@ -0,0 +1,45 @@
# ci:kernel:x86:64 is going to trigger CI kernel check jobs for x86/64 target
name: Build kernel and check patches for target specified in labels
on:
pull_request:
types:
- labeled
jobs:
set_target:
if: startsWith(github.event.label.name, 'ci:kernel:')
name: Set target
runs-on: ubuntu-latest
outputs:
target: ${{ steps.set_target.outputs.target }}
steps:
- name: Set target
id: set_target
env:
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
run: |
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target="\1\/\2"/p' | tee --append $GITHUB_OUTPUT
build_kernel:
name: Build Kernel with external toolchain
needs: set_target
permissions:
contents: read
packages: read
uses: ./.github/workflows/build.yml
with:
target: ${{ needs.set_target.outputs.target }}
build_kernel: true
build_all_kmods: true
check-kernel-patches:
name: Check Kernel patches
needs: set_target
permissions:
contents: read
packages: read
uses: ./.github/workflows/check-kernel-patches.yml
with:
target: ${{ needs.set_target.outputs.target }}

37
.github/workflows/label-target.yml vendored Normal file
View file

@ -0,0 +1,37 @@
# ci:target:x86:64 is going to trigger CI target check jobs for x86/64 target
name: Build check target specified in labels
on:
pull_request:
types:
- labeled
jobs:
set_target:
if: startsWith(github.event.label.name, 'ci:target:')
name: Set target
runs-on: ubuntu-latest
outputs:
target: ${{ steps.set_target.outputs.target }}
steps:
- name: Set target
id: set_target
env:
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
run: |
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target="\1\/\2"/p' | tee --append $GITHUB_OUTPUT
build_target:
name: Build target
needs: set_target
permissions:
contents: read
packages: read
uses: ./.github/workflows/build.yml
with:
target: ${{ needs.set_target.outputs.target }}
build_full: true
build_all_kmods: true
build_all_boards: true
build_all_modules: true

View file

@ -11,9 +11,14 @@ on:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-linux-buildbot:
name: Build tools with buildbot container
if: ${{ github.repository_owner == 'openwrt' }}
uses: ./.github/workflows/build-tools.yml
with:
generate_prebuilt_artifacts: true
@ -21,6 +26,7 @@ jobs:
push-tools-container:
needs: build-linux-buildbot
name: Push prebuilt tools container
if: ${{ github.repository_owner == 'openwrt' }}
runs-on: ubuntu-latest
permissions:
@ -70,6 +76,10 @@ jobs:
name: linux-buildbot-prebuilt-tools
path: openwrt
- name: Extract prebuild tools
working-directory: openwrt
run: tar -xf tools.tar
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:

View file

@ -47,6 +47,7 @@ jobs:
findutils \
gawk \
git-extras \
gnu-getopt \
gnu-sed \
grep \
make

View file

@ -1123,6 +1123,13 @@ config KERNEL_WEXT_PROC
config KERNEL_WEXT_SPY
def_bool KERNEL_WIRELESS_EXT
config KERNEL_PAGE_POOL
def_bool n
config KERNEL_PAGE_POOL_STATS
bool "Page pool stats support"
depends on KERNEL_PAGE_POOL
depends on !LINUX_5_10
#
# NFS related symbols

View file

@ -206,5 +206,9 @@ endif
define HostBuild
$(HostBuild/Core)
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,
$(if $(and $(CONFIG_AUTOREMOVE), $(wildcard $(HOST_STAMP_INSTALLED), $(wildcard $(HOST_STAMP_BUILT)))),,
$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
)
)
endef

View file

@ -333,6 +333,8 @@ define Device/InitProfile
DEVICE_ALT0_TITLE = $$(DEVICE_ALT0_VENDOR) $$(DEVICE_ALT0_MODEL)$$(if $$(DEVICE_ALT0_VARIANT), $$(DEVICE_ALT0_VARIANT))
DEVICE_ALT1_TITLE = $$(DEVICE_ALT1_VENDOR) $$(DEVICE_ALT1_MODEL)$$(if $$(DEVICE_ALT1_VARIANT), $$(DEVICE_ALT1_VARIANT))
DEVICE_ALT2_TITLE = $$(DEVICE_ALT2_VENDOR) $$(DEVICE_ALT2_MODEL)$$(if $$(DEVICE_ALT2_VARIANT), $$(DEVICE_ALT2_VARIANT))
DEVICE_ALT3_TITLE = $$(DEVICE_ALT3_VENDOR) $$(DEVICE_ALT3_MODEL)$$(if $$(DEVICE_ALT3_VARIANT), $$(DEVICE_ALT3_VARIANT))
DEVICE_ALT4_TITLE = $$(DEVICE_ALT4_VENDOR) $$(DEVICE_ALT4_MODEL)$$(if $$(DEVICE_ALT4_VARIANT), $$(DEVICE_ALT4_VARIANT))
DEVICE_VENDOR :=
DEVICE_MODEL :=
DEVICE_VARIANT :=
@ -345,6 +347,12 @@ define Device/InitProfile
DEVICE_ALT2_VENDOR :=
DEVICE_ALT2_MODEL :=
DEVICE_ALT2_VARIANT :=
DEVICE_ALT3_VENDOR :=
DEVICE_ALT3_MODEL :=
DEVICE_ALT3_VARIANT :=
DEVICE_ALT4_VENDOR :=
DEVICE_ALT4_MODEL :=
DEVICE_ALT4_VARIANT :=
DEVICE_PACKAGES :=
DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
endef
@ -424,7 +432,9 @@ DEFAULT_DEVICE_VARS := \
DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \
DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT \
DEVICE_ALT3_VENDOR DEVICE_ALT3_MODEL DEVICE_ALT3_VARIANT \
DEVICE_ALT4_VENDOR DEVICE_ALT4_MODEL DEVICE_ALT4_VARIANT
define Device/ExportVar
$(1) : $(2):=$$($(2))
@ -507,6 +517,12 @@ define Device/Build/initramfs
DEVICE_ALT2_VENDOR="$$(DEVICE_ALT2_VENDOR)" \
DEVICE_ALT2_MODEL="$$(DEVICE_ALT2_MODEL)" \
DEVICE_ALT2_VARIANT="$$(DEVICE_ALT2_VARIANT)" \
DEVICE_ALT3_VENDOR="$$(DEVICE_ALT3_VENDOR)" \
DEVICE_ALT3_MODEL="$$(DEVICE_ALT3_MODEL)" \
DEVICE_ALT3_VARIANT="$$(DEVICE_ALT3_VARIANT)" \
DEVICE_ALT4_VENDOR="$$(DEVICE_ALT4_VENDOR)" \
DEVICE_ALT4_MODEL="$$(DEVICE_ALT4_MODEL)" \
DEVICE_ALT4_VARIANT="$$(DEVICE_ALT4_VARIANT)" \
DEVICE_TITLE="$$(DEVICE_TITLE)" \
DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
TARGET="$(BOARD)" \
@ -615,6 +631,12 @@ define Device/Build/image
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
DEVICE_ALT3_VENDOR="$(DEVICE_ALT3_VENDOR)" \
DEVICE_ALT3_MODEL="$(DEVICE_ALT3_MODEL)" \
DEVICE_ALT3_VARIANT="$(DEVICE_ALT3_VARIANT)" \
DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
DEVICE_TITLE="$(DEVICE_TITLE)" \
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
TARGET="$(BOARD)" \
@ -660,6 +682,12 @@ define Device/Build/artifact
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
DEVICE_ALT3_VENDOR="$(DEVICE_ALT3_VENDOR)" \
DEVICE_ALT3_MODEL="$(DEVICE_ALT3_MODEL)" \
DEVICE_ALT3_VARIANT="$(DEVICE_ALT3_VARIANT)" \
DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
DEVICE_TITLE="$(DEVICE_TITLE)" \
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
TARGET="$(BOARD)" \
@ -701,6 +729,8 @@ $(if $(strip $(DEVICE_ALT0_TITLE)),Alternative device titles:
- $(DEVICE_ALT0_TITLE))
$(if $(strip $(DEVICE_ALT1_TITLE)),- $(DEVICE_ALT1_TITLE))
$(if $(strip $(DEVICE_ALT2_TITLE)),- $(DEVICE_ALT2_TITLE))
$(if $(strip $(DEVICE_ALT3_TITLE)),- $(DEVICE_ALT3_TITLE))
$(if $(strip $(DEVICE_ALT4_TITLE)),- $(DEVICE_ALT4_TITLE))
@@
endef
@ -718,6 +748,14 @@ ifneq ($$(strip $$(DEVICE_ALT2_TITLE)),)
DEVICE_DISPLAY = $$(DEVICE_ALT2_TITLE) ($$(DEVICE_TITLE))
$$(info $$(call Device/DumpInfo,$(1)))
endif
ifneq ($$(strip $$(DEVICE_ALT3_TITLE)),)
DEVICE_DISPLAY = $$(DEVICE_ALT3_TITLE) ($$(DEVICE_TITLE))
$$(info $$(call Device/DumpInfo,$(1)))
endif
ifneq ($$(strip $$(DEVICE_ALT4_TITLE)),)
DEVICE_DISPLAY = $$(DEVICE_ALT4_TITLE) ($$(DEVICE_TITLE))
$$(info $$(call Device/DumpInfo,$(1)))
endif
DEVICE_DISPLAY = $$(DEVICE_TITLE)
$$(eval $$(if $$(DEVICE_TITLE),$$(info $$(call Device/DumpInfo,$(1)))))
endef

View file

@ -1,2 +1,2 @@
LINUX_VERSION-5.10 = .163
LINUX_KERNEL_HASH-5.10.163 = 96e226e2d388abc0600434e0f4f365a8829ef901f4d8e761e7ffe2799dc09b20
LINUX_VERSION-5.10 = .165
LINUX_KERNEL_HASH-5.10.165 = 971defc48f19ed0a2a7ffd4b48234619cac28895c985c6d747f5b707ba47af0d

View file

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .88
LINUX_KERNEL_HASH-5.15.88 = 417539fdd96a3af97ef9ad2b51ca13967cb922f53970563b60290b935a81a181
LINUX_VERSION-5.15 = .90
LINUX_KERNEL_HASH-5.15.90 = e6fd430022686753af7516fe7544f96aab379509dc5b7829017bdcd92b393b42

View file

@ -81,7 +81,7 @@ define Build/Compile/Trusted-Firmware-A
$(if $(DTC),DTC="$(DTC)") \
PLAT=$(PLAT) \
BUILD_STRING="OpenWrt v$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
$(if $(CONFIG_BINUTILS_VERSION_2_39),LDFLAGS="-no-warn-rwx-segments") \
$(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \
$(TFA_MAKE_FLAGS)
endef

View file

@ -127,6 +127,33 @@ get_magic_fat32() {
(get_image "$@" | dd bs=1 count=5 skip=82) 2>/dev/null
}
identify_magic_long() {
local magic=$1
case "$magic" in
"55424923")
echo "ubi"
;;
"31181006")
echo "ubifs"
;;
"68737173")
echo "squashfs"
;;
"d00dfeed")
echo "fit"
;;
"4349"*)
echo "combined"
;;
"1f8b"*)
echo "gzip"
;;
*)
echo "unknown $magic"
;;
esac
}
part_magic_efi() {
local magic=$(get_magic_gpt "$@")
[ "$magic" = "EFI PART" ]

View file

@ -58,7 +58,7 @@ emmc_copy_config() {
}
emmc_do_upgrade() {
local file_type=$(identify $1)
local file_type=$(identify_magic_long "$(get_magic_long "$1")")
case "$file_type" in
"fit") emmc_upgrade_fit $1;;

View file

@ -65,40 +65,12 @@ get_magic_long_tar() {
(tar xO${3}f "$1" "$2" | dd bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2> /dev/null
}
identify_magic() {
local magic=$1
case "$magic" in
"55424923")
echo "ubi"
;;
"31181006")
echo "ubifs"
;;
"68737173")
echo "squashfs"
;;
"d00dfeed")
echo "fit"
;;
"4349"*)
echo "combined"
;;
"1f8b"*)
echo "gzip"
;;
*)
echo "unknown $magic"
;;
esac
}
identify() {
identify_magic $(nand_get_magic_long "$@")
identify_magic_long $(nand_get_magic_long "$@")
}
identify_tar() {
identify_magic $(get_magic_long_tar "$@")
identify_magic_long $(get_magic_long_tar "$@")
}
identify_if_gzip() {
@ -481,7 +453,11 @@ nand_do_platform_check() {
local gz="$(identify_if_gzip "$file")"
local file_type="$(identify "$file" "" "$gz")"
local control_length=$( (tar xO${gz}f "$file" "sysupgrade-$board_name/CONTROL" | wc -c) 2> /dev/null)
local control_length=$( (tar xO${gz}f "$file" "sysupgrade-${board_name//,/_}/CONTROL" | wc -c) 2> /dev/null)
if [ "$control_length" = 0 ]; then
control_length=$( (tar xO${gz}f "$file" "sysupgrade-${board_name//_/,}/CONTROL" | wc -c) 2> /dev/null)
fi
if [ "$control_length" != 0 ]; then
nand_verify_tar_file "$file" "$gz" || return 1

View file

@ -38,11 +38,11 @@ engenius,ecb600|\
engenius,enh202-v1|\
engenius,ens202ext-v1|\
engenius,enstationac-v1|\
engenius,ews660ap|\
etactica,eg200|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand|\
librerouter,librerouter-v1|\
netgear,ex6400|\
netgear,ex7300|\
netgear,ex7300-v2|\
netgear,wndr4300-v2|\

View file

@ -13,18 +13,21 @@ board=$(board_name)
case "$board" in
bananapi,bpi-r3)
case "$(cmdline_get_var root)" in
/dev/mmc*)
rootdev="$(cmdline_get_var root)"
rootdev="${rootdev##*/}"
rootdev="${rootdev%%p[0-9]*}"
case "$rootdev" in
mmc*)
local envdev=$(find_mmc_part "ubootenv" $rootdev)
ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
;;
/dev/mtd*)
mtd*)
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
ubootenv_add_uci_config "$envdev" "0x20000" "0x20000" "0x20000" "1"
;;
/dev/ubi*)
ubi*)
. /lib/upgrade/nand.sh
local envubi=$(nand_find_ubi ubi)
local envdev=/dev/$(nand_find_volume $envubi ubootenv)

View file

@ -17,13 +17,16 @@ linksys,e8450-ubi)
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
;;
bananapi,bpi-r64)
case "$(cmdline_get_var root)" in
/dev/mmc*)
rootdev="$(cmdline_get_var root)"
rootdev="${rootdev##*/}"
rootdev="${rootdev%%p[0-9]*}"
case "$rootdev" in
mmc*)
local envdev=$(find_mmc_part "ubootenv" $rootdev)
ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
;;
/dev/ubi*)
ubi*)
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
;;

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=intel-microcode
PKG_VERSION:=20220809
PKG_VERSION:=20221108
PKG_RELEASE:=1
PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz
PKG_SOURCE_URL:=@DEBIAN/pool/non-free/i/intel-microcode/
PKG_HASH:=4cf6c3638bb52d9d45c1916af866fd0929628a6f459daac3edfd369149e9c665
PKG_HASH:=9c40fc5cbb386a4e1154f8f316422b28fccc9eaabdea707a80643f9bed3f9064
PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1
PKG_BUILD_DEPENDS:=iucode-tool/host

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=linux-firmware
PKG_VERSION:=20221214
PKG_RELEASE:=3
PKG_VERSION:=20230117
PKG_RELEASE:=1
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=e793783e92acbde549965521462d1d1327827360664cf242dbda08f075654331
PKG_HASH:=df11e25ba2fb4d5343473757e17a3b4cef599250a26b1f7e0f038850f0cb3d64
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

View file

@ -170,6 +170,28 @@ endef
$(eval $(call KernelPackage,lib-lz4))
define KernelPackage/lib-842
SUBMENU:=$(LIB_MENU)
TITLE:=842 support
DEPENDS:=+kmod-crypto-acompress +kmod-crypto-crc32
KCONFIG:= \
CONFIG_CRYPTO_842 \
CONFIG_842_COMPRESS \
CONFIG_842_DECOMPRESS
FILES:= \
$(LINUX_DIR)/crypto/842.ko \
$(LINUX_DIR)/lib/842/842_compress.ko \
$(LINUX_DIR)/lib/842/842_decompress.ko
AUTOLOAD:=$(call AutoProbe,842 842_compress 842_decompress)
endef
define KernelPackage/lib-842/description
Kernel module for 842 compression/decompression support
endef
$(eval $(call KernelPackage,lib-842))
define KernelPackage/lib-raid6
SUBMENU:=$(LIB_MENU)
TITLE:=RAID6 algorithm support

View file

@ -901,8 +901,8 @@ mac80211_setup_supplicant_noctl() {
mac80211_prepare_iw_htmode() {
case "$htmode" in
VHT20|HT20) iw_htmode=HT20;;
HT40*|VHT40|VHT160)
VHT20|HT20|HE20) iw_htmode=HT20;;
HT40*|VHT40|VHT160|HE40)
case "$band" in
2g)
case "$htmode" in
@ -926,7 +926,7 @@ mac80211_prepare_iw_htmode() {
esac
[ "$auto_channel" -gt 0 ] && iw_htmode="HT40+"
;;
VHT80)
VHT80|HE80)
iw_htmode="80MHZ"
;;
NONE|NOHT)

View file

@ -0,0 +1,11 @@
--- a/backport-include/linux/skbuff.h
+++ b/backport-include/linux/skbuff.h
@@ -140,4 +140,8 @@ static inline u64 skb_get_kcov_handle(st
}
#endif
+#if LINUX_VERSION_IS_LESS(5,11,0)
+#define napi_build_skb build_skb
+#endif
+
#endif /* __BACKPORT_SKBUFF_H */

View file

@ -0,0 +1,52 @@
From 2bcf8e69bd92e33d84c48e7d108d3d46b22f8a6d Mon Sep 17 00:00:00 2001
From: ValdikSS <iam@valdikss.org.ru>
Date: Wed, 18 Jan 2023 20:14:48 +0300
Subject: [PATCH] Padlock: fix byte swapping assembly for AES-192 and 256
Byte swapping code incorrectly uses the number of AES rounds to swap expanded
AES key, while swapping only a single dword in a loop, resulting in swapped
key and partially swapped expanded keys, breaking AES encryption and
decryption on VIA Padlock hardware.
This commit correctly sets the number of swapping loops to be done.
Fixes #20073
CLA: trivial
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20077)
(cherry picked from commit 7331e7ef79fe4499d81cc92249e9c97e9ff9291a)
---
engines/asm/e_padlock-x86.pl | 2 ++
engines/asm/e_padlock-x86_64.pl | 2 ++
2 files changed, 4 insertions(+)
diff --git a/engines/asm/e_padlock-x86.pl b/engines/asm/e_padlock-x86.pl
index 5b097ce3ef9b..07f7000fd38a 100644
--- a/engines/asm/e_padlock-x86.pl
+++ b/engines/asm/e_padlock-x86.pl
@@ -116,6 +116,8 @@
&function_begin_B("padlock_key_bswap");
&mov ("edx",&wparam(0));
&mov ("ecx",&DWP(240,"edx"));
+ &inc ("ecx");
+ &shl ("ecx",2);
&set_label("bswap_loop");
&mov ("eax",&DWP(0,"edx"));
&bswap ("eax");
diff --git a/engines/asm/e_padlock-x86_64.pl b/engines/asm/e_padlock-x86_64.pl
index 09b0aaa48dfe..dfd2ae656375 100644
--- a/engines/asm/e_padlock-x86_64.pl
+++ b/engines/asm/e_padlock-x86_64.pl
@@ -92,6 +92,8 @@
.align 16
padlock_key_bswap:
mov 240($arg1),%edx
+ inc %edx
+ shl \$2,%edx
.Lbswap_loop:
mov ($arg1),%eax
bswap %eax

View file

@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bridger
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/nbd168/bridger
PKG_SOURCE_DATE:=2023-01-03
PKG_SOURCE_VERSION:=978c1f9eed07504cc0b84f72ee7384aab722386a
PKG_MIRROR_HASH:=2a019b188d8de2fdc95453529d1820b0a7a5576adf161bd19e182c9c1c2b2c85
PKG_SOURCE_DATE:=2023-01-27
PKG_SOURCE_VERSION:=8be8bb9df789b53a68f08298f610648ebded6063
PKG_MIRROR_HASH:=d4f47009bb00c4f129d0959cb00ed90bc14bfe5dd0e67458ddb54176365e65f0
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

View file

@ -10,6 +10,7 @@ config dnsmasq
option domain 'lan'
option expandhosts 1
option nonegcache 0
option cachesize 1000
option authoritative 1
option readethers 1
option leasefile '/tmp/dhcp.leases'

View file

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_URL=$(PROJECT_GIT)/project/relayd.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-04-25
PKG_SOURCE_VERSION:=f4d759be54ceb37714e9a6ca320d5b50c95e9ce9
PKG_MIRROR_HASH:=b1ff6e99072867be0975ba0be52ba9da3a876c8b8da893d68301e8238243a51e
PKG_SOURCE_DATE:=2023-01-28
PKG_SOURCE_VERSION:=f646ba40489371e69f624f2dee2fc4e19ceec00e
PKG_MIRROR_HASH:=672d3115728d40ee6897a9f633d269d127496699a7bd45eba11844aa771f2501
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0

View file

@ -12,15 +12,14 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
PKG_SOURCE_DATE:=2022-10-31
PKG_SOURCE_VERSION:=23977554d9694d025eada50a5547e99ee1be7838
PKG_MIRROR_HASH:=e546fd57d0d0be6a51e2aeb5797febe8c89d2bba61b26c930ecb0616d5f6ace9
PKG_SOURCE_DATE:=2023-01-28
PKG_SOURCE_VERSION:=47561aa13574068403d48f13ea310f8511057b2b
PKG_MIRROR_HASH:=84500cf0c8224fe80b5717c9b6bad8ac13f44f286e3a88e8b12adfcf02e22c7c
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=ISC
PKG_ASLR_PIE_REGULAR:=1
PKG_BUILD_DEPENDS = ustream-ssl
PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua CONFIG_uhttpd_ucode
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@ -44,18 +43,6 @@ define Package/uhttpd/description
HTTP daemon.
endef
define Package/uhttpd/config
config uhttpd_lua
depends on PACKAGE_uhttpd-mod-lua
bool "Enable Integrated Lua interpreter"
default y
config uhttpd_ucode
depends on PACKAGE_uhttpd-mod-ucode
bool "Enable Integrated ucode interpreter"
default y
endef
define Package/uhttpd/conffiles
/etc/config/uhttpd
/etc/uhttpd.crt
@ -101,17 +88,11 @@ ifneq ($(CONFIG_USE_GLIBC),)
TARGET_CFLAGS += -D_DEFAULT_SOURCE
endif
TARGET_LDFLAGS += -lcrypt
CMAKE_OPTIONS += -DTLS_SUPPORT=on
define Package/uhttpd/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/usr/sbin
$(INSTALL_BIN) ./files/uhttpd.init $(1)/etc/init.d/uhttpd
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/uhttpd.config $(1)/etc/config/uhttpd
$(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
endef

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethtool
PKG_VERSION:=6.0
PKG_VERSION:=6.1
PKG_RELEASE:=1
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
PKG_HASH:=d5446c93de570ce68f3b1ea69dbfa12fcfd67fc19897f655d3f18231e2b818d6
PKG_HASH:=c41fc881ffa5a40432d2dd829eb44c64a49dee482e716baacf9262c64daa8f90
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View file

@ -0,0 +1,465 @@
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool v2 1/3] uapi: Bring in if.h
Date: Sat, 14 Jan 2023 08:34:09 -0800
Bring in if.h from commit eec517cdb481 ("net: Add IF_OPER_TESTING") as
well as uapi/linux/hdlc/ioctl.h. Ensure that we define all of the
necessary guards to provide updated definitions of ifmap, ifreq and
IFNAMSIZ. This resolves build issues with kernel headers < 4.11 which
lacked 2618be7dccf8739b89e1906b64bd8d551af351e6 ("uapi: fix linux/if.h
userspace compilation errors").
Fixes: 1fa60003a8b8 ("misc: header includes cleanup")
Reported-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Makefile.am | 6 +-
internal.h | 7 +-
uapi/linux/hdlc/ioctl.h | 94 +++++++++++++
uapi/linux/if.h | 296 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 397 insertions(+), 6 deletions(-)
create mode 100644 uapi/linux/hdlc/ioctl.h
create mode 100644 uapi/linux/if.h
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,8 @@ EXTRA_DIST = LICENSE ethtool.8 ethtool.s
sbin_PROGRAMS = ethtool
ethtool_SOURCES = ethtool.c uapi/linux/ethtool.h internal.h \
- uapi/linux/net_tstamp.h rxclass.c common.c common.h \
+ uapi/linux/net_tstamp.h uapi/linux/if.h uapi/linux/hdlc/ioctl.h \
+ rxclass.c common.c common.h \
json_writer.c json_writer.h json_print.c json_print.h \
list.h
if ETHTOOL_ENABLE_PRETTY_DUMP
@@ -43,7 +44,8 @@ ethtool_SOURCES += \
netlink/desc-rtnl.c netlink/cable_test.c netlink/tunnels.c \
uapi/linux/ethtool_netlink.h \
uapi/linux/netlink.h uapi/linux/genetlink.h \
- uapi/linux/rtnetlink.h uapi/linux/if_link.h
+ uapi/linux/rtnetlink.h uapi/linux/if_link.h \
+ uapi/linux/if.h uapi/linux/hdlc/ioctl.h
AM_CPPFLAGS += @MNL_CFLAGS@
LDADD += @MNL_LIBS@
endif
--- a/internal.h
+++ b/internal.h
@@ -21,6 +21,9 @@
#include <unistd.h>
#include <endian.h>
#include <sys/ioctl.h>
+#define __UAPI_DEF_IF_IFNAMSIZ 1
+#define __UAPI_DEF_IF_IFMAP 1
+#define __UAPI_DEF_IF_IFREQ 1
#include <linux/if.h>
#include "json_writer.h"
@@ -52,10 +55,6 @@ typedef int32_t s32;
#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#endif
-#ifndef ALTIFNAMSIZ
-#define ALTIFNAMSIZ 128
-#endif
-
#include <linux/ethtool.h>
#include <linux/net_tstamp.h>
--- /dev/null
+++ b/uapi/linux/hdlc/ioctl.h
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef __HDLC_IOCTL_H__
+#define __HDLC_IOCTL_H__
+
+
+#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
+
+#define CLOCK_DEFAULT 0 /* Default setting */
+#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
+#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
+#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
+#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
+
+
+#define ENCODING_DEFAULT 0 /* Default setting */
+#define ENCODING_NRZ 1
+#define ENCODING_NRZI 2
+#define ENCODING_FM_MARK 3
+#define ENCODING_FM_SPACE 4
+#define ENCODING_MANCHESTER 5
+
+
+#define PARITY_DEFAULT 0 /* Default setting */
+#define PARITY_NONE 1 /* No parity */
+#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
+#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
+#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
+#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
+#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
+#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
+
+#define LMI_DEFAULT 0 /* Default setting */
+#define LMI_NONE 1 /* No LMI, all PVCs are static */
+#define LMI_ANSI 2 /* ANSI Annex D */
+#define LMI_CCITT 3 /* ITU-T Annex A */
+#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
+
+#ifndef __ASSEMBLY__
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+} sync_serial_settings; /* V.35, V.24, X.21 */
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+ unsigned int slot_map;
+} te1_settings; /* T1, E1 */
+
+typedef struct {
+ unsigned short encoding;
+ unsigned short parity;
+} raw_hdlc_proto;
+
+typedef struct {
+ unsigned int t391;
+ unsigned int t392;
+ unsigned int n391;
+ unsigned int n392;
+ unsigned int n393;
+ unsigned short lmi;
+ unsigned short dce; /* 1 for DCE (network side) operation */
+} fr_proto;
+
+typedef struct {
+ unsigned int dlci;
+} fr_proto_pvc; /* for creating/deleting FR PVCs */
+
+typedef struct {
+ unsigned int dlci;
+ char master[IFNAMSIZ]; /* Name of master FRAD device */
+}fr_proto_pvc_info; /* for returning PVC information only */
+
+typedef struct {
+ unsigned int interval;
+ unsigned int timeout;
+} cisco_proto;
+
+typedef struct {
+ unsigned short dce; /* 1 for DCE (network side) operation */
+ unsigned int modulo; /* modulo (8 = basic / 128 = extended) */
+ unsigned int window; /* frame window size */
+ unsigned int t1; /* timeout t1 */
+ unsigned int t2; /* timeout t2 */
+ unsigned int n2; /* frame retry counter */
+} x25_hdlc_proto;
+
+/* PPP doesn't need any info now - supply length = 0 to ioctl */
+
+#endif /* __ASSEMBLY__ */
+#endif /* __HDLC_IOCTL_H__ */
--- /dev/null
+++ b/uapi/linux/if.h
@@ -0,0 +1,296 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the INET interface module.
+ *
+ * Version: @(#)if.h 1.0.2 04/18/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * This program 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
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _LINUX_IF_H
+#define _LINUX_IF_H
+
+#include <linux/libc-compat.h> /* for compatibility with glibc */
+#include <linux/types.h> /* for "__kernel_caddr_t" et al */
+#include <linux/socket.h> /* for "struct sockaddr" et al */
+ /* for "__user" et al */
+
+#include <sys/socket.h> /* for struct sockaddr. */
+
+#if __UAPI_DEF_IF_IFNAMSIZ
+#define IFNAMSIZ 16
+#endif /* __UAPI_DEF_IF_IFNAMSIZ */
+#define IFALIASZ 256
+#define ALTIFNAMSIZ 128
+#include <linux/hdlc/ioctl.h>
+
+/* For glibc compatibility. An empty enum does not compile. */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \
+ __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
+/**
+ * enum net_device_flags - &struct net_device flags
+ *
+ * These are the &struct net_device flags, they can be set by drivers, the
+ * kernel and some can be triggered by userspace. Userspace can query and
+ * set these flags using userspace utilities but there is also a sysfs
+ * entry available for all dev flags which can be queried and set. These flags
+ * are shared for all types of net_devices. The sysfs entries are available
+ * via /sys/class/net/<dev>/flags. Flags which can be toggled through sysfs
+ * are annotated below, note that only a few flags can be toggled and some
+ * other flags are always preserved from the original net_device flags
+ * even if you try to set them via sysfs. Flags which are always preserved
+ * are kept under the flag grouping @IFF_VOLATILE. Flags which are __volatile__
+ * are annotated below as such.
+ *
+ * You should have a pretty good reason to be extending these flags.
+ *
+ * @IFF_UP: interface is up. Can be toggled through sysfs.
+ * @IFF_BROADCAST: broadcast address valid. Volatile.
+ * @IFF_DEBUG: turn on debugging. Can be toggled through sysfs.
+ * @IFF_LOOPBACK: is a loopback net. Volatile.
+ * @IFF_POINTOPOINT: interface is has p-p link. Volatile.
+ * @IFF_NOTRAILERS: avoid use of trailers. Can be toggled through sysfs.
+ * Volatile.
+ * @IFF_RUNNING: interface RFC2863 OPER_UP. Volatile.
+ * @IFF_NOARP: no ARP protocol. Can be toggled through sysfs. Volatile.
+ * @IFF_PROMISC: receive all packets. Can be toggled through sysfs.
+ * @IFF_ALLMULTI: receive all multicast packets. Can be toggled through
+ * sysfs.
+ * @IFF_MASTER: master of a load balancer. Volatile.
+ * @IFF_SLAVE: slave of a load balancer. Volatile.
+ * @IFF_MULTICAST: Supports multicast. Can be toggled through sysfs.
+ * @IFF_PORTSEL: can set media type. Can be toggled through sysfs.
+ * @IFF_AUTOMEDIA: auto media select active. Can be toggled through sysfs.
+ * @IFF_DYNAMIC: dialup device with changing addresses. Can be toggled
+ * through sysfs.
+ * @IFF_LOWER_UP: driver signals L1 up. Volatile.
+ * @IFF_DORMANT: driver signals dormant. Volatile.
+ * @IFF_ECHO: echo sent packets. Volatile.
+ */
+enum net_device_flags {
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ IFF_UP = 1<<0, /* sysfs */
+ IFF_BROADCAST = 1<<1, /* __volatile__ */
+ IFF_DEBUG = 1<<2, /* sysfs */
+ IFF_LOOPBACK = 1<<3, /* __volatile__ */
+ IFF_POINTOPOINT = 1<<4, /* __volatile__ */
+ IFF_NOTRAILERS = 1<<5, /* sysfs */
+ IFF_RUNNING = 1<<6, /* __volatile__ */
+ IFF_NOARP = 1<<7, /* sysfs */
+ IFF_PROMISC = 1<<8, /* sysfs */
+ IFF_ALLMULTI = 1<<9, /* sysfs */
+ IFF_MASTER = 1<<10, /* __volatile__ */
+ IFF_SLAVE = 1<<11, /* __volatile__ */
+ IFF_MULTICAST = 1<<12, /* sysfs */
+ IFF_PORTSEL = 1<<13, /* sysfs */
+ IFF_AUTOMEDIA = 1<<14, /* sysfs */
+ IFF_DYNAMIC = 1<<15, /* sysfs */
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ IFF_LOWER_UP = 1<<16, /* __volatile__ */
+ IFF_DORMANT = 1<<17, /* __volatile__ */
+ IFF_ECHO = 1<<18, /* __volatile__ */
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
+};
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
+#define IFF_UP IFF_UP
+#define IFF_BROADCAST IFF_BROADCAST
+#define IFF_DEBUG IFF_DEBUG
+#define IFF_LOOPBACK IFF_LOOPBACK
+#define IFF_POINTOPOINT IFF_POINTOPOINT
+#define IFF_NOTRAILERS IFF_NOTRAILERS
+#define IFF_RUNNING IFF_RUNNING
+#define IFF_NOARP IFF_NOARP
+#define IFF_PROMISC IFF_PROMISC
+#define IFF_ALLMULTI IFF_ALLMULTI
+#define IFF_MASTER IFF_MASTER
+#define IFF_SLAVE IFF_SLAVE
+#define IFF_MULTICAST IFF_MULTICAST
+#define IFF_PORTSEL IFF_PORTSEL
+#define IFF_AUTOMEDIA IFF_AUTOMEDIA
+#define IFF_DYNAMIC IFF_DYNAMIC
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
+
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+#define IFF_LOWER_UP IFF_LOWER_UP
+#define IFF_DORMANT IFF_DORMANT
+#define IFF_ECHO IFF_ECHO
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
+
+#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
+ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+
+#define IF_GET_IFACE 0x0001 /* for querying only */
+#define IF_GET_PROTO 0x0002
+
+/* For definitions see hdlc.h */
+#define IF_IFACE_V35 0x1000 /* V.35 serial interface */
+#define IF_IFACE_V24 0x1001 /* V.24 serial interface */
+#define IF_IFACE_X21 0x1002 /* X.21 serial interface */
+#define IF_IFACE_T1 0x1003 /* T1 telco serial interface */
+#define IF_IFACE_E1 0x1004 /* E1 telco serial interface */
+#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */
+#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking (FarSite) */
+
+/* For definitions see hdlc.h */
+#define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */
+#define IF_PROTO_PPP 0x2001 /* PPP protocol */
+#define IF_PROTO_CISCO 0x2002 /* Cisco HDLC protocol */
+#define IF_PROTO_FR 0x2003 /* Frame Relay protocol */
+#define IF_PROTO_FR_ADD_PVC 0x2004 /* Create FR PVC */
+#define IF_PROTO_FR_DEL_PVC 0x2005 /* Delete FR PVC */
+#define IF_PROTO_X25 0x2006 /* X.25 */
+#define IF_PROTO_HDLC_ETH 0x2007 /* raw HDLC, Ethernet emulation */
+#define IF_PROTO_FR_ADD_ETH_PVC 0x2008 /* Create FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */
+#define IF_PROTO_FR_ETH_PVC 0x200B
+#define IF_PROTO_RAW 0x200C /* RAW Socket */
+
+/* RFC 2863 operational status */
+enum {
+ IF_OPER_UNKNOWN,
+ IF_OPER_NOTPRESENT,
+ IF_OPER_DOWN,
+ IF_OPER_LOWERLAYERDOWN,
+ IF_OPER_TESTING,
+ IF_OPER_DORMANT,
+ IF_OPER_UP,
+};
+
+/* link modes */
+enum {
+ IF_LINK_MODE_DEFAULT,
+ IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
+ IF_LINK_MODE_TESTING, /* limit upward transition to testing */
+};
+
+/*
+ * Device mapping structure. I'd just gone off and designed a
+ * beautiful scheme using only loadable modules with arguments
+ * for driver options and along come the PCMCIA people 8)
+ *
+ * Ah well. The get() side of this is good for WDSETUP, and it'll
+ * be handy for debugging things. The set side is fine for now and
+ * being very small might be worth keeping for clean configuration.
+ */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_IFMAP
+struct ifmap {
+ unsigned long mem_start;
+ unsigned long mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+};
+#endif /* __UAPI_DEF_IF_IFMAP */
+
+struct if_settings {
+ unsigned int type; /* Type of physical device or protocol */
+ unsigned int size; /* Size of the data allocated by the caller */
+ union {
+ /* {atm/eth/dsl}_settings anyone ? */
+ raw_hdlc_proto *raw_hdlc;
+ cisco_proto *cisco;
+ fr_proto *fr;
+ fr_proto_pvc *fr_pvc;
+ fr_proto_pvc_info *fr_pvc_info;
+ x25_hdlc_proto *x25;
+
+ /* interface settings */
+ sync_serial_settings *sync;
+ te1_settings *te1;
+ } ifs_ifsu;
+};
+
+/*
+ * Interface request structure used for socket
+ * ioctl's. All interface ioctl's must have parameter
+ * definitions which begin with ifr_name. The
+ * remainder may be interface specific.
+ */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_IFREQ
+struct ifreq {
+#define IFHWADDRLEN 6
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ void * ifru_data;
+ struct if_settings ifru_settings;
+ } ifr_ifru;
+};
+#endif /* __UAPI_DEF_IF_IFREQ */
+
+#define ifr_name ifr_ifrn.ifrn_name /* interface name */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+#define ifr_flags ifr_ifru.ifru_flags /* flags */
+#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+#define ifr_map ifr_ifru.ifru_map /* device map */
+#define ifr_slave ifr_ifru.ifru_slave /* slave device */
+#define ifr_data ifr_ifru.ifru_data /* for use by interface */
+#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
+#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
+#define ifr_newname ifr_ifru.ifru_newname /* New name */
+#define ifr_settings ifr_ifru.ifru_settings /* Device/proto settings*/
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_IFCONF
+struct ifconf {
+ int ifc_len; /* size of buffer */
+ union {
+ char *ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+};
+#endif /* __UAPI_DEF_IF_IFCONF */
+
+#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
+#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
+
+#endif /* _LINUX_IF_H */

View file

@ -0,0 +1,25 @@
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool v2 2/3] netlink: Fix maybe uninitialized 'meters' variable
Date: Sat, 14 Jan 2023 08:34:10 -0800
GCC12 warns that 'meters' may be uninitialized, initialize it
accordingly.
Fixes: 9561db9b76f4 ("Add cable test TDR support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
netlink/parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/netlink/parser.c
+++ b/netlink/parser.c
@@ -237,7 +237,7 @@ int nl_parse_direct_m2cm(struct nl_conte
struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
- float meters;
+ float meters = 0.0;
uint32_t cm;
int ret;

View file

@ -0,0 +1,63 @@
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool v2 3/3] marvell.c: Fix build with musl-libc
Date: Sat, 14 Jan 2023 08:34:11 -0800
After commit 1fa60003a8b8 ("misc: header includes cleanup") we stopped
including net/if.h which resolved the proper defines to pull in
sys/types.h and provide a definition for u_int32_t. With musl-libc we
would need to define _GNU_SOURCE to ensure that sys/types.h does provide a
definition for u_int32_t.
Rather, just replace u_uint{16,32}_t with the more standard
uint{16,32}_t types from stdint.h
Fixes: 1fa60003a8b8 ("misc: header includes cleanup")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
marvell.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
--- a/marvell.c
+++ b/marvell.c
@@ -31,23 +31,23 @@ static void dump_timer(const char *name,
static void dump_queue(const char *name, const void *a, int rx)
{
struct desc {
- u_int32_t ctl;
- u_int32_t next;
- u_int32_t data_lo;
- u_int32_t data_hi;
- u_int32_t status;
- u_int32_t timestamp;
- u_int16_t csum2;
- u_int16_t csum1;
- u_int16_t csum2_start;
- u_int16_t csum1_start;
- u_int32_t addr_lo;
- u_int32_t addr_hi;
- u_int32_t count_lo;
- u_int32_t count_hi;
- u_int32_t byte_count;
- u_int32_t csr;
- u_int32_t flag;
+ uint32_t ctl;
+ uint32_t next;
+ uint32_t data_lo;
+ uint32_t data_hi;
+ uint32_t status;
+ uint32_t timestamp;
+ uint16_t csum2;
+ uint16_t csum1;
+ uint16_t csum2_start;
+ uint16_t csum1_start;
+ uint32_t addr_lo;
+ uint32_t addr_hi;
+ uint32_t count_lo;
+ uint32_t count_hi;
+ uint32_t byte_count;
+ uint32_t csr;
+ uint32_t flag;
};
const struct desc *d = a;

View file

@ -11,13 +11,13 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
PKG_SOURCE_DATE:=2023-01-06
PKG_SOURCE_VERSION:=c7b420a2f33c6f1034c3e2191eba0cb0374af7b6
PKG_MIRROR_HASH:=c5d188b2c7aa0fe987ffba8330c956670047ebf5be9a217ef647549c65002cd6
PKG_SOURCE_DATE:=2023-01-23
PKG_SOURCE_VERSION:=1e4e709d6f26cc38411ca189bab04f857b444ef3
PKG_MIRROR_HASH:=851ca5c724f01260770ac7f4c98bc4f32b03fde635d06c797896ff2c4658c753
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0
IWINFO_ABI_VERSION:=20210430
IWINFO_ABI_VERSION:=20230121
include $(INCLUDE_DIR)/package.mk

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rssileds
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICNESE:=GPL-2.0+
include $(INCLUDE_DIR)/package.mk

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=tcpdump
PKG_VERSION:=4.99.2
PKG_VERSION:=4.99.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.tcpdump.org/release/
PKG_HASH:=f4304357d34b79d46f4e17e654f1f91f9ce4e3d5608a1badbd53295a26fb44d5
PKG_HASH:=ad75a6ed3dc0d9732945b2e5483cb41dc8b4b528a169315e499c6861952e73b3
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-3-Clause

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fstools
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
PKG_MIRROR_HASH:=28be14a1e28fc62e80681e1b5e7f2435692ee326b66afcc1f3d158764df686d5
PKG_SOURCE_DATE:=2022-11-10
PKG_SOURCE_VERSION:=3affe9ea5098c8bb90111ce97d50ad976ef0c034
PKG_MIRROR_HASH:=edda9151c73c1adfe369f5e315347344727a540ad57d3e2b41b9f57f9d4313fe
PKG_SOURCE_DATE:=2023-01-22
PKG_SOURCE_VERSION:=1ea5855e980cd88766dd9f615e78e7dd6edfbb74
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rpcd
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
PKG_MIRROR_HASH:=87dab115512070d3ab566ebe47859bad3c148986271cdb2ac05a0952be262519
PKG_SOURCE_DATE:=2022-12-15
PKG_SOURCE_VERSION:=7de4820c87437033f6b7716018f3bfa60a3f7b12
PKG_MIRROR_HASH:=7038ab08dc67f7440effbf04ab2f083915c819f758ab16b0fbdf846bd3b87773
PKG_SOURCE_DATE:=2023-01-21
PKG_SOURCE_VERSION:=c0df2a7af7d6284f4a446de15d0dab17124d9448
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC
@ -103,5 +103,5 @@ endef
$(eval $(call BuildPackage,rpcd))
$(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
$(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
$(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.,libiwinfo (>= 2022-12-15)))
$(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.,libiwinfo (>= 2023-01-21)))
$(eval $(call BuildPlugin,ucode,+libucode,Allows implementing plugins using ucode scripts.))

View file

@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
PKG_SOURCE_DATE:=2022-06-01
PKG_SOURCE_VERSION:=2bebf93cd3343fe49f22a05ef935e460d2d44f67
PKG_MIRROR_HASH:=4efd873928089c086bbac02f3ca5bae55904500b6e6f1c4c377181a00b67147f
PKG_SOURCE_DATE:=2022-06-15
PKG_SOURCE_VERSION:=9913aa61de739e3efe067a2d186021c20bcd65e2
PKG_MIRROR_HASH:=f6702e68d7c60388c11f40ca5ca8e932d0bf423325db5bee2c79404782bbcb52
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
CMAKE_INSTALL:=1

View file

@ -20,6 +20,7 @@
*/
#include <sys/types.h>
#include <sys/random.h>
#include <stdio.h>
#include <stdlib.h>
@ -31,6 +32,7 @@
#include <stdbool.h>
#include <mbedtls/bignum.h>
#include <mbedtls/entropy.h>
#include <mbedtls/x509_crt.h>
#include <mbedtls/ecp.h>
#include <mbedtls/rsa.h>
@ -40,12 +42,16 @@
#define PX5G_COPY "Copyright (c) 2009 Steven Barth <steven@midlink.org>"
#define PX5G_LICENSE "Licensed under the GNU Lesser General Public License v2.1"
static int urandom_fd;
static char buf[16384];
static int _urandom(void *ctx, unsigned char *out, size_t len)
{
read(urandom_fd, out, len);
ssize_t ret;
ret = getrandom(out, len, 0);
if (ret < 0 || (size_t)ret != len)
return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
return 0;
}
@ -306,8 +312,6 @@ int selfsigned(char **arg)
int main(int argc, char *argv[])
{
urandom_fd = open("/dev/urandom", O_RDONLY);
if (!argv[1]) {
//Usage
} else if (!strcmp(argv[1], "eckey")) {

View file

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
PKG_SOURCE_DATE:=2023-01-07
PKG_SOURCE_VERSION:=1e4d20932646f90523d21ea358c72901e3ee689e
PKG_MIRROR_HASH:=8c43b9a0a80c3de92961caad65c934bd3989e6f7f9389f676d91e2e926c9e4a6
PKG_SOURCE_DATE:=2023-01-23
PKG_SOURCE_VERSION:=941d14837faf248eb2fa88dd0d5cfddeed044a15
PKG_MIRROR_HASH:=19e8654bcb8a13a0a276a240a1da0f2815b0dd0d4f8bb8622e8de1040d5408a5
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC
@ -39,9 +39,10 @@ CMAKE_HOST_OPTIONS += \
define Package/ucode/default
SECTION:=utils
CATEGORY:=Utilities
TITLE:=ucode - Tiny scripting and templating language
SUBMENU:=ucode
SECTION:=lang
CATEGORY:=Languages
TITLE:=Tiny scripting and templating language
endef
define Package/ucode
@ -57,7 +58,10 @@ endef
define Package/libucode
$(Package/ucode/default)
TITLE+= - runtime library
SUBMENU:=
SECTION:=libs
CATEGORY:=Libraries
TITLE+= (library)
ABI_VERSION:=$(PKG_ABI_VERSION)
DEPENDS:=+libjson-c
endef
@ -92,7 +96,7 @@ endef
define Package/ucode-mod-nl80211
$(Package/ucode/default)
TITLE+= (nl80211 module)
DEPENDS:=ucode +libnl-tiny
DEPENDS:=ucode +libnl-tiny +libubox
endef
define Package/ucode-mod-nl80211/description
@ -129,7 +133,7 @@ define Package/ucode-mod-struct
endef
define Package/ucode-mod-struct/description
The struct plugin implemnts Python 3 compatible struct.pack/unpack functionality.
The struct plugin implements Python 3 compatible struct.pack/unpack functionality.
endef

View file

@ -5,16 +5,14 @@ HOST_BUILD_DIR=$(pwd)/"build_dir/host"
HOST_STAGING_DIR_STAMP=$(pwd)/"staging_dir/host/stamp"
refresh_timestamps() {
find "$1" -not -type l -print0 | xargs -0 touch
find -H "$1" -not -type l -print0 | xargs -0 touch
}
extract_prebuilt_tar() {
tar -xf "$1"
}
install_prebuilt_tools() {
extract_prebuilt_tar "$TOOLS_TAR"
refresh_prebuilt_tools() {
if [ ! -d "$HOST_BUILD_DIR" ]; then
echo "Can't find Host Build Dir "$HOST_BUILD_DIR"" >&2
exit 1
@ -33,6 +31,14 @@ install_prebuilt_tools() {
return 0
}
install_prebuilt_tools() {
extract_prebuilt_tar "$TOOLS_TAR"
refresh_prebuilt_tools
return 0
}
while [ -n "$1" ]; do
arg="$1"; shift
case "$arg" in
@ -63,6 +69,12 @@ while [ -n "$1" ]; do
exit $?
;;
--refresh)
refresh_prebuilt_tools
exit $?
;;
-h|--help)
me="$(basename "$0")"
echo -e "\nUsage:\n" >&2
@ -81,8 +93,12 @@ while [ -n "$1" ]; do
echo -e " $me --tools {tar}" >&2
echo -e " Install the prebuilt tools present in the passed" >&2
echo -e " tar and prepare them." >&2
echo -e " To correctly use them it's needed to update the." >&2
echo -e " To correctly use them it's needed to update the" >&2
echo -e " timestamp of each tools to skip recompilation.\n" >&2
echo -e " $me --refresh" >&2
echo -e " Refresh timestamps of already extracted prebuilt" >&2
echo -e " tools to correctly use them and skip" >&2
echo -e " recompilation.\n" >&2
echo -e " $me --help" >&2
echo -e " Display this help text and exit.\n\n" >&2
exit 1

View file

@ -21,7 +21,7 @@ if not file_path.is_file():
def get_titles():
titles = []
for prefix in ["", "ALT0_", "ALT1_", "ALT2_"]:
for prefix in ["", "ALT0_", "ALT1_", "ALT2_", "ALT3_", "ALT4_"]:
title = {}
for var in ["vendor", "model", "variant"]:
if getenv("DEVICE_{}{}".format(prefix, var.upper())):

View file

@ -13,7 +13,7 @@ produce a noisy warning.
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -276,6 +276,7 @@ static void xhci_pci_quirks(struct devic
@@ -279,6 +279,7 @@ static void xhci_pci_quirks(struct devic
pdev->device == 0x0015) {
xhci->quirks |= XHCI_RESET_ON_RESUME;
xhci->quirks |= XHCI_ZERO_64B_REGS;
@ -43,7 +43,7 @@ produce a noisy warning.
hcd->msi_enabled = 1;
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1897,6 +1897,7 @@ struct xhci_hcd {
@@ -1902,6 +1902,7 @@ struct xhci_hcd {
struct xhci_hub usb2_rhub;
struct xhci_hub usb3_rhub;
/* support xHCI 1.0 spec USB2 hardware LPM */

View file

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
ARCH:=mips
BOARD:=ath25
BOARDNAME:=Atheros AR231x/AR5312
FEATURES:=squashfs low_mem small_flash
FEATURES:=squashfs low_mem small_flash source-only
SUBTARGETS:=generic
KERNEL_PATCHVER:=5.10

View file

@ -29,6 +29,9 @@
/* default for ar934x, except for 1000M */
pll-data = <0x06000000 0x00000101 0x00001616>;
nvmem-cells = <&macaddr_lan>;
nvmem-cell-names = "mac-address-ascii";
phy-mode = "rgmii";
phy-handle = <&phy0>;
};
@ -55,7 +58,13 @@
ath9k: wifi@0,0 {
compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
/* "mac-address-ascii" currently does not work for
ath9k pci devices. these below are retained for future
improvements. */
/* nvmem-cells = <&macaddr_wan>, <&cal_art_5000>;
nvmem-cell-names = "mac-address-ascii", "calibration";
mac-address-increment = <1>; */
qca,no-eeprom; /* remove this when "mac-address-ascii" works */
gpio-controller;
#gpio-cells = <2>;
};
@ -102,16 +111,40 @@
read-only;
};
partition@fe0000 {
mac: partition@fe0000 {
label = "mac";
reg = <0xfe0000 0x010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_lan: macaddr@4 {
reg = <0x4 0x11>;
};
partition@ff0000 {
macaddr_wan: macaddr@18 {
reg = <0x18 0x11>;
};
};
art: partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: cal@1000 {
reg = <0x1000 0x440>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0x440>;
};
};
};
};
@ -127,5 +160,6 @@
&wmac {
status = "okay";
qca,no-eeprom;
nvmem-cells = <&macaddr_lan>, <&cal_art_1000>;
nvmem-cell-names = "mac-address-ascii", "calibration";
};

View file

@ -9,6 +9,10 @@
compatible = "glinet,gl-xe300", "qca,qca9531";
model = "GL.iNet GL-XE300";
aliases {
label-mac-device = &eth0;
};
gpio-export {
compatible = "gpio-export";

View file

@ -4,6 +4,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ {
@ -11,11 +12,11 @@
compatible = "letv,lba-047-ch", "qca,qca9531";
aliases {
led-boot = &led_status_red;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_red;
label-mac-device = &eth0;
led-boot = &led_status_red;
led-failsafe = &led_status_blue;
led-running = &led_status_green;
led-upgrade = &led_status_blue;
};
keys {
@ -31,16 +32,24 @@
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&led_wan_pin>;
led_status_blue: status_blue {
led_status_blue: led-0 {
label = "blue:status";
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
led_status_red: status_red {
led_status_green: led-1 {
label = "green:status";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
led_status_red: led-2 {
label = "red:status";
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
};
@ -64,20 +73,13 @@
};
};
&pinmux {
/* GPIO 4: LED_LINK_5 (WAN) */
led_wan_pin: pinmux_led_wan_pin {
pinctrl-single,bits = <0x04 0x0000002d 0x000000ff>;
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
spi-max-frequency = <30000000>;
m25p,fast-read;
partitions {
@ -112,10 +114,26 @@
reg = <0xe90000 0x160000>;
};
art: partition@ff0000 {
partition@ff0000 {
label = "art";
reg = <0xff0000 0x10000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
};
};
};
@ -140,19 +158,6 @@
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View file

@ -94,6 +94,10 @@
mac-address-increment = <1>;
};
&pcie0 {
status = "okay";
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;

View file

@ -110,10 +110,14 @@
mac-address-increment = <1>;
};
&ath10k {
&ath10k_0 {
status = "okay";
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <2>;
};
&pcie0 {
status = "okay";
};

View file

@ -111,6 +111,10 @@
qca955x-sgmii-fixup;
};
&pcie0 {
status = "okay";
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;

View file

@ -95,6 +95,10 @@
mac-address-increment = <1>;
};
&pcie0 {
status = "okay";
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;

View file

@ -93,6 +93,10 @@
mac-address-increment = <1>;
};
&pcie0 {
status = "okay";
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;

View file

@ -0,0 +1,170 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "dlink,dir-629-a1", "qca,qca9558";
model = "D-Link DIR-629 A1";
aliases {
label-mac-device = &eth0;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
serial0 = &uart;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
led_power: led-1 {
label = "green:power";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
};
led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WPS;
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
};
};
};
&eth0 {
status = "okay";
phy-mode = "mii";
nvmem-cells = <&macaddr_mfcdata_35>;
nvmem-cell-names = "mac-address-ascii";
fixed-link {
speed = <100>;
full-duplex;
};
};
&mdio0 {
status = "okay";
switch0@1f {
compatible = "qca,ar8236";
reg = <0x1f>;
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <30000000>;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x008000>;
read-only;
};
partition@48000 {
label = "mfcdata";
reg = <0x048000 0x008000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_mfcdata_35: macaddr@35 {
reg = <0x35 0x11>;
};
macaddr_mfcdata_51: macaddr@51 {
reg = <0x51 0x11>;
};
};
partition@50000 {
label = "devconf";
reg = <0x050000 0x010000>;
read-only;
};
partition@60000 {
label = "langpack";
reg = <0x060000 0x020000>;
read-only;
};
partition@80000 {
label = "art";
reg = <0x080000 0x010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
};
partition@90000 {
compatible = "seama";
label = "firmware";
reg = <0x090000 0x770000>;
};
};
};
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>, <&macaddr_mfcdata_51>;
nvmem-cell-names = "calibration", "mac-address-ascii";
};

View file

@ -110,10 +110,14 @@
mac-address-increment = <1>;
};
&ath10k {
&ath10k_0 {
status = "okay";
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <2>;
};
&pcie0 {
status = "okay";
};

View file

@ -0,0 +1,132 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x_senao_loader.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "engenius,ews660ap", "qca,qca9558";
model = "EnGenius EWS660AP";
aliases {
label-mac-device = &eth0;
led-boot = &led_wifi5g;
led-failsafe = &led_wifi5g;
led-upgrade = &led_wifi5g;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
wifi2g {
label = "green:wifi2g";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
led_wifi5g: wifi5g {
label = "green:wifi5g";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
};
&partitions {
partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x844>;
};
};
};
&mdio0 {
status = "okay";
phy1: ethernet-phy@1 {
reg = <1>;
eee-broken-100tx;
eee-broken-1000t;
};
phy2: ethernet-phy@2 {
reg = <2>;
eee-broken-100tx;
eee-broken-1000t;
at803x-override-sgmii-link-check;
};
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
pll-data = <0x82000000 0x80000101 0x80001313>;
};
&eth1 {
status = "okay";
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
phy-handle = <&phy2>;
pll-data = <0x03000000 0x00000101 0x00001313>;
qca955x-sgmii-fixup;
};
&wmac {
status = "okay";
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <2>;
};
&ath10k_1 {
status = "okay";
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <3>;
};
&pcie1 {
status = "okay";
};

View file

@ -1,8 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_netgear_ex7300.dtsi"
/ {
model = "Netgear EX6400";
compatible = "netgear,ex6400", "qca,qca9558";
};

View file

@ -1,8 +1,246 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_netgear_ex7300.dtsi"
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
model = "Netgear EX7300";
compatible = "netgear,ex7300", "qca,qca9558";
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_amber;
led-running = &led_power_green;
led-upgrade = &led_power_amber;
label-mac-device = &eth0;
};
led_spi {
compatible = "spi-gpio";
#address-cells = <1>;
#size-cells = <0>;
sck-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;
led_gpio: led_gpio@0 {
compatible = "nxp,74lvc594";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <500000>;
gpio_latch_bit {
gpio-hog;
gpios = <4 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "gpio-latch-bit";
};
};
};
leds {
compatible = "gpio-leds";
led_power_green: power_green {
label = "green:power";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
};
led_power_amber: power_amber {
label = "amber:power";
gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
};
left_blue {
label = "blue:left";
gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
};
right_blue {
label = "blue:right";
gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
};
wps_green {
label = "green:wps";
gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
};
client_red {
label = "red:client";
gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
};
client_green {
label = "green:client";
gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
};
router_red {
label = "red:router";
gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
};
router_green {
label = "green:router";
gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "Reset button";
linux,code = <KEY_RESTART>;
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
wps {
label = "WPS button";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
extender_apmode {
label = "EXTENDER/APMODE switch";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
linux,input-type = <EV_SW>;
debounce-interval = <60>;
};
};
};
&pcie0 {
status = "okay";
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0 0 0 0 0>;
nvmem-cells = <&macaddr_caldata_c>, <&precal_caldata_5000>;
nvmem-cell-names = "mac-address", "pre-calibration";
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
uboot: partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
caldata: partition@50000 {
label = "caldata";
reg = <0x050000 0x010000>;
read-only;
};
partition@60000 {
label = "caldata-backup";
reg = <0x060000 0x010000>;
read-only;
};
partition@70000 {
label = "config";
reg = <0x070000 0x010000>;
};
partition@80000 {
label = "pot";
reg = <0x080000 0x010000>;
};
partition@90000 {
label = "firmware";
reg = <0x090000 0xf30000>;
compatible = "denx,uimage";
};
partition@fc0000 {
label = "language";
reg = <0xfc0000 0x040000>;
};
};
};
};
&wmac {
status = "okay";
nvmem-cells = <&macaddr_caldata_6>, <&cal_caldata_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&mdio0 {
status = "okay";
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_caldata_0>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy4>;
phy-mode = "rgmii-rxid";
pll-data = <0x86000000 0x80000101 0x80001313>;
};
&caldata {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_caldata_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_caldata_6: macaddr@6 {
reg = <0x6 0x6>;
};
macaddr_caldata_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_caldata_1000: cal@1000 {
reg = <0x1000 0x440>;
};
precal_caldata_5000: precal@5000 {
reg = <0x5000 0x2f20>;
};
};

View file

@ -1,224 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_amber;
led-running = &led_power_green;
led-upgrade = &led_power_amber;
label-mac-device = &eth0;
};
led_spi {
compatible = "spi-gpio";
#address-cells = <1>;
#size-cells = <0>;
sck-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;
led_gpio: led_gpio@0 {
compatible = "nxp,74lvc594";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <500000>;
gpio_latch_bit {
gpio-hog;
gpios = <4 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "gpio-latch-bit";
};
};
};
leds {
compatible = "gpio-leds";
led_power_green: power_green {
label = "green:power";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
};
led_power_amber: power_amber {
label = "amber:power";
gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
};
left_blue {
label = "blue:left";
gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
};
right_blue {
label = "blue:right";
gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
};
wps_green {
label = "green:wps";
gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
};
client_red {
label = "red:client";
gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
};
client_green {
label = "green:client";
gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
};
router_red {
label = "red:router";
gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
};
router_green {
label = "green:router";
gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "Reset button";
linux,code = <KEY_RESTART>;
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
wps {
label = "WPS button";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
extender_apmode {
label = "EXTENDER/APMODE switch";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
linux,input-type = <EV_SW>;
debounce-interval = <60>;
};
};
};
&pcie0 {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
uboot: partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
caldata: partition@50000 {
label = "caldata";
reg = <0x050000 0x010000>;
read-only;
};
partition@60000 {
label = "caldata-backup";
reg = <0x060000 0x010000>;
read-only;
};
partition@70000 {
label = "config";
reg = <0x070000 0x010000>;
};
partition@80000 {
label = "pot";
reg = <0x080000 0x010000>;
};
partition@90000 {
label = "firmware";
reg = <0x090000 0xf30000>;
compatible = "denx,uimage";
};
partition@fc0000 {
label = "language";
reg = <0xfc0000 0x040000>;
};
};
};
};
&wmac {
status = "okay";
mtd-cal-data = <&caldata 0x1000>;
nvmem-cells = <&macaddr_caldata_6>;
nvmem-cell-names = "mac-address";
};
&mdio0 {
status = "okay";
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_caldata_0>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy4>;
phy-mode = "rgmii-rxid";
pll-data = <0x86000000 0x80000101 0x80001313>;
};
&caldata {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_caldata_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_caldata_6: macaddr@6 {
reg = <0x6 0x6>;
};
};

View file

@ -121,6 +121,10 @@
mac-address-increment = <1>;
};
&pcie0 {
status = "okay";
};
&art {
compatible = "nvmem-cells";
#address-cells = <1>;

View file

@ -26,14 +26,19 @@
};
&pcie0 {
status = "okay";
ath10k: wifi@0,0,0 {
ath10k_0: wifi@0,0,0 {
compatible = "qcom,ath10k";
reg = <0x0 0 0 0 0>;
};
};
&pcie1 {
ath10k_1: wifi@0,1,0 {
compatible = "qcom,ath10k";
reg = <0x0 1 0 0 0>;
};
};
&spi {
status = "okay";

View file

@ -50,7 +50,6 @@ ath79_setup_interfaces()
glinet,gl-usb150|\
hak5,wifi-pineapple-nano|\
meraki,mr16|\
netgear,ex6400|\
netgear,ex7300|\
netgear,ex7300-v2|\
netgear,wndap360|\
@ -137,6 +136,7 @@ ath79_setup_interfaces()
devolo,dvl1750e|\
engenius,enstationac-v1|\
engenius,ews511ap|\
engenius,ews660ap|\
ocedo,ursus|\
ruckus,zf7372|\
ubnt,unifi-ap-outdoor-plus)
@ -279,6 +279,7 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:2" "2:lan:1"
;;
dlink,dir-629-a1|\
dlink,dir-825-c1|\
dlink,dir-835-a1|\
dlink,dir-842-c1|\
@ -624,6 +625,9 @@ ath79_setup_macs()
dlink,dap-3662-a1)
label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac")
;;
dlink,dir-629-a1)
wan_mac=$(mtd_get_mac_text "mfcdata" 0x6a)
;;
dlink,dir-825-b1|\
trendnet,tew-673gru)
lan_mac=$(mtd_get_mac_text "caldata" 0xffa0)
@ -635,7 +639,6 @@ ath79_setup_macs()
;;
dlink,dir-825-c1|\
dlink,dir-835-a1)
lan_mac=$(mtd_get_mac_text "mac" 0x4)
wan_mac=$(mtd_get_mac_text "mac" 0x18)
;;
dlink,dir-842-c1|\

View file

@ -23,9 +23,7 @@ case "$FIRMWARE" in
avm,fritzdvbc)
caldata_extract_reverse "urlader" 0x1541 0x440
;;
dlink,dir-505|\
dlink,dir-825-c1|\
dlink,dir-835-a1)
dlink,dir-505)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
;;

View file

@ -216,11 +216,6 @@ case "$FIRMWARE" in
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
netgear,ex6400|\
netgear,ex7300)
caldata_extract "caldata" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary caldata 0xc)
;;
phicomm,k2t)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(k2t_get_mac "5g_mac")

View file

@ -21,6 +21,7 @@ dlink,dap-3320-a1|\
dlink,dap-3662-a1)
fixwrgg
;;
dlink,dir-629-a1|\
qihoo,c301)
fix_seama_header
;;

View file

@ -0,0 +1,42 @@
. /lib/functions.sh
do_sysinfo_ath79_fixup() {
local model=""
case $(board_name) in
netgear,ex7300)
local part=$(find_mtd_part caldata)
local board_hw_id=$(dd if=$part bs=1 skip=67 count=10 2>/dev/null)
case "$board_hw_id" in
5508013406)
model="Netgear EX6400"
;;
5508013271)
model="Netgear EX7300"
;;
esac
;;
netgear,ex7300-v2)
local part=$(find_mtd_part artmtd)
local antenna_cfg=$(dd if=$part bs=1 skip=59 count=7 2>/dev/null)
local board_hw_id=$(dd if=$part bs=1 skip=67 count=6 2>/dev/null)
case "$antenna_cfg" in
3X3+3X3)
model="Netgear EX6250"
;;
3X3+4X4)
# EX6400 v2, EX6410, EX6420
model="Netgear ${board_hw_id:-EX6400 v2}"
;;
4X4+4X4)
# EX7300 v2, EX7320
model="Netgear ${board_hw_id:-EX7300 v2}"
;;
esac
;;
esac
[ -n "$model" ] && echo "$model" > /tmp/sysinfo/model
}
boot_hook_add preinit_main do_sysinfo_ath79_fixup

View file

@ -42,6 +42,7 @@ platform_do_upgrade() {
engenius,ecb600|\
engenius,ens202ext-v1|\
engenius,enstationac-v1|\
engenius,ews660ap|\
watchguard,ap100|\
watchguard,ap200|\
watchguard,ap300)

View file

@ -1010,6 +1010,19 @@ define Device/dlink_dir-505
endef
TARGET_DEVICES += dlink_dir-505
define Device/dlink_dir-629-a1
$(Device/seama)
SOC := qca9558
IMAGE_SIZE := 7616k
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DIR-629
DEVICE_VARIANT := A1
DEVICE_PACKAGES := -uboot-envtools
SEAMA_MTDBLOCK := 6
SEAMA_SIGNATURE := wrgn83_dlob.hans_dir629
endef
TARGET_DEVICES += dlink_dir-629-a1
define Device/dlink_dir-825-b1
SOC := ar7161
DEVICE_VENDOR := D-Link
@ -1295,6 +1308,18 @@ define Device/engenius_ews511ap
endef
TARGET_DEVICES += engenius_ews511ap
define Device/engenius_ews660ap
$(Device/senao_loader_okli)
SOC := qca9558
DEVICE_VENDOR := EnGenius
DEVICE_MODEL := EWS660AP
DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
IMAGE_SIZE := 11584k
LOADER_FLASH_OFFS := 0x220000
SENAO_IMGNAME := ar71xx-generic-ews660ap
endef
TARGET_DEVICES += engenius_ews660ap
define Device/enterasys_ws-ap3705i
SOC := ar9344
DEVICE_VENDOR := Enterasys
@ -1620,13 +1645,15 @@ define Device/letv_lba-047-ch
SOC := qca9531
DEVICE_VENDOR := Letv
DEVICE_MODEL := LBA-047-CH
DEVICE_PACKAGES := -uboot-envtools
FACTORY_SIZE := 14528k
IMAGE_SIZE := 15936k
LOADER_FLASH_OFFS := 0x50000
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
append-rootfs | pad-rootfs | check-size | pad-to 14528k | \
append-loader-okli-uimage $(1) | pad-to 64k
IMAGES += kernel.bin rootfs.bin
IMAGE/kernel.bin := append-loader-okli-uimage $(1) | pad-to 64k
IMAGE/rootfs.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
append-rootfs | pad-rootfs | check-size $$$$(FACTORY_SIZE)
endef
TARGET_DEVICES += letv_lba-047-ch
@ -1732,41 +1759,45 @@ define Device/nec_wg800hp
endef
TARGET_DEVICES += nec_wg800hp
define Device/netgear_ex6400_ex7300
$(Device/netgear_generic)
define Device/netgear_ex7300
SOC := qca9558
UIMAGE_MAGIC := 0x27051956
DEVICE_VENDOR := NETGEAR
DEVICE_MODEL := EX7300
DEVICE_ALT0_VENDOR := NETGEAR
DEVICE_ALT0_MODEL := EX6400
NETGEAR_BOARD_ID := EX7300series
NETGEAR_HW_ID := 29765104+16+0+128
IMAGE_SIZE := 15552k
IMAGES += factory.img
IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
netgear-rootfs | pad-rootfs
IMAGE/sysupgrade.bin := $$(IMAGE/default) | check-size | append-metadata
IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size
DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca99x0-ct
endef
define Device/netgear_ex6400
$(Device/netgear_ex6400_ex7300)
DEVICE_MODEL := EX6400
endef
TARGET_DEVICES += netgear_ex6400
define Device/netgear_ex7300
$(Device/netgear_ex6400_ex7300)
DEVICE_MODEL := EX7300
SUPPORTED_DEVICES += netgear,ex6400
endef
TARGET_DEVICES += netgear_ex7300
define Device/netgear_ex7300-v2
$(Device/netgear_generic)
SOC := qcn5502
DEVICE_VENDOR := NETGEAR
DEVICE_MODEL := EX7300
DEVICE_VARIANT := v2
UIMAGE_MAGIC := 0x27051956
DEVICE_ALT0_VENDOR := NETGEAR
DEVICE_ALT0_MODEL := EX6250
DEVICE_ALT1_VENDOR := NETGEAR
DEVICE_ALT1_MODEL := EX6400
DEVICE_ALT1_VARIANT := v2
DEVICE_ALT2_VENDOR := NETGEAR
DEVICE_ALT2_MODEL := EX6410
DEVICE_ALT3_VENDOR := NETGEAR
DEVICE_ALT3_MODEL := EX6420
DEVICE_ALT4_VENDOR := NETGEAR
DEVICE_ALT4_MODEL := EX7320
NETGEAR_BOARD_ID := EX7300v2series
NETGEAR_HW_ID := 29765907+16+0+128
IMAGE_SIZE := 14528k
IMAGES += factory.img
IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
netgear-rootfs | pad-rootfs
IMAGE/sysupgrade.bin := $$(IMAGE/default) | check-size | append-metadata

View file

@ -199,7 +199,8 @@ define Device/glinet_gl-xe300
SOC := qca9531
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-XE300
DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341
DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 \
kmod-usb-net-qmi-wwan uqmi
KERNEL_SIZE := 4096k
IMAGE_SIZE := 131072k
PAGESIZE := 2048

View file

@ -1123,7 +1123,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
}
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5582,7 +5582,7 @@ static void port_event(struct usb_hub *h
@@ -5585,7 +5585,7 @@ static void port_event(struct usb_hub *h
port_dev->over_current_count++;
port_over_current_notify(port_dev);

View file

@ -70,7 +70,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
* @dev: the device whose endpoint is being disabled
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1842,6 +1842,8 @@ extern int usb_clear_halt(struct usb_dev
@@ -1845,6 +1845,8 @@ extern int usb_clear_halt(struct usb_dev
extern int usb_reset_configuration(struct usb_device *dev);
extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr);

View file

@ -125,7 +125,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
* non-error returns are a promise to giveback() the urb later
* we drop ownership so next owner (or urb unlink) can get it
*/
@@ -5443,6 +5546,7 @@ static const struct hc_driver xhci_hc_dr
@@ -5457,6 +5560,7 @@ static const struct hc_driver xhci_hc_dr
.endpoint_reset = xhci_endpoint_reset,
.check_bandwidth = xhci_check_bandwidth,
.reset_bandwidth = xhci_reset_bandwidth,

View file

@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -293,6 +293,7 @@ static void xhci_pci_quirks(struct devic
@@ -296,6 +296,7 @@ static void xhci_pci_quirks(struct devic
if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
xhci->quirks |= XHCI_LPM_SUPPORT;
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
@ -50,7 +50,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
addr = xhci_trb_virt_to_dma(new_seg, new_deq);
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1905,6 +1905,7 @@ struct xhci_hcd {
@@ -1906,6 +1906,7 @@ struct xhci_hcd {
#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42)
#define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43)
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)

View file

@ -205,7 +205,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
xhci_err(xhci, "Tried to move enqueue past ring segment\n");
return;
}
@@ -3159,7 +3162,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd
@@ -3162,7 +3165,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd
* that clears the EHB.
*/
while (xhci_handle_event(xhci) > 0) {
@ -214,7 +214,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
continue;
xhci_update_erst_dequeue(xhci, event_ring_deq);
event_ring_deq = xhci->event_ring->dequeue;
@@ -3301,7 +3304,8 @@ static int prepare_ring(struct xhci_hcd
@@ -3304,7 +3307,8 @@ static int prepare_ring(struct xhci_hcd
}
}

View file

@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
cycle_state, type, max_packet, flags);
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -294,6 +294,7 @@ static void xhci_pci_quirks(struct devic
@@ -297,6 +297,7 @@ static void xhci_pci_quirks(struct devic
xhci->quirks |= XHCI_LPM_SUPPORT;
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
xhci->quirks |= XHCI_AVOID_DQ_ON_LINK;
@ -63,7 +63,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1907,6 +1907,7 @@ struct xhci_hcd {
@@ -1908,6 +1908,7 @@ struct xhci_hcd {
#define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43)
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)
#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(45)

View file

@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -295,6 +295,7 @@ static void xhci_pci_quirks(struct devic
@@ -298,6 +298,7 @@ static void xhci_pci_quirks(struct devic
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
xhci->quirks |= XHCI_AVOID_DQ_ON_LINK;
xhci->quirks |= XHCI_VLI_TRB_CACHE_BUG;
@ -36,7 +36,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3614,14 +3614,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3617,14 +3617,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
unsigned int num_trbs;
unsigned int start_cycle, num_sgs = 0;
unsigned int enqd_len, block_len, trb_buff_len, full_len;
@ -54,7 +54,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
full_len = urb->transfer_buffer_length;
/* If we have scatter/gather list, we use it. */
if (urb->num_sgs && !(urb->transfer_flags & URB_DMA_MAP_SINGLE)) {
@@ -3658,6 +3659,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3661,6 +3662,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
start_cycle = ring->cycle_state;
send_addr = addr;
@ -72,7 +72,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* Queue the TRBs, even if they are zero-length */
for (enqd_len = 0; first_trb || enqd_len < full_len;
enqd_len += trb_buff_len) {
@@ -3670,6 +3682,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3673,6 +3685,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
if (enqd_len + trb_buff_len > full_len)
trb_buff_len = full_len - enqd_len;
@ -86,7 +86,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
first_trb = false;
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1908,6 +1908,7 @@ struct xhci_hcd {
@@ -1909,6 +1909,7 @@ struct xhci_hcd {
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)
#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(45)
#define XHCI_VLI_TRB_CACHE_BUG BIT_ULL(46)

View file

@ -13,7 +13,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3614,7 +3614,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3617,7 +3617,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
unsigned int num_trbs;
unsigned int start_cycle, num_sgs = 0;
unsigned int enqd_len, block_len, trb_buff_len, full_len;
@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
u32 field, length_field, remainder, maxpacket;
u64 addr, send_addr;
@@ -3660,14 +3660,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3663,14 +3663,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
send_addr = addr;
if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG &&
@ -40,7 +40,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
/* Queue the TRBs, even if they are zero-length */
@@ -3682,7 +3677,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3685,7 +3680,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
if (enqd_len + trb_buff_len > full_len)
trb_buff_len = full_len - enqd_len;

View file

@ -127,7 +127,7 @@ it on BCM4708 family.
/*
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1890,6 +1890,7 @@ struct xhci_hcd {
@@ -1895,6 +1895,7 @@ struct xhci_hcd {
#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42)
#define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43)
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)

View file

@ -127,7 +127,7 @@ it on BCM4708 family.
/*
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1905,6 +1905,7 @@ struct xhci_hcd {
@@ -1906,6 +1906,7 @@ struct xhci_hcd {
#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42)
#define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43)
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)

View file

@ -0,0 +1,798 @@
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -45,7 +45,10 @@
* Please note DMA-sync-for-CPU is still
* device driver responsibility
*/
-#define PP_FLAG_ALL (PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV)
+#define PP_FLAG_PAGE_FRAG BIT(2) /* for page frag feature */
+#define PP_FLAG_ALL (PP_FLAG_DMA_MAP |\
+ PP_FLAG_DMA_SYNC_DEV |\
+ PP_FLAG_PAGE_FRAG)
/*
* Fast allocation side cache array/stack
@@ -65,7 +68,7 @@
#define PP_ALLOC_CACHE_REFILL 64
struct pp_alloc_cache {
u32 count;
- void *cache[PP_ALLOC_CACHE_SIZE];
+ struct page *cache[PP_ALLOC_CACHE_SIZE];
};
struct page_pool_params {
@@ -79,6 +82,22 @@ struct page_pool_params {
unsigned int offset; /* DMA addr offset */
};
+
+static inline int page_pool_ethtool_stats_get_count(void)
+{
+ return 0;
+}
+
+static inline u8 *page_pool_ethtool_stats_get_strings(u8 *data)
+{
+ return data;
+}
+
+static inline u64 *page_pool_ethtool_stats_get(u64 *data, void *stats)
+{
+ return data;
+}
+
struct page_pool {
struct page_pool_params p;
@@ -88,6 +107,9 @@ struct page_pool {
unsigned long defer_warn;
u32 pages_state_hold_cnt;
+ unsigned int frag_offset;
+ struct page *frag_page;
+ long frag_users;
/*
* Data structure for allocation side
@@ -137,6 +159,18 @@ static inline struct page *page_pool_dev
return page_pool_alloc_pages(pool, gfp);
}
+struct page *page_pool_alloc_frag(struct page_pool *pool, unsigned int *offset,
+ unsigned int size, gfp_t gfp);
+
+static inline struct page *page_pool_dev_alloc_frag(struct page_pool *pool,
+ unsigned int *offset,
+ unsigned int size)
+{
+ gfp_t gfp = (GFP_ATOMIC | __GFP_NOWARN);
+
+ return page_pool_alloc_frag(pool, offset, size, gfp);
+}
+
/* get the stored dma direction. A driver might decide to treat this locally and
* avoid the extra cache line from page_pool to determine the direction
*/
@@ -146,6 +180,8 @@ inline enum dma_data_direction page_pool
return pool->p.dma_dir;
}
+bool page_pool_return_skb_page(struct page *page);
+
struct page_pool *page_pool_create(const struct page_pool_params *params);
#ifdef CONFIG_PAGE_POOL
@@ -165,6 +201,7 @@ static inline void page_pool_release_pag
struct page *page)
{
}
+
#endif
void page_pool_put_page(struct page_pool *pool, struct page *page,
@@ -189,19 +226,48 @@ static inline void page_pool_recycle_dir
page_pool_put_full_page(pool, page, true);
}
+#define PAGE_POOL_DMA_USE_PP_FRAG_COUNT \
+ (sizeof(dma_addr_t) > sizeof(unsigned long))
+
static inline dma_addr_t page_pool_get_dma_addr(struct page *page)
{
- dma_addr_t ret = page->dma_addr[0];
- if (sizeof(dma_addr_t) > sizeof(unsigned long))
- ret |= (dma_addr_t)page->dma_addr[1] << 16 << 16;
+ dma_addr_t ret = page->dma_addr;
+
+ if (PAGE_POOL_DMA_USE_PP_FRAG_COUNT)
+ ret |= (dma_addr_t)page->dma_addr_upper << 16 << 16;
+
return ret;
}
static inline void page_pool_set_dma_addr(struct page *page, dma_addr_t addr)
{
- page->dma_addr[0] = addr;
- if (sizeof(dma_addr_t) > sizeof(unsigned long))
- page->dma_addr[1] = upper_32_bits(addr);
+ page->dma_addr = addr;
+ if (PAGE_POOL_DMA_USE_PP_FRAG_COUNT)
+ page->dma_addr_upper = upper_32_bits(addr);
+}
+
+static inline void page_pool_set_frag_count(struct page *page, long nr)
+{
+ atomic_long_set(&page->pp_frag_count, nr);
+}
+
+static inline long page_pool_atomic_sub_frag_count_return(struct page *page,
+ long nr)
+{
+ long ret;
+
+ /* As suggested by Alexander, atomic_long_read() may cover up the
+ * reference count errors, so avoid calling atomic_long_read() in
+ * the cases of freeing or draining the page_frags, where we would
+ * not expect it to match or that are slowpath anyway.
+ */
+ if (__builtin_constant_p(nr) &&
+ atomic_long_read(&page->pp_frag_count) == nr)
+ return 0;
+
+ ret = atomic_long_sub_return(nr, &page->pp_frag_count);
+ WARN_ON(ret < 0);
+ return ret;
}
static inline bool is_page_pool_compiled_in(void)
@@ -225,4 +291,23 @@ static inline void page_pool_nid_changed
if (unlikely(pool->p.nid != new_nid))
page_pool_update_nid(pool, new_nid);
}
+
+static inline void page_pool_ring_lock(struct page_pool *pool)
+ __acquires(&pool->ring.producer_lock)
+{
+ if (in_serving_softirq())
+ spin_lock(&pool->ring.producer_lock);
+ else
+ spin_lock_bh(&pool->ring.producer_lock);
+}
+
+static inline void page_pool_ring_unlock(struct page_pool *pool)
+ __releases(&pool->ring.producer_lock)
+{
+ if (in_serving_softirq())
+ spin_unlock(&pool->ring.producer_lock);
+ else
+ spin_unlock_bh(&pool->ring.producer_lock);
+}
+
#endif /* _NET_PAGE_POOL_H */
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -11,16 +11,22 @@
#include <linux/device.h>
#include <net/page_pool.h>
+#include <net/xdp.h>
+
#include <linux/dma-direction.h>
#include <linux/dma-mapping.h>
#include <linux/page-flags.h>
#include <linux/mm.h> /* for __put_page() */
+#include <linux/poison.h>
+#include <linux/ethtool.h>
#include <trace/events/page_pool.h>
#define DEFER_TIME (msecs_to_jiffies(1000))
#define DEFER_WARN_INTERVAL (60 * HZ)
+#define BIAS_MAX LONG_MAX
+
static int page_pool_init(struct page_pool *pool,
const struct page_pool_params *params)
{
@@ -64,6 +70,10 @@ static int page_pool_init(struct page_po
*/
}
+ if (PAGE_POOL_DMA_USE_PP_FRAG_COUNT &&
+ pool->p.flags & PP_FLAG_PAGE_FRAG)
+ return -EINVAL;
+
if (ptr_ring_init(&pool->ring, ring_qsize, GFP_KERNEL) < 0)
return -ENOMEM;
@@ -180,40 +190,10 @@ static void page_pool_dma_sync_for_devic
pool->p.dma_dir);
}
-/* slow path */
-noinline
-static struct page *__page_pool_alloc_pages_slow(struct page_pool *pool,
- gfp_t _gfp)
+static bool page_pool_dma_map(struct page_pool *pool, struct page *page)
{
- struct page *page;
- gfp_t gfp = _gfp;
dma_addr_t dma;
- /* We could always set __GFP_COMP, and avoid this branch, as
- * prep_new_page() can handle order-0 with __GFP_COMP.
- */
- if (pool->p.order)
- gfp |= __GFP_COMP;
-
- /* FUTURE development:
- *
- * Current slow-path essentially falls back to single page
- * allocations, which doesn't improve performance. This code
- * need bulk allocation support from the page allocator code.
- */
-
- /* Cache was empty, do real allocation */
-#ifdef CONFIG_NUMA
- page = alloc_pages_node(pool->p.nid, gfp, pool->p.order);
-#else
- page = alloc_pages(gfp, pool->p.order);
-#endif
- if (!page)
- return NULL;
-
- if (!(pool->p.flags & PP_FLAG_DMA_MAP))
- goto skip_dma_map;
-
/* Setup DMA mapping: use 'struct page' area for storing DMA-addr
* since dma_addr_t can be either 32 or 64 bits and does not always fit
* into page private data (i.e 32bit cpu with 64bit DMA caps)
@@ -222,22 +202,53 @@ static struct page *__page_pool_alloc_pa
dma = dma_map_page_attrs(pool->p.dev, page, 0,
(PAGE_SIZE << pool->p.order),
pool->p.dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
- if (dma_mapping_error(pool->p.dev, dma)) {
- put_page(page);
- return NULL;
- }
+ if (dma_mapping_error(pool->p.dev, dma))
+ return false;
+
page_pool_set_dma_addr(page, dma);
if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV)
page_pool_dma_sync_for_device(pool, page, pool->p.max_len);
-skip_dma_map:
+ return true;
+}
+
+static void page_pool_set_pp_info(struct page_pool *pool,
+ struct page *page)
+{
+ page->pp = pool;
+ page->pp_magic |= PP_SIGNATURE;
+}
+
+static void page_pool_clear_pp_info(struct page *page)
+{
+ page->pp_magic = 0;
+ page->pp = NULL;
+}
+
+/* slow path */
+noinline
+static struct page *__page_pool_alloc_pages_slow(struct page_pool *pool,
+ gfp_t gfp)
+{
+ struct page *page;
+
+ gfp |= __GFP_COMP;
+ page = alloc_pages_node(pool->p.nid, gfp, pool->p.order);
+ if (unlikely(!page))
+ return NULL;
+
+ if ((pool->p.flags & PP_FLAG_DMA_MAP) &&
+ unlikely(!page_pool_dma_map(pool, page))) {
+ put_page(page);
+ return NULL;
+ }
+
+ page_pool_set_pp_info(pool, page);
+
/* Track how many pages are held 'in-flight' */
pool->pages_state_hold_cnt++;
-
trace_page_pool_state_hold(pool, page, pool->pages_state_hold_cnt);
-
- /* When page just alloc'ed is should/must have refcnt 1. */
return page;
}
@@ -302,10 +313,12 @@ void page_pool_release_page(struct page_
DMA_ATTR_SKIP_CPU_SYNC);
page_pool_set_dma_addr(page, 0);
skip_dma_unmap:
+ page_pool_clear_pp_info(page);
+
/* This may be the last page returned, releasing the pool, so
* it is not safe to reference pool afterwards.
*/
- count = atomic_inc_return(&pool->pages_state_release_cnt);
+ count = atomic_inc_return_relaxed(&pool->pages_state_release_cnt);
trace_page_pool_state_release(pool, page, count);
}
EXPORT_SYMBOL(page_pool_release_page);
@@ -331,7 +344,10 @@ static bool page_pool_recycle_in_ring(st
else
ret = ptr_ring_produce_bh(&pool->ring, page);
- return (ret == 0) ? true : false;
+ if (!ret)
+ return true;
+
+ return false;
}
/* Only allow direct recycling in special circumstances, into the
@@ -350,46 +366,43 @@ static bool page_pool_recycle_in_cache(s
return true;
}
-/* page is NOT reusable when:
- * 1) allocated when system is under some pressure. (page_is_pfmemalloc)
- */
-static bool pool_page_reusable(struct page_pool *pool, struct page *page)
-{
- return !page_is_pfmemalloc(page);
-}
-
/* If the page refcnt == 1, this will try to recycle the page.
* if PP_FLAG_DMA_SYNC_DEV is set, we'll try to sync the DMA area for
* the configured size min(dma_sync_size, pool->max_len).
* If the page refcnt != 1, then the page will be returned to memory
* subsystem.
*/
-void page_pool_put_page(struct page_pool *pool, struct page *page,
- unsigned int dma_sync_size, bool allow_direct)
-{
+static __always_inline struct page *
+__page_pool_put_page(struct page_pool *pool, struct page *page,
+ unsigned int dma_sync_size, bool allow_direct)
+{
+ /* It is not the last user for the page frag case */
+ if (pool->p.flags & PP_FLAG_PAGE_FRAG &&
+ page_pool_atomic_sub_frag_count_return(page, 1))
+ return NULL;
+
/* This allocator is optimized for the XDP mode that uses
* one-frame-per-page, but have fallbacks that act like the
* regular page allocator APIs.
*
* refcnt == 1 means page_pool owns page, and can recycle it.
+ *
+ * page is NOT reusable when allocated when system is under
+ * some pressure. (page_is_pfmemalloc)
*/
- if (likely(page_ref_count(page) == 1 &&
- pool_page_reusable(pool, page))) {
+ if (likely(page_ref_count(page) == 1 && !page_is_pfmemalloc(page))) {
/* Read barrier done in page_ref_count / READ_ONCE */
if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV)
page_pool_dma_sync_for_device(pool, page,
dma_sync_size);
- if (allow_direct && in_serving_softirq())
- if (page_pool_recycle_in_cache(page, pool))
- return;
+ if (allow_direct && in_serving_softirq() &&
+ page_pool_recycle_in_cache(page, pool))
+ return NULL;
- if (!page_pool_recycle_in_ring(pool, page)) {
- /* Cache full, fallback to free pages */
- page_pool_return_page(pool, page);
- }
- return;
+ /* Page found as candidate for recycling */
+ return page;
}
/* Fallback/non-XDP mode: API user have elevated refcnt.
*
@@ -407,9 +420,98 @@ void page_pool_put_page(struct page_pool
/* Do not replace this with page_pool_return_page() */
page_pool_release_page(pool, page);
put_page(page);
+
+ return NULL;
+}
+
+void page_pool_put_page(struct page_pool *pool, struct page *page,
+ unsigned int dma_sync_size, bool allow_direct)
+{
+ page = __page_pool_put_page(pool, page, dma_sync_size, allow_direct);
+ if (page && !page_pool_recycle_in_ring(pool, page))
+ /* Cache full, fallback to free pages */
+ page_pool_return_page(pool, page);
}
EXPORT_SYMBOL(page_pool_put_page);
+static struct page *page_pool_drain_frag(struct page_pool *pool,
+ struct page *page)
+{
+ long drain_count = BIAS_MAX - pool->frag_users;
+
+ /* Some user is still using the page frag */
+ if (likely(page_pool_atomic_sub_frag_count_return(page,
+ drain_count)))
+ return NULL;
+
+ if (page_ref_count(page) == 1 && !page_is_pfmemalloc(page)) {
+ if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV)
+ page_pool_dma_sync_for_device(pool, page, -1);
+
+ return page;
+ }
+
+ page_pool_return_page(pool, page);
+ return NULL;
+}
+
+static void page_pool_free_frag(struct page_pool *pool)
+{
+ long drain_count = BIAS_MAX - pool->frag_users;
+ struct page *page = pool->frag_page;
+
+ pool->frag_page = NULL;
+
+ if (!page ||
+ page_pool_atomic_sub_frag_count_return(page, drain_count))
+ return;
+
+ page_pool_return_page(pool, page);
+}
+
+struct page *page_pool_alloc_frag(struct page_pool *pool,
+ unsigned int *offset,
+ unsigned int size, gfp_t gfp)
+{
+ unsigned int max_size = PAGE_SIZE << pool->p.order;
+ struct page *page = pool->frag_page;
+
+ if (WARN_ON(!(pool->p.flags & PP_FLAG_PAGE_FRAG) ||
+ size > max_size))
+ return NULL;
+
+ size = ALIGN(size, dma_get_cache_alignment());
+ *offset = pool->frag_offset;
+
+ if (page && *offset + size > max_size) {
+ page = page_pool_drain_frag(pool, page);
+ if (page)
+ goto frag_reset;
+ }
+
+ if (!page) {
+ page = page_pool_alloc_pages(pool, gfp);
+ if (unlikely(!page)) {
+ pool->frag_page = NULL;
+ return NULL;
+ }
+
+ pool->frag_page = page;
+
+frag_reset:
+ pool->frag_users = 1;
+ *offset = 0;
+ pool->frag_offset = size;
+ page_pool_set_frag_count(page, BIAS_MAX);
+ return page;
+ }
+
+ pool->frag_users++;
+ pool->frag_offset = *offset + size;
+ return page;
+}
+EXPORT_SYMBOL(page_pool_alloc_frag);
+
static void page_pool_empty_ring(struct page_pool *pool)
{
struct page *page;
@@ -515,6 +617,8 @@ void page_pool_destroy(struct page_pool
if (!page_pool_put(pool))
return;
+ page_pool_free_frag(pool);
+
if (!page_pool_release(pool))
return;
@@ -541,3 +645,32 @@ void page_pool_update_nid(struct page_po
}
}
EXPORT_SYMBOL(page_pool_update_nid);
+
+bool page_pool_return_skb_page(struct page *page)
+{
+ struct page_pool *pp;
+
+ page = compound_head(page);
+
+ /* page->pp_magic is OR'ed with PP_SIGNATURE after the allocation
+ * in order to preserve any existing bits, such as bit 0 for the
+ * head page of compound page and bit 1 for pfmemalloc page, so
+ * mask those bits for freeing side when doing below checking,
+ * and page_is_pfmemalloc() is checked in __page_pool_put_page()
+ * to avoid recycling the pfmemalloc page.
+ */
+ if (unlikely((page->pp_magic & ~0x3UL) != PP_SIGNATURE))
+ return false;
+
+ pp = page->pp;
+
+ /* Driver set this to memory recycling info. Reset it on recycle.
+ * This will *not* work for NIC using a split-page memory model.
+ * The page will be returned to the pool here regardless of the
+ * 'flipped' fragment being in use or not.
+ */
+ page_pool_put_full_page(pp, page, false);
+
+ return true;
+}
+EXPORT_SYMBOL(page_pool_return_skb_page);
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -97,10 +97,25 @@ struct page {
};
struct { /* page_pool used by netstack */
/**
- * @dma_addr: might require a 64-bit value on
- * 32-bit architectures.
+ * @pp_magic: magic value to avoid recycling non
+ * page_pool allocated pages.
*/
- unsigned long dma_addr[2];
+ unsigned long pp_magic;
+ struct page_pool *pp;
+ unsigned long _pp_mapping_pad;
+ unsigned long dma_addr;
+ union {
+ /**
+ * dma_addr_upper: might require a 64-bit
+ * value on 32-bit architectures.
+ */
+ unsigned long dma_addr_upper;
+ /**
+ * For frag page support, not supported in
+ * 32-bit architectures with 64-bit DMA.
+ */
+ atomic_long_t pp_frag_count;
+ };
};
struct { /* slab, slob and slub */
union {
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -594,13 +594,22 @@ static void skb_clone_fraglist(struct sk
skb_get(list);
}
+static bool skb_pp_recycle(struct sk_buff *skb, void *data)
+{
+ if (!IS_ENABLED(CONFIG_PAGE_POOL) || !skb->pp_recycle)
+ return false;
+ return page_pool_return_skb_page(virt_to_page(data));
+}
+
static void skb_free_head(struct sk_buff *skb)
{
unsigned char *head = skb->head;
- if (skb->head_frag)
+ if (skb->head_frag) {
+ if (skb_pp_recycle(skb, head))
+ return;
skb_free_frag(head);
- else
+ } else
kfree(head);
}
@@ -612,16 +621,27 @@ static void skb_release_data(struct sk_b
if (skb->cloned &&
atomic_sub_return(skb->nohdr ? (1 << SKB_DATAREF_SHIFT) + 1 : 1,
&shinfo->dataref))
- return;
+ goto exit;
for (i = 0; i < shinfo->nr_frags; i++)
- __skb_frag_unref(&shinfo->frags[i]);
+ __skb_frag_unref(&shinfo->frags[i], skb->pp_recycle);
if (shinfo->frag_list)
kfree_skb_list(shinfo->frag_list);
skb_zcopy_clear(skb, true);
skb_free_head(skb);
+exit:
+ /* When we clone an SKB we copy the reycling bit. The pp_recycle
+ * bit is only set on the head though, so in order to avoid races
+ * while trying to recycle fragments on __skb_frag_unref() we need
+ * to make one SKB responsible for triggering the recycle path.
+ * So disable the recycling bit if an SKB is cloned and we have
+ * additional references to to the fragmented part of the SKB.
+ * Eventually the last SKB will have the recycling bit set and it's
+ * dataref set to 0, which will trigger the recycling
+ */
+ skb->pp_recycle = 0;
}
/*
@@ -1003,6 +1023,7 @@ static struct sk_buff *__skb_clone(struc
n->nohdr = 0;
n->peeked = 0;
C(pfmemalloc);
+ C(pp_recycle);
n->destructor = NULL;
C(tail);
C(end);
@@ -3421,7 +3442,7 @@ int skb_shift(struct sk_buff *tgt, struc
fragto = &skb_shinfo(tgt)->frags[merge];
skb_frag_size_add(fragto, skb_frag_size(fragfrom));
- __skb_frag_unref(fragfrom);
+ __skb_frag_unref(fragfrom, skb->pp_recycle);
}
/* Reposition in the original skb */
@@ -5189,6 +5210,20 @@ bool skb_try_coalesce(struct sk_buff *to
if (skb_cloned(to))
return false;
+ /* In general, avoid mixing slab allocated and page_pool allocated
+ * pages within the same SKB. However when @to is not pp_recycle and
+ * @from is cloned, we can transition frag pages from page_pool to
+ * reference counted.
+ *
+ * On the other hand, don't allow coalescing two pp_recycle SKBs if
+ * @from is cloned, in case the SKB is using page_pool fragment
+ * references (PP_FLAG_PAGE_FRAG). Since we only take full page
+ * references for cloned SKBs at the moment that would result in
+ * inconsistent reference counts.
+ */
+ if (to->pp_recycle != (from->pp_recycle && !skb_cloned(from)))
+ return false;
+
if (len <= skb_tailroom(to)) {
if (len)
BUG_ON(skb_copy_bits(from, 0, skb_put(to, len), len));
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -37,6 +37,7 @@
#include <linux/in6.h>
#include <linux/if_packet.h>
#include <net/flow.h>
+#include <net/page_pool.h>
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <linux/netfilter/nf_conntrack_common.h>
#endif
@@ -786,7 +787,8 @@ struct sk_buff {
fclone:2,
peeked:1,
head_frag:1,
- pfmemalloc:1;
+ pfmemalloc:1,
+ pp_recycle:1; /* page_pool recycle indicator */
#ifdef CONFIG_SKB_EXTENSIONS
__u8 active_extensions;
#endif
@@ -3029,9 +3031,15 @@ static inline void skb_frag_ref(struct s
*
* Releases a reference on the paged fragment @frag.
*/
-static inline void __skb_frag_unref(skb_frag_t *frag)
+static inline void __skb_frag_unref(skb_frag_t *frag, bool recycle)
{
- put_page(skb_frag_page(frag));
+ struct page *page = skb_frag_page(frag);
+
+#ifdef CONFIG_PAGE_POOL
+ if (recycle && page_pool_return_skb_page(page))
+ return;
+#endif
+ put_page(page);
}
/**
@@ -3043,7 +3051,7 @@ static inline void __skb_frag_unref(skb_
*/
static inline void skb_frag_unref(struct sk_buff *skb, int f)
{
- __skb_frag_unref(&skb_shinfo(skb)->frags[f]);
+ __skb_frag_unref(&skb_shinfo(skb)->frags[f], skb->pp_recycle);
}
/**
@@ -4642,5 +4650,12 @@ static inline u64 skb_get_kcov_handle(st
#endif
}
+#ifdef CONFIG_PAGE_POOL
+static inline void skb_mark_for_recycle(struct sk_buff *skb)
+{
+ skb->pp_recycle = 1;
+}
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_SKBUFF_H */
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -2501,7 +2501,7 @@ static void skb_put_frags(struct sk_buff
if (length == 0) {
/* don't need this page */
- __skb_frag_unref(frag);
+ __skb_frag_unref(frag, false);
--skb_shinfo(skb)->nr_frags;
} else {
size = min(length, (unsigned) PAGE_SIZE);
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -526,7 +526,7 @@ static int mlx4_en_complete_rx_desc(stru
fail:
while (nr > 0) {
nr--;
- __skb_frag_unref(skb_shinfo(skb)->frags + nr);
+ __skb_frag_unref(skb_shinfo(skb)->frags + nr, false);
}
return 0;
}
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -131,7 +131,7 @@ static void destroy_record(struct tls_re
int i;
for (i = 0; i < record->num_frags; i++)
- __skb_frag_unref(&record->frags[i]);
+ __skb_frag_unref(&record->frags[i], false);
kfree(record);
}
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -82,4 +82,7 @@
/********** security/ **********/
#define KEY_DESTROY 0xbd
+/********** net/core/page_pool.c **********/
+#define PP_SIGNATURE (0x40 + POISON_POINTER_DELTA)
+
#endif
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1602,7 +1602,7 @@ static inline bool page_is_pfmemalloc(st
* Page index cannot be this large so this must be
* a pfmemalloc page.
*/
- return page->index == -1UL;
+ return (uintptr_t)page->lru.next & BIT(1);
}
/*
@@ -1611,12 +1611,12 @@ static inline bool page_is_pfmemalloc(st
*/
static inline void set_page_pfmemalloc(struct page *page)
{
- page->index = -1UL;
+ page->lru.next = (void *)BIT(1);
}
static inline void clear_page_pfmemalloc(struct page *page)
{
- page->index = 0;
+ page->lru.next = NULL;
}
/*

View file

@ -0,0 +1,44 @@
From ef26c0349eb5a615dab2272d08d1d5de4ac9cd4c Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Wed, 11 Jan 2023 00:30:56 +0100
Subject: [PATCH] of: property: fix #nvmem-cell-cells parsing
Commit 67b8497f005f ("of: property: make #.*-cells optional for simple
props") claims to make the cells-name property optional for simple
properties, but changed the code for the wrong property, i.e. for
DEFINE_SUFFIX_PROP(). Fix that.
Fixes: 67b8497f005f ("of: property: make #.*-cells optional for simple props")
Reported-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/of/property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1213,8 +1213,8 @@ static struct device_node *parse_prop_ce
if (strcmp(prop_name, list_name))
return NULL;
- if (of_parse_phandle_with_args(np, list_name, cells_name, index,
- &sup_args))
+ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
+ &sup_args))
return NULL;
return sup_args.np;
@@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_
if (strcmp_suffix(prop_name, suffix))
return NULL;
- if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
- &sup_args))
+ if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
+ &sup_args))
return NULL;
return sup_args.np;

View file

@ -329,7 +329,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8
/* forking complete and child started to run, tell ptracer */
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4978,6 +4978,7 @@ context_switch(struct rq *rq, struct tas
@@ -5007,6 +5007,7 @@ context_switch(struct rq *rq, struct tas
* finish_task_switch()'s mmdrop().
*/
switch_mm_irqs_off(prev->active_mm, next->mm, next);

View file

@ -0,0 +1,44 @@
From ef26c0349eb5a615dab2272d08d1d5de4ac9cd4c Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Wed, 11 Jan 2023 00:30:56 +0100
Subject: [PATCH] of: property: fix #nvmem-cell-cells parsing
Commit 67b8497f005f ("of: property: make #.*-cells optional for simple
props") claims to make the cells-name property optional for simple
properties, but changed the code for the wrong property, i.e. for
DEFINE_SUFFIX_PROP(). Fix that.
Fixes: 67b8497f005f ("of: property: make #.*-cells optional for simple props")
Reported-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/of/property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1173,8 +1173,8 @@ static struct device_node *parse_prop_ce
if (strcmp(prop_name, list_name))
return NULL;
- if (of_parse_phandle_with_args(np, list_name, cells_name, index,
- &sup_args))
+ if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
+ &sup_args))
return NULL;
return sup_args.np;
@@ -1227,8 +1227,8 @@ static struct device_node *parse_suffix_
if (strcmp_suffix(prop_name, suffix))
return NULL;
- if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
- &sup_args))
+ if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
+ &sup_args))
return NULL;
return sup_args.np;

View file

@ -7562,6 +7562,7 @@ CONFIG_ZONE_DMA=y
# CONFIG_ZPA2326 is not set
# CONFIG_ZPOOL is not set
# CONFIG_ZRAM is not set
# CONFIG_ZRAM_DEF_COMP_842 is not set
# CONFIG_ZRAM_DEF_COMP_LZ4 is not set
# CONFIG_ZRAM_DEF_COMP_LZ4HC is not set
# CONFIG_ZRAM_DEF_COMP_LZO is not set

View file

@ -95,8 +95,14 @@ bbt_nand_read(u32 page, unsigned char *dat, int dat_len,
.datbuf = dat,
.len = dat_len,
};
int ret;
return bmtd._read_oob(bmtd.mtd, page << bmtd.pg_shift, &ops);
ret = bmtd._read_oob(bmtd.mtd, page << bmtd.pg_shift, &ops);
if (ret < 0)
return ret;
if (ret)
pr_info("%s: %d bitflips\n", __func__, ret);
return 0;
}
static inline int bbt_nand_erase(u16 block)

View file

@ -197,3 +197,14 @@ Signed-off-by: John Crispin <john@phrozen.org>
config SND_JACK
bool
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -436,7 +436,7 @@ config NET_DEVLINK
default n
config PAGE_POOL
- bool
+ bool "Page pool support"
config FAILOVER
tristate "Generic failover module"

View file

@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
*/
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2725,6 +2725,10 @@ static inline int pskb_trim(struct sk_bu
@@ -2727,6 +2727,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
@@ -2856,16 +2860,6 @@ static inline struct sk_buff *dev_alloc_
@@ -2858,16 +2862,6 @@ static inline struct sk_buff *dev_alloc_
}

View file

@ -33,7 +33,7 @@ Submitted-by: Daniel Golle <daniel@makrotopia.org>
#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
@@ -1156,6 +1158,11 @@ static const struct usb_device_id option
@@ -1162,6 +1164,11 @@ static const struct usb_device_id option
.driver_info = ZLP },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
.driver_info = RSVD(4) },

View file

@ -197,3 +197,14 @@ Signed-off-by: John Crispin <john@phrozen.org>
config SND_JACK
bool
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -432,7 +432,7 @@ config NET_DEVLINK
default n
config PAGE_POOL
- bool
+ bool "Page pool support"
config PAGE_POOL_STATS
default n

View file

@ -29,7 +29,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
@@ -1156,6 +1158,11 @@ static const struct usb_device_id option
@@ -1162,6 +1164,11 @@ static const struct usb_device_id option
.driver_info = ZLP },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
.driver_info = RSVD(4) },

View file

@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4184,6 +4184,7 @@ int wake_up_state(struct task_struct *p,
@@ -4213,6 +4213,7 @@ int wake_up_state(struct task_struct *p,
{
return try_to_wake_up(p, state, 0);
}

View file

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2691,7 +2691,7 @@ static inline int pskb_network_may_pull(
@@ -2693,7 +2693,7 @@ static inline int pskb_network_may_pull(
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD

View file

@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -861,6 +861,7 @@ struct sk_buff {
@@ -863,6 +863,7 @@ struct sk_buff {
__u8 decrypted:1;
#endif
__u8 scm_io_uring:1;

View file

@ -0,0 +1,35 @@
From: Alexander Duyck <alexanderduyck@fb.com>
Date: Thu, 26 Jan 2023 11:06:59 -0800
Subject: [PATCH] skb: Do mix page pool and page referenced frags in GRO
GSO should not merge page pool recycled frames with standard reference
counted frames. Traditionally this didn't occur, at least not often.
However as we start looking at adding support for wireless adapters there
becomes the potential to mix the two due to A-MSDU repartitioning frames in
the receive path. There are possibly other places where this may have
occurred however I suspect they must be few and far between as we have not
seen this issue until now.
Fixes: 53e0961da1c7 ("page_pool: add frag page recycling support in page pool")
Reported-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
---
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4166,6 +4166,15 @@ int skb_gro_receive(struct sk_buff *p, s
if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
return -E2BIG;
+ /* Do not splice page pool based packets w/ non-page pool
+ * packets. This can result in reference count issues as page
+ * pool pages will not decrement the reference count and will
+ * instead be immediately returned to the pool or have frag
+ * count decremented.
+ */
+ if (p->pp_recycle != skb->pp_recycle)
+ return -ETOOMANYREFS;
+
lp = NAPI_GRO_CB(p)->last;
pinfo = skb_shinfo(lp);

View file

@ -0,0 +1,35 @@
From: Alexander Duyck <alexanderduyck@fb.com>
Date: Thu, 26 Jan 2023 11:06:59 -0800
Subject: [PATCH] skb: Do mix page pool and page referenced frags in GRO
GSO should not merge page pool recycled frames with standard reference
counted frames. Traditionally this didn't occur, at least not often.
However as we start looking at adding support for wireless adapters there
becomes the potential to mix the two due to A-MSDU repartitioning frames in
the receive path. There are possibly other places where this may have
occurred however I suspect they must be few and far between as we have not
seen this issue until now.
Fixes: 53e0961da1c7 ("page_pool: add frag page recycling support in page pool")
Reported-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
---
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4348,6 +4348,15 @@ int skb_gro_receive(struct sk_buff *p, s
if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
return -E2BIG;
+ /* Do not splice page pool based packets w/ non-page pool
+ * packets. This can result in reference count issues as page
+ * pool pages will not decrement the reference count and will
+ * instead be immediately returned to the pool or have frag
+ * count decremented.
+ */
+ if (p->pp_recycle != skb->pp_recycle)
+ return -ETOOMANYREFS;
+
lp = NAPI_GRO_CB(p)->last;
pinfo = skb_shinfo(lp);

View file

@ -5,10 +5,10 @@ include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=ipq806x
BOARDNAME:=Qualcomm Atheros IPQ806X
FEATURES:=squashfs nand fpu ramdisk
FEATURES:=squashfs fpu ramdisk
CPU_TYPE:=cortex-a15
CPU_SUBTYPE:=neon-vfpv4
SUBTARGETS:=generic
SUBTARGETS:=generic chromium
KERNEL_PATCHVER:=5.15

View file

@ -79,6 +79,12 @@ tplink,ad7200)
ucidef_add_switch "switch0" \
"2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
;;
asus,onhub |\
tplink,onhub)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch0" \
"1:lan" "6@eth1" "2:wan" "0@eth0"
;;
ubnt,unifi-ac-hd)
ucidef_set_interface_lan "eth0 eth1"
;;

View file

@ -6,9 +6,32 @@
board=$(board_name)
dt_base64_extract() {
local target_dir="/sys$DEVPATH"
local source="$target_dir/../../of_node/qcom,ath10k-calibration-data-base64"
[ -e "$source" ] || caldata_die "cannot find base64 calibration data: $source"
[ -d "$target_dir" ] || \
caldata_die "no sysfs dir to write: $target"
echo 1 > "$target_dir/loading"
base64decode.uc "$source" > "$target_dir/data"
if [ $? != 0 ]; then
echo 1 > "$target_dir/loading"
caldata_die \
"failed to write calibration data to $target_dir/data"
else
echo 0 > "$target_dir/loading"
fi
}
case "$FIRMWARE" in
"ath10k/cal-pci-0000:01:00.0.bin")
case "$board" in
asus,onhub |\
tplink,onhub)
dt_base64_extract
;;
meraki,mr52)
CI_UBIPART=art
caldata_extract_ubi "ART" 0x1000 0x844
@ -35,6 +58,14 @@ case "$FIRMWARE" in
;;
esac
;;
"ath10k/cal-pci-0001:01:00.0.bin")
case "$board" in
asus,onhub |\
tplink,onhub)
dt_base64_extract
;;
esac
;;
"ath10k/pre-cal-pci-0001:01:00.0.bin")
case $board in
asrock,g10)
@ -61,6 +92,10 @@ case "$FIRMWARE" in
;;
"ath10k/cal-pci-0002:01:00.0.bin")
case "$board" in
asus,onhub |\
tplink,onhub)
dt_base64_extract
;;
meraki,mr42)
CI_UBIPART=art
caldata_extract_ubi "ART" 0x9000 0x844

Some files were not shown because too many files have changed in this diff Show more