Merge branch 'openwrt:master' into master

This commit is contained in:
Hayzam Sherif 2022-12-20 23:49:04 +05:30 committed by GitHub
commit 78dbf48f5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
323 changed files with 52965 additions and 930 deletions

View file

@ -14,6 +14,8 @@ on:
type: boolean type: boolean
build_full: build_full:
type: boolean type: boolean
build_kernel:
type: boolean
build_all_modules: build_all_modules:
type: boolean type: boolean
build_all_kmods: build_all_kmods:
@ -26,7 +28,7 @@ permissions:
jobs: jobs:
setup_build: setup_build:
name: Setup build name: Setup build ${{ inputs.target }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
@ -80,7 +82,7 @@ jobs:
echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
build: build:
name: Build with external toolchain name: Build ${{ inputs.target }}
needs: setup_build needs: setup_build
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -338,11 +340,13 @@ jobs:
run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Build Kernel - name: Build Kernel
if: inputs.build_kernel == true
shell: su buildbot -c "sh -e {0}" shell: su buildbot -c "sh -e {0}"
working-directory: openwrt working-directory: openwrt
run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
- name: Build Kernel Kmods - name: Build Kernel Kmods
if: inputs.build_kernel == true
shell: su buildbot -c "sh -e {0}" shell: su buildbot -c "sh -e {0}"
working-directory: openwrt working-directory: openwrt
run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh

View file

@ -67,6 +67,7 @@ jobs:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
target: ${{ matrix.target }} target: ${{ matrix.target }}
build_kernel: true
build_all_kmods: true build_all_kmods: true
check-kernel-patches: check-kernel-patches:

View file

@ -25,6 +25,7 @@ permissions:
jobs: jobs:
build: build:
name: Build Packages with external toolchain
permissions: permissions:
contents: read contents: read
packages: read packages: read
@ -37,6 +38,7 @@ jobs:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
target: ${{ matrix.target }} target: ${{ matrix.target }}
build_kernel: true
build_all_kmods: true build_all_kmods: true
build_all_modules: true build_all_modules: true
build_full: true build_full: true

64
.github/workflows/toolchain.yml vendored Normal file
View file

@ -0,0 +1,64 @@
name: Build Toolchains
on:
pull_request:
paths:
- '.github/workflows/build.yml'
- '.github/workflows/toolchain.yml'
- 'toolchain/**'
push:
paths:
- '.github/workflows/build.yml'
- '.github/workflows/toolchain.yml'
- 'toolchain/**'
permissions:
contents: read
jobs:
determine_targets:
name: Set targets
runs-on: ubuntu-latest
outputs:
target: ${{ steps.find_targets.outputs.target }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set targets
id: find_targets
run: |
export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \
| sort -u -t '/' -k1,1 \
| awk '{ print $1 }')"
JSON='['
FIRST=1
for TARGET in $TARGETS; do
[[ $FIRST -ne 1 ]] && JSON="$JSON"','
JSON="$JSON"'"'"${TARGET}"'"'
FIRST=0
done
JSON="$JSON"']'
echo -e "\n---- targets ----\n"
echo "$JSON"
echo -e "\n---- targets ----\n"
echo "target=$JSON" >> $GITHUB_OUTPUT
build:
name: Build Target Toolchain
needs: determine_targets
permissions:
contents: read
packages: read
strategy:
fail-fast: False
matrix:
target: ${{fromJson(needs.determine_targets.outputs.target)}}
uses: ./.github/workflows/build.yml
with:
target: ${{ matrix.target }}
build_toolchain: true

View file

@ -307,7 +307,7 @@ define Build/fit
endef endef
define Build/gzip define Build/gzip
gzip -f -9n -c $@ $(1) > $@.new $(STAGING_DIR_HOST)/bin/gzip -f -9n -c $@ $(1) > $@.new
@mv $@.new $@ @mv $@.new $@
endef endef

View file

@ -520,6 +520,7 @@ define Device/Build/compile
$$(_COMPILE_TARGET): $(KDIR)/$(1) $$(_COMPILE_TARGET): $(KDIR)/$(1)
$(eval $(call Device/Export,$(KDIR)/$(1))) $(eval $(call Device/Export,$(KDIR)/$(1)))
$(KDIR)/$(1): FORCE $(KDIR)/$(1): FORCE
rm -f $(KDIR)/$(1)
$$(call concat_cmd,$(COMPILE/$(1))) $$(call concat_cmd,$(COMPILE/$(1)))
endef endef

View file

@ -1,2 +1,2 @@
LINUX_VERSION-5.10 = .158 LINUX_VERSION-5.10 = .160
LINUX_KERNEL_HASH-5.10.158 = 1e0a24bb5510caa18b3601b25e12cc2a1ce123948de551f4f2cdbb40aea707e7 LINUX_KERNEL_HASH-5.10.160 = 30d5076acae863941045880c4c5c5109d26a54a932168fa1324237e8aeaa840b

View file

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .82 LINUX_VERSION-5.15 = .84
LINUX_KERNEL_HASH-5.15.82 = fceef6bb79bac494663ccde34453521fc616cd94272fd30564752b3742381b65 LINUX_KERNEL_HASH-5.15.84 = 318dc30cb059c2e35b59652b166b39804bb3a941f11878aae6119019a04b8217

View file

@ -130,7 +130,7 @@ ifneq ($(HOST_OS),Linux)
export SKIP_STACK_VALIDATION:=1 export SKIP_STACK_VALIDATION:=1
endif endif
KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS) KERNEL_MAKEOPTS = -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
ifdef CONFIG_USE_SPARSE ifdef CONFIG_USE_SPARSE
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse

View file

@ -7,6 +7,8 @@
CI_KERNPART="${CI_KERNPART:-kernel}" CI_KERNPART="${CI_KERNPART:-kernel}"
# 'ubi' partition on NAND contains UBI # 'ubi' partition on NAND contains UBI
# There are also CI_KERN_UBIPART and CI_ROOT_UBIPART if kernel
# and rootfs are on separated UBIs.
CI_UBIPART="${CI_UBIPART:-ubi}" CI_UBIPART="${CI_UBIPART:-ubi}"
# 'rootfs' UBI volume on NAND contains the rootfs # 'rootfs' UBI volume on NAND contains the rootfs
@ -104,7 +106,7 @@ identify_if_gzip() {
} }
nand_restore_config() { nand_restore_config() {
local ubidev=$( nand_find_ubi "$CI_UBIPART" ) local ubidev=$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )
local ubivol="$( nand_find_volume $ubidev rootfs_data )" local ubivol="$( nand_find_volume $ubidev rootfs_data )"
if [ ! "$ubivol" ]; then if [ ! "$ubivol" ]; then
ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
@ -146,6 +148,42 @@ nand_remove_ubiblock() {
fi fi
} }
nand_attach_ubi() {
local ubipart="$1"
local has_env="${2:-0}"
local mtdnum="$( find_mtd_index "$ubipart" )"
if [ ! "$mtdnum" ]; then
>&2 echo "cannot find ubi mtd partition $ubipart"
return 1
fi
local ubidev="$( nand_find_ubi "$ubipart" )"
if [ ! "$ubidev" ]; then
>&2 ubiattach -m "$mtdnum"
ubidev="$( nand_find_ubi "$ubipart" )"
if [ ! "$ubidev" ]; then
>&2 ubiformat /dev/mtd$mtdnum -y
>&2 ubiattach -m "$mtdnum"
ubidev="$( nand_find_ubi "$ubipart" )"
if [ ! "$ubidev" ]; then
>&2 echo "cannot attach ubi mtd partition $ubipart"
return 1
fi
if [ "$has_env" -gt 0 ]; then
>&2 ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB
>&2 ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB
fi
fi
fi
echo "$ubidev"
return 0
}
nand_detach_ubi() { nand_detach_ubi() {
local ubipart="$1" local ubipart="$1"
@ -177,40 +215,25 @@ nand_upgrade_prepare_ubi() {
local kernel_length="$3" local kernel_length="$3"
local has_env="${4:-0}" local has_env="${4:-0}"
local kern_ubidev
local root_ubidev
[ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1 [ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1
local mtdnum="$( find_mtd_index "$CI_UBIPART" )" if [ -n "$CI_KERN_UBIPART" -a -n "$CI_ROOT_UBIPART" ]; then
if [ ! "$mtdnum" ]; then kern_ubidev="$( nand_attach_ubi "$CI_KERN_UBIPART" "$has_env" )"
echo "cannot find ubi mtd partition $CI_UBIPART" [ -n "$kern_ubidev" ] || return 1
return 1 root_ubidev="$( nand_attach_ubi "$CI_ROOT_UBIPART" )"
[ -n "$root_ubidev" ] || return 1
else
kern_ubidev="$( nand_attach_ubi "$CI_UBIPART" "$has_env" )"
[ -n "$kern_ubidev" ] || return 1
root_ubidev="$kern_ubidev"
fi fi
local ubidev="$( nand_find_ubi "$CI_UBIPART" )" local kern_ubivol="$( nand_find_volume $kern_ubidev "$CI_KERNPART" )"
if [ ! "$ubidev" ]; then local root_ubivol="$( nand_find_volume $root_ubidev "$CI_ROOTPART" )"
ubiattach -m "$mtdnum" local data_ubivol="$( nand_find_volume $root_ubidev rootfs_data )"
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
if [ ! "$ubidev" ]; then
ubiformat /dev/mtd$mtdnum -y
ubiattach -m "$mtdnum"
ubidev="$( nand_find_ubi "$CI_UBIPART" )"
if [ ! "$ubidev" ]; then
echo "cannot attach ubi mtd partition $CI_UBIPART"
return 1
fi
if [ "$has_env" -gt 0 ]; then
ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB
ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB
fi
fi
fi
local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )"
local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
local data_ubivol="$( nand_find_volume $ubidev rootfs_data )"
[ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol= [ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol=
# remove ubiblocks # remove ubiblocks
@ -219,13 +242,13 @@ nand_upgrade_prepare_ubi() {
[ "$data_ubivol" ] && { nand_remove_ubiblock $data_ubivol || return 1; } [ "$data_ubivol" ] && { nand_remove_ubiblock $data_ubivol || return 1; }
# kill volumes # kill volumes
[ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N "$CI_KERNPART" || : [ "$kern_ubivol" ] && ubirmvol /dev/$kern_ubidev -N "$CI_KERNPART" || :
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N "$CI_ROOTPART" || : [ "$root_ubivol" ] && ubirmvol /dev/$root_ubidev -N "$CI_ROOTPART" || :
[ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || : [ "$data_ubivol" ] && ubirmvol /dev/$root_ubidev -N rootfs_data || :
# create kernel vol # create kernel vol
if [ -n "$kernel_length" ]; then if [ -n "$kernel_length" ]; then
if ! ubimkvol /dev/$ubidev -N "$CI_KERNPART" -s $kernel_length; then if ! ubimkvol /dev/$kern_ubidev -N "$CI_KERNPART" -s $kernel_length; then
echo "cannot create kernel volume" echo "cannot create kernel volume"
return 1; return 1;
fi fi
@ -239,7 +262,7 @@ nand_upgrade_prepare_ubi() {
else else
rootfs_size_param="-s $rootfs_length" rootfs_size_param="-s $rootfs_length"
fi fi
if ! ubimkvol /dev/$ubidev -N "$CI_ROOTPART" $rootfs_size_param; then if ! ubimkvol /dev/$root_ubidev -N "$CI_ROOTPART" $rootfs_size_param; then
echo "cannot create rootfs volume" echo "cannot create rootfs volume"
return 1; return 1;
fi fi
@ -251,8 +274,8 @@ nand_upgrade_prepare_ubi() {
if [ -n "$rootfs_data_max" ]; then if [ -n "$rootfs_data_max" ]; then
rootfs_data_size_param="-s $rootfs_data_max" rootfs_data_size_param="-s $rootfs_data_max"
fi fi
if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then if ! ubimkvol /dev/$root_ubidev -N rootfs_data $rootfs_data_size_param; then
if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then if ! ubimkvol /dev/$root_ubidev -N rootfs_data -m; then
echo "cannot initialize rootfs_data volume" echo "cannot initialize rootfs_data volume"
return 1 return 1
fi fi
@ -336,8 +359,8 @@ nand_upgrade_tar() {
local has_env=0 local has_env=0
nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$ubi_kernel_length" "$has_env" || return 1 nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$ubi_kernel_length" "$has_env" || return 1
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
if [ "$rootfs_length" ]; then if [ "$rootfs_length" ]; then
local ubidev="$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )"
local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
tar xO${gz}f "$tar_file" "$board_dir/root" | \ tar xO${gz}f "$tar_file" "$board_dir/root" | \
ubiupdatevol /dev/$root_ubivol -s "$rootfs_length" - ubiupdatevol /dev/$root_ubivol -s "$rootfs_length" -
@ -347,6 +370,7 @@ nand_upgrade_tar() {
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \ tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
mtd write - "$CI_KERNPART" mtd write - "$CI_KERNPART"
else else
local ubidev="$( nand_find_ubi "${CI_KERN_UBIPART:-$CI_UBIPART}" )"
local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )" local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )"
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \ tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
ubiupdatevol /dev/$kern_ubivol -s "$kernel_length" - ubiupdatevol /dev/$kern_ubivol -s "$kernel_length" -

View file

@ -34,7 +34,8 @@ bananapi,bpi-r3)
;; ;;
esac esac
;; ;;
xiaomi,redmi-router-ax6000) xiaomi,redmi-router-ax6000|\
xiaomi,redmi-router-ax6000-stock)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000" ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
;; ;;

View file

@ -33,6 +33,7 @@ ampedwireless,ally-r1900k)
;; ;;
beeline,smartbox-giga|\ beeline,smartbox-giga|\
beeline,smartbox-turbo|\ beeline,smartbox-turbo|\
etisalat,s3|\
rostelecom,rt-sf-1) rostelecom,rt-sf-1)
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000" ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
;; ;;
@ -78,6 +79,11 @@ linksys,ea8100-v2|\
mts,wg430223) mts,wg430223)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
;; ;;
snr,cpe-w4n-mt)
idx="$(find_mtd_index uboot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
;;
xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-3g-v2|\
xiaomi,mi-router-4a-gigabit|\ xiaomi,mi-router-4a-gigabit|\
xiaomi,miwifi-3c) xiaomi,miwifi-3c)

View file

@ -116,8 +116,8 @@ endef
define U-Boot/Marsboard_A10 define U-Boot/Marsboard_A10
BUILD_SUBTARGET:=cortexa8 BUILD_SUBTARGET:=cortexa8
NAME:=Marsboard NAME:=HAOYU Marsboard A10
BUILD_DEVICES:=marsboard_a10-marsboard BUILD_DEVICES:=haoyu_a10-marsboard
endef endef
define U-Boot/Mele_M9 define U-Boot/Mele_M9

View file

@ -29,7 +29,7 @@ diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index b8a382d1539..ed3d360bb10 100644 index b8a382d1539..ed3d360bb10 100644
--- a/arch/arm/dts/Makefile --- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile
@@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \ @@ -555,6 +555,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \
sun50i-h5-libretech-all-h5-cc.dtb \ sun50i-h5-libretech-all-h5-cc.dtb \
sun50i-h5-nanopi-neo2.dtb \ sun50i-h5-nanopi-neo2.dtb \
sun50i-h5-nanopi-neo-plus2.dtb \ sun50i-h5-nanopi-neo-plus2.dtb \

View file

@ -66,6 +66,7 @@ CONFIGURE_ARGS+= \
--without-mpc \ --without-mpc \
--without-mpfr \ --without-mpfr \
--without-isl \ --without-isl \
--without-xxhash \
--with-libgmp-prefix=$(STAGING_DIR)/usr --with-libgmp-prefix=$(STAGING_DIR)/usr
CONFIGURE_VARS+= \ CONFIGURE_VARS+= \

View file

@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=strace PKG_NAME:=strace
PKG_VERSION:=6.0 PKG_VERSION:=6.1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
PKG_HASH:=92d720a666855e9f1c6a11512fd6e99674a82bbfe1442557815f2ce8e1293338 PKG_HASH:=2579e9cec37dbb786f6ea0bebd15f40dd561ef2bde2a2a2ecdce5963b01859fd
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=LGPL-2.1-or-later PKG_LICENSE:=LGPL-2.1-or-later

View file

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=trace-cmd PKG_NAME:=trace-cmd
PKG_VERSION:=v3.1.4 PKG_VERSION:=v3.1.5
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/ PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/
PKG_HASH:=447e095dbdfb0d362ab8c2086d62d80c5a2ecf67aef09b8f6b0cc064c0e1bfb5 PKG_HASH:=9af1ea00e312d03639470e126fa9c786789f03c16df93a57c0bc90eeffbc7d50
PKG_LICENSE:=GPL-2.0-only PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING PKG_LICENSE_FILES:=COPYING

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=linux-firmware PKG_NAME:=linux-firmware
PKG_VERSION:=20221109 PKG_VERSION:=20221109
PKG_RELEASE:=4 PKG_RELEASE:=5
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz

View file

@ -0,0 +1,23 @@
Package/ath11k-firmware-qca6390 = $(call Package/firmware-default,QCA6390 ath11k firmware)
define Package/ath11k-firmware-qca6390/install
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCA6390/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/QCA6390/hw2.0/* $(1)/lib/firmware/ath11k/QCA6390/hw2.0/
endef
$(eval $(call BuildPackage,ath11k-firmware-qca6390))
Package/ath11k-firmware-wcn6750 = $(call Package/firmware-default,WCN6750 ath11k firmware)
define Package/ath11k-firmware-wcn6750/install
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6750/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/* $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
endef
$(eval $(call BuildPackage,ath11k-firmware-wcn6750))
Package/ath11k-firmware-wcn6855 = $(call Package/firmware-default,WCN6855 ath11k firmware)
define Package/ath11k-firmware-wcn6855/install
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6855/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6855/hw2.0/* $(1)/lib/firmware/ath11k/WCN6855/hw2.0/
endef
$(eval $(call BuildPackage,ath11k-firmware-wcn6855))

View file

@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/ath10k-ct define KernelPackage/ath10k-ct
SUBMENU:=Wireless Drivers SUBMENU:=Wireless Drivers
TITLE:=ath10k-ct driver optimized for CT ath10k firmware TITLE:=ath10k-ct driver optimized for CT ath10k firmware
DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core
FILES:=\ FILES:=\
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
@ -111,8 +111,7 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
endif endif
define Build/Compile define Build/Compile
+$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \ +$(KERNEL_MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \ M="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules modules

View file

@ -99,8 +99,7 @@ define Package/nas/description
proprietary Broadcom wl driver. proprietary Broadcom wl driver.
endef endef
MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \ MAKE_KMOD := $(KERNEL_MAKE) \
$(KERNEL_MAKE_FLAGS) \
PATH="$(TARGET_PATH)" \ PATH="$(TARGET_PATH)" \
M="$(PKG_BUILD_DIR)/kmod" \ M="$(PKG_BUILD_DIR)/kmod" \

View file

@ -32,14 +32,8 @@ define KernelPackage/gpio-button-hotplug/description
an overkill for OpenWrt simple needs. an overkill for OpenWrt simple needs.
endef endef
MAKE_OPTS:= \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)"
define Build/Compile define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \ $(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
$(MAKE_OPTS) \
modules
endef endef
$(eval $(call KernelPackage,gpio-button-hotplug)) $(eval $(call KernelPackage,gpio-button-hotplug))

View file

@ -36,15 +36,11 @@ EXTRA_CFLAGS:= \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
MAKE_OPTS:= \ define Build/Compile
$(KERNEL_MAKE_FLAGS) \ $(KERNEL_MAKE) \
M="$(PKG_BUILD_DIR)" \ M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
$(EXTRA_KCONFIG) $(EXTRA_KCONFIG) \
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules modules
endef endef

View file

@ -19,8 +19,7 @@ define KernelPackage/hwmon-gsc/description
endef endef
define Build/Compile define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \ $(KERNEL_MAKE) \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \ M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(BUILDFLAGS)" \ EXTRA_CFLAGS="$(BUILDFLAGS)" \
modules modules

View file

@ -51,8 +51,7 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ +$(KERNEL_MAKE) $(PKG_JOBS) \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/$(MAKE_PATH)" \ M="$(PKG_BUILD_DIR)/$(MAKE_PATH)" \
modules modules
endef endef

View file

@ -0,0 +1,34 @@
#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=leds-ws2812b
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define KernelPackage/leds-ws2812b
SUBMENU:=LED modules
TITLE:=Worldsemi WS2812B (NeoPixel) LED support
FILES:= \
$(PKG_BUILD_DIR)/leds-ws2812b.ko
AUTOLOAD:=$(call AutoProbe,leds-ws2812b,1)
DEPENDS:=@TARGET_mediatek_filogic
endef
define KernelPackage/leds-ws2812b/description
LED support for driving WS2812B (NeoPixel) using SPI MOSI.
endef
define Build/Compile
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
endef
$(eval $(call KernelPackage,leds-ws2812b))

View file

@ -0,0 +1 @@
obj-m := leds-ws2812b.o

View file

@ -0,0 +1,233 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* WorldSemi WS2812B individually-addressable LED driver using SPI
*
* Copyright 2022 Chuanhong Guo <gch981213@gmail.com>
*
* This driver simulates WS2812B protocol using SPI MOSI pin. A one pulse
* is transferred as 3'b110 and a zero pulse is 3'b100. For this driver to
* work properly, the SPI frequency should be 2.105MHz~2.85MHz and it needs
* to transfer all the bytes continuously.
*/
#include <linux/led-class-multicolor.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/spi/spi.h>
#include <linux/mutex.h>
#define WS2812B_BYTES_PER_COLOR 3
#define WS2812B_NUM_COLORS 3
/* A continuous 0 for 50us+ as the 'reset' signal */
#define WS2812B_RESET_LEN 18
struct ws2812b_led {
struct led_classdev_mc mc_cdev;
struct mc_subled subled[WS2812B_NUM_COLORS];
int cascade;
};
struct ws2812b_priv {
struct led_classdev ldev;
struct spi_device *spi;
struct mutex mutex;
int num_leds;
size_t data_len;
u8 *data_buf;
struct ws2812b_led leds[];
};
/**
* ws2812b_set_byte - convert a byte of data to 3-byte SPI data for pulses
* @priv: pointer to the private data structure
* @offset: offset of the target byte in the data stream
* @val: 1-byte data to be set
*
* WS2812B receives a stream of bytes from DI, takes the first 3 byte as LED
* brightness and pases the rest to the next LED through the DO pin.
* This function assembles a single byte of data to the LED:
* A bit is represented with a pulse of specific length. A long pulse is a 1
* and a short pulse is a 0.
* SPI transfers data continuously, MSB first. We can send 3'b100 to create a
* 0 pulse and 3'b110 for a 1 pulse. In this way, a byte of data takes up 3
* bytes in a SPI transfer:
* 1x0 1x0 1x0 1x0 1x0 1x0 1x0 1x0
* Let's rearrange it in 8 bits:
* 1x01x01x 01x01x01 x01x01x0
* The higher 3 bits, middle 2 bits and lower 3 bits are represented with the
* 1st, 2nd and 3rd byte in the SPI transfer respectively.
* There are only 8 combinations for 3 bits and 4 for 2 bits, so we can create
* a lookup table for the 3 bytes.
* e.g. For 0x6b -> 2'b01101011:
* Bit 7-5: 3'b011 -> 10011011 -> 0x9b
* Bit 4-3: 2'b01 -> 01001101 -> 0x4d
* Bit 2-0: 3'b011 -> 00110110 -> 0x36
*/
static void ws2812b_set_byte(struct ws2812b_priv *priv, size_t offset, u8 val)
{
/* The lookup table for Bit 7-5 4-3 2-0 */
const u8 h3b[] = { 0x92, 0x93, 0x9a, 0x9b, 0xd2, 0xd3, 0xda, 0xdb };
const u8 m2b[] = { 0x49, 0x4d, 0x69, 0x6d };
const u8 l3b[] = { 0x24, 0x26, 0x34, 0x36, 0xa4, 0xa6, 0xb4, 0xb6 };
u8 *p = priv->data_buf + WS2812B_RESET_LEN + (offset * WS2812B_BYTES_PER_COLOR);
p[0] = h3b[val >> 5]; /* Bit 7-5 */
p[1] = m2b[(val >> 3) & 0x3]; /* Bit 4-3 */
p[2] = l3b[val & 0x7]; /* Bit 2-0 */
}
static int ws2812b_set(struct led_classdev *cdev,
enum led_brightness brightness)
{
struct led_classdev_mc *mc_cdev = lcdev_to_mccdev(cdev);
struct ws2812b_led *led =
container_of(mc_cdev, struct ws2812b_led, mc_cdev);
struct ws2812b_priv *priv = dev_get_drvdata(cdev->dev->parent);
int ret;
int i;
led_mc_calc_color_components(mc_cdev, brightness);
mutex_lock(&priv->mutex);
for (i = 0; i < WS2812B_NUM_COLORS; i++)
ws2812b_set_byte(priv, led->cascade * WS2812B_NUM_COLORS + i,
led->subled[i].brightness);
ret = spi_write(priv->spi, priv->data_buf, priv->data_len);
mutex_unlock(&priv->mutex);
return ret;
}
static int ws2812b_probe(struct spi_device *spi)
{
struct device *dev = &spi->dev;
int cur_led = 0;
struct ws2812b_priv *priv;
struct fwnode_handle *led_node;
int num_leds, i, cnt, ret;
num_leds = device_get_child_node_count(dev);
priv = devm_kzalloc(dev, struct_size(priv, leds, num_leds), GFP_KERNEL);
if (!priv)
return -ENOMEM;
priv->data_len =
num_leds * WS2812B_BYTES_PER_COLOR * WS2812B_NUM_COLORS +
WS2812B_RESET_LEN;
priv->data_buf = kzalloc(priv->data_len, GFP_KERNEL);
if (!priv->data_buf)
return -ENOMEM;
for (i = 0; i < num_leds * WS2812B_NUM_COLORS; i++)
ws2812b_set_byte(priv, i, 0);
mutex_init(&priv->mutex);
priv->num_leds = num_leds;
priv->spi = spi;
device_for_each_child_node(dev, led_node) {
struct led_init_data init_data = {
.fwnode = led_node,
};
/* WS2812B LEDs usually come with GRB color */
u32 color_idx[WS2812B_NUM_COLORS] = {
LED_COLOR_ID_GREEN,
LED_COLOR_ID_RED,
LED_COLOR_ID_BLUE,
};
u32 cascade;
ret = fwnode_property_read_u32(led_node, "reg", &cascade);
if (ret) {
dev_err(dev, "failed to obtain numerical LED index for %s",
fwnode_get_name(led_node));
goto ERR_UNREG_LEDS;
}
if (cascade >= num_leds) {
dev_err(dev, "LED index of %s is larger than the number of LEDs.",
fwnode_get_name(led_node));
ret = -EINVAL;
goto ERR_UNREG_LEDS;
}
cnt = fwnode_property_count_u32(led_node, "color-index");
if (cnt > 0 && cnt <= WS2812B_NUM_COLORS)
fwnode_property_read_u32_array(led_node, "color-index",
color_idx, (size_t)cnt);
priv->leds[cur_led].mc_cdev.subled_info =
priv->leds[cur_led].subled;
priv->leds[cur_led].mc_cdev.num_colors = WS2812B_NUM_COLORS;
priv->leds[cur_led].mc_cdev.led_cdev.max_brightness = 255;
priv->leds[cur_led].mc_cdev.led_cdev.brightness_set_blocking = ws2812b_set;
for (i = 0; i < WS2812B_NUM_COLORS; i++) {
priv->leds[cur_led].subled[i].color_index = color_idx[i];
priv->leds[cur_led].subled[i].intensity = 255;
}
priv->leds[cur_led].cascade = cascade;
ret = led_classdev_multicolor_register_ext(
dev, &priv->leds[cur_led].mc_cdev, &init_data);
if (ret) {
dev_err(dev, "registration of %s failed.",
fwnode_get_name(led_node));
goto ERR_UNREG_LEDS;
}
cur_led++;
}
spi_set_drvdata(spi, priv);
return 0;
ERR_UNREG_LEDS:
for (; cur_led >= 0; cur_led--)
led_classdev_multicolor_unregister(&priv->leds[cur_led].mc_cdev);
mutex_destroy(&priv->mutex);
kfree(priv->data_buf);
return ret;
}
static int ws2812b_remove(struct spi_device *spi)
{
struct ws2812b_priv *priv = spi_get_drvdata(spi);
int cur_led;
for (cur_led = priv->num_leds - 1; cur_led >= 0; cur_led--)
led_classdev_multicolor_unregister(&priv->leds[cur_led].mc_cdev);
kfree(priv->data_buf);
mutex_destroy(&priv->mutex);
return 0;
}
static const struct spi_device_id ws2812b_spi_ids[] = {
{ "ws2812b" },
{},
};
MODULE_DEVICE_TABLE(spi, ws2812b_spi_ids);
static const struct of_device_id ws2812b_dt_ids[] = {
{ .compatible = "worldsemi,ws2812b" },
{},
};
MODULE_DEVICE_TABLE(of, ws2812b_dt_ids);
static struct spi_driver ws2812b_driver = {
.probe = ws2812b_probe,
.remove = ws2812b_remove,
.id_table = ws2812b_spi_ids,
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = ws2812b_dt_ids,
},
};
module_spi_driver(ws2812b_driver);
MODULE_AUTHOR("Chuanhong Guo <gch981213@gmail.com>");
MODULE_DESCRIPTION("WS2812B LED driver using SPI");
MODULE_LICENSE("GPL");

View file

@ -152,13 +152,15 @@ define KernelPackage/lib-lz4
DEPENDS:=+kmod-crypto-acompress DEPENDS:=+kmod-crypto-acompress
KCONFIG:= \ KCONFIG:= \
CONFIG_CRYPTO_LZ4 \ CONFIG_CRYPTO_LZ4 \
CONFIG_CRYPTO_LZ4HC \
CONFIG_LZ4_COMPRESS \ CONFIG_LZ4_COMPRESS \
CONFIG_LZ4_DECOMPRESS CONFIG_LZ4_DECOMPRESS
FILES:= \ FILES:= \
$(LINUX_DIR)/crypto/lz4.ko \ $(LINUX_DIR)/crypto/lz4.ko \
$(LINUX_DIR)/lib/lz4/lz4_compress.ko \ $(LINUX_DIR)/lib/lz4/lz4_compress.ko \
$(LINUX_DIR)/lib/lz4/lz4hc_compress.ko \
$(LINUX_DIR)/lib/lz4/lz4_decompress.ko $(LINUX_DIR)/lib/lz4/lz4_decompress.ko
AUTOLOAD:=$(call AutoProbe,lz4 lz4_compress lz4_decompress) AUTOLOAD:=$(call AutoProbe,lz4 lz4_compress lz4hc_compress lz4_decompress)
endef endef
define KernelPackage/lib-lz4/description define KernelPackage/lib-lz4/description

View file

@ -1438,3 +1438,67 @@ define KernelPackage/netconsole/description
endef endef
$(eval $(call KernelPackage,netconsole)) $(eval $(call KernelPackage,netconsole))
define KernelPackage/qrtr
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=Qualcomm IPC Router support
HIDDEN:=1
DEPENDS:=@!LINUX_5_10
KCONFIG:=CONFIG_QRTR
FILES:= \
$(LINUX_DIR)/net/qrtr/qrtr.ko \
$(LINUX_DIR)/net/qrtr/ns.ko
AUTOLOAD:=$(call AutoProbe,qrtr)
endef
define KernelPackage/qrtr/description
Qualcomm IPC Router support
endef
$(eval $(call KernelPackage,qrtr))
define KernelPackage/qrtr-tun
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=TUN device for Qualcomm IPC Router
DEPENDS:=+kmod-qrtr
KCONFIG:=CONFIG_QRTR_TUN
FILES:= $(LINUX_DIR)/net/qrtr/qrtr-tun.ko
AUTOLOAD:=$(call AutoProbe,qrtr-tun)
endef
define KernelPackage/qrtr-tun/description
TUN device for Qualcomm IPC Router
endef
$(eval $(call KernelPackage,qrtr-tun))
define KernelPackage/qrtr-smd
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=SMD IPC Router channels
DEPENDS:=+kmod-qrtr @TARGET_ipq807x
KCONFIG:=CONFIG_QRTR_SMD
FILES:= $(LINUX_DIR)/net/qrtr/qrtr-smd.ko
AUTOLOAD:=$(call AutoProbe,qrtr-smd)
endef
define KernelPackage/qrtr-smd/description
SMD IPC Router channels
endef
$(eval $(call KernelPackage,qrtr-smd))
define KernelPackage/qrtr-mhi
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=MHI IPC Router channels
DEPENDS:=+kmod-mhi-bus +kmod-qrtr
KCONFIG:=CONFIG_QRTR_MHI
FILES:= $(LINUX_DIR)/net/qrtr/qrtr-mhi.ko
AUTOLOAD:=$(call AutoProbe,qrtr-mhi)
endef
define KernelPackage/qrtr-mhi/description
MHI IPC Router channels
endef
$(eval $(call KernelPackage,qrtr-mhi))

View file

@ -1010,6 +1010,10 @@ define KernelPackage/zram/config
bool "lz4" bool "lz4"
select PACKAGE_kmod-lib-lz4 select PACKAGE_kmod-lib-lz4
config ZRAM_DEF_COMP_LZ4HC
bool "lz4-hc"
select PACKAGE_kmod-lib-lz4hc
config ZRAM_DEF_COMP_ZSTD config ZRAM_DEF_COMP_ZSTD
bool "zstd" bool "zstd"
select PACKAGE_kmod-lib-zstd select PACKAGE_kmod-lib-zstd

View file

@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211 PKG_NAME:=mac80211
PKG_VERSION:=6.1-rc8 PKG_VERSION:=6.1-rc8
PKG_RELEASE:=1 PKG_RELEASE:=2
# PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/ # PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
PKG_HASH:=7f3d96c2573183cd79d6a3ebe5e1b7b73c19d1326d443c85b69c4181f14e6e2b PKG_HASH:=7f3d96c2573183cd79d6a3ebe5e1b7b73c19d1326d443c85b69c4181f14e6e2b
@ -163,7 +163,7 @@ endef
define KernelPackage/mac80211-hwsim define KernelPackage/mac80211-hwsim
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=mac80211 HW simulation device TITLE:=mac80211 HW simulation device
DEPENDS+= +kmod-mac80211 +@DRIVER_11AX_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT DEPENDS+= +kmod-mac80211 +@DRIVER_11AX_SUPPORT +@DRIVER_11AC_SUPPORT
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
endef endef
@ -172,7 +172,7 @@ endef
define KernelPackage/mt7601u define KernelPackage/mt7601u
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=MT7601U-based USB dongles Wireless Driver TITLE:=MT7601U-based USB dongles Wireless Driver
DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware DEPENDS+= +kmod-mac80211 @USB_SUPPORT +kmod-usb-core +mt7601u-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
AUTOLOAD:=$(call AutoProbe,mt7601u) AUTOLOAD:=$(call AutoProbe,mt7601u)
endef endef
@ -180,7 +180,7 @@ endef
define KernelPackage/rsi91x define KernelPackage/rsi91x
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Redpine Signals Inc 91x WLAN driver support TITLE:=Redpine Signals Inc 91x WLAN driver support
DEPENDS+= +kmod-mac80211 +rs9113-firmware +@DRIVER_11N_SUPPORT DEPENDS+= +kmod-mac80211 +rs9113-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko
endef endef
@ -204,7 +204,7 @@ endef
define KernelPackage/wlcore define KernelPackage/wlcore
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=TI common driver part TITLE:=TI common driver part
DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT DEPENDS+= +kmod-mmc +kmod-mac80211
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
@ -307,6 +307,7 @@ define Build/Prepare
$(PKG_BUILD_DIR)/include/linux/crc8.h \ $(PKG_BUILD_DIR)/include/linux/crc8.h \
$(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \ $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
$(PKG_BUILD_DIR)/include/linux/wl12xx.h \ $(PKG_BUILD_DIR)/include/linux/wl12xx.h \
$(PKG_BUILD_DIR)/include/linux/mhi.h \
$(PKG_BUILD_DIR)/include/net/ieee80211.h \ $(PKG_BUILD_DIR)/include/net/ieee80211.h \
$(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h

View file

@ -1,6 +1,6 @@
PKG_DRIVERS += \ PKG_DRIVERS += \
ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k ath10k-smallbuffers \ ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k ath10k-smallbuffers \
carl9170 owl-loader ar5523 wil6210 ath11k ath11k-pci carl9170 owl-loader ar5523 wil6210
PKG_CONFIG_DEPENDS += \ PKG_CONFIG_DEPENDS += \
CONFIG_PACKAGE_ATH_DEBUG \ CONFIG_PACKAGE_ATH_DEBUG \
@ -12,6 +12,7 @@ PKG_CONFIG_DEPENDS += \
CONFIG_ATH9K_TX99 \ CONFIG_ATH9K_TX99 \
CONFIG_ATH10K_LEDS \ CONFIG_ATH10K_LEDS \
CONFIG_ATH10K_THERMAL \ CONFIG_ATH10K_THERMAL \
CONFIG_ATH11K_THERMAL \
CONFIG_ATH_USER_REGD CONFIG_ATH_USER_REGD
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
@ -19,6 +20,7 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
ATH9K_DEBUGFS \ ATH9K_DEBUGFS \
ATH9K_HTC_DEBUGFS \ ATH9K_HTC_DEBUGFS \
ATH10K_DEBUGFS \ ATH10K_DEBUGFS \
ATH11K_DEBUGFS \
CARL9170_DEBUGFS \ CARL9170_DEBUGFS \
ATH5K_DEBUG \ ATH5K_DEBUG \
ATH6KL_DEBUG \ ATH6KL_DEBUG \
@ -28,6 +30,7 @@ endif
ifdef CONFIG_PACKAGE_MAC80211_TRACING ifdef CONFIG_PACKAGE_MAC80211_TRACING
config-y += \ config-y += \
ATH10K_TRACING \ ATH10K_TRACING \
ATH11K_TRACING \
ATH6KL_TRACING \ ATH6KL_TRACING \
ATH_TRACEPOINTS \ ATH_TRACEPOINTS \
ATH5K_TRACER \ ATH5K_TRACER \
@ -35,9 +38,9 @@ ifdef CONFIG_PACKAGE_MAC80211_TRACING
endif endif
config-$(call config_package,ath) += ATH_CARDS ATH_COMMON config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH11K_DEBUG ATH9K_STATION_STATISTICS
config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL ATH11K_SPECTRAL
config-$(CONFIG_PACKAGE_ATH_DYNACK) += ATH9K_DYNACK config-$(CONFIG_PACKAGE_ATH_DYNACK) += ATH9K_DYNACK
config-$(call config_package,ath9k) += ATH9K config-$(call config_package,ath9k) += ATH9K
config-$(call config_package,ath9k-common) += ATH9K_COMMON config-$(call config_package,ath9k-common) += ATH9K_COMMON
@ -52,10 +55,13 @@ config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
config-$(CONFIG_ATH11K_THERMAL) += ATH11K_THERMAL
config-$(call config_package,ath9k-htc) += ATH9K_HTC config-$(call config_package,ath9k-htc) += ATH9K_HTC
config-$(call config_package,ath10k) += ATH10K ATH10K_PCI config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
config-$(call config_package,ath10k-smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS config-$(call config_package,ath10k-smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS
config-$(call config_package,ath11k) += ATH11K
config-$(call config_package,ath11k-pci) += ATH11K_PCI
config-$(call config_package,ath5k) += ATH5K config-$(call config_package,ath5k) += ATH5K
ifdef CONFIG_TARGET_ath25 ifdef CONFIG_TARGET_ath25
@ -154,7 +160,7 @@ define KernelPackage/ath6kl
TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb) TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb)
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
HIDDEN:=1 HIDDEN:=1
DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT DEPENDS+= +kmod-ath
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko
endef endef
@ -191,7 +197,7 @@ define KernelPackage/ath9k-common
TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
HIDDEN:=1 HIDDEN:=1
DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +kmod-random-core
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
@ -255,7 +261,7 @@ define KernelPackage/ath10k
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Atheros 802.11ac wireless cards support TITLE:=Atheros 802.11ac wireless cards support
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k
DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT \ DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11AC_SUPPORT \
+ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal +ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
@ -290,10 +296,47 @@ define KernelPackage/ath10k-smallbuffers
VARIANT:=smallbuffers VARIANT:=smallbuffers
endef endef
define KernelPackage/ath11k
$(call KernelPackage/mac80211/Default)
TITLE:=Qualcomm 802.11ax wireless chipset support (common code)
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
DEPENDS+= +kmod-ath +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT \
+kmod-crypto-michael-mic +ATH11K_THERMAL:kmod-hwmon-core +ATH11K_THERMAL:kmod-thermal
FILES:=$(PKG_BUILD_DIR)/drivers/soc/qcom/qmi_helpers.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k.ko
endef
define KernelPackage/ath11k/description
This module adds support for Qualcomm Technologies 802.11ax family of
chipsets.
endef
define KernelPackage/ath11k/config
config ATH11K_THERMAL
bool "Enable thermal sensors and throttling support"
depends on PACKAGE_kmod-ath11k
endef
define KernelPackage/ath11k-pci
$(call KernelPackage/mac80211/Default)
TITLE:=Qualcomm 802.11ax PCI wireless chipset support
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
DEPENDS+= @PCI_SUPPORT +kmod-qrtr-mhi +kmod-ath11k
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k_pci.ko
AUTOLOAD:=$(call AutoProbe,ath11k_pci)
endef
define KernelPackage/ath11k-pci/description
This module adds support for Qualcomm Technologies 802.11ax family of
chipsets with PCI bus.
endef
define KernelPackage/carl9170 define KernelPackage/carl9170
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Driver for Atheros AR9170 USB sticks TITLE:=Driver for Atheros AR9170 USB sticks
DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +carl9170-firmware DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +carl9170-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko
AUTOLOAD:=$(call AutoProbe,carl9170) AUTOLOAD:=$(call AutoProbe,carl9170)
endef endef

View file

@ -381,7 +381,7 @@ define KernelPackage/brcmsmac
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +!TARGET_bcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil +!BRCMSMAC_USE_FW_FROM_WL:brcmsmac-firmware DEPENDS+= +kmod-mac80211 +!TARGET_bcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil +!BRCMSMAC_USE_FW_FROM_WL:brcmsmac-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcmsmac.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcmsmac.ko
AUTOLOAD:=$(call AutoProbe,brcmsmac) AUTOLOAD:=$(call AutoProbe,brcmsmac)
MENU:=1 MENU:=1
@ -413,7 +413,7 @@ define KernelPackage/brcmfmac
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT \ DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11AC_SUPPORT \
+kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \ +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \
+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb +BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko

View file

@ -167,6 +167,10 @@ detect_mac80211() {
path="$(iwinfo nl80211 path "$dev")" path="$(iwinfo nl80211 path "$dev")"
macaddr="$(cat /sys/class/ieee80211/${dev}/macaddress)" macaddr="$(cat /sys/class/ieee80211/${dev}/macaddress)"
# work around phy rename related race condition
[ -n "$path" -o -n "$macaddr" ] || continue
board_dev= board_dev=
fallback_board_dev= fallback_board_dev=
json_for_each_item check_board_phy wlan json_for_each_item check_board_phy wlan

View file

@ -6,7 +6,7 @@ config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
define KernelPackage/iwlwifi define KernelPackage/iwlwifi
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT
TITLE:=Intel AGN Wireless support TITLE:=Intel AGN Wireless support
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \

View file

@ -9,7 +9,7 @@ define KernelPackage/mwl8k
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwl8k URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwl8k
DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +mwl8k-firmware DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +mwl8k-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwl8k.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwl8k.ko
AUTOLOAD:=$(call AutoProbe,mwl8k) AUTOLOAD:=$(call AutoProbe,mwl8k)
endef endef
@ -23,7 +23,7 @@ define KernelPackage/mwifiex-pcie
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards
URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwifiex URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwifiex
DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +mwifiex-pcie-firmware DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11AC_SUPPORT +mwifiex-pcie-firmware
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko
@ -38,7 +38,7 @@ define KernelPackage/mwifiex-sdio
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Driver for Marvell 802.11n/802.11ac SDIO Wireless cards TITLE:=Driver for Marvell 802.11n/802.11ac SDIO Wireless cards
URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwifiex URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwifiex
DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +mwifiex-sdio-firmware DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11AC_SUPPORT +mwifiex-sdio-firmware
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_sdio.ko $(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_sdio.ko

View file

@ -0,0 +1,78 @@
From 81e60b2dfb2744ab6642c4aa62534b4f711fdc5d Mon Sep 17 00:00:00 2001
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
Date: Tue, 27 Sep 2022 09:18:54 +0300
Subject: [PATCH] wifi: ath11k: stop tx queues immediately upon firmware exit
Currently, recovery flag is set immediately upon firmware
exit but tx queues are stopped once firmware arrives back
and is ready which is during ath11k_core_restart. Once
ieee80211 hw restart is completed, tx queues are resumed.
If during the time delta between firmware exit and firmware
ready, mac80211 send packets, currently ath11k will drop it
since recovery flag will be set. But warning prints will
come -
"ath11k c000000.wifi: failed to transmit frame -108"
If more tx packets are there, this could lead to flooding
of above print.
However, actually tx queues should be stopped immediately
when firmware leaves. This will prevent packets to get
dropped when firmware is recovering.
Add fix to stop tx queues immediately after firmware exit.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220923170235.18873-1-quic_adisi@quicinc.com
---
drivers/net/wireless/ath/ath11k/core.c | 5 +----
drivers/net/wireless/ath/ath11k/core.h | 1 +
drivers/net/wireless/ath/ath11k/qmi.c | 3 +++
3 files changed, 5 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -1641,7 +1641,7 @@ static void ath11k_update_11d(struct wor
}
}
-static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
+void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
{
struct ath11k *ar;
struct ath11k_pdev *pdev;
@@ -1730,9 +1730,6 @@ static void ath11k_core_restart(struct w
struct ath11k_base *ab = container_of(work, struct ath11k_base, restart_work);
int ret;
- if (!ab->is_reset)
- ath11k_core_pre_reconfigure_recovery(ab);
-
ret = ath11k_core_reconfigure_on_crash(ab);
if (ret) {
ath11k_err(ab, "failed to reconfigure driver on crash recovery\n");
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -1157,6 +1157,7 @@ int ath11k_core_check_smbios(struct ath1
void ath11k_core_halt(struct ath11k *ar);
int ath11k_core_resume(struct ath11k_base *ab);
int ath11k_core_suspend(struct ath11k_base *ab);
+void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
const char *filename);
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -3158,6 +3158,9 @@ static void ath11k_qmi_driver_event_work
case ATH11K_QMI_EVENT_SERVER_EXIT:
set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags);
set_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags);
+
+ if (!ab->is_reset)
+ ath11k_core_pre_reconfigure_recovery(ab);
break;
case ATH11K_QMI_EVENT_REQUEST_MEM:
ret = ath11k_qmi_event_mem_request(qmi);

View file

@ -0,0 +1,45 @@
From 45d2e268369b0c768d5a644f319758bcfd370521 Mon Sep 17 00:00:00 2001
From: Baochen Qiang <quic_bqiang@quicinc.com>
Date: Wed, 28 Sep 2022 09:51:40 +0800
Subject: [PATCH] wifi: ath11k: Don't exit on wakeup failure
Currently, ath11k_pcic_read() returns an error if wakeup()
fails, this makes firmware crash debug quite hard because we can
get nothing.
Change to go ahead on wakeup failure, in that case we still may
get something valid to check. There should be no mislead due
to incorrect content because we are aware of the failure with the
log printed.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220928015140.5431-1-quic_bqiang@quicinc.com
---
drivers/net/wireless/ath/ath11k/pcic.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/pcic.c
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
@@ -218,9 +218,16 @@ int ath11k_pcic_read(struct ath11k_base
if (wakeup_required && ab->pci.ops->wakeup) {
ret = ab->pci.ops->wakeup(ab);
if (ret) {
- ath11k_warn(ab, "failed to wakeup for read from 0x%x: %d\n",
- start, ret);
- return ret;
+ ath11k_warn(ab,
+ "wakeup failed, data may be invalid: %d",
+ ret);
+ /* Even though wakeup() failed, continue processing rather
+ * than returning because some parts of the data may still
+ * be valid and useful in some cases, e.g. could give us
+ * some clues on firmware crash.
+ * Mislead due to invalid data could be avoided because we
+ * are aware of the wakeup failure.
+ */
}
}

View file

@ -0,0 +1,139 @@
From f74878433d5ade360447da5d92e9c2e535780d80 Mon Sep 17 00:00:00 2001
From: Wen Gong <quic_wgong@quicinc.com>
Date: Wed, 28 Sep 2022 03:38:32 -0400
Subject: [PATCH] wifi: ath11k: fix warning in dma_free_coherent() of memory
chunks while recovery
Commit 26f3a021b37c ("ath11k: allocate smaller chunks of memory for
firmware") and commit f6f92968e1e5 ("ath11k: qmi: try to allocate a
big block of DMA memory first") change ath11k to allocate the memory
chunks for target twice while wlan load. It fails for the 1st time
because of large memory and then changed to allocate many small chunks
for the 2nd time sometimes as below log.
1st time failed:
[10411.640620] ath11k_pci 0000:05:00.0: qmi firmware request memory request
[10411.640625] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 6881280
[10411.640630] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 3784704
[10411.640658] ath11k_pci 0000:05:00.0: qmi dma allocation failed (6881280 B type 1), will try later with small size
[10411.640671] ath11k_pci 0000:05:00.0: qmi delays mem_request 2
[10411.640677] ath11k_pci 0000:05:00.0: qmi respond memory request delayed 1
2nd time success:
[10411.642004] ath11k_pci 0000:05:00.0: qmi firmware request memory request
[10411.642008] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642012] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642014] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642016] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642018] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642020] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642022] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642024] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642027] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642029] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
[10411.642031] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 458752
[10411.642033] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 131072
[10411.642035] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 524288
[10411.642037] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 524288
[10411.642039] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 524288
[10411.642041] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 524288
[10411.642043] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 524288
[10411.642045] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 524288
[10411.642047] ath11k_pci 0000:05:00.0: qmi mem seg type 4 size 491520
[10411.642049] ath11k_pci 0000:05:00.0: qmi mem seg type 1 size 524288
And then commit 5962f370ce41 ("ath11k: Reuse the available memory after
firmware reload") skip the ath11k_qmi_free_resource() which frees the
memory chunks while recovery, after that, when run recovery test on
WCN6855, a warning happened every time as below and finally leads fail
for recovery.
[ 159.570318] BUG: Bad page state in process kworker/u16:5 pfn:33300
[ 159.570320] page:0000000096ffdbb9 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33300
[ 159.570324] flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff)
[ 159.570329] raw: 000fffffc0000000 0000000000000000 dead000000000122 0000000000000000
[ 159.570332] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[ 159.570334] page dumped because: nonzero _refcount
[ 159.570440] firewire_ohci syscopyarea sysfillrect psmouse sdhci_pci ahci sysimgblt firewire_core fb_sys_fops libahci crc_itu_t cqhci drm sdhci e1000e wmi video
[ 159.570460] CPU: 2 PID: 217 Comm: kworker/u16:5 Kdump: loaded Tainted: G B 5.19.0-rc1-wt-ath+ #3
[ 159.570465] Hardware name: LENOVO 418065C/418065C, BIOS 83ET63WW (1.33 ) 07/29/2011
[ 159.570467] Workqueue: qmi_msg_handler qmi_data_ready_work [qmi_helpers]
[ 159.570475] Call Trace:
[ 159.570476] <TASK>
[ 159.570478] dump_stack_lvl+0x49/0x5f
[ 159.570486] dump_stack+0x10/0x12
[ 159.570493] bad_page+0xab/0xf0
[ 159.570502] check_free_page_bad+0x66/0x70
[ 159.570511] __free_pages_ok+0x530/0x9a0
[ 159.570517] ? __dev_printk+0x58/0x6b
[ 159.570525] ? _dev_printk+0x56/0x72
[ 159.570534] ? qmi_decode+0x119/0x470 [qmi_helpers]
[ 159.570543] __free_pages+0x91/0xd0
[ 159.570548] dma_free_contiguous+0x50/0x60
[ 159.570556] dma_direct_free+0xe5/0x140
[ 159.570564] dma_free_attrs+0x35/0x50
[ 159.570570] ath11k_qmi_msg_mem_request_cb+0x2ae/0x3c0 [ath11k]
[ 159.570620] qmi_invoke_handler+0xac/0xe0 [qmi_helpers]
[ 159.570630] qmi_handle_message+0x6d/0x180 [qmi_helpers]
[ 159.570643] qmi_data_ready_work+0x2ca/0x440 [qmi_helpers]
[ 159.570656] process_one_work+0x227/0x440
[ 159.570667] worker_thread+0x31/0x3d0
[ 159.570676] ? process_one_work+0x440/0x440
[ 159.570685] kthread+0xfe/0x130
[ 159.570692] ? kthread_complete_and_exit+0x20/0x20
[ 159.570701] ret_from_fork+0x22/0x30
[ 159.570712] </TASK>
The reason is because when wlan start to recovery, the type, size and
count is not same for the 1st and 2nd QMI_WLFW_REQUEST_MEM_IND message,
Then it leads the parameter size is not correct for the dma_free_coherent().
For the chunk[1], the actual dma size is 524288 which allocate in the
2nd time of the initial wlan load phase, and the size which pass to
dma_free_coherent() is 3784704 which is got in the 1st time of recovery
phase, then warning above happened.
Change to use prev_size of struct target_mem_chunk for the paramter of
dma_free_coherent() since prev_size is the real size of last load/recovery.
Also change to check both type and size of struct target_mem_chunk to
reuse the memory to avoid mismatch buffer size for target. Then the
warning disappear and recovery success. When the 1st QMI_WLFW_REQUEST_MEM_IND
for recovery arrived, the trunk[0] is freed in ath11k_qmi_alloc_target_mem_chunk()
and then dma_alloc_coherent() failed caused by large size, and then
trunk[1] is freed in ath11k_qmi_free_target_mem_chunk(), the left 18
trunks will be reuse for the 2nd QMI_WLFW_REQUEST_MEM_IND message.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
Fixes: 5962f370ce41 ("ath11k: Reuse the available memory after firmware reload")
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220928073832.16251-1-quic_wgong@quicinc.com
---
drivers/net/wireless/ath/ath11k/qmi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -1961,7 +1961,7 @@ static void ath11k_qmi_free_target_mem_c
continue;
dma_free_coherent(ab->dev,
- ab->qmi.target_mem[i].size,
+ ab->qmi.target_mem[i].prev_size,
ab->qmi.target_mem[i].vaddr,
ab->qmi.target_mem[i].paddr);
ab->qmi.target_mem[i].vaddr = NULL;
@@ -1982,12 +1982,12 @@ static int ath11k_qmi_alloc_target_mem_c
* in such case, no need to allocate memory for FW again.
*/
if (chunk->vaddr) {
- if (chunk->prev_type == chunk->type ||
+ if (chunk->prev_type == chunk->type &&
chunk->prev_size == chunk->size)
continue;
/* cannot reuse the existing chunk */
- dma_free_coherent(ab->dev, chunk->size,
+ dma_free_coherent(ab->dev, chunk->prev_size,
chunk->vaddr, chunk->paddr);
chunk->vaddr = NULL;
}

View file

@ -0,0 +1,25 @@
From a797f479bf3e02c6d179c2e6aeace7f9b22b0acd Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.i.king@gmail.com>
Date: Wed, 28 Sep 2022 15:38:34 +0100
Subject: [PATCH] wifi: ath11k: Fix spelling mistake "chnange" -> "change"
There is a spelling mistake in an ath11k_dbg debug message. Fix it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220928143834.35189-1-colin.i.king@gmail.com
---
drivers/net/wireless/ath/ath11k/wmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -6829,7 +6829,7 @@ static void ath11k_wmi_event_peer_sta_ps
}
ath11k_dbg(ab, ATH11K_DBG_WMI,
- "peer sta ps chnange ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n",
+ "peer sta ps change ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n",
ev->peer_macaddr.addr, ev->peer_ps_state,
ev->ps_supported_bitmap, ev->peer_ps_valid,
ev->peer_ps_timestamp);

View file

@ -0,0 +1,225 @@
From 3ff51d7416ee1ea2d771051a0ffa1ec8be054768 Mon Sep 17 00:00:00 2001
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
Date: Wed, 5 Oct 2022 15:24:30 +0530
Subject: [PATCH 6/9] wifi: ath11k: fix firmware assert during bandwidth change
for peer sta
Currently, ath11k sends peer assoc command for each peer to
firmware when bandwidth changes. Peer assoc command is a
bulky command and if many clients are connected, this could
lead to firmware buffer getting overflowed leading to a firmware
assert.
However, during bandwidth change, only phymode and bandwidth
also can be updated by WMI set peer param command. This makes
the overall command light when compared to peer assoc and for
multi-client cases, firmware buffer overflow also does not
occur.
Remove sending peer assoc command during sta bandwidth change
and instead add sending WMI set peer param command for phymode
and bandwidth.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Fixes: f187fe8e3bc65 ("ath11k: fix firmware crash during channel switch")
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221005095430.19890-1-quic_adisi@quicinc.com
---
drivers/net/wireless/ath/ath11k/core.h | 2 +
drivers/net/wireless/ath/ath11k/mac.c | 122 +++++++++++++++++--------
2 files changed, 87 insertions(+), 37 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -505,6 +505,8 @@ struct ath11k_sta {
u64 ps_start_jiffies;
u64 ps_total_duration;
bool peer_current_ps_valid;
+
+ u32 bw_prev;
};
#define ATH11K_MIN_5G_FREQ 4150
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -4215,10 +4215,11 @@ static void ath11k_sta_rc_update_wk(stru
const u8 *ht_mcs_mask;
const u16 *vht_mcs_mask;
const u16 *he_mcs_mask;
- u32 changed, bw, nss, smps;
+ u32 changed, bw, nss, smps, bw_prev;
int err, num_vht_rates, num_he_rates;
const struct cfg80211_bitrate_mask *mask;
struct peer_assoc_params peer_arg;
+ enum wmi_phy_mode peer_phymode;
arsta = container_of(wk, struct ath11k_sta, update_wk);
sta = container_of((void *)arsta, struct ieee80211_sta, drv_priv);
@@ -4239,6 +4240,7 @@ static void ath11k_sta_rc_update_wk(stru
arsta->changed = 0;
bw = arsta->bw;
+ bw_prev = arsta->bw_prev;
nss = arsta->nss;
smps = arsta->smps;
@@ -4252,26 +4254,57 @@ static void ath11k_sta_rc_update_wk(stru
ath11k_mac_max_he_nss(he_mcs_mask)));
if (changed & IEEE80211_RC_BW_CHANGED) {
- /* Send peer assoc command before set peer bandwidth param to
- * avoid the mismatch between the peer phymode and the peer
- * bandwidth.
- */
- ath11k_peer_assoc_prepare(ar, arvif->vif, sta, &peer_arg, true);
+ /* Get the peer phymode */
+ ath11k_peer_assoc_h_phymode(ar, arvif->vif, sta, &peer_arg);
+ peer_phymode = peer_arg.peer_phymode;
+
+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac update sta %pM peer bw %d phymode %d\n",
+ sta->addr, bw, peer_phymode);
+
+ if (bw > bw_prev) {
+ /* BW is upgraded. In this case we send WMI_PEER_PHYMODE
+ * followed by WMI_PEER_CHWIDTH
+ */
+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac BW upgrade for sta %pM new BW %d, old BW %d\n",
+ sta->addr, bw, bw_prev);
+
+ err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id,
+ WMI_PEER_PHYMODE, peer_phymode);
+
+ if (err) {
+ ath11k_warn(ar->ab, "failed to update STA %pM peer phymode %d: %d\n",
+ sta->addr, peer_phymode, err);
+ goto err_rc_bw_changed;
+ }
- peer_arg.is_assoc = false;
- err = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
- if (err) {
- ath11k_warn(ar->ab, "failed to send peer assoc for STA %pM vdev %i: %d\n",
- sta->addr, arvif->vdev_id, err);
- } else if (wait_for_completion_timeout(&ar->peer_assoc_done, 1 * HZ)) {
err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id,
WMI_PEER_CHWIDTH, bw);
+
if (err)
ath11k_warn(ar->ab, "failed to update STA %pM peer bw %d: %d\n",
sta->addr, bw, err);
} else {
- ath11k_warn(ar->ab, "failed to get peer assoc conf event for %pM vdev %i\n",
- sta->addr, arvif->vdev_id);
+ /* BW is downgraded. In this case we send WMI_PEER_CHWIDTH
+ * followed by WMI_PEER_PHYMODE
+ */
+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac BW downgrade for sta %pM new BW %d,old BW %d\n",
+ sta->addr, bw, bw_prev);
+
+ err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id,
+ WMI_PEER_CHWIDTH, bw);
+
+ if (err) {
+ ath11k_warn(ar->ab, "failed to update STA %pM peer bw %d: %d\n",
+ sta->addr, bw, err);
+ goto err_rc_bw_changed;
+ }
+
+ err = ath11k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id,
+ WMI_PEER_PHYMODE, peer_phymode);
+
+ if (err)
+ ath11k_warn(ar->ab, "failed to update STA %pM peer phymode %d: %d\n",
+ sta->addr, peer_phymode, err);
}
}
@@ -4352,6 +4385,7 @@ static void ath11k_sta_rc_update_wk(stru
}
}
+err_rc_bw_changed:
mutex_unlock(&ar->conf_mutex);
}
@@ -4505,6 +4539,34 @@ exit:
return ret;
}
+static u32 ath11k_mac_ieee80211_sta_bw_to_wmi(struct ath11k *ar,
+ struct ieee80211_sta *sta)
+{
+ u32 bw = WMI_PEER_CHWIDTH_20MHZ;
+
+ switch (sta->deflink.bandwidth) {
+ case IEEE80211_STA_RX_BW_20:
+ bw = WMI_PEER_CHWIDTH_20MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_40:
+ bw = WMI_PEER_CHWIDTH_40MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_80:
+ bw = WMI_PEER_CHWIDTH_80MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_160:
+ bw = WMI_PEER_CHWIDTH_160MHZ;
+ break;
+ default:
+ ath11k_warn(ar->ab, "Invalid bandwidth %d for %pM\n",
+ sta->deflink.bandwidth, sta->addr);
+ bw = WMI_PEER_CHWIDTH_20MHZ;
+ break;
+ }
+
+ return bw;
+}
+
static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
@@ -4590,6 +4652,12 @@ static int ath11k_mac_op_sta_state(struc
if (ret)
ath11k_warn(ar->ab, "Failed to associate station: %pM\n",
sta->addr);
+
+ spin_lock_bh(&ar->data_lock);
+ /* Set arsta bw and prev bw */
+ arsta->bw = ath11k_mac_ieee80211_sta_bw_to_wmi(ar, sta);
+ arsta->bw_prev = arsta->bw;
+ spin_unlock_bh(&ar->data_lock);
} else if (old_state == IEEE80211_STA_ASSOC &&
new_state == IEEE80211_STA_AUTHORIZED) {
spin_lock_bh(&ar->ab->base_lock);
@@ -4713,28 +4781,8 @@ static void ath11k_mac_op_sta_rc_update(
spin_lock_bh(&ar->data_lock);
if (changed & IEEE80211_RC_BW_CHANGED) {
- bw = WMI_PEER_CHWIDTH_20MHZ;
-
- switch (sta->deflink.bandwidth) {
- case IEEE80211_STA_RX_BW_20:
- bw = WMI_PEER_CHWIDTH_20MHZ;
- break;
- case IEEE80211_STA_RX_BW_40:
- bw = WMI_PEER_CHWIDTH_40MHZ;
- break;
- case IEEE80211_STA_RX_BW_80:
- bw = WMI_PEER_CHWIDTH_80MHZ;
- break;
- case IEEE80211_STA_RX_BW_160:
- bw = WMI_PEER_CHWIDTH_160MHZ;
- break;
- default:
- ath11k_warn(ar->ab, "Invalid bandwidth %d in rc update for %pM\n",
- sta->deflink.bandwidth, sta->addr);
- bw = WMI_PEER_CHWIDTH_20MHZ;
- break;
- }
-
+ bw = ath11k_mac_ieee80211_sta_bw_to_wmi(ar, sta);
+ arsta->bw_prev = arsta->bw;
arsta->bw = bw;
}

View file

@ -0,0 +1,52 @@
From 638b26652b0438563a76ec90014c8cba34db982b Mon Sep 17 00:00:00 2001
From: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Date: Thu, 6 Oct 2022 06:28:42 +0530
Subject: [PATCH 7/9] wifi: ath11k: suppress add interface error
In the VIF (other than monitor type) creation request, we should not
throw the error code when the monitor VIF creation fails, since the
actual VIF creation succeeds. If we throw the error code from driver
then the actual VIF creation get fail. So suppress the monitor VIF
creation error by throwing warning message instead of error code.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.6.0.1-00760-QCAHKSWPL_SILICONZ-1
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221006005842.8599-1-quic_periyasa@quicinc.com
---
drivers/net/wireless/ath/ath11k/mac.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6421,18 +6421,16 @@ static int ath11k_mac_op_add_interface(s
ath11k_dp_vdev_tx_attach(ar, arvif);
+ ath11k_debugfs_add_interface(arvif);
+
if (vif->type != NL80211_IFTYPE_MONITOR &&
test_bit(ATH11K_FLAG_MONITOR_CONF_ENABLED, &ar->monitor_flags)) {
ret = ath11k_mac_monitor_vdev_create(ar);
- if (ret) {
+ if (ret)
ath11k_warn(ar->ab, "failed to create monitor vdev during add interface: %d",
ret);
- goto err_peer_del;
- }
}
- ath11k_debugfs_add_interface(arvif);
-
mutex_unlock(&ar->conf_mutex);
return 0;
@@ -6457,7 +6455,6 @@ err_vdev_del:
spin_unlock_bh(&ar->data_lock);
err:
- ath11k_debugfs_remove_interface(arvif);
mutex_unlock(&ar->conf_mutex);
return ret;

View file

@ -0,0 +1,102 @@
From c362daa213cdeb0a9e7c2ed84849544c24505720 Mon Sep 17 00:00:00 2001
From: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Date: Fri, 7 Oct 2022 10:41:30 +0530
Subject: [PATCH 8/9] wifi: ath11k: add support to configure channel dwell time
Add support to configure channel dwell time during scan.
Dwell time help to stay on the channel for a specified duration
during scan and aid userspace in finding WiFi networks. Very
useful in passive scans where longer dwell times are needed
to find the WiFi networks.
Configure channel dwell time from duration of the scan request
received from mac80211 when the duration is non-zero. When the
scan request does not have duration value, use the default ones,
the current implementation.
Advertise corresponding feature flag NL80211_EXT_FEATURE_SET_SCAN_DWELL
to enable the feature.
Change is applicable for all ath11k hardware.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221007051130.6067-1-quic_mpubbise@quicinc.com
---
drivers/net/wireless/ath/ath11k/mac.c | 33 +++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -241,7 +241,10 @@ const struct htt_rx_ring_tlv_filter ath1
#define ath11k_a_rates (ath11k_legacy_rates + 4)
#define ath11k_a_rates_size (ARRAY_SIZE(ath11k_legacy_rates) - 4)
-#define ATH11K_MAC_SCAN_TIMEOUT_MSECS 200 /* in msecs */
+#define ATH11K_MAC_SCAN_CMD_EVT_OVERHEAD 200 /* in msecs */
+
+/* Overhead due to the processing of channel switch events from FW */
+#define ATH11K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD 10 /* in msecs */
static const u32 ath11k_smps_map[] = {
[WLAN_HT_CAP_SM_PS_STATIC] = WMI_PEER_SMPS_STATIC,
@@ -3612,6 +3615,7 @@ static int ath11k_mac_op_hw_scan(struct
struct scan_req_params arg;
int ret = 0;
int i;
+ u32 scan_timeout;
mutex_lock(&ar->conf_mutex);
@@ -3681,6 +3685,26 @@ static int ath11k_mac_op_hw_scan(struct
ether_addr_copy(arg.mac_mask.addr, req->mac_addr_mask);
}
+ /* if duration is set, default dwell times will be overwritten */
+ if (req->duration) {
+ arg.dwell_time_active = req->duration;
+ arg.dwell_time_active_2g = req->duration;
+ arg.dwell_time_active_6g = req->duration;
+ arg.dwell_time_passive = req->duration;
+ arg.dwell_time_passive_6g = req->duration;
+ arg.burst_duration = req->duration;
+
+ scan_timeout = min_t(u32, arg.max_rest_time *
+ (arg.num_chan - 1) + (req->duration +
+ ATH11K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD) *
+ arg.num_chan, arg.max_scan_time);
+ } else {
+ scan_timeout = arg.max_scan_time;
+ }
+
+ /* Add a margin to account for event/command processing */
+ scan_timeout += ATH11K_MAC_SCAN_CMD_EVT_OVERHEAD;
+
ret = ath11k_start_scan(ar, &arg);
if (ret) {
ath11k_warn(ar->ab, "failed to start hw scan: %d\n", ret);
@@ -3689,10 +3713,8 @@ static int ath11k_mac_op_hw_scan(struct
spin_unlock_bh(&ar->data_lock);
}
- /* Add a 200ms margin to account for event/command processing */
ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
- msecs_to_jiffies(arg.max_scan_time +
- ATH11K_MAC_SCAN_TIMEOUT_MSECS));
+ msecs_to_jiffies(scan_timeout));
exit:
kfree(arg.chan_list);
@@ -9060,6 +9082,9 @@ static int __ath11k_mac_register(struct
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP);
}
+ wiphy_ext_feature_set(ar->hw->wiphy,
+ NL80211_EXT_FEATURE_SET_SCAN_DWELL);
+
ath11k_reg_init(ar);
if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) {

View file

@ -0,0 +1,39 @@
From 3f9b09ccf7d5f23066b02881a737bee42def9d1a Mon Sep 17 00:00:00 2001
From: Baochen Qiang <quic_bqiang@quicinc.com>
Date: Mon, 10 Oct 2022 11:32:37 +0800
Subject: [PATCH 9/9] wifi: ath11k: Send PME message during wakeup from D3cold
We are seeing system stuck on some specific platforms due to
WLAN chip fails to wakeup from D3cold state.
With this flag, firmware will send PME message during wakeup
and this issue is gone.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221010033237.415478-1-quic_bqiang@quicinc.com
---
drivers/net/wireless/ath/ath11k/qmi.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -19,6 +19,7 @@
#define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02
#define HOST_CSTATE_BIT 0x04
#define PLATFORM_CAP_PCIE_GLOBAL_RESET 0x08
+#define PLATFORM_CAP_PCIE_PME_D3COLD 0x10
#define FW_BUILD_ID_MASK "QC_IMAGE_VERSION_STRING="
@@ -1752,6 +1753,8 @@ static int ath11k_qmi_host_cap_send(stru
if (ab->hw_params.global_reset)
req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET;
+ req.nm_modem |= PLATFORM_CAP_PCIE_PME_D3COLD;
+
ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n");
ret = qmi_txn_init(&ab->qmi.handle, &txn,

View file

@ -0,0 +1,116 @@
From 3811fa1f231f1a3e29759efef4992116604aab8b Mon Sep 17 00:00:00 2001
From: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
Date: Tue, 11 Oct 2022 15:23:46 +0530
Subject: [PATCH] wifi: ath11k: Fix firmware crash on vdev delete race
condition
Current code does not wait for vdev delete completion on vdev create
failures and tries to send another vdev create followed by vdev set
param to firmware with same vdev id. This causes firmware crash.
Fix this crash by waiting for vdev delete completion on vdev
create failures.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.6.0.1-00905-QCAHKSWPL_SILICONZ-1
Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221011095346.3901-1-quic_ssreeela@quicinc.com
---
drivers/net/wireless/ath/ath11k/mac.c | 60 +++++++++++++++++----------
1 file changed, 37 insertions(+), 23 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6233,6 +6233,40 @@ void ath11k_mac_11d_scan_stop_all(struct
}
}
+static int ath11k_mac_vdev_delete(struct ath11k *ar, struct ath11k_vif *arvif)
+{
+ unsigned long time_left;
+ struct ieee80211_vif *vif = arvif->vif;
+ int ret = 0;
+
+ lockdep_assert_held(&ar->conf_mutex);
+
+ reinit_completion(&ar->vdev_delete_done);
+
+ ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id);
+ if (ret) {
+ ath11k_warn(ar->ab, "failed to delete WMI vdev %d: %d\n",
+ arvif->vdev_id, ret);
+ return ret;
+ }
+
+ time_left = wait_for_completion_timeout(&ar->vdev_delete_done,
+ ATH11K_VDEV_DELETE_TIMEOUT_HZ);
+ if (time_left == 0) {
+ ath11k_warn(ar->ab, "Timeout in receiving vdev delete response\n");
+ return -ETIMEDOUT;
+ }
+
+ ar->ab->free_vdev_map |= 1LL << (arvif->vdev_id);
+ ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id);
+ ar->num_created_vdevs--;
+
+ ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n",
+ vif->addr, arvif->vdev_id);
+
+ return ret;
+}
+
static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
@@ -6468,10 +6502,7 @@ err_peer_del:
}
err_vdev_del:
- ath11k_wmi_vdev_delete(ar, arvif->vdev_id);
- ar->num_created_vdevs--;
- ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id);
- ab->free_vdev_map |= 1LL << arvif->vdev_id;
+ ath11k_mac_vdev_delete(ar, arvif);
spin_lock_bh(&ar->data_lock);
list_del(&arvif->list);
spin_unlock_bh(&ar->data_lock);
@@ -6499,7 +6530,6 @@ static void ath11k_mac_op_remove_interfa
struct ath11k *ar = hw->priv;
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
struct ath11k_base *ab = ar->ab;
- unsigned long time_left;
int ret;
int i;
@@ -6520,29 +6550,13 @@ static void ath11k_mac_op_remove_interfa
arvif->vdev_id, ret);
}
- reinit_completion(&ar->vdev_delete_done);
-
- ret = ath11k_wmi_vdev_delete(ar, arvif->vdev_id);
+ ret = ath11k_mac_vdev_delete(ar, arvif);
if (ret) {
- ath11k_warn(ab, "failed to delete WMI vdev %d: %d\n",
+ ath11k_warn(ab, "failed to delete vdev %d: %d\n",
arvif->vdev_id, ret);
goto err_vdev_del;
}
- time_left = wait_for_completion_timeout(&ar->vdev_delete_done,
- ATH11K_VDEV_DELETE_TIMEOUT_HZ);
- if (time_left == 0) {
- ath11k_warn(ab, "Timeout in receiving vdev delete response\n");
- goto err_vdev_del;
- }
-
- ab->free_vdev_map |= 1LL << (arvif->vdev_id);
- ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id);
- ar->num_created_vdevs--;
-
- ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n",
- vif->addr, arvif->vdev_id);
-
if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
clear_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags);
ar->monitor_vdev_id = -1;

View file

@ -0,0 +1,40 @@
From f3ca72b0327101a074a871539e61775d43908ca4 Mon Sep 17 00:00:00 2001
From: Nagarajan Maran <quic_nmaran@quicinc.com>
Date: Fri, 14 Oct 2022 21:20:54 +0530
Subject: [PATCH] wifi: ath11k: fix monitor vdev creation with firmware
recovery
During firmware recovery, the monitor interface is not
getting created in the driver and firmware since
the respective flags are not updated properly.
So after firmware recovery is successful, when monitor
interface is brought down manually, firmware assertion
is observed, since we are trying to bring down the
interface which is not yet created in the firmware.
Fix this by updating the monitor flags properly per
phy#, during firmware recovery.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221014155054.11471-1-quic_nmaran@quicinc.com
---
drivers/net/wireless/ath/ath11k/core.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -1677,6 +1677,10 @@ void ath11k_core_pre_reconfigure_recover
ath11k_mac_tx_mgmt_pending_free, ar);
idr_destroy(&ar->txmgmt_idr);
wake_up(&ar->txmgmt_empty_waitq);
+
+ ar->monitor_vdev_id = -1;
+ clear_bit(ATH11K_FLAG_MONITOR_STARTED, &ar->monitor_flags);
+ clear_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags);
}
wake_up(&ab->wmi_ab.tx_credits_wq);

View file

@ -0,0 +1,33 @@
From ed3725e15a154ebebf44e0c34806c57525483f92 Mon Sep 17 00:00:00 2001
From: Rahul Bhattacharjee <quic_rbhattac@quicinc.com>
Date: Fri, 21 Oct 2022 14:31:26 +0530
Subject: [PATCH] wifi: ath11k: Fix qmi_msg_handler data structure
initialization
qmi_msg_handler is required to be null terminated by QMI module.
There might be a case where a handler for a msg id is not present in the
handlers array which can lead to infinite loop while searching the handler
and therefore out of bound access in qmi_invoke_handler().
Hence update the initialization in qmi_msg_handler data structure.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Signed-off-by: Rahul Bhattacharjee <quic_rbhattac@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221021090126.28626-1-quic_rbhattac@quicinc.com
---
drivers/net/wireless/ath/ath11k/qmi.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -3090,6 +3090,9 @@ static const struct qmi_msg_handler ath1
sizeof(struct qmi_wlfw_fw_init_done_ind_msg_v01),
.fn = ath11k_qmi_msg_fw_init_done_cb,
},
+
+ /* end of list */
+ {},
};
static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl,

View file

@ -0,0 +1,42 @@
From dd1c2322694522f674c874f5fa02ac5ae39135dd Mon Sep 17 00:00:00 2001
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Date: Mon, 31 Oct 2022 12:43:41 +0100
Subject: [PATCH] wifi: ath11k: synchronize
ath11k_mac_he_gi_to_nl80211_he_gi()'s return type
ath11k_mac_he_gi_to_nl80211_he_gi() generates a valid warning with gcc-13:
drivers/net/wireless/ath/ath11k/mac.c:321:20: error: conflicting types for 'ath11k_mac_he_gi_to_nl80211_he_gi' due to enum/integer mismatch; have 'enum nl80211_he_gi(u8)'
drivers/net/wireless/ath/ath11k/mac.h:166:5: note: previous declaration of 'ath11k_mac_he_gi_to_nl80211_he_gi' with type 'u32(u8)'
I.e. the type of the return value ath11k_mac_he_gi_to_nl80211_he_gi() in
the declaration is u32, while the definition spells enum nl80211_he_gi.
Synchronize them to the latter.
Cc: Martin Liska <mliska@suse.cz>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221031114341.10377-1-jirislaby@kernel.org
---
drivers/net/wireless/ath/ath11k/mac.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/ath/ath11k/mac.h
+++ b/drivers/net/wireless/ath/ath11k/mac.h
@@ -163,7 +163,7 @@ void ath11k_mac_drain_tx(struct ath11k *
void ath11k_mac_peer_cleanup_all(struct ath11k *ar);
int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
u8 ath11k_mac_bw_to_mac80211_bw(u8 bw);
-u32 ath11k_mac_he_gi_to_nl80211_he_gi(u8 sgi);
+enum nl80211_he_gi ath11k_mac_he_gi_to_nl80211_he_gi(u8 sgi);
enum nl80211_he_ru_alloc ath11k_mac_phy_he_ru_to_nl80211_he_ru_alloc(u16 ru_phy);
enum nl80211_he_ru_alloc ath11k_mac_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones);
enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw);

View file

@ -0,0 +1,341 @@
From 93c1592889fca46d09d833455628bab05516cdbf Mon Sep 17 00:00:00 2001
From: Jeff Johnson <quic_jjohnson@quicinc.com>
Date: Wed, 14 Sep 2022 17:23:03 -0700
Subject: [PATCH] wifi: ath11k: Make QMI message rules const
Commit ff6d365898d4 ("soc: qcom: qmi: use const for struct
qmi_elem_info") allows QMI message encoding/decoding rules to be
const, so do that for ath11k.
Compile tested only.
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220915002303.12206-1-quic_jjohnson@quicinc.com
---
drivers/net/wireless/ath/ath11k/qmi.c | 72 +++++++++++++--------------
1 file changed, 36 insertions(+), 36 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -29,7 +29,7 @@ module_param_named(cold_boot_cal, ath11k
MODULE_PARM_DESC(cold_boot_cal,
"Decrease the channel switch time but increase the driver load time (Default: true)");
-static struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = {
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
@@ -280,7 +280,7 @@ static struct qmi_elem_info qmi_wlanfw_h
},
};
-static struct qmi_elem_info qmi_wlanfw_host_cap_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_host_cap_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -297,7 +297,7 @@ static struct qmi_elem_info qmi_wlanfw_h
},
};
-static struct qmi_elem_info qmi_wlanfw_ind_register_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_ind_register_req_msg_v01_ei[] = {
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
@@ -522,7 +522,7 @@ static struct qmi_elem_info qmi_wlanfw_i
},
};
-static struct qmi_elem_info qmi_wlanfw_ind_register_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_ind_register_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -558,7 +558,7 @@ static struct qmi_elem_info qmi_wlanfw_i
},
};
-static struct qmi_elem_info qmi_wlanfw_mem_cfg_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_mem_cfg_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_8_BYTE,
.elem_len = 1,
@@ -590,7 +590,7 @@ static struct qmi_elem_info qmi_wlanfw_m
},
};
-static struct qmi_elem_info qmi_wlanfw_mem_seg_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_mem_seg_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -632,7 +632,7 @@ static struct qmi_elem_info qmi_wlanfw_m
},
};
-static struct qmi_elem_info qmi_wlanfw_request_mem_ind_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_request_mem_ind_msg_v01_ei[] = {
{
.data_type = QMI_DATA_LEN,
.elem_len = 1,
@@ -659,7 +659,7 @@ static struct qmi_elem_info qmi_wlanfw_r
},
};
-static struct qmi_elem_info qmi_wlanfw_mem_seg_resp_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_mem_seg_resp_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_8_BYTE,
.elem_len = 1,
@@ -699,7 +699,7 @@ static struct qmi_elem_info qmi_wlanfw_m
},
};
-static struct qmi_elem_info qmi_wlanfw_respond_mem_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_respond_mem_req_msg_v01_ei[] = {
{
.data_type = QMI_DATA_LEN,
.elem_len = 1,
@@ -726,7 +726,7 @@ static struct qmi_elem_info qmi_wlanfw_r
},
};
-static struct qmi_elem_info qmi_wlanfw_respond_mem_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_respond_mem_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -744,7 +744,7 @@ static struct qmi_elem_info qmi_wlanfw_r
},
};
-static struct qmi_elem_info qmi_wlanfw_cap_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_cap_req_msg_v01_ei[] = {
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,
@@ -752,7 +752,7 @@ static struct qmi_elem_info qmi_wlanfw_c
},
};
-static struct qmi_elem_info qmi_wlanfw_device_info_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_device_info_req_msg_v01_ei[] = {
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,
@@ -760,7 +760,7 @@ static struct qmi_elem_info qmi_wlanfw_d
},
};
-static struct qmi_elem_info qmi_wlfw_device_info_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlfw_device_info_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -814,7 +814,7 @@ static struct qmi_elem_info qmi_wlfw_dev
},
};
-static struct qmi_elem_info qmi_wlanfw_rf_chip_info_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_rf_chip_info_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -840,7 +840,7 @@ static struct qmi_elem_info qmi_wlanfw_r
},
};
-static struct qmi_elem_info qmi_wlanfw_rf_board_info_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_rf_board_info_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -857,7 +857,7 @@ static struct qmi_elem_info qmi_wlanfw_r
},
};
-static struct qmi_elem_info qmi_wlanfw_soc_info_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_soc_info_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -873,7 +873,7 @@ static struct qmi_elem_info qmi_wlanfw_s
},
};
-static struct qmi_elem_info qmi_wlanfw_fw_version_info_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_fw_version_info_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -899,7 +899,7 @@ static struct qmi_elem_info qmi_wlanfw_f
},
};
-static struct qmi_elem_info qmi_wlanfw_cap_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_cap_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -1100,7 +1100,7 @@ static struct qmi_elem_info qmi_wlanfw_c
},
};
-static struct qmi_elem_info qmi_wlanfw_bdf_download_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_bdf_download_req_msg_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_1_BYTE,
.elem_len = 1,
@@ -1235,7 +1235,7 @@ static struct qmi_elem_info qmi_wlanfw_b
},
};
-static struct qmi_elem_info qmi_wlanfw_bdf_download_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_bdf_download_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -1253,7 +1253,7 @@ static struct qmi_elem_info qmi_wlanfw_b
},
};
-static struct qmi_elem_info qmi_wlanfw_m3_info_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_m3_info_req_msg_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_8_BYTE,
.elem_len = 1,
@@ -1277,7 +1277,7 @@ static struct qmi_elem_info qmi_wlanfw_m
},
};
-static struct qmi_elem_info qmi_wlanfw_m3_info_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_m3_info_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -1294,7 +1294,7 @@ static struct qmi_elem_info qmi_wlanfw_m
},
};
-static struct qmi_elem_info qmi_wlanfw_ce_tgt_pipe_cfg_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_ce_tgt_pipe_cfg_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -1347,7 +1347,7 @@ static struct qmi_elem_info qmi_wlanfw_c
},
};
-static struct qmi_elem_info qmi_wlanfw_ce_svc_pipe_cfg_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_ce_svc_pipe_cfg_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -1382,7 +1382,7 @@ static struct qmi_elem_info qmi_wlanfw_c
},
};
-static struct qmi_elem_info qmi_wlanfw_shadow_reg_cfg_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_shadow_reg_cfg_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_2_BYTE,
.elem_len = 1,
@@ -1406,7 +1406,7 @@ static struct qmi_elem_info qmi_wlanfw_s
},
};
-static struct qmi_elem_info qmi_wlanfw_shadow_reg_v2_cfg_s_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_shadow_reg_v2_cfg_s_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -1423,7 +1423,7 @@ static struct qmi_elem_info qmi_wlanfw_s
},
};
-static struct qmi_elem_info qmi_wlanfw_wlan_mode_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_wlan_mode_req_msg_v01_ei[] = {
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
@@ -1458,7 +1458,7 @@ static struct qmi_elem_info qmi_wlanfw_w
},
};
-static struct qmi_elem_info qmi_wlanfw_wlan_mode_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_wlan_mode_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -1476,7 +1476,7 @@ static struct qmi_elem_info qmi_wlanfw_w
},
};
-static struct qmi_elem_info qmi_wlanfw_wlan_cfg_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_wlan_cfg_req_msg_v01_ei[] = {
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
@@ -1615,7 +1615,7 @@ static struct qmi_elem_info qmi_wlanfw_w
},
};
-static struct qmi_elem_info qmi_wlanfw_wlan_cfg_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_wlan_cfg_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -1632,28 +1632,28 @@ static struct qmi_elem_info qmi_wlanfw_w
},
};
-static struct qmi_elem_info qmi_wlanfw_mem_ready_ind_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_mem_ready_ind_msg_v01_ei[] = {
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,
},
};
-static struct qmi_elem_info qmi_wlanfw_fw_ready_ind_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_fw_ready_ind_msg_v01_ei[] = {
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,
},
};
-static struct qmi_elem_info qmi_wlanfw_cold_boot_cal_done_ind_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_cold_boot_cal_done_ind_msg_v01_ei[] = {
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,
},
};
-static struct qmi_elem_info qmi_wlanfw_wlan_ini_req_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_wlan_ini_req_msg_v01_ei[] = {
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
@@ -1679,7 +1679,7 @@ static struct qmi_elem_info qmi_wlanfw_w
},
};
-static struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
@@ -1697,7 +1697,7 @@ static struct qmi_elem_info qmi_wlanfw_w
},
};
-static struct qmi_elem_info qmi_wlfw_fw_init_done_ind_msg_v01_ei[] = {
+static const struct qmi_elem_info qmi_wlfw_fw_init_done_ind_msg_v01_ei[] = {
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,

View file

@ -0,0 +1,119 @@
From a018750a2cceaf4427c4ee3d9ce3e83a171d5bd6 Mon Sep 17 00:00:00 2001
From: Youghandhar Chintala <quic_youghand@quicinc.com>
Date: Fri, 4 Nov 2022 14:24:03 +0530
Subject: [PATCH] wifi: ath11k: Trigger sta disconnect on hardware restart
Currently after the hardware restart triggered from the driver, the
station interface connection remains intact, since a disconnect trigger
is not sent to userspace. This can lead to a problem in targets where
the wifi mac sequence is added by the firmware.
After the target restart, its wifi mac sequence number gets reset to
zero. Hence AP to which our device is connected will receive frames with
a wifi mac sequence number jump to the past, thereby resulting in the
AP dropping all these frames, until the frame arrives with a wifi mac
sequence number which AP was expecting.
To avoid such frame drops, its better to trigger a station disconnect
upon target hardware restart which can be done with API
ieee80211_reconfig_disconnect exposed to mac80211.
The other targets are not affected by this change, since the hardware
params flag is not set.
Reported-by: kernel test robot <lkp@intel.com>
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221104085403.11025-1-quic_youghand@quicinc.com
---
drivers/net/wireless/ath/ath11k/core.c | 6 ++++++
drivers/net/wireless/ath/ath11k/hw.h | 1 +
drivers/net/wireless/ath/ath11k/mac.c | 7 +++++++
3 files changed, 14 insertions(+)
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -195,6 +195,7 @@ static const struct ath11k_hw_params ath
.tcl_ring_retry = true,
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
+ .support_fw_mac_sequence = false,
},
{
.name = "qca6390 hw2.0",
@@ -277,6 +278,7 @@ static const struct ath11k_hw_params ath
.tcl_ring_retry = true,
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
+ .support_fw_mac_sequence = true,
},
{
.name = "qcn9074 hw1.0",
@@ -356,6 +358,7 @@ static const struct ath11k_hw_params ath
.tcl_ring_retry = true,
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
+ .support_fw_mac_sequence = false,
},
{
.name = "wcn6855 hw2.0",
@@ -438,6 +441,7 @@ static const struct ath11k_hw_params ath
.tcl_ring_retry = true,
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
+ .support_fw_mac_sequence = true,
},
{
.name = "wcn6855 hw2.1",
@@ -519,6 +523,7 @@ static const struct ath11k_hw_params ath
.tcl_ring_retry = true,
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
+ .support_fw_mac_sequence = true,
},
{
.name = "wcn6750 hw1.0",
@@ -597,6 +602,7 @@ static const struct ath11k_hw_params ath
.tcl_ring_retry = false,
.tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750,
.smp2p_wow_exit = true,
+ .support_fw_mac_sequence = true,
},
};
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -219,6 +219,7 @@ struct ath11k_hw_params {
bool tcl_ring_retry;
u32 tx_ring_size;
bool smp2p_wow_exit;
+ bool support_fw_mac_sequence;
};
struct ath11k_hw_ops {
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -8010,6 +8010,7 @@ ath11k_mac_op_reconfig_complete(struct i
struct ath11k *ar = hw->priv;
struct ath11k_base *ab = ar->ab;
int recovery_count;
+ struct ath11k_vif *arvif;
if (reconfig_type != IEEE80211_RECONFIG_TYPE_RESTART)
return;
@@ -8045,6 +8046,12 @@ ath11k_mac_op_reconfig_complete(struct i
ath11k_dbg(ab, ATH11K_DBG_BOOT, "reset success\n");
}
}
+ if (ar->ab->hw_params.support_fw_mac_sequence) {
+ list_for_each_entry(arvif, &ar->arvifs, list) {
+ if (arvif->is_up && arvif->vdev_type == WMI_VDEV_TYPE_STA)
+ ieee80211_hw_restart_disconnect(arvif->vif);
+ }
+ }
}
mutex_unlock(&ar->conf_mutex);

View file

@ -0,0 +1,103 @@
From e44de90453bb2b46a523df78c39eb896bab35dcd Mon Sep 17 00:00:00 2001
From: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
Date: Tue, 29 Nov 2022 13:04:02 +0200
Subject: [PATCH] wifi: ath11k: Fix race condition with struct
htt_ppdu_stats_info
A crash happens when running the traffic with multiple clients:
Crash Signature : Unable to handle kernel paging request at
virtual address ffffffd700970918 During the crash, PC points to
"ieee80211_tx_rate_update+0x30/0x68 [mac80211]"
LR points to "ath11k_dp_htt_htc_t2h_msg_handler+0x5a8/0x8a0 [ath11k]".
Struct ppdu_stats_info is allocated and accessed from event callback via copy
engine tasklet, this has a problem when freeing it from ath11k_mac_op_stop().
Use data_lock during entire ath11k_dp_htt_get_ppdu_desc() call to protect
struct htt_ppdu_stats_info access and to avoid race condition when accessing it
from ath11k_mac_op_stop().
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
Co-developed-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221124071104.22506-1-quic_kathirve@quicinc.com
---
drivers/net/wireless/ath/ath11k/dp_rx.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -1535,13 +1535,12 @@ struct htt_ppdu_stats_info *ath11k_dp_ht
{
struct htt_ppdu_stats_info *ppdu_info;
- spin_lock_bh(&ar->data_lock);
+ lockdep_assert_held(&ar->data_lock);
+
if (!list_empty(&ar->ppdu_stats_info)) {
list_for_each_entry(ppdu_info, &ar->ppdu_stats_info, list) {
- if (ppdu_info->ppdu_id == ppdu_id) {
- spin_unlock_bh(&ar->data_lock);
+ if (ppdu_info->ppdu_id == ppdu_id)
return ppdu_info;
- }
}
if (ar->ppdu_stat_list_depth > HTT_PPDU_DESC_MAX_DEPTH) {
@@ -1553,16 +1552,13 @@ struct htt_ppdu_stats_info *ath11k_dp_ht
kfree(ppdu_info);
}
}
- spin_unlock_bh(&ar->data_lock);
ppdu_info = kzalloc(sizeof(*ppdu_info), GFP_ATOMIC);
if (!ppdu_info)
return NULL;
- spin_lock_bh(&ar->data_lock);
list_add_tail(&ppdu_info->list, &ar->ppdu_stats_info);
ar->ppdu_stat_list_depth++;
- spin_unlock_bh(&ar->data_lock);
return ppdu_info;
}
@@ -1586,16 +1582,17 @@ static int ath11k_htt_pull_ppdu_stats(st
ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id);
if (!ar) {
ret = -EINVAL;
- goto exit;
+ goto out;
}
if (ath11k_debugfs_is_pktlog_lite_mode_enabled(ar))
trace_ath11k_htt_ppdu_stats(ar, skb->data, len);
+ spin_lock_bh(&ar->data_lock);
ppdu_info = ath11k_dp_htt_get_ppdu_desc(ar, ppdu_id);
if (!ppdu_info) {
ret = -EINVAL;
- goto exit;
+ goto out_unlock_data;
}
ppdu_info->ppdu_id = ppdu_id;
@@ -1604,10 +1601,13 @@ static int ath11k_htt_pull_ppdu_stats(st
(void *)ppdu_info);
if (ret) {
ath11k_warn(ab, "Failed to parse tlv %d\n", ret);
- goto exit;
+ goto out_unlock_data;
}
-exit:
+out_unlock_data:
+ spin_unlock_bh(&ar->data_lock);
+
+out:
rcu_read_unlock();
return ret;

View file

@ -0,0 +1,66 @@
From 703d6551f71e7290619d6effe2a25a64e10538b7 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Thu, 15 Dec 2022 12:20:52 +0100
Subject: [PATCH] ath11k: control thermal support via symbol
Currently, thermal support will get built if CONFIG_THERMAL is reachable,
however this is not suitable for OpenWrt as with ALL_KMODS being set to y
ATH11K_THERMAL wont get selected and so hwmon and thermal kmods wont get
pulled in resulting in a build-failure.
So, to avoid that, lets do what is already done for ath10k and add a
config symbol into backports for enabling thermal support.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
drivers/net/wireless/ath/ath11k/Kconfig | 7 +++++++
drivers/net/wireless/ath/ath11k/Makefile | 2 +-
drivers/net/wireless/ath/ath11k/thermal.h | 2 +-
local-symbols | 1 +
4 files changed, 10 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/Kconfig
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
@@ -61,3 +61,10 @@ config ATH11K_SPECTRAL
Enable ath11k spectral scan support
Say Y to enable access to the FFT/spectral data via debugfs.
+
+config ATH11K_THERMAL
+ bool "ath11k thermal sensors and throttling support"
+ depends on ATH11K
+ depends on THERMAL
+ help
+ Enable ath11k thermal sensors and throttling support.
--- a/drivers/net/wireless/ath/ath11k/Makefile
+++ b/drivers/net/wireless/ath/ath11k/Makefile
@@ -22,7 +22,7 @@ ath11k-y += core.o \
ath11k-$(CPTCFG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o
ath11k-$(CPTCFG_NL80211_TESTMODE) += testmode.o
ath11k-$(CPTCFG_ATH11K_TRACING) += trace.o
-ath11k-$(CONFIG_THERMAL) += thermal.o
+ath11k-$(CPTCFG_ATH11K_THERMAL) += thermal.o
ath11k-$(CPTCFG_ATH11K_SPECTRAL) += spectral.o
ath11k-$(CONFIG_PM) += wow.o
--- a/drivers/net/wireless/ath/ath11k/thermal.h
+++ b/drivers/net/wireless/ath/ath11k/thermal.h
@@ -25,7 +25,7 @@ struct ath11k_thermal {
int temperature;
};
-#if IS_REACHABLE(CONFIG_THERMAL)
+#if IS_REACHABLE(CPTCFG_ATH11K_THERMAL)
int ath11k_thermal_register(struct ath11k_base *sc);
void ath11k_thermal_unregister(struct ath11k_base *sc);
int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
--- a/local-symbols
+++ b/local-symbols
@@ -174,6 +174,7 @@ ATH11K_DEBUG=
ATH11K_DEBUGFS=
ATH11K_TRACING=
ATH11K_SPECTRAL=
+ATH11K_THERMAL=
WLAN_VENDOR_ATMEL=
ATMEL=
PCI_ATMEL=

View file

@ -0,0 +1,29 @@
From 04178918e7f6b5f34dde81ec79ee8a1ccace3be3 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Mon, 17 Oct 2022 11:45:03 +0200
Subject: [PATCH] wifi: ath11k: pci: fix compilation in 5.16 and older
Commit ("genirq/msi, treewide: Use a named struct for PCI/MSI attributes")
changed the msi_desc structure a bit, however that is only available in
kernels 5.17 and newer, so check for kernel version to allow compilation
in 5.16 and older.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
drivers/net/wireless/ath/ath11k/pci.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -451,7 +451,11 @@ static int ath11k_pci_alloc_msi(struct a
pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO,
&ab->pci.msi.addr_lo);
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 17, 0))
if (msi_desc->pci.msi_attrib.is_64) {
+#else
+ if (msi_desc->msi_attrib.is_64) {
+#endif
pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_HI,
&ab->pci.msi.addr_hi);
} else {

View file

@ -0,0 +1,76 @@
From 54e0f9aaf340377fb76acdffee9ec7372c4b70ae Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Mon, 17 Oct 2022 11:35:36 +0200
Subject: [PATCH] backports: drop QRTR and MHI
Backports currently include QRTR and MHI due to ath11k-pci requiring them,
however this at the same time prevents us from adding ath11k-ahb as it
also requires QRTR however its AHB variant from the kernel will conflict
with the core provided by backports.
Since MHI also conflicts with existing OpenWrt kmods providing MHI drop
both from backports and use the ones provided by OpenWrt kernel.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
Kconfig.sources | 2 --
Makefile.kernel | 2 --
drivers/net/wireless/ath/ath11k/Kconfig | 6 +++---
local-symbols | 8 --------
4 files changed, 3 insertions(+), 15 deletions(-)
--- a/Kconfig.sources
+++ b/Kconfig.sources
@@ -4,8 +4,6 @@ source "$BACKPORT_DIR/compat/Kconfig"
# these are copied from the kernel
source "$BACKPORT_DIR/net/wireless/Kconfig"
source "$BACKPORT_DIR/net/mac80211/Kconfig"
-source "$BACKPORT_DIR/net/qrtr/Kconfig"
-source "$BACKPORT_DIR/drivers/bus/mhi/Kconfig"
source "$BACKPORT_DIR/drivers/soc/qcom/Kconfig"
source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
--- a/Makefile.kernel
+++ b/Makefile.kernel
@@ -39,9 +39,7 @@ obj-y += compat/
obj-$(CPTCFG_CFG80211) += net/wireless/
obj-$(CPTCFG_MAC80211) += net/mac80211/
-obj-$(CPTCFG_QRTR) += net/qrtr/
obj-$(CPTCFG_QCOM_QMI_HELPERS) += drivers/soc/qcom/
-obj-$(CPTCFG_MHI_BUS) += drivers/bus/mhi/
obj-$(CPTCFG_WLAN) += drivers/net/wireless/
obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/
--- a/drivers/net/wireless/ath/ath11k/Kconfig
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
@@ -25,9 +25,9 @@ config ATH11K_PCI
tristate "Atheros ath11k PCI support"
depends on m
depends on ATH11K && PCI
- select MHI_BUS
- select QRTR
- select QRTR_MHI
+ depends on MHI_BUS
+ depends on QRTR
+ depends on QRTR_MHI
help
This module adds support for PCIE bus
--- a/local-symbols
+++ b/local-symbols
@@ -65,14 +65,6 @@ MAC80211_MESH_PS_DEBUG=
MAC80211_TDLS_DEBUG=
MAC80211_DEBUG_COUNTERS=
MAC80211_STA_HASH_MAX_SIZE=
-QRTR=
-QRTR_SMD=
-QRTR_TUN=
-QRTR_MHI=
-MHI_BUS=
-MHI_BUS_DEBUG=
-MHI_BUS_PCI_GENERIC=
-MHI_BUS_EP=
QCOM_AOSS_QMP=
QCOM_COMMAND_DB=
QCOM_CPR=

View file

@ -0,0 +1,406 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Tue, 13 Dec 2022 21:03:19 +0100
Subject: [PATCH] wifi: mac80211: fix initialization of rx->link and
rx->link_sta
There are some codepaths that do not initialize rx->link_sta properly. This
causes a crash in places which assume that rx->link_sta is valid if rx->sta
is valid.
One known instance is triggered by __ieee80211_rx_h_amsdu being called from
fast-rx.
Since the initialization of rx->link and rx->link_sta is rather convoluted
and duplicated in many places, clean it up by using a helper function to
set it.
Fixes: ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")
Fixes: b320d6c456ff ("wifi: mac80211: use correct rx link_sta instead of default")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4067,6 +4067,56 @@ static void ieee80211_invoke_rx_handlers
#undef CALL_RXH
}
+static bool
+ieee80211_rx_is_valid_sta_link_id(struct ieee80211_sta *sta, u8 link_id)
+{
+ if (!sta->mlo)
+ return false;
+
+ return !!(sta->valid_links & BIT(link_id));
+}
+
+static bool ieee80211_rx_data_set_link(struct ieee80211_rx_data *rx,
+ u8 link_id)
+{
+ if (!ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, link_id))
+ return false;
+
+ rx->link_id = link_id;
+ rx->link = rcu_dereference(rx->sdata->link[link_id]);
+ rx->link_sta = rcu_dereference(rx->sta->link[link_id]);
+
+ return rx->link && rx->link_sta;
+}
+
+static bool ieee80211_rx_data_set_sta(struct ieee80211_rx_data *rx,
+ struct ieee80211_sta *pubsta,
+ int link_id)
+{
+ struct sta_info *sta;
+
+ sta = container_of(pubsta, struct sta_info, sta);
+
+ rx->link_id = link_id;
+ rx->sta = sta;
+
+ if (sta) {
+ rx->local = sta->sdata->local;
+ if (!rx->sdata)
+ rx->sdata = sta->sdata;
+ rx->link_sta = &sta->deflink;
+
+ if (link_id >= 0 &&
+ !ieee80211_rx_data_set_link(rx, link_id))
+ return false;
+ }
+
+ if (link_id < 0)
+ rx->link = &rx->sdata->deflink;
+
+ return true;
+}
+
/*
* This function makes calls into the RX path, therefore
* it has to be invoked under RCU read lock.
@@ -4075,16 +4125,19 @@ void ieee80211_release_reorder_timeout(s
{
struct sk_buff_head frames;
struct ieee80211_rx_data rx = {
- .sta = sta,
- .sdata = sta->sdata,
- .local = sta->local,
/* This is OK -- must be QoS data frame */
.security_idx = tid,
.seqno_idx = tid,
- .link_id = -1,
};
struct tid_ampdu_rx *tid_agg_rx;
- u8 link_id;
+ int link_id = -1;
+
+ /* FIXME: statistics won't be right with this */
+ if (sta->sta.valid_links)
+ link_id = ffs(sta->sta.valid_links) - 1;
+
+ if (!ieee80211_rx_data_set_sta(&rx, &sta->sta, link_id))
+ return;
tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
if (!tid_agg_rx)
@@ -4104,10 +4157,6 @@ void ieee80211_release_reorder_timeout(s
};
drv_event_callback(rx.local, rx.sdata, &event);
}
- /* FIXME: statistics won't be right with this */
- link_id = sta->sta.valid_links ? ffs(sta->sta.valid_links) - 1 : 0;
- rx.link = rcu_dereference(sta->sdata->link[link_id]);
- rx.link_sta = rcu_dereference(sta->link[link_id]);
ieee80211_rx_handlers(&rx, &frames);
}
@@ -4123,7 +4172,6 @@ void ieee80211_mark_rx_ba_filtered_frame
/* This is OK -- must be QoS data frame */
.security_idx = tid,
.seqno_idx = tid,
- .link_id = -1,
};
int i, diff;
@@ -4134,10 +4182,8 @@ void ieee80211_mark_rx_ba_filtered_frame
sta = container_of(pubsta, struct sta_info, sta);
- rx.sta = sta;
- rx.sdata = sta->sdata;
- rx.link = &rx.sdata->deflink;
- rx.local = sta->local;
+ if (!ieee80211_rx_data_set_sta(&rx, pubsta, -1))
+ return;
rcu_read_lock();
tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
@@ -4524,15 +4570,6 @@ void ieee80211_check_fast_rx_iface(struc
mutex_unlock(&local->sta_mtx);
}
-static bool
-ieee80211_rx_is_valid_sta_link_id(struct ieee80211_sta *sta, u8 link_id)
-{
- if (!sta->mlo)
- return false;
-
- return !!(sta->valid_links & BIT(link_id));
-}
-
static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
struct ieee80211_fast_rx *fast_rx,
int orig_len)
@@ -4643,7 +4680,6 @@ static bool ieee80211_invoke_fast_rx(str
struct sk_buff *skb = rx->skb;
struct ieee80211_hdr *hdr = (void *)skb->data;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- struct sta_info *sta = rx->sta;
int orig_len = skb->len;
int hdrlen = ieee80211_hdrlen(hdr->frame_control);
int snap_offs = hdrlen;
@@ -4655,7 +4691,6 @@ static bool ieee80211_invoke_fast_rx(str
u8 da[ETH_ALEN];
u8 sa[ETH_ALEN];
} addrs __aligned(2);
- struct link_sta_info *link_sta;
struct ieee80211_sta_rx_stats *stats;
/* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
@@ -4758,18 +4793,10 @@ static bool ieee80211_invoke_fast_rx(str
drop:
dev_kfree_skb(skb);
- if (rx->link_id >= 0) {
- link_sta = rcu_dereference(sta->link[rx->link_id]);
- if (!link_sta)
- return true;
- } else {
- link_sta = &sta->deflink;
- }
-
if (fast_rx->uses_rss)
- stats = this_cpu_ptr(link_sta->pcpu_rx_stats);
+ stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats);
else
- stats = &link_sta->rx_stats;
+ stats = &rx->link_sta->rx_stats;
stats->dropped++;
return true;
@@ -4787,8 +4814,8 @@ static bool ieee80211_prepare_and_rx_han
struct ieee80211_local *local = rx->local;
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct ieee80211_hdr *hdr = (void *)skb->data;
- struct link_sta_info *link_sta = NULL;
- struct ieee80211_link_data *link;
+ struct link_sta_info *link_sta = rx->link_sta;
+ struct ieee80211_link_data *link = rx->link;
rx->skb = skb;
@@ -4810,35 +4837,6 @@ static bool ieee80211_prepare_and_rx_han
if (!ieee80211_accept_frame(rx))
return false;
- if (rx->link_id >= 0) {
- link = rcu_dereference(rx->sdata->link[rx->link_id]);
-
- /* we might race link removal */
- if (!link)
- return true;
- rx->link = link;
-
- if (rx->sta) {
- rx->link_sta =
- rcu_dereference(rx->sta->link[rx->link_id]);
- if (!rx->link_sta)
- return true;
- }
- } else {
- if (rx->sta)
- rx->link_sta = &rx->sta->deflink;
-
- rx->link = &sdata->deflink;
- }
-
- if (unlikely(!is_multicast_ether_addr(hdr->addr1) &&
- rx->link_id >= 0 && rx->sta && rx->sta->sta.mlo)) {
- link_sta = rcu_dereference(rx->sta->link[rx->link_id]);
-
- if (WARN_ON_ONCE(!link_sta))
- return true;
- }
-
if (!consume) {
struct skb_shared_hwtstamps *shwt;
@@ -4858,7 +4856,7 @@ static bool ieee80211_prepare_and_rx_han
shwt->hwtstamp = skb_hwtstamps(skb)->hwtstamp;
}
- if (unlikely(link_sta)) {
+ if (unlikely(rx->sta && rx->sta->sta.mlo)) {
/* translate to MLD addresses */
if (ether_addr_equal(link->conf->addr, hdr->addr1))
ether_addr_copy(hdr->addr1, rx->sdata->vif.addr);
@@ -4888,6 +4886,7 @@ static void __ieee80211_rx_handle_8023(s
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_fast_rx *fast_rx;
struct ieee80211_rx_data rx;
+ int link_id = -1;
memset(&rx, 0, sizeof(rx));
rx.skb = skb;
@@ -4904,12 +4903,8 @@ static void __ieee80211_rx_handle_8023(s
if (!pubsta)
goto drop;
- rx.sta = container_of(pubsta, struct sta_info, sta);
- rx.sdata = rx.sta->sdata;
-
- if (status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(pubsta, status->link_id))
- goto drop;
+ if (status->link_valid)
+ link_id = status->link_id;
/*
* TODO: Should the frame be dropped if the right link_id is not
@@ -4918,19 +4913,8 @@ static void __ieee80211_rx_handle_8023(s
* link_id is used only for stats purpose and updating the stats on
* the deflink is fine?
*/
- if (status->link_valid)
- rx.link_id = status->link_id;
-
- if (rx.link_id >= 0) {
- struct ieee80211_link_data *link;
-
- link = rcu_dereference(rx.sdata->link[rx.link_id]);
- if (!link)
- goto drop;
- rx.link = link;
- } else {
- rx.link = &rx.sdata->deflink;
- }
+ if (!ieee80211_rx_data_set_sta(&rx, pubsta, link_id))
+ goto drop;
fast_rx = rcu_dereference(rx.sta->fast_rx);
if (!fast_rx)
@@ -4948,6 +4932,8 @@ static bool ieee80211_rx_for_interface(s
{
struct link_sta_info *link_sta;
struct ieee80211_hdr *hdr = (void *)skb->data;
+ struct sta_info *sta;
+ int link_id = -1;
/*
* Look up link station first, in case there's a
@@ -4957,24 +4943,19 @@ static bool ieee80211_rx_for_interface(s
*/
link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2);
if (link_sta) {
- rx->sta = link_sta->sta;
- rx->link_id = link_sta->link_id;
+ sta = link_sta->sta;
+ link_id = link_sta->link_id;
} else {
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- rx->sta = sta_info_get_bss(rx->sdata, hdr->addr2);
- if (rx->sta) {
- if (status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta,
- status->link_id))
- return false;
-
- rx->link_id = status->link_valid ? status->link_id : -1;
- } else {
- rx->link_id = -1;
- }
+ sta = sta_info_get_bss(rx->sdata, hdr->addr2);
+ if (status->link_valid)
+ link_id = status->link_id;
}
+ if (!ieee80211_rx_data_set_sta(rx, &sta->sta, link_id))
+ return false;
+
return ieee80211_prepare_and_rx_handle(rx, skb, consume);
}
@@ -5033,19 +5014,15 @@ static void __ieee80211_rx_handle_packet
if (ieee80211_is_data(fc)) {
struct sta_info *sta, *prev_sta;
- u8 link_id = status->link_id;
+ int link_id = -1;
- if (pubsta) {
- rx.sta = container_of(pubsta, struct sta_info, sta);
- rx.sdata = rx.sta->sdata;
+ if (status->link_valid)
+ link_id = status->link_id;
- if (status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(pubsta, link_id))
+ if (pubsta) {
+ if (!ieee80211_rx_data_set_sta(&rx, pubsta, link_id))
goto out;
- if (status->link_valid)
- rx.link_id = status->link_id;
-
/*
* In MLO connection, fetch the link_id using addr2
* when the driver does not pass link_id in status.
@@ -5063,7 +5040,7 @@ static void __ieee80211_rx_handle_packet
if (!link_sta)
goto out;
- rx.link_id = link_sta->link_id;
+ ieee80211_rx_data_set_link(&rx, link_sta->link_id);
}
if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
@@ -5079,30 +5056,25 @@ static void __ieee80211_rx_handle_packet
continue;
}
- if ((status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(&prev_sta->sta,
- link_id)) ||
- (!status->link_valid && prev_sta->sta.mlo))
+ if (!ieee80211_rx_data_set_sta(&rx, &prev_sta->sta,
+ link_id))
+ goto out;
+
+ if (!status->link_valid && prev_sta->sta.mlo)
continue;
- rx.link_id = status->link_valid ? link_id : -1;
- rx.sta = prev_sta;
- rx.sdata = prev_sta->sdata;
ieee80211_prepare_and_rx_handle(&rx, skb, false);
prev_sta = sta;
}
if (prev_sta) {
- if ((status->link_valid &&
- !ieee80211_rx_is_valid_sta_link_id(&prev_sta->sta,
- link_id)) ||
- (!status->link_valid && prev_sta->sta.mlo))
+ if (!ieee80211_rx_data_set_sta(&rx, &prev_sta->sta,
+ link_id))
goto out;
- rx.link_id = status->link_valid ? link_id : -1;
- rx.sta = prev_sta;
- rx.sdata = prev_sta->sdata;
+ if (!status->link_valid && prev_sta->sta.mlo)
+ goto out;
if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
return;

View file

@ -0,0 +1,25 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 14 Dec 2022 13:46:38 +0100
Subject: [PATCH] wifi: mac80211: fix MLO + AP_VLAN check
Instead of preventing adding AP_VLAN to MLO enabled APs, this check was
preventing adding more than one 4-addr AP_VLAN regardless of the MLO status.
Fix this by adding missing extra checks.
Fixes: ae960ee90bb1 ("wifi: mac80211: prevent VLANs on MLDs")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -364,7 +364,9 @@ static int ieee80211_check_concurrent_if
/* No support for VLAN with MLO yet */
if (iftype == NL80211_IFTYPE_AP_VLAN &&
- nsdata->wdev.use_4addr)
+ sdata->wdev.use_4addr &&
+ nsdata->vif.type == NL80211_IFTYPE_AP &&
+ nsdata->vif.valid_links)
return -EOPNOTSUPP;
/*

View file

@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/mac80211/iface.c --- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c +++ b/net/mac80211/iface.c
@@ -2179,6 +2179,7 @@ int ieee80211_if_add(struct ieee80211_lo @@ -2181,6 +2181,7 @@ int ieee80211_if_add(struct ieee80211_lo
ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
ndev->hw_features |= ndev->features & ndev->hw_features |= ndev->features &
MAC80211_SUPPORTED_FEATURES_TX; MAC80211_SUPPORTED_FEATURES_TX;

View file

@ -88,7 +88,7 @@ endef
define KernelPackage/rt2800-lib define KernelPackage/rt2800-lib
$(call KernelPackage/rt2x00/Default) $(call KernelPackage/rt2x00/Default)
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt
HIDDEN:=1 HIDDEN:=1
TITLE+= (rt2800 LIB) TITLE+= (rt2800 LIB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800lib.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800lib.ko

View file

@ -38,7 +38,7 @@ endef
define KernelPackage/rtlwifi define KernelPackage/rtlwifi
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Realtek common driver part TITLE:=Realtek common driver part
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko
HIDDEN:=1 HIDDEN:=1
endef endef
@ -169,7 +169,7 @@ endef
define KernelPackage/rtw88 define KernelPackage/rtw88
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE
DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT
FILES:=\ FILES:=\
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \

View file

@ -40,7 +40,7 @@ define KernelPackage/mt76-default
SUBMENU:=Wireless Drivers SUBMENU:=Wireless Drivers
DEPENDS:= \ DEPENDS:= \
+kmod-mac80211 \ +kmod-mac80211 \
+@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
endef endef
define KernelPackage/mt76 define KernelPackage/mt76
@ -379,8 +379,7 @@ ifdef CONFIG_PACKAGE_kmod-mt7921e
endif endif
define Build/Compile define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ +$(KERNEL_MAKE) $(PKG_JOBS) \
$(KERNEL_MAKE_FLAGS) \
$(PKG_MAKE_FLAGS) \ $(PKG_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \ M="$(PKG_BUILD_DIR)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \

View file

@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/mwlwifi define KernelPackage/mwlwifi
SUBMENU:=Wireless Drivers SUBMENU:=Wireless Drivers
TITLE:=Marvell 88W8864/88W8897/88W8964/88W8997 wireless driver TITLE:=Marvell 88W8864/88W8897/88W8964/88W8997 wireless driver
DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT @TARGET_mvebu DEPENDS:=+kmod-mac80211 +@DRIVER_11AC_SUPPORT @PCI_SUPPORT @TARGET_mvebu
FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko
AUTOLOAD:=$(call AutoLoad,50,mwlwifi) AUTOLOAD:=$(call AutoLoad,50,mwlwifi)
endef endef
@ -45,8 +45,7 @@ NOSTDINC_FLAGS := \
-Wno-unused-result -Wno-unused-result
define Build/Compile define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ +$(KERNEL_MAKE) $(PKG_JOBS) \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \ M="$(PKG_BUILD_DIR)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules modules

View file

@ -22,8 +22,7 @@ define KernelPackage/rtc-rv5c386a
endef endef
define Build/Compile define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \ $(KERNEL_MAKE) \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \ M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(BUILDFLAGS)" \ EXTRA_CFLAGS="$(BUILDFLAGS)" \
modules modules

View file

@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/rtl8812au-ct define KernelPackage/rtl8812au-ct
SUBMENU:=Wireless Drivers SUBMENU:=Wireless Drivers
TITLE:=Driver for Realtek 8812 AU devices comfast 912-ac, etc TITLE:=Driver for Realtek 8812 AU devices comfast 912-ac, etc
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11AC_SUPPORT
FILES:=\ FILES:=\
$(PKG_BUILD_DIR)/rtl8812au.ko $(PKG_BUILD_DIR)/rtl8812au.ko
AUTOLOAD:=$(call AutoProbe,rtl8812au) AUTOLOAD:=$(call AutoProbe,rtl8812au)
@ -44,8 +44,7 @@ NOSTDINC_FLAGS := \
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT
define Build/Compile define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ +$(KERNEL_MAKE) $(PKG_JOBS) \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \ M="$(PKG_BUILD_DIR)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules modules

View file

@ -0,0 +1,642 @@
From b86b960fbd5c215c9c0f43544935b9a25d9445c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
Date: Mon, 23 Nov 2020 00:38:22 +0100
Subject: [PATCH] Add support for B.A.T.M.A.N. Advanced
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This adds support for the layer 2 mesh routing protocol
B.A.T.M.A.N. Advanced. "batadv" can be used to filter on batman-adv
packets. It also allows later filters to look at frames inside the
tunnel when both "version" and "type" are specified.
Documentation for the batman-adv protocol can be found at the following
locations:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/batman-adv.rst
https://www.open-mesh.org/
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
Makefile.in | 2 +
batadv_legacy_packet.h | 77 +++++++++++++++++++
batadv_packet.h | 78 ++++++++++++++++++++
ethertype.h | 3 +
gencode.c | 164 +++++++++++++++++++++++++++++++++++++++++
gencode.h | 3 +
grammar.y.in | 32 +++++++-
nametoaddr.c | 59 +++++++++++++++
pcap-filter.manmisc.in | 35 ++++++++-
pcap/namedb.h | 2 +
scanner.l | 1 +
11 files changed, 453 insertions(+), 3 deletions(-)
create mode 100644 batadv_legacy_packet.h
create mode 100644 batadv_packet.h
--- a/Makefile.in
+++ b/Makefile.in
@@ -134,6 +134,8 @@ PUBHDR = \
HDR = $(PUBHDR) \
arcnet.h \
atmuni31.h \
+ batadv_legacy_packet.h \
+ batadv_packet.h \
diag-control.h \
ethertype.h \
extract.h \
--- /dev/null
+++ b/batadv_legacy_packet.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: BSD-3 */
+/* Copyright (C) 2020 Linus Lüssing */
+
+#ifndef _BATADV_LEGACY_PACKET_H_
+#define _BATADV_LEGACY_PACKET_H_
+
+enum batadv_legacy_packettype {
+ BATADV_LEGACY_IV_OGM = 0x01,
+ BATADV_LEGACY_ICMP = 0x02,
+ BATADV_LEGACY_UNICAST = 0x03,
+ BATADV_LEGACY_BCAST = 0x04,
+ BATADV_LEGACY_VIS = 0x05,
+ BATADV_LEGACY_UNICAST_FRAG = 0x06,
+ BATADV_LEGACY_TT_QUERY = 0x07,
+ BATADV_LEGACY_ROAM_ADV = 0x08,
+ BATADV_LEGACY_UNICAST_4ADDR = 0x09,
+ BATADV_LEGACY_CODED = 0x0a,
+};
+
+#define ETH_ALEN 6
+
+struct batadv_legacy_unicast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t ttvn;
+ uint8_t dest[ETH_ALEN];
+};
+
+struct batadv_legacy_unicast_4addr_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t src[ETH_ALEN];
+ uint8_t subtype;
+ uint8_t reserved;
+};
+
+struct batadv_legacy_unicast_frag_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t ttvn;
+ uint8_t dest[ETH_ALEN];
+ uint8_t flags;
+ uint8_t align;
+ uint8_t orig[ETH_ALEN];
+ uint8_t seqno[2]; /* 2-byte integral value */
+};
+
+struct batadv_legacy_bcast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t reserved;
+ uint8_t seqno[4]; /* 4-byte integral value */
+ uint8_t orig[ETH_ALEN];
+};
+
+struct batadv_legacy_coded_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t first_ttvn;
+ uint8_t first_source[ETH_ALEN];
+ uint8_t first_orig_dest[ETH_ALEN];
+ uint8_t first_crc[4]; /* 4-byte integral value */
+ uint8_t second_ttl;
+ uint8_t second_ttvn;
+ uint8_t second_dest[ETH_ALEN];
+ uint8_t second_source[ETH_ALEN];
+ uint8_t second_orig_dest[ETH_ALEN];
+ uint8_t second_crc[4]; /* 4-byte integral value */
+ uint8_t coded_len[2]; /* 2-byte integral value */
+};
+
+#endif /* _BATADV_LEGACY_PACKET_H_ */
--- /dev/null
+++ b/batadv_packet.h
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: BSD-3 */
+/* Copyright (C) 2020 Linus Lüssing */
+
+#ifndef _BATADV_PACKET_H_
+#define _BATADV_PACKET_H_
+
+/* For the definitive and most recent packet format definition,
+ * see the batadv_packet.h in the Linux kernel.
+ */
+
+enum batadv_packettype {
+ BATADV_IV_OGM = 0x00,
+ BATADV_BCAST = 0x01,
+ BATADV_CODED = 0x02,
+ BATADV_ELP = 0x03,
+ BATADV_OGM2 = 0x04,
+ BATADV_UNICAST = 0x40,
+ BATADV_UNICAST_FRAG = 0x41,
+ BATADV_UNICAST_4ADDR = 0x42,
+ BATADV_ICMP = 0x43,
+ BATADV_UNICAST_TVLV = 0x44,
+};
+
+#define ETH_ALEN 6
+
+struct batadv_unicast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t ttvn;
+ uint8_t dest[ETH_ALEN];
+};
+
+struct batadv_unicast_4addr_packet {
+ struct batadv_unicast_packet u;
+ uint8_t src[ETH_ALEN];
+ uint8_t subtype;
+ uint8_t reserved;
+};
+
+struct batadv_frag_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t num_pri; /* number and priority */
+ uint8_t dest[ETH_ALEN];
+ uint8_t orig[ETH_ALEN];
+ uint8_t seqno[2]; /* 2-byte integral value */
+ uint8_t total_size[2]; /* 2-byte integral value */
+};
+
+struct batadv_bcast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t reserved;
+ uint8_t seqno[4]; /* 4-byte integral value */
+ uint8_t orig[ETH_ALEN];
+};
+
+struct batadv_coded_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t first_ttvn;
+ uint8_t first_source[ETH_ALEN];
+ uint8_t first_orig_dest[ETH_ALEN];
+ uint8_t first_crc[4]; /* 4-byte integral value */
+ uint8_t second_ttl;
+ uint8_t second_ttvn;
+ uint8_t second_dest[ETH_ALEN];
+ uint8_t second_source[ETH_ALEN];
+ uint8_t second_orig_dest[ETH_ALEN];
+ uint8_t second_crc[4]; /* 4-byte integral value */
+ uint8_t coded_len[2]; /* 2-byte integral value */
+};
+
+#endif /* _BATADV_PACKET_H_ */
--- a/ethertype.h
+++ b/ethertype.h
@@ -49,6 +49,9 @@
#ifndef ETHERTYPE_TRAIL
#define ETHERTYPE_TRAIL 0x1000
#endif
+#ifndef ETHERTYPE_BATMAN
+#define ETHERTYPE_BATMAN 0x4305 /* B.A.T.M.A.N. Advanced */
+#endif
#ifndef ETHERTYPE_MOPDL
#define ETHERTYPE_MOPDL 0x6001
#endif
--- a/gencode.c
+++ b/gencode.c
@@ -74,6 +74,8 @@
#include "atmuni31.h"
#include "sunatmpos.h"
#include "ppp.h"
+#include "batadv_packet.h"
+#include "batadv_legacy_packet.h"
#include "pcap/sll.h"
#include "pcap/ipnet.h"
#include "arcnet.h"
@@ -9501,6 +9503,168 @@ gen_geneve(compiler_state_t *cstate, bpf
return b1;
}
+static struct block *
+gen_batadv_check_version(compiler_state_t *cstate, struct block *b0, bpf_u_int32 version)
+{
+ struct block *b1;
+
+ if (version > UINT8_MAX)
+ bpf_error(cstate,
+ "batman-adv compatibility version number %u unsupported",
+ version);
+
+ b1 = gen_cmp(cstate, OR_LINKPL, 1, BPF_B, version);
+ gen_and(b0, b1);
+
+ return b1;
+}
+
+static struct block *
+gen_batadv_check_type(compiler_state_t *cstate, struct block *b0,
+ bpf_u_int32 version, bpf_u_int32 type)
+{
+ struct block *b1;
+
+ switch (version) {
+ case 14:
+ case 15:
+ if (type > UINT8_MAX)
+ bpf_error(cstate,
+ "batman-adv packet type %u unsupported for compatibility version %u",
+ type, version);
+
+ b1 = gen_cmp(cstate, OR_LINKPL, 0, BPF_B, type);
+ gen_and(b0, b1);
+ b0 = b1;
+
+ break;
+ default:
+ bpf_error(cstate,
+ "batman-adv compatibility version number %u unsupported",
+ version);
+ }
+
+ return b0;
+}
+
+
+static void gen_batadv_push_offset(compiler_state_t *cstate, u_int offset)
+{
+ PUSH_LINKHDR(cstate, DLT_EN10MB, cstate->off_linkpl.is_variable,
+ cstate->off_linkpl.constant_part + cstate->off_nl + offset,
+ cstate->off_linkpl.reg);
+
+ cstate->off_linktype.constant_part += cstate->off_linkhdr.constant_part;
+ cstate->off_linkpl.constant_part += cstate->off_linkhdr.constant_part;
+
+ cstate->off_nl = 0;
+ cstate->off_nl_nosnap = 0; /* no 802.2 LLC */
+}
+
+static void
+gen_batadv_offsets_v14(compiler_state_t *cstate, bpf_u_int32 type)
+{
+ size_t offset;
+
+ switch (type) {
+ case BATADV_LEGACY_UNICAST: /* 0x03 */
+ offset = sizeof(struct batadv_legacy_unicast_packet);
+ break;
+ case BATADV_LEGACY_BCAST: /* 0x04 */
+ offset = sizeof(struct batadv_legacy_bcast_packet);
+ break;
+ case BATADV_LEGACY_UNICAST_FRAG: /* 0x06 */
+ offset = sizeof(struct batadv_legacy_unicast_frag_packet);
+ break;
+ case BATADV_LEGACY_UNICAST_4ADDR: /* 0x09 */
+ offset = sizeof(struct batadv_legacy_unicast_4addr_packet);
+ break;
+ case BATADV_LEGACY_CODED: /* 0x0a */
+ offset = sizeof(struct batadv_legacy_coded_packet);
+ break;
+ default:
+ offset = 0;
+ }
+
+ if (offset)
+ gen_batadv_push_offset(cstate, (u_int)offset);
+}
+
+static void
+gen_batadv_offsets_v15(compiler_state_t *cstate, bpf_u_int32 type)
+{
+ size_t offset;
+
+ switch (type) {
+ case BATADV_BCAST: /* 0x01 */
+ offset = sizeof(struct batadv_bcast_packet);
+ break;
+ case BATADV_CODED: /* 0x02 */
+ offset = sizeof(struct batadv_coded_packet);
+ break;
+ case BATADV_UNICAST: /* 0x40 */
+ offset = sizeof(struct batadv_unicast_packet);
+ break;
+ case BATADV_UNICAST_FRAG: /* 0x41 */
+ offset = sizeof(struct batadv_frag_packet);
+ break;
+ case BATADV_UNICAST_4ADDR: /* 0x42 */
+ offset = sizeof(struct batadv_unicast_4addr_packet);
+ break;
+ case BATADV_UNICAST_TVLV:
+ /* unsupported for now, needs variable offset to
+ * take tvlv_len into account
+ */
+ /* fall through */
+ default:
+ offset = 0;
+ }
+
+ if (offset)
+ gen_batadv_push_offset(cstate, (u_int)offset);
+}
+
+static void
+gen_batadv_offsets(compiler_state_t *cstate, bpf_u_int32 version, bpf_u_int32 type)
+{
+ switch (version) {
+ case 14:
+ gen_batadv_offsets_v14(cstate, type);
+ break;
+ case 15:
+ gen_batadv_offsets_v15(cstate, type);
+ break;
+ default:
+ break;
+ }
+}
+
+struct block *
+gen_batadv(compiler_state_t *cstate, bpf_u_int32 version, int has_version,
+ bpf_u_int32 type, int has_type)
+{
+ struct block *b0;
+
+ /*
+ * Catch errors reported by us and routines below us, and return NULL
+ * on an error.
+ */
+ if (setjmp(cstate->top_ctx))
+ return (NULL);
+
+ b0 = gen_linktype(cstate, ETHERTYPE_BATMAN);
+
+ if (has_version)
+ b0 = gen_batadv_check_version(cstate, b0, version);
+
+ if (has_type) {
+ b0 = gen_batadv_check_type(cstate, b0, version, type);
+ gen_batadv_offsets(cstate, version, type);
+ }
+
+ return b0;
+}
+
/* Check that the encapsulated frame has a link layer header
* for Ethernet filters. */
static struct block *
--- a/gencode.h
+++ b/gencode.h
@@ -346,6 +346,9 @@ struct block *gen_pppoes(compiler_state_
struct block *gen_geneve(compiler_state_t *, bpf_u_int32, int);
+struct block *gen_batadv(compiler_state_t *, bpf_u_int32, int,
+ bpf_u_int32, int);
+
struct block *gen_atmfield_code(compiler_state_t *, int, bpf_u_int32,
int, int);
struct block *gen_atmtype_abbrev(compiler_state_t *, int);
--- a/grammar.y.in
+++ b/grammar.y.in
@@ -347,6 +347,7 @@ DIAG_OFF_BISON_BYACC
%type <i> mtp2type
%type <blk> mtp3field
%type <blk> mtp3fieldvalue mtp3value mtp3listvalue
+%type <rblk> pbatadv
%token DST SRC HOST GATEWAY
@@ -365,7 +366,7 @@ DIAG_OFF_BISON_BYACC
%token LEN
%token IPV6 ICMPV6 AH ESP
%token VLAN MPLS
-%token PPPOED PPPOES GENEVE
+%token PPPOED PPPOES GENEVE BATADV
%token ISO ESIS CLNP ISIS L1 L2 IIH LSP SNP CSNP PSNP
%token STP
%token IPX
@@ -592,11 +593,40 @@ other: pqual TK_BROADCAST { CHECK_PTR_
| PPPOES { CHECK_PTR_VAL(($$ = gen_pppoes(cstate, 0, 0))); }
| GENEVE pnum { CHECK_PTR_VAL(($$ = gen_geneve(cstate, $2, 1))); }
| GENEVE { CHECK_PTR_VAL(($$ = gen_geneve(cstate, 0, 0))); }
+ | BATADV pbatadv { $$ = $2; }
| pfvar { $$ = $1; }
| pqual p80211 { $$ = $2; }
| pllc { $$ = $1; }
;
+pbatadv: { CHECK_PTR_VAL(($$ = gen_batadv(cstate, 0, 0, 0, 0))); }
+ | pnum { CHECK_PTR_VAL(($$ = gen_batadv(cstate, $1, 1, 0, 0))); }
+ | pnum pnum { CHECK_PTR_VAL(($$ = gen_batadv(cstate, $1, 1, $2, 1))); }
+ | pnum ID
+ {
+ int type;
+
+ switch ($1) {
+ case 14:
+ type = pcap_nametobatadvtype_v14($2);
+ break;
+ case 15:
+ type = pcap_nametobatadvtype_v15($2);
+ break;
+ default:
+ bpf_set_error(cstate, "batman-adv compatibility version number %u unsupported", $1);
+ YYABORT;
+ }
+
+ if (type == PROTO_UNDEF) {
+ bpf_set_error(cstate, "invalid batman-adv packet type value \"%s\"", $2);
+ YYABORT;
+ }
+
+ CHECK_PTR_VAL(($$ = gen_batadv(cstate, $1, 1, type, 1)));
+ }
+ ;
+
pfvar: PF_IFNAME ID { CHECK_PTR_VAL($2); CHECK_PTR_VAL(($$ = gen_pf_ifname(cstate, $2))); }
| PF_RSET ID { CHECK_PTR_VAL($2); CHECK_PTR_VAL(($$ = gen_pf_ruleset(cstate, $2))); }
| PF_RNR NUM { CHECK_PTR_VAL(($$ = gen_pf_rnr(cstate, $2))); }
--- a/nametoaddr.c
+++ b/nametoaddr.c
@@ -136,8 +136,12 @@
#include "diag-control.h"
+#include "batadv_packet.h"
+#include "batadv_legacy_packet.h"
+
#include "gencode.h"
#include <pcap/namedb.h>
+
#include "nametoaddr.h"
#ifdef HAVE_OS_PROTO_H
@@ -604,6 +608,7 @@ PCAP_API_DEF struct eproto eproto_db[] =
{ "moprc", ETHERTYPE_MOPRC },
{ "rarp", ETHERTYPE_REVARP },
{ "sca", ETHERTYPE_SCA },
+ { "batadv", ETHERTYPE_BATMAN },
{ (char *)0, 0 }
};
@@ -638,6 +643,60 @@ pcap_nametollc(const char *s)
while (p->s != 0) {
if (strcmp(p->s, s) == 0)
+ return p->p;
+ p += 1;
+ }
+ return PROTO_UNDEF;
+}
+
+/* Static data base of batman-adv v14 packet type values. */
+static struct eproto batadv_type_db_v14[] = {
+ { "iv_ogm", BATADV_LEGACY_IV_OGM },
+ { "icmp", BATADV_LEGACY_ICMP },
+ { "unicast", BATADV_LEGACY_UNICAST },
+ { "bcast", BATADV_LEGACY_BCAST },
+ { "vis", BATADV_LEGACY_VIS },
+ { "unicast_frag", BATADV_LEGACY_UNICAST_FRAG },
+ { "tt_query", BATADV_LEGACY_TT_QUERY },
+ { "roam_adv", BATADV_LEGACY_ROAM_ADV },
+ { "unicast_4addr", BATADV_LEGACY_UNICAST_4ADDR },
+ { "coded", BATADV_LEGACY_CODED },
+ { (char *)0, 0 }
+};
+
+int pcap_nametobatadvtype_v14(const char *s)
+{
+ struct eproto *p = batadv_type_db_v14;
+
+ while (p->s != 0) {
+ if (strcmp(p->s, s) == 0)
+ return p->p;
+ p += 1;
+ }
+ return PROTO_UNDEF;
+}
+
+/* Static data base of batman-adv v15 packet type values. */
+static struct eproto batadv_type_db_v15[] = {
+ { "iv_ogm", BATADV_IV_OGM },
+ { "bcast", BATADV_BCAST },
+ { "coded", BATADV_CODED },
+ { "elp", BATADV_ELP },
+ { "ogm2", BATADV_OGM2 },
+ { "unicast", BATADV_UNICAST },
+ { "unicast_frag", BATADV_UNICAST_FRAG },
+ { "unicast_4addr", BATADV_UNICAST_4ADDR },
+ { "icmp", BATADV_ICMP },
+ { "unicast_tvlv", BATADV_UNICAST_TVLV },
+ { (char *)0, 0 }
+};
+
+int pcap_nametobatadvtype_v15(const char *s)
+{
+ struct eproto *p = batadv_type_db_v15;
+
+ while (p->s != 0) {
+ if (strcmp(p->s, s) == 0)
return p->p;
p += 1;
}
--- a/pcap-filter.manmisc.in
+++ b/pcap-filter.manmisc.in
@@ -98,6 +98,7 @@ protos are:
.BR arp ,
.BR rarp ,
.BR decnet ,
+.BR batadv ,
.B tcp
and
.BR udp .
@@ -361,7 +362,7 @@ True if the packet is an IPv6 multicast
.IP "\fBether proto \fIprotocol\fR"
True if the packet is of ether type \fIprotocol\fR.
\fIProtocol\fP can be a number or one of the names
-\fBaarp\fP, \fBarp\fP, \fBatalk\fP, \fBdecnet\fP, \fBip\fP, \fBip6\fP,
+\fBaarp\fP, \fBarp\fP, \fBatalk\fP, \fBbatadv\fP, \fBdecnet\fP, \fBip\fP, \fBip6\fP,
\fBipx\fP, \fBiso\fP, \fBlat\fP, \fBloopback\fP, \fBmopdl\fP, \fBmoprc\fP, \fBnetbeui\fP,
\fBrarp\fP, \fBsca\fP or \fBstp\fP.
Note these identifiers (except \fBloopback\fP) are also keywords
@@ -415,7 +416,7 @@ the filter checks for the IPX etype in a
DSAP in the LLC header, the 802.3-with-no-LLC-header encapsulation of
IPX, and the IPX etype in a SNAP frame.
.RE
-.IP "\fBip\fR, \fBip6\fR, \fBarp\fR, \fBrarp\fR, \fBatalk\fR, \fBaarp\fR, \fBdecnet\fR, \fBiso\fR, \fBstp\fR, \fBipx\fR, \fBnetbeui\fP"
+.IP "\fBip\fR, \fBip6\fR, \fBarp\fR, \fBrarp\fR, \fBatalk\fR, \fBaarp\fR, \fBdecnet\fR, \fBiso\fR, \fBstp\fR, \fBipx\fR, \fBnetbeui\fP, \fBbatadv\fP"
Abbreviations for:
.in +.5i
.nf
@@ -752,6 +753,36 @@ For example:
filters IPv4 protocol encapsulated in Geneve with VNI 0xb. This will
match both IPv4 directly encapsulated in Geneve as well as IPv4 contained
inside an Ethernet frame.
+.IP "\fBbatadv \fI[version] \fI[type]\fR"
+True if the packet is a B.A.T.M.A.N. Advanced packet (Ethernet type 0x4305).
+If the optional \fIversion\fR is specified, only true if the packet has the
+specified batman-adv compatibility \fIversion\fR. If the optional \fIversion\fR
+and \fItype\fR are specified, only true if the packet has both the specified
+batman-adv compatibility \fIversion\fR and batman-adv packet \fItype\fR.
+.IP
+\fIversion\fR may be a number from 0 to 255, though only compatibility version
+14 and 15 were actually deployed in the wild. Version 15 is the current version,
+14 is considered deprecated.
+.IP
+\fItype\fR is currently only defined for compatibility \fIversion\fR 14 and 15.
+\fItype\fR may be a number from 0 to 255 for compatibility \fIversion\fR 14 and 15.
+.IP
+The following packet \fItype\fR aliases are available for compat \fIversion\fR 14:
+\fBiv_ogm\fP, \fBicmp\fP, \fBunicast\fP, \fBbcast\fP, \fBvis\fP, \fBunicast-frag\fP,
+\fBtt_query\fP, \fBroam_adv\fP, \fBunicast_4addr\fP, \fPcoded\fP.
+.IP
+The following packet \fItype\fR aliases are available for compat \fIversion\fR 15:
+\fBiv_ogm\fP, \fBbcast\fP, \fBcoded\fP, \fBelp\fP, \fBogm2\fP, \fBunicast\fP,
+\fBunicast_frag\fP, \fBunicast_4addr\fP, \fBicmp\fP, \fPunicast_tvlv\fP.
+.IP
+Note that when the \fBbatadv\fR keyword is encountered in an expression and
+a batman-adv packet \fItype\fR is provided which specifies an encapsulating
+packet type then it changes the decoding offsets for the remainder of the
+expression on the assumption that the packet is a batman-adv packet. For compat
+\fIversion\fR 14 these are packet \fItype\fRs \fBunicast\fP, \fBbcast\fP,
+\fBunicast_frag\fP, \fBunicast_4addr\fP and \fBcoded\fP. For compat \fIversion\fR
+15 these are currently packet \fItype\fRs \fBbcast\fP, \fBcoded\fP, \fBunicast\fP,
+\fBunicast_frag\fP and \fBunicast_4addr\fP.
.IP "\fBiso proto \fIprotocol\fR"
True if the packet is an OSI packet of protocol type \fIprotocol\fP.
\fIProtocol\fP can be a number or one of the names
--- a/pcap/namedb.h
+++ b/pcap/namedb.h
@@ -69,6 +69,8 @@ PCAP_API int pcap_nametoportrange(const
PCAP_API int pcap_nametoproto(const char *);
PCAP_API int pcap_nametoeproto(const char *);
PCAP_API int pcap_nametollc(const char *);
+PCAP_API int pcap_nametobatadvtype_v14(const char *);
+PCAP_API int pcap_nametobatadvtype_v15(const char *);
/*
* If a protocol is unknown, PROTO_UNDEF is returned.
* Also, pcap_nametoport() returns the protocol along with the port number.
--- a/scanner.l
+++ b/scanner.l
@@ -344,6 +344,7 @@ mpls return MPLS;
pppoed return PPPOED;
pppoes return PPPOES;
geneve return GENEVE;
+batadv return BATADV;
lane return LANE;
llc return LLC;

View file

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=libtraceevent PKG_NAME:=libtraceevent
PKG_VERSION:=1.6.3 PKG_VERSION:=1.7.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/ PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/
PKG_HASH:=031e4428586788bb835d894f7f11c54e482764063d96ead303c7f208fb59e353 PKG_HASH:=3e902184f743c955b183b45f25ea163a3d41c9f287fdcfc95cd9cca748c563c8
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org> PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>

View file

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=libtracefs PKG_NAME:=libtracefs
PKG_VERSION:=1.6.2 PKG_VERSION:=1.6.3
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/ PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/
PKG_HASH:=3598ead36660b03cec097bd7e45d900e4c3f7673bba673f5508884477d2d982c PKG_HASH:=de307faaa54ac52cf0ce3ff19b32b51af24897e3440e643068ac82d31e197e92
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org> PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>

View file

@ -4,20 +4,25 @@ config WPA_RFKILL_SUPPORT
depends on PACKAGE_wpa-supplicant || \ depends on PACKAGE_wpa-supplicant || \
PACKAGE_wpa-supplicant-openssl || \ PACKAGE_wpa-supplicant-openssl || \
PACKAGE_wpa-supplicant-wolfssl || \ PACKAGE_wpa-supplicant-wolfssl || \
PACKAGE_wpa-supplicant-mbedtls || \
PACKAGE_wpa-supplicant-mesh-openssl || \ PACKAGE_wpa-supplicant-mesh-openssl || \
PACKAGE_wpa-supplicant-mesh-wolfssl || \ PACKAGE_wpa-supplicant-mesh-wolfssl || \
PACKAGE_wpa-supplicant-mesh-mbedtls || \
PACKAGE_wpa-supplicant-basic || \ PACKAGE_wpa-supplicant-basic || \
PACKAGE_wpa-supplicant-mini || \ PACKAGE_wpa-supplicant-mini || \
PACKAGE_wpa-supplicant-p2p || \ PACKAGE_wpa-supplicant-p2p || \
PACKAGE_wpad || \ PACKAGE_wpad || \
PACKAGE_wpad-openssl || \ PACKAGE_wpad-openssl || \
PACKAGE_wpad-wolfssl || \ PACKAGE_wpad-wolfssl || \
PACKAGE_wpad-mbedtls || \
PACKAGE_wpad-basic || \ PACKAGE_wpad-basic || \
PACKAGE_wpad-basic-openssl || \ PACKAGE_wpad-basic-openssl || \
PACKAGE_wpad-basic-wolfssl || \ PACKAGE_wpad-basic-wolfssl || \
PACKAGE_wpad-basic-mbedtls || \
PACKAGE_wpad-mini || \ PACKAGE_wpad-mini || \
PACKAGE_wpad-mesh-openssl || \ PACKAGE_wpad-mesh-openssl || \
PACKAGE_wpad-mesh-wolfssl PACKAGE_wpad-mesh-wolfssl || \
PACKAGE_wpad-mesh-mbedtls
default n default n
config WPA_MSG_MIN_PRIORITY config WPA_MSG_MIN_PRIORITY
@ -25,20 +30,25 @@ config WPA_MSG_MIN_PRIORITY
depends on PACKAGE_wpa-supplicant || \ depends on PACKAGE_wpa-supplicant || \
PACKAGE_wpa-supplicant-openssl || \ PACKAGE_wpa-supplicant-openssl || \
PACKAGE_wpa-supplicant-wolfssl || \ PACKAGE_wpa-supplicant-wolfssl || \
PACKAGE_wpa-supplicant-mbedtls || \
PACKAGE_wpa-supplicant-mesh-openssl || \ PACKAGE_wpa-supplicant-mesh-openssl || \
PACKAGE_wpa-supplicant-mesh-wolfssl || \ PACKAGE_wpa-supplicant-mesh-wolfssl || \
PACKAGE_wpa-supplicant-mesh-mbedtls || \
PACKAGE_wpa-supplicant-basic || \ PACKAGE_wpa-supplicant-basic || \
PACKAGE_wpa-supplicant-mini || \ PACKAGE_wpa-supplicant-mini || \
PACKAGE_wpa-supplicant-p2p || \ PACKAGE_wpa-supplicant-p2p || \
PACKAGE_wpad || \ PACKAGE_wpad || \
PACKAGE_wpad-openssl || \ PACKAGE_wpad-openssl || \
PACKAGE_wpad-wolfssl || \ PACKAGE_wpad-wolfssl || \
PACKAGE_wpad-mbedtls || \
PACKAGE_wpad-basic || \ PACKAGE_wpad-basic || \
PACKAGE_wpad-basic-openssl || \ PACKAGE_wpad-basic-openssl || \
PACKAGE_wpad-basic-wolfssl || \ PACKAGE_wpad-basic-wolfssl || \
PACKAGE_wpad-basic-mbedtls || \
PACKAGE_wpad-mini || \ PACKAGE_wpad-mini || \
PACKAGE_wpad-mesh-openssl || \ PACKAGE_wpad-mesh-openssl || \
PACKAGE_wpad-mesh-wolfssl PACKAGE_wpad-mesh-wolfssl || \
PACKAGE_wpad-mesh-mbedtls
default 3 default 3
help help
Useful values are: Useful values are:
@ -68,10 +78,6 @@ config DRIVER_WEXT_SUPPORT
select KERNEL_WIRELESS_EXT select KERNEL_WIRELESS_EXT
default n default n
config DRIVER_11N_SUPPORT
bool
default n
config DRIVER_11AC_SUPPORT config DRIVER_11AC_SUPPORT
bool bool
default n default n
@ -95,9 +101,11 @@ config WPA_MBO_SUPPORT
default PACKAGE_wpa-supplicant || \ default PACKAGE_wpa-supplicant || \
PACKAGE_wpa-supplicant-openssl || \ PACKAGE_wpa-supplicant-openssl || \
PACKAGE_wpa-supplicant-wolfssl || \ PACKAGE_wpa-supplicant-wolfssl || \
PACKAGE_wpa-supplicant-mbedtls || \
PACKAGE_wpad || \ PACKAGE_wpad || \
PACKAGE_wpad-openssl || \ PACKAGE_wpad-openssl || \
PACKAGE_wpad-wolfssl PACKAGE_wpad-wolfssl || \
PACKAGE_wpad-mbedtls
help help
Multi Band Operation aka (Agile Multiband) enables features Multi Band Operation aka (Agile Multiband) enables features
that facilitate efficient use of multiple frequency bands. that facilitate efficient use of multiple frequency bands.

View file

@ -28,7 +28,6 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_hostapd-mini \ CONFIG_PACKAGE_hostapd-mini \
CONFIG_WPA_RFKILL_SUPPORT \ CONFIG_WPA_RFKILL_SUPPORT \
CONFIG_DRIVER_WEXT_SUPPORT \ CONFIG_DRIVER_WEXT_SUPPORT \
CONFIG_DRIVER_11N_SUPPORT \
CONFIG_DRIVER_11AC_SUPPORT \ CONFIG_DRIVER_11AC_SUPPORT \
CONFIG_DRIVER_11AX_SUPPORT \ CONFIG_DRIVER_11AX_SUPPORT \
CONFIG_WPA_ENABLE_WEP CONFIG_WPA_ENABLE_WEP
@ -53,14 +52,16 @@ LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\
LOCAL_VARIANT=$(patsubst %-internal,%,\ LOCAL_VARIANT=$(patsubst %-internal,%,\
$(patsubst %-openssl,%,\ $(patsubst %-openssl,%,\
$(patsubst %-wolfssl,%,\ $(patsubst %-wolfssl,%,\
$(patsubst %-mbedtls,%,\
$(LOCAL_AND_LIB_VARIANT)\ $(LOCAL_AND_LIB_VARIANT)\
))) ))))
SSL_VARIANT=$(strip \ SSL_VARIANT=$(strip \
$(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\ $(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\
$(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\ $(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\
$(if $(findstring mbedtls,$(LOCAL_AND_LIB_VARIANT)),mbedtls,\
internal\ internal\
))) ))))
CONFIG_VARIANT:=$(LOCAL_VARIANT) CONFIG_VARIANT:=$(LOCAL_VARIANT)
ifeq ($(LOCAL_VARIANT),mesh) ifeq ($(LOCAL_VARIANT),mesh)
@ -71,11 +72,6 @@ include $(INCLUDE_DIR)/package.mk
STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY) STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
HOSTAPD_IEEE80211N:=y
endif
ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),) ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),)
HOSTAPD_IEEE80211AC:=y HOSTAPD_IEEE80211AC:=y
endif endif
@ -87,7 +83,6 @@ endif
DRIVER_MAKEOPTS= \ DRIVER_MAKEOPTS= \
CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \ CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \ CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \ CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \ CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
@ -123,6 +118,21 @@ ifeq ($(SSL_VARIANT),wolfssl)
endif endif
endif endif
ifeq ($(SSL_VARIANT),mbedtls)
DRIVER_MAKEOPTS += CONFIG_TLS=mbedtls CONFIG_SAE=y
TARGET_LDFLAGS += -lmbedcrypto -lmbedx509 -lmbedtls
ifeq ($(LOCAL_VARIANT),basic)
DRIVER_MAKEOPTS += CONFIG_OWE=y
endif
ifeq ($(LOCAL_VARIANT),mesh)
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
endif
ifeq ($(LOCAL_VARIANT),full)
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
endif
endif
ifneq ($(LOCAL_TYPE),hostapd) ifneq ($(LOCAL_TYPE),hostapd)
ifdef CONFIG_WPA_RFKILL_SUPPORT ifdef CONFIG_WPA_RFKILL_SUPPORT
DRIVER_MAKEOPTS += NEED_RFKILL=y DRIVER_MAKEOPTS += NEED_RFKILL=y
@ -180,6 +190,15 @@ endef
Package/hostapd-wolfssl/description = $(Package/hostapd/description) Package/hostapd-wolfssl/description = $(Package/hostapd/description)
define Package/hostapd-mbedtls
$(call Package/hostapd/Default,$(1))
TITLE+= (mbedTLS full)
VARIANT:=full-mbedtls
DEPENDS+=+PACKAGE_hostapd-mbedtls:libmbedtls
endef
Package/hostapd-mbedtls/description = $(Package/hostapd/description)
define Package/hostapd-basic define Package/hostapd-basic
$(call Package/hostapd/Default,$(1)) $(call Package/hostapd/Default,$(1))
TITLE+= (WPA-PSK, 11r, 11w) TITLE+= (WPA-PSK, 11r, 11w)
@ -212,6 +231,17 @@ define Package/hostapd-basic-wolfssl/description
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
endef endef
define Package/hostapd-basic-mbedtls
$(call Package/hostapd/Default,$(1))
TITLE+= (WPA-PSK, 11r and 11w)
VARIANT:=basic-mbedtls
DEPENDS+=+PACKAGE_hostapd-basic-mbedtls:libmbedtls
endef
define Package/hostapd-basic-mbedtls/description
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
endef
define Package/hostapd-mini define Package/hostapd-mini
$(call Package/hostapd/Default,$(1)) $(call Package/hostapd/Default,$(1))
TITLE+= (WPA-PSK only) TITLE+= (WPA-PSK only)
@ -267,6 +297,15 @@ endef
Package/wpad-wolfssl/description = $(Package/wpad/description) Package/wpad-wolfssl/description = $(Package/wpad/description)
define Package/wpad-mbedtls
$(call Package/wpad/Default,$(1))
TITLE+= (mbedTLS full)
VARIANT:=wpad-full-mbedtls
DEPENDS+=+PACKAGE_wpad-mbedtls:libmbedtls
endef
Package/wpad-mbedtls/description = $(Package/wpad/description)
define Package/wpad-basic define Package/wpad-basic
$(call Package/wpad/Default,$(1)) $(call Package/wpad/Default,$(1))
TITLE+= (WPA-PSK, 11r, 11w) TITLE+= (WPA-PSK, 11r, 11w)
@ -299,6 +338,17 @@ define Package/wpad-basic-wolfssl/description
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support. This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
endef endef
define Package/wpad-basic-mbedtls
$(call Package/wpad/Default,$(1))
TITLE+= (mbedTLS, 11r, 11w)
VARIANT:=wpad-basic-mbedtls
DEPENDS+=+PACKAGE_wpad-basic-mbedtls:libmbedtls
endef
define Package/wpad-basic-mbedtls/description
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
endef
define Package/wpad-mini define Package/wpad-mini
$(call Package/wpad/Default,$(1)) $(call Package/wpad/Default,$(1))
TITLE+= (WPA-PSK only) TITLE+= (WPA-PSK only)
@ -337,6 +387,15 @@ endef
Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description) Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description)
define Package/wpad-mesh-mbedtls
$(call Package/wpad-mesh,$(1))
TITLE+= (mbedTLS, 11s, SAE)
DEPENDS+=+PACKAGE_wpad-mesh-mbedtls:libmbedtls
VARIANT:=wpad-mesh-mbedtls
endef
Package/wpad-mesh-mbedtls/description = $(Package/wpad-mesh/description)
define Package/wpa-supplicant/Default define Package/wpa-supplicant/Default
SECTION:=net SECTION:=net
@ -372,6 +431,13 @@ $(call Package/wpa-supplicant/Default,$(1))
DEPENDS+=+PACKAGE_wpa-supplicant-wolfssl:libwolfssl DEPENDS+=+PACKAGE_wpa-supplicant-wolfssl:libwolfssl
endef endef
define Package/wpa-supplicant-mbedtls
$(call Package/wpa-supplicant/Default,$(1))
TITLE+= (mbedTLS full)
VARIANT:=supplicant-full-mbedtls
DEPENDS+=+PACKAGE_wpa-supplicant-mbedtls:libmbedtls
endef
define Package/wpa-supplicant/config define Package/wpa-supplicant/config
source "$(SOURCE)/Config.in" source "$(SOURCE)/Config.in"
endef endef
@ -403,6 +469,13 @@ $(call Package/wpa-supplicant-mesh/Default,$(1))
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-wolfssl:libwolfssl DEPENDS+=+PACKAGE_wpa-supplicant-mesh-wolfssl:libwolfssl
endef endef
define Package/wpa-supplicant-mesh-mbedtls
$(call Package/wpa-supplicant-mesh/Default,$(1))
TITLE+= (mbedTLS, 11s, SAE)
VARIANT:=supplicant-mesh-mbedtls
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-mbedtls:libmbedtls
endef
define Package/wpa-supplicant-basic define Package/wpa-supplicant-basic
$(call Package/wpa-supplicant/Default,$(1)) $(call Package/wpa-supplicant/Default,$(1))
TITLE+= (11r, 11w) TITLE+= (11r, 11w)
@ -479,6 +552,15 @@ define Package/eapol-test-wolfssl
PROVIDES:=eapol-test PROVIDES:=eapol-test
endef endef
define Package/eapol-test-mbedtls
$(call Package/eapol-test/Default,$(1))
TITLE+= (mbedTLS full)
VARIANT:=supplicant-full-mbedtls
CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-mbedtls ,$(EAPOL_TEST_PROVIDERS)))
DEPENDS+=+PACKAGE_eapol-test-mbedtls:libmbedtls
PROVIDES:=eapol-test
endef
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED))) ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
define Build/Configure/rebuild define Build/Configure/rebuild
@ -587,6 +669,12 @@ define Build/Compile/supplicant-full-wolfssl
) )
endef endef
define Build/Compile/supplicant-full-mbedtls
+$(call Build/RunMake,wpa_supplicant, \
eapol_test \
)
endef
define Build/Compile define Build/Compile
$(Build/Compile/$(LOCAL_TYPE)) $(Build/Compile/$(LOCAL_TYPE))
$(Build/Compile/$(BUILD_VARIANT)) $(Build/Compile/$(BUILD_VARIANT))
@ -617,9 +705,11 @@ endef
Package/hostapd-basic/install = $(Package/hostapd/install) Package/hostapd-basic/install = $(Package/hostapd/install)
Package/hostapd-basic-openssl/install = $(Package/hostapd/install) Package/hostapd-basic-openssl/install = $(Package/hostapd/install)
Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install) Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install)
Package/hostapd-basic-mbedtls/install = $(Package/hostapd/install)
Package/hostapd-mini/install = $(Package/hostapd/install) Package/hostapd-mini/install = $(Package/hostapd/install)
Package/hostapd-openssl/install = $(Package/hostapd/install) Package/hostapd-openssl/install = $(Package/hostapd/install)
Package/hostapd-wolfssl/install = $(Package/hostapd/install) Package/hostapd-wolfssl/install = $(Package/hostapd/install)
Package/hostapd-mbedtls/install = $(Package/hostapd/install)
ifneq ($(LOCAL_TYPE),supplicant) ifneq ($(LOCAL_TYPE),supplicant)
define Package/hostapd-utils/install define Package/hostapd-utils/install
@ -638,11 +728,14 @@ endef
Package/wpad-basic/install = $(Package/wpad/install) Package/wpad-basic/install = $(Package/wpad/install)
Package/wpad-basic-openssl/install = $(Package/wpad/install) Package/wpad-basic-openssl/install = $(Package/wpad/install)
Package/wpad-basic-wolfssl/install = $(Package/wpad/install) Package/wpad-basic-wolfssl/install = $(Package/wpad/install)
Package/wpad-basic-mbedtls/install = $(Package/wpad/install)
Package/wpad-mini/install = $(Package/wpad/install) Package/wpad-mini/install = $(Package/wpad/install)
Package/wpad-openssl/install = $(Package/wpad/install) Package/wpad-openssl/install = $(Package/wpad/install)
Package/wpad-wolfssl/install = $(Package/wpad/install) Package/wpad-wolfssl/install = $(Package/wpad/install)
Package/wpad-mbedtls/install = $(Package/wpad/install)
Package/wpad-mesh-openssl/install = $(Package/wpad/install) Package/wpad-mesh-openssl/install = $(Package/wpad/install)
Package/wpad-mesh-wolfssl/install = $(Package/wpad/install) Package/wpad-mesh-wolfssl/install = $(Package/wpad/install)
Package/wpad-mesh-mbedtls/install = $(Package/wpad/install)
define Package/wpa-supplicant/install define Package/wpa-supplicant/install
$(call Install/supplicant,$(1)) $(call Install/supplicant,$(1))
@ -653,8 +746,10 @@ Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-mbedtls/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install)
Package/wpa-supplicant-mesh-mbedtls/install = $(Package/wpa-supplicant/install)
ifneq ($(LOCAL_TYPE),hostapd) ifneq ($(LOCAL_TYPE),hostapd)
define Package/wpa-cli/install define Package/wpa-cli/install
@ -684,6 +779,13 @@ ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl)
endef endef
endif endif
ifeq ($(BUILD_VARIANT),supplicant-full-mbedtls)
define Package/eapol-test-mbedtls/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
endef
endif
# Build hostapd-common before its dependents, to avoid # Build hostapd-common before its dependents, to avoid
# spurious rebuilds when building multiple variants. # spurious rebuilds when building multiple variants.
$(eval $(call BuildPackage,hostapd-common)) $(eval $(call BuildPackage,hostapd-common))
@ -691,28 +793,36 @@ $(eval $(call BuildPackage,hostapd))
$(eval $(call BuildPackage,hostapd-basic)) $(eval $(call BuildPackage,hostapd-basic))
$(eval $(call BuildPackage,hostapd-basic-openssl)) $(eval $(call BuildPackage,hostapd-basic-openssl))
$(eval $(call BuildPackage,hostapd-basic-wolfssl)) $(eval $(call BuildPackage,hostapd-basic-wolfssl))
$(eval $(call BuildPackage,hostapd-basic-mbedtls))
$(eval $(call BuildPackage,hostapd-mini)) $(eval $(call BuildPackage,hostapd-mini))
$(eval $(call BuildPackage,hostapd-openssl)) $(eval $(call BuildPackage,hostapd-openssl))
$(eval $(call BuildPackage,hostapd-wolfssl)) $(eval $(call BuildPackage,hostapd-wolfssl))
$(eval $(call BuildPackage,hostapd-mbedtls))
$(eval $(call BuildPackage,wpad)) $(eval $(call BuildPackage,wpad))
$(eval $(call BuildPackage,wpad-mesh-openssl)) $(eval $(call BuildPackage,wpad-mesh-openssl))
$(eval $(call BuildPackage,wpad-mesh-wolfssl)) $(eval $(call BuildPackage,wpad-mesh-wolfssl))
$(eval $(call BuildPackage,wpad-mesh-mbedtls))
$(eval $(call BuildPackage,wpad-basic)) $(eval $(call BuildPackage,wpad-basic))
$(eval $(call BuildPackage,wpad-basic-openssl)) $(eval $(call BuildPackage,wpad-basic-openssl))
$(eval $(call BuildPackage,wpad-basic-wolfssl)) $(eval $(call BuildPackage,wpad-basic-wolfssl))
$(eval $(call BuildPackage,wpad-basic-mbedtls))
$(eval $(call BuildPackage,wpad-mini)) $(eval $(call BuildPackage,wpad-mini))
$(eval $(call BuildPackage,wpad-openssl)) $(eval $(call BuildPackage,wpad-openssl))
$(eval $(call BuildPackage,wpad-wolfssl)) $(eval $(call BuildPackage,wpad-wolfssl))
$(eval $(call BuildPackage,wpad-mbedtls))
$(eval $(call BuildPackage,wpa-supplicant)) $(eval $(call BuildPackage,wpa-supplicant))
$(eval $(call BuildPackage,wpa-supplicant-mesh-openssl)) $(eval $(call BuildPackage,wpa-supplicant-mesh-openssl))
$(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl)) $(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl))
$(eval $(call BuildPackage,wpa-supplicant-mesh-mbedtls))
$(eval $(call BuildPackage,wpa-supplicant-basic)) $(eval $(call BuildPackage,wpa-supplicant-basic))
$(eval $(call BuildPackage,wpa-supplicant-mini)) $(eval $(call BuildPackage,wpa-supplicant-mini))
$(eval $(call BuildPackage,wpa-supplicant-p2p)) $(eval $(call BuildPackage,wpa-supplicant-p2p))
$(eval $(call BuildPackage,wpa-supplicant-openssl)) $(eval $(call BuildPackage,wpa-supplicant-openssl))
$(eval $(call BuildPackage,wpa-supplicant-wolfssl)) $(eval $(call BuildPackage,wpa-supplicant-wolfssl))
$(eval $(call BuildPackage,wpa-supplicant-mbedtls))
$(eval $(call BuildPackage,wpa-cli)) $(eval $(call BuildPackage,wpa-cli))
$(eval $(call BuildPackage,hostapd-utils)) $(eval $(call BuildPackage,hostapd-utils))
$(eval $(call BuildPackage,eapol-test)) $(eval $(call BuildPackage,eapol-test))
$(eval $(call BuildPackage,eapol-test-openssl)) $(eval $(call BuildPackage,eapol-test-openssl))
$(eval $(call BuildPackage,eapol-test-wolfssl)) $(eval $(call BuildPackage,eapol-test-wolfssl))
$(eval $(call BuildPackage,eapol-test-mbedtls))

View file

@ -611,7 +611,9 @@ hostapd_set_bss_options() {
[ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N" [ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N"
} }
[ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N" set_default nasid "${macaddr//\:}"
append bss_conf "nas_identifier=$nasid" "$N"
[ -n "$acct_server" ] && { [ -n "$acct_server" ] && {
append bss_conf "acct_server_addr=$acct_server" "$N" append bss_conf "acct_server_addr=$acct_server" "$N"
append bss_conf "acct_server_port=$acct_port" "$N" append bss_conf "acct_server_port=$acct_port" "$N"
@ -687,7 +689,7 @@ hostapd_set_bss_options() {
json_get_vars \ json_get_vars \
auth_server auth_secret auth_port \ auth_server auth_secret auth_port \
dae_client dae_secret dae_port \ dae_client dae_secret dae_port \
ownip radius_client_addr \ dynamic_ownip ownip radius_client_addr \
eap_reauth_period request_cui \ eap_reauth_period request_cui \
erp_domain mobility_domain \ erp_domain mobility_domain \
fils_realm fils_dhcp fils_realm fils_dhcp
@ -695,6 +697,8 @@ hostapd_set_bss_options() {
# radius can provide VLAN ID for clients # radius can provide VLAN ID for clients
vlan_possible=1 vlan_possible=1
set_default dynamic_ownip 1
# legacy compatibility # legacy compatibility
[ -n "$auth_server" ] || json_get_var auth_server server [ -n "$auth_server" ] || json_get_var auth_server server
[ -n "$auth_port" ] || json_get_var auth_port port [ -n "$auth_port" ] || json_get_var auth_port port
@ -743,7 +747,12 @@ hostapd_set_bss_options() {
} }
json_for_each_item append_radius_auth_req_attr radius_auth_req_attr json_for_each_item append_radius_auth_req_attr radius_auth_req_attr
[ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N" if [ -n "$ownip" ]; then
append bss_conf "own_ip_addr=$ownip" "$N"
elif [ "$dynamic_ownip" -gt 0 ]; then
append bss_conf "dynamic_own_ip_addr=$dynamic_ownip" "$N"
fi
[ -n "$radius_client_addr" ] && append bss_conf "radius_client_addr=$radius_client_addr" "$N" [ -n "$radius_client_addr" ] && append bss_conf "radius_client_addr=$radius_client_addr" "$N"
append bss_conf "eapol_key_index_workaround=1" "$N" append bss_conf "eapol_key_index_workaround=1" "$N"
append bss_conf "ieee8021x=1" "$N" append bss_conf "ieee8021x=1" "$N"
@ -905,7 +914,6 @@ hostapd_set_bss_options() {
append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N"
append bss_conf "ft_over_ds=$ft_over_ds" "$N" append bss_conf "ft_over_ds=$ft_over_ds" "$N"
append bss_conf "reassociation_deadline=$reassociation_deadline" "$N" append bss_conf "reassociation_deadline=$reassociation_deadline" "$N"
[ -n "$nasid" ] || append bss_conf "nas_identifier=${macaddr//\:}" "$N"
if [ "$ft_psk_generate_local" -eq "0" ]; then if [ "$ft_psk_generate_local" -eq "0" ]; then
json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push

View file

@ -13,6 +13,7 @@ start_service() {
procd_open_instance hostapd procd_open_instance hostapd
procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global
procd_set_param respawn 3600 1 0 procd_set_param respawn 3600 1 0
procd_set_param limits core="unlimited"
[ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && { [ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && {
procd_add_jail hostapd procd_add_jail hostapd
procd_set_param capabilities /etc/capabilities/wpad.json procd_set_param capabilities /etc/capabilities/wpad.json
@ -29,6 +30,7 @@ start_service() {
procd_open_instance supplicant procd_open_instance supplicant
procd_set_param command /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global procd_set_param command /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global
procd_set_param respawn 3600 1 0 procd_set_param respawn 3600 1 0
procd_set_param limits core="unlimited"
[ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && { [ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && {
procd_add_jail wpa_supplicant procd_add_jail wpa_supplicant
procd_set_param capabilities /etc/capabilities/wpad.json procd_set_param capabilities /etc/capabilities/wpad.json

View file

@ -0,0 +1,114 @@
From c8dba4bd750269bcc80fed3d546e2077cb4cdf0e Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Tue, 19 Jul 2022 20:02:21 -0400
Subject: [PATCH 2/7] mbedtls: fips186_2_prf()
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
hostapd/Makefile | 4 ---
src/crypto/crypto_mbedtls.c | 60 +++++++++++++++++++++++++++++++++++++
wpa_supplicant/Makefile | 4 ---
3 files changed, 60 insertions(+), 8 deletions(-)
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -759,10 +759,6 @@ endif
OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
HOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
SOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
-ifdef NEED_FIPS186_2_PRF
-OBJS += ../src/crypto/fips_prf_internal.o
-SHA1OBJS += ../src/crypto/sha1-internal.o
-endif
ifeq ($(CONFIG_CRYPTO), mbedtls)
ifdef CONFIG_DPP
LIBS += -lmbedx509
--- a/src/crypto/crypto_mbedtls.c
+++ b/src/crypto/crypto_mbedtls.c
@@ -132,6 +132,12 @@
#define CRYPTO_MBEDTLS_HMAC_KDF_SHA512
#endif
+#if defined(EAP_SIM) || defined(EAP_SIM_DYNAMIC) || defined(EAP_SERVER_SIM) \
+ || defined(EAP_AKA) || defined(EAP_AKA_DYNAMIC) || defined(EAP_SERVER_AKA)
+/* EAP_SIM=y EAP_AKA=y */
+#define CRYPTO_MBEDTLS_FIPS186_2_PRF
+#endif
+
#if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST) \
|| defined(EAP_TEAP) || defined(EAP_TEAP_DYNAMIC) || defined(EAP_SERVER_FAST)
#define CRYPTO_MBEDTLS_SHA1_T_PRF
@@ -813,6 +819,60 @@ int sha1_t_prf(const u8 *key, size_t key
#endif /* CRYPTO_MBEDTLS_SHA1_T_PRF */
+#ifdef CRYPTO_MBEDTLS_FIPS186_2_PRF
+
+/* fips_prf_internal.c sha1-internal.c */
+
+/* used only by src/eap_common/eap_sim_common.c:eap_sim_prf()
+ * for eap_sim_derive_keys() and eap_sim_derive_keys_reauth()
+ * where xlen is 160 */
+
+int fips186_2_prf(const u8 *seed, size_t seed_len, u8 *x, size_t xlen)
+{
+ /* FIPS 186-2 + change notice 1 */
+
+ mbedtls_sha1_context ctx;
+ u8 * const xkey = ctx.MBEDTLS_PRIVATE(buffer);
+ u32 * const xstate = ctx.MBEDTLS_PRIVATE(state);
+ const u32 xstate_init[] =
+ { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 };
+
+ mbedtls_sha1_init(&ctx);
+ os_memcpy(xkey, seed, seed_len < 64 ? seed_len : 64);
+
+ /* note: does not fill extra bytes if (xlen % 20) (SHA1_MAC_LEN) */
+ for (; xlen >= 20; xlen -= 20) {
+ /* XSEED_j = 0 */
+ /* XVAL = (XKEY + XSEED_j) mod 2^b */
+
+ /* w_i = G(t, XVAL) */
+ os_memcpy(xstate, xstate_init, sizeof(xstate_init));
+ mbedtls_internal_sha1_process(&ctx, xkey);
+
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ xstate[0] = host_to_be32(xstate[0]);
+ xstate[1] = host_to_be32(xstate[1]);
+ xstate[2] = host_to_be32(xstate[2]);
+ xstate[3] = host_to_be32(xstate[3]);
+ xstate[4] = host_to_be32(xstate[4]);
+ #endif
+ os_memcpy(x, xstate, 20);
+ if (xlen == 20) /*(done; skip prep for next loop)*/
+ break;
+
+ /* XKEY = (1 + XKEY + w_i) mod 2^b */
+ for (u32 carry = 1, k = 20; k-- > 0; carry >>= 8)
+ xkey[k] = (carry += xkey[k] + x[k]) & 0xff;
+ x += 20;
+ /* x_j = w_0|w_1 (each pair of iterations through loop)*/
+ }
+
+ mbedtls_sha1_free(&ctx);
+ return 0;
+}
+
+#endif /* CRYPTO_MBEDTLS_FIPS186_2_PRF */
+
#endif /* MBEDTLS_SHA1_C */
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1160,10 +1160,6 @@ endif
OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
-ifdef NEED_FIPS186_2_PRF
-OBJS += ../src/crypto/fips_prf_internal.o
-SHA1OBJS += ../src/crypto/sha1-internal.o
-endif
ifeq ($(CONFIG_CRYPTO), mbedtls)
LIBS += -lmbedcrypto
LIBS_p += -lmbedcrypto

View file

@ -0,0 +1,421 @@
From 31bd19e0e0254b910cccfd3ddc6a6a9222bbcfc0 Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Sun, 9 Oct 2022 05:12:17 -0400
Subject: [PATCH 3/7] mbedtls: annotate with TEST_FAIL() for hwsim tests
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
src/crypto/crypto_mbedtls.c | 124 ++++++++++++++++++++++++++++++++++++
1 file changed, 124 insertions(+)
--- a/src/crypto/crypto_mbedtls.c
+++ b/src/crypto/crypto_mbedtls.c
@@ -280,6 +280,9 @@ __attribute_noinline__
static int md_vector(size_t num_elem, const u8 *addr[], const size_t *len,
u8 *mac, mbedtls_md_type_t md_type)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_md_context_t ctx;
mbedtls_md_init(&ctx);
if (mbedtls_md_setup(&ctx, mbedtls_md_info_from_type(md_type), 0) != 0){
@@ -343,6 +346,9 @@ __attribute_noinline__
static int sha384_512_vector(size_t num_elem, const u8 *addr[],
const size_t *len, u8 *mac, int is384)
{
+ if (TEST_FAIL())
+ return -1;
+
struct mbedtls_sha512_context ctx;
mbedtls_sha512_init(&ctx);
#if MBEDTLS_VERSION_MAJOR >= 3
@@ -375,6 +381,9 @@ int sha384_vector(size_t num_elem, const
#include <mbedtls/sha256.h>
int sha256_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
{
+ if (TEST_FAIL())
+ return -1;
+
struct mbedtls_sha256_context ctx;
mbedtls_sha256_init(&ctx);
#if MBEDTLS_VERSION_MAJOR >= 3
@@ -397,6 +406,9 @@ int sha256_vector(size_t num_elem, const
#include <mbedtls/sha1.h>
int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
{
+ if (TEST_FAIL())
+ return -1;
+
struct mbedtls_sha1_context ctx;
mbedtls_sha1_init(&ctx);
#if MBEDTLS_VERSION_MAJOR >= 3
@@ -419,6 +431,9 @@ int sha1_vector(size_t num_elem, const u
#include <mbedtls/md5.h>
int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
{
+ if (TEST_FAIL())
+ return -1;
+
struct mbedtls_md5_context ctx;
mbedtls_md5_init(&ctx);
#if MBEDTLS_VERSION_MAJOR >= 3
@@ -441,6 +456,9 @@ int md5_vector(size_t num_elem, const u8
#include <mbedtls/md4.h>
int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
{
+ if (TEST_FAIL())
+ return -1;
+
struct mbedtls_md4_context ctx;
mbedtls_md4_init(&ctx);
mbedtls_md4_starts_ret(&ctx);
@@ -460,6 +478,9 @@ static int hmac_vector(const u8 *key, si
const u8 *addr[], const size_t *len, u8 *mac,
mbedtls_md_type_t md_type)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_md_context_t ctx;
mbedtls_md_init(&ctx);
if (mbedtls_md_setup(&ctx, mbedtls_md_info_from_type(md_type), 1) != 0){
@@ -571,6 +592,9 @@ static int hmac_kdf_expand(const u8 *prk
const char *label, const u8 *info, size_t info_len,
u8 *okm, size_t okm_len, mbedtls_md_type_t md_type)
{
+ if (TEST_FAIL())
+ return -1;
+
const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type);
#ifdef MBEDTLS_HKDF_C
if (label == NULL) /* RFC 5869 HKDF-Expand when (label == NULL) */
@@ -663,6 +687,9 @@ static int hmac_prf_bits(const u8 *key,
const u8 *data, size_t data_len, u8 *buf,
size_t buf_len_bits, mbedtls_md_type_t md_type)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_md_context_t ctx;
mbedtls_md_init(&ctx);
const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type);
@@ -938,6 +965,9 @@ int pbkdf2_sha1(const char *passphrase,
static void *aes_crypt_init_mode(const u8 *key, size_t len, int mode)
{
+ if (TEST_FAIL())
+ return NULL;
+
mbedtls_aes_context *aes = os_malloc(sizeof(*aes));
if (!aes)
return NULL;
@@ -996,6 +1026,9 @@ void aes_decrypt_deinit(void *ctx)
/* aes-wrap.c */
int aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, u8 *cipher)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_nist_kw_context ctx;
mbedtls_nist_kw_init(&ctx);
size_t olen;
@@ -1010,6 +1043,9 @@ int aes_wrap(const u8 *kek, size_t kek_l
/* aes-unwrap.c */
int aes_unwrap(const u8 *kek, size_t kek_len, int n, const u8 *cipher, u8 *plain)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_nist_kw_context ctx;
mbedtls_nist_kw_init(&ctx);
size_t olen;
@@ -1041,6 +1077,9 @@ int omac1_aes_vector(
const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[],
const size_t *len, u8 *mac)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_cipher_type_t cipher_type;
switch (key_len) {
case 16: cipher_type = MBEDTLS_CIPHER_AES_128_ECB; break;
@@ -1103,6 +1142,9 @@ int omac1_aes_256(const u8 *key, const u
/* aes-encblock.c */
int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_aes_context aes;
mbedtls_aes_init(&aes);
int ret = mbedtls_aes_setkey_enc(&aes, key, 128)
@@ -1118,6 +1160,9 @@ int aes_128_encrypt_block(const u8 *key,
int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce,
u8 *data, size_t data_len)
{
+ if (TEST_FAIL())
+ return -1;
+
unsigned char counter[MBEDTLS_AES_BLOCK_SIZE];
unsigned char stream_block[MBEDTLS_AES_BLOCK_SIZE];
os_memcpy(counter, nonce, MBEDTLS_AES_BLOCK_SIZE);/*(must be writable)*/
@@ -1160,11 +1205,17 @@ static int aes_128_cbc_oper(const u8 *ke
int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len)
{
+ if (TEST_FAIL())
+ return -1;
+
return aes_128_cbc_oper(key, iv, data, data_len, MBEDTLS_AES_ENCRYPT);
}
int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len)
{
+ if (TEST_FAIL())
+ return -1;
+
return aes_128_cbc_oper(key, iv, data, data_len, MBEDTLS_AES_DECRYPT);
}
@@ -1407,6 +1458,10 @@ int crypto_hash_finish(struct crypto_has
}
mbedtls_md_free(mctx);
os_free(mctx);
+
+ if (TEST_FAIL())
+ return -1;
+
return 0;
}
@@ -1421,6 +1476,9 @@ int crypto_hash_finish(struct crypto_has
struct crypto_bignum *crypto_bignum_init(void)
{
+ if (TEST_FAIL())
+ return NULL;
+
mbedtls_mpi *bn = os_malloc(sizeof(*bn));
if (bn)
mbedtls_mpi_init(bn);
@@ -1429,6 +1487,9 @@ struct crypto_bignum *crypto_bignum_init
struct crypto_bignum *crypto_bignum_init_set(const u8 *buf, size_t len)
{
+ if (TEST_FAIL())
+ return NULL;
+
mbedtls_mpi *bn = os_malloc(sizeof(*bn));
if (bn) {
mbedtls_mpi_init(bn);
@@ -1442,6 +1503,9 @@ struct crypto_bignum *crypto_bignum_init
struct crypto_bignum *crypto_bignum_init_uint(unsigned int val)
{
+ if (TEST_FAIL())
+ return NULL;
+
#if 0 /*(hostap use of this interface passes int, not uint)*/
val = host_to_be32(val);
return crypto_bignum_init_set((const u8 *)&val, sizeof(val));
@@ -1467,6 +1531,9 @@ void crypto_bignum_deinit(struct crypto_
int crypto_bignum_to_bin(const struct crypto_bignum *a,
u8 *buf, size_t buflen, size_t padlen)
{
+ if (TEST_FAIL())
+ return -1;
+
size_t n = mbedtls_mpi_size((mbedtls_mpi *)a);
if (n < padlen)
n = padlen;
@@ -1477,6 +1544,9 @@ int crypto_bignum_to_bin(const struct cr
int crypto_bignum_rand(struct crypto_bignum *r, const struct crypto_bignum *m)
{
+ if (TEST_FAIL())
+ return -1;
+
/*assert(r != m);*//* r must not be same as m for mbedtls_mpi_random()*/
#if MBEDTLS_VERSION_NUMBER >= 0x021B0000 /* mbedtls 2.27.0 */
return mbedtls_mpi_random((mbedtls_mpi *)r, 0, (mbedtls_mpi *)m,
@@ -1513,6 +1583,9 @@ int crypto_bignum_exptmod(const struct c
const struct crypto_bignum *c,
struct crypto_bignum *d)
{
+ if (TEST_FAIL())
+ return -1;
+
/* (check if input params match d; d is the result) */
/* (a == d) is ok in current mbedtls implementation */
if (b == d || c == d) { /*(not ok; store result in intermediate)*/
@@ -1540,6 +1613,9 @@ int crypto_bignum_inverse(const struct c
const struct crypto_bignum *b,
struct crypto_bignum *c)
{
+ if (TEST_FAIL())
+ return -1;
+
return mbedtls_mpi_inv_mod((mbedtls_mpi *)c,
(const mbedtls_mpi *)a,
(const mbedtls_mpi *)b) ? -1 : 0;
@@ -1549,6 +1625,9 @@ int crypto_bignum_sub(const struct crypt
const struct crypto_bignum *b,
struct crypto_bignum *c)
{
+ if (TEST_FAIL())
+ return -1;
+
return mbedtls_mpi_sub_mpi((mbedtls_mpi *)c,
(const mbedtls_mpi *)a,
(const mbedtls_mpi *)b) ? -1 : 0;
@@ -1558,6 +1637,9 @@ int crypto_bignum_div(const struct crypt
const struct crypto_bignum *b,
struct crypto_bignum *c)
{
+ if (TEST_FAIL())
+ return -1;
+
/*(most current use of this crypto.h interface has a == c (result),
* so store result in an intermediate to avoid overwritten input)*/
mbedtls_mpi R;
@@ -1575,6 +1657,9 @@ int crypto_bignum_addmod(const struct cr
const struct crypto_bignum *c,
struct crypto_bignum *d)
{
+ if (TEST_FAIL())
+ return -1;
+
return mbedtls_mpi_add_mpi((mbedtls_mpi *)d,
(const mbedtls_mpi *)a,
(const mbedtls_mpi *)b)
@@ -1588,6 +1673,9 @@ int crypto_bignum_mulmod(const struct cr
const struct crypto_bignum *c,
struct crypto_bignum *d)
{
+ if (TEST_FAIL())
+ return -1;
+
return mbedtls_mpi_mul_mpi((mbedtls_mpi *)d,
(const mbedtls_mpi *)a,
(const mbedtls_mpi *)b)
@@ -1600,6 +1688,9 @@ int crypto_bignum_sqrmod(const struct cr
const struct crypto_bignum *b,
struct crypto_bignum *c)
{
+ if (TEST_FAIL())
+ return -1;
+
#if 1
return crypto_bignum_mulmod(a, a, b, c);
#else
@@ -1650,6 +1741,9 @@ int crypto_bignum_is_odd(const struct cr
int crypto_bignum_legendre(const struct crypto_bignum *a,
const struct crypto_bignum *p)
{
+ if (TEST_FAIL())
+ return -2;
+
/* Security Note:
* mbedtls_mpi_exp_mod() is not documented to run in constant time,
* though mbedtls/library/bignum.c uses constant_time_internal.h funcs.
@@ -1702,6 +1796,9 @@ int crypto_mod_exp(const u8 *base, size_
const u8 *modulus, size_t modulus_len,
u8 *result, size_t *result_len)
{
+ if (TEST_FAIL())
+ return -1;
+
mbedtls_mpi bn_base, bn_exp, bn_modulus, bn_result;
mbedtls_mpi_init(&bn_base);
mbedtls_mpi_init(&bn_exp);
@@ -1769,6 +1866,9 @@ static int crypto_mbedtls_dh_init_public
int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey,
u8 *pubkey)
{
+ if (TEST_FAIL())
+ return -1;
+
#if 0 /*(crypto_dh_init() duplicated (and identical) in crypto_*.c modules)*/
size_t pubkey_len, pad;
@@ -1810,6 +1910,9 @@ int crypto_dh_derive_secret(u8 generator
const u8 *pubkey, size_t pubkey_len,
u8 *secret, size_t *len)
{
+ if (TEST_FAIL())
+ return -1;
+
#if 0
if (pubkey_len > prime_len ||
(pubkey_len == prime_len &&
@@ -2512,6 +2615,9 @@ const struct crypto_ec_point * crypto_ec
struct crypto_ec_point *crypto_ec_point_init(struct crypto_ec *e)
{
+ if (TEST_FAIL())
+ return NULL;
+
mbedtls_ecp_point *p = os_malloc(sizeof(*p));
if (p != NULL)
mbedtls_ecp_point_init(p);
@@ -2536,6 +2642,9 @@ int crypto_ec_point_x(struct crypto_ec *
int crypto_ec_point_to_bin(struct crypto_ec *e,
const struct crypto_ec_point *point, u8 *x, u8 *y)
{
+ if (TEST_FAIL())
+ return -1;
+
/* crypto.h documents crypto_ec_point_to_bin() output is big-endian */
size_t len = CRYPTO_EC_plen(e);
if (x) {
@@ -2563,6 +2672,9 @@ int crypto_ec_point_to_bin(struct crypto
struct crypto_ec_point * crypto_ec_point_from_bin(struct crypto_ec *e,
const u8 *val)
{
+ if (TEST_FAIL())
+ return NULL;
+
size_t len = CRYPTO_EC_plen(e);
mbedtls_ecp_point *p = os_malloc(sizeof(*p));
u8 buf[1+MBEDTLS_MPI_MAX_SIZE*2];
@@ -2615,6 +2727,9 @@ int crypto_ec_point_add(struct crypto_ec
const struct crypto_ec_point *b,
struct crypto_ec_point *c)
{
+ if (TEST_FAIL())
+ return -1;
+
/* mbedtls does not provide an mbedtls_ecp_point add function */
mbedtls_mpi one;
mbedtls_mpi_init(&one);
@@ -2631,6 +2746,9 @@ int crypto_ec_point_mul(struct crypto_ec
const struct crypto_bignum *b,
struct crypto_ec_point *res)
{
+ if (TEST_FAIL())
+ return -1;
+
return mbedtls_ecp_mul(
(mbedtls_ecp_group *)e, (mbedtls_ecp_point *)res,
(const mbedtls_mpi *)b, (const mbedtls_ecp_point *)p,
@@ -2639,6 +2757,9 @@ int crypto_ec_point_mul(struct crypto_ec
int crypto_ec_point_invert(struct crypto_ec *e, struct crypto_ec_point *p)
{
+ if (TEST_FAIL())
+ return -1;
+
if (mbedtls_ecp_get_type((mbedtls_ecp_group *)e)
== MBEDTLS_ECP_TYPE_MONTGOMERY) {
/* e.g. MBEDTLS_ECP_DP_CURVE25519 and MBEDTLS_ECP_DP_CURVE448 */
@@ -2751,6 +2872,9 @@ struct crypto_bignum *
crypto_ec_point_compute_y_sqr(struct crypto_ec *e,
const struct crypto_bignum *x)
{
+ if (TEST_FAIL())
+ return NULL;
+
mbedtls_mpi *y2 = os_malloc(sizeof(*y2));
if (y2 == NULL)
return NULL;

View file

@ -0,0 +1,45 @@
From 33afce36c54b0cad38643629ded10ff5d727f077 Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Fri, 12 Aug 2022 05:34:47 -0400
Subject: [PATCH 5/7] add NULL checks (encountered during tests/hwsim)
sae_derive_commit_element_ecc NULL pwe_ecc check
dpp_gen_keypair() NULL curve check
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
src/common/dpp_crypto.c | 6 ++++++
src/common/sae.c | 7 +++++++
2 files changed, 13 insertions(+)
--- a/src/common/dpp_crypto.c
+++ b/src/common/dpp_crypto.c
@@ -248,6 +248,12 @@ struct crypto_ec_key * dpp_set_pubkey_po
struct crypto_ec_key * dpp_gen_keypair(const struct dpp_curve_params *curve)
{
+ if (curve == NULL) {
+ wpa_printf(MSG_DEBUG,
+ "DPP: %s curve must be initialized", __func__);
+ return NULL;
+ }
+
struct crypto_ec_key *key;
wpa_printf(MSG_DEBUG, "DPP: Generating a keypair");
--- a/src/common/sae.c
+++ b/src/common/sae.c
@@ -1278,6 +1278,13 @@ void sae_deinit_pt(struct sae_pt *pt)
static int sae_derive_commit_element_ecc(struct sae_data *sae,
struct crypto_bignum *mask)
{
+ if (sae->tmp->pwe_ecc == NULL) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: %s sae->tmp->pwe_ecc must be initialized",
+ __func__);
+ return -1;
+ }
+
/* COMMIT-ELEMENT = inverse(scalar-op(mask, PWE)) */
if (!sae->tmp->own_commit_element_ecc) {
sae->tmp->own_commit_element_ecc =

View file

@ -0,0 +1,26 @@
From 54211caa2e0e5163aefef390daf88a971367a702 Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Tue, 4 Oct 2022 17:09:24 -0400
Subject: [PATCH 6/7] dpp_pkex: EC point mul w/ value < prime
crypto_ec_point_mul() with mbedtls requires point
be multiplied by a multiplicand with value < prime
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
src/common/dpp_crypto.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/src/common/dpp_crypto.c
+++ b/src/common/dpp_crypto.c
@@ -1567,7 +1567,9 @@ dpp_pkex_derive_Qr(const struct dpp_curv
Pr = crypto_ec_key_get_public_key(Pr_key);
Qr = crypto_ec_point_init(ec);
hash_bn = crypto_bignum_init_set(hash, curve->hash_len);
- if (!Pr || !Qr || !hash_bn || crypto_ec_point_mul(ec, Pr, hash_bn, Qr))
+ if (!Pr || !Qr || !hash_bn ||
+ crypto_bignum_mod(hash_bn, crypto_ec_get_prime(ec), hash_bn) ||
+ crypto_ec_point_mul(ec, Pr, hash_bn, Qr))
goto fail;
if (crypto_ec_point_is_at_infinity(ec, Qr)) {

View file

@ -0,0 +1,32 @@
From 639bb1bb912029ec4ff110c3ed807b62f583d6bf Mon Sep 17 00:00:00 2001
From: Glenn Strauss <gstrauss@gluelogic.com>
Date: Sun, 9 Oct 2022 04:02:44 -0400
Subject: [PATCH 7/7] DPP: fix memleak of intro.peer_key
fix memleak of intro.peer_key in wpas_dpp_rx_peer_disc_resp()
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
---
wpa_supplicant/dpp_supplicant.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -2610,6 +2610,8 @@ static void wpas_dpp_rx_peer_disc_resp(s
return;
}
+ os_memset(&intro, 0, sizeof(intro));
+
trans_id = dpp_get_attr(buf, len, DPP_ATTR_TRANSACTION_ID,
&trans_id_len);
if (!trans_id || trans_id_len != 1) {
@@ -2720,7 +2722,7 @@ static void wpas_dpp_rx_peer_disc_resp(s
wpa_supplicant_req_scan(wpa_s, 0, 0);
}
fail:
- os_memset(&intro, 0, sizeof(intro));
+ dpp_peer_intro_deinit(&intro);
}

View file

@ -36,7 +36,7 @@
LIBS += $(DRV_AP_LIBS) LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET ifdef CONFIG_L2_PACKET
@@ -1291,6 +1297,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) @@ -1378,6 +1384,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
_OBJS_VAR := OBJS _OBJS_VAR := OBJS
include ../src/objs.mk include ../src/objs.mk
@ -49,7 +49,7 @@
hostapd: $(OBJS) hostapd: $(OBJS)
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@ @$(E) " LD " $@
@@ -1365,6 +1377,12 @@ include ../src/objs.mk @@ -1458,6 +1470,12 @@ include ../src/objs.mk
_OBJS_VAR := SOBJS _OBJS_VAR := SOBJS
include ../src/objs.mk include ../src/objs.mk
@ -128,7 +128,7 @@
NEED_AES_WRAP=y NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o OBJS += ../src/ap/wpa_auth_ie.o
@@ -1920,6 +1937,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) @@ -1996,6 +2013,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
_OBJS_VAR := OBJS _OBJS_VAR := OBJS
include ../src/objs.mk include ../src/objs.mk
@ -141,7 +141,7 @@
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@ @$(E) " LD " $@
@@ -2052,6 +2075,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) @@ -2128,6 +2151,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
@$(E) " sed" $< @$(E) " sed" $<

View file

@ -10,7 +10,7 @@
bss->freq = 0; bss->freq = 0;
nl80211_put_wiphy_data_ap(bss); nl80211_put_wiphy_data_ap(bss);
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
+ msg = nl80211_bss_msg(drv, 0, NL80211_CMD_DEL_BEACON); + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
} }

View file

@ -1,6 +1,6 @@
--- a/hostapd/Makefile --- a/hostapd/Makefile
+++ b/hostapd/Makefile +++ b/hostapd/Makefile
@@ -1307,7 +1307,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) @@ -1394,7 +1394,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
@$(AR) cr $@ hostapd_multi.o $(OBJS) @$(AR) cr $@ hostapd_multi.o $(OBJS)
hostapd: $(OBJS) hostapd: $(OBJS)
@ -9,7 +9,7 @@
@$(E) " LD " $@ @$(E) " LD " $@
ifdef CONFIG_WPA_TRACE ifdef CONFIG_WPA_TRACE
@@ -1318,7 +1318,7 @@ _OBJS_VAR := OBJS_c @@ -1405,7 +1405,7 @@ _OBJS_VAR := OBJS_c
include ../src/objs.mk include ../src/objs.mk
hostapd_cli: $(OBJS_c) hostapd_cli: $(OBJS_c)
@ -20,7 +20,7 @@
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
--- a/wpa_supplicant/Makefile --- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile
@@ -1949,31 +1949,31 @@ wpa_supplicant_multi.a: .config $(BCHECK @@ -2025,31 +2025,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)

View file

@ -0,0 +1,109 @@
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -311,6 +311,7 @@ struct hostapd_bss_config {
unsigned int eap_sim_db_timeout;
int eap_server_erp; /* Whether ERP is enabled on internal EAP server */
struct hostapd_ip_addr own_ip_addr;
+ int dynamic_own_ip_addr;
char *nas_identifier;
struct hostapd_radius_servers *radius;
int acct_interim_interval;
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -163,6 +163,8 @@ struct radius_client_data {
*/
void *ctx;
+ struct hostapd_ip_addr local_ip;
+
/**
* conf - RADIUS client configuration (list of RADIUS servers to use)
*/
@@ -720,6 +722,30 @@ static void radius_client_list_add(struc
/**
+ * radius_client_send - Get local address for the RADIUS auth socket
+ * @radius: RADIUS client context from radius_client_init()
+ * @addr: pointer to store the address
+ *
+ * This function returns the local address for the connection to the RADIUS
+ * auth server. It also opens the socket if it's not available yet.
+ */
+int radius_client_get_local_addr(struct radius_client_data *radius,
+ struct hostapd_ip_addr *addr)
+{
+ struct hostapd_radius_servers *conf = radius->conf;
+
+ if (conf->auth_server && radius->auth_sock < 0)
+ radius_client_init_auth(radius);
+
+ if (radius->auth_sock < 0)
+ return -1;
+
+ memcpy(addr, &radius->local_ip, sizeof(*addr));
+
+ return 0;
+}
+
+/**
* radius_client_send - Send a RADIUS request
* @radius: RADIUS client context from radius_client_init()
* @msg: RADIUS message to be sent
@@ -1238,6 +1264,10 @@ radius_change_server(struct radius_clien
wpa_printf(MSG_DEBUG, "RADIUS local address: %s:%u",
inet_ntoa(claddr.sin_addr),
ntohs(claddr.sin_port));
+ if (auth) {
+ radius->local_ip.af = AF_INET;
+ radius->local_ip.u.v4 = claddr.sin_addr;
+ }
}
break;
#ifdef CONFIG_IPV6
@@ -1249,6 +1279,10 @@ radius_change_server(struct radius_clien
inet_ntop(AF_INET6, &claddr6.sin6_addr,
abuf, sizeof(abuf)),
ntohs(claddr6.sin6_port));
+ if (auth) {
+ radius->local_ip.af = AF_INET6;
+ radius->local_ip.u.v6 = claddr6.sin6_addr;
+ }
}
break;
}
--- a/src/radius/radius_client.h
+++ b/src/radius/radius_client.h
@@ -249,6 +249,8 @@ int radius_client_register(struct radius
void radius_client_set_interim_error_cb(struct radius_client_data *radius,
void (*cb)(const u8 *addr, void *ctx),
void *ctx);
+int radius_client_get_local_addr(struct radius_client_data *radius,
+ struct hostapd_ip_addr * addr);
int radius_client_send(struct radius_client_data *radius,
struct radius_msg *msg,
RadiusType msg_type, const u8 *addr);
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -535,6 +535,10 @@ int add_common_radius_attr(struct hostap
struct hostapd_radius_attr *attr;
int len;
+ if (hapd->conf->dynamic_own_ip_addr)
+ radius_client_get_local_addr(hapd->radius,
+ &hapd->conf->own_ip_addr);
+
if (!hostapd_config_get_radius_attr(req_attr,
RADIUS_ATTR_NAS_IP_ADDRESS) &&
hapd->conf->own_ip_addr.af == AF_INET &&
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2681,6 +2681,8 @@ static int hostapd_config_fill(struct ho
} else if (os_strcmp(buf, "iapp_interface") == 0) {
wpa_printf(MSG_INFO, "DEPRECATED: iapp_interface not used");
#endif /* CONFIG_IAPP */
+ } else if (os_strcmp(buf, "dynamic_own_ip_addr") == 0) {
+ bss->dynamic_own_ip_addr = atoi(pos);
} else if (os_strcmp(buf, "own_ip_addr") == 0) {
if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) {
wpa_printf(MSG_ERROR,

View file

@ -390,32 +390,6 @@ hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj,
return 0; return 0;
} }
/* Imported from iw/util.c
* https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/tree/util.c?id=4b25ae3537af48dbf9d0abf94132e5ba01b32c18#n200
*/
int ieee80211_frequency_to_channel(int freq)
{
/* see 802.11-2007 17.3.8.3.2 and Annex J */
if (freq == 2484)
return 14;
/* see 802.11ax D6.1 27.3.23.2 and Annex E */
else if (freq == 5935)
return 2;
else if (freq < 2484)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
else if (freq < 5950)
return (freq - 5000) / 5;
else if (freq <= 45000) /* DMG band lower limit */
/* see 802.11ax D6.1 27.3.23.2 */
return (freq - 5950) / 5;
else if (freq >= 58320 && freq <= 70200)
return (freq - 56160) / 2160;
else
return 0;
}
static int static int
hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj, hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method, struct ubus_request_data *req, const char *method,

View file

@ -7,10 +7,6 @@ static inline int has_feature(const char *feat)
if (!strcmp(feat, "eap")) if (!strcmp(feat, "eap"))
return 1; return 1;
#endif #endif
#ifdef CONFIG_IEEE80211N
if (!strcmp(feat, "11n"))
return 1;
#endif
#ifdef CONFIG_IEEE80211AC #ifdef CONFIG_IEEE80211AC
if (!strcmp(feat, "11ac")) if (!strcmp(feat, "11ac"))
return 1; return 1;

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2 PKG_NAME:=iproute2
PKG_VERSION:=6.0.0 PKG_VERSION:=6.1.0
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
PKG_HASH:=523139e9e72aec996374fa2de74be4c53d2dd05589488934d21ff97bae19580a PKG_HASH:=5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=iptables PKG_BUILD_DEPENDS:=iptables
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View file

@ -25,7 +25,7 @@
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
--- a/ip/ip.c --- a/ip/ip.c
+++ b/ip/ip.c +++ b/ip/ip.c
@@ -64,11 +64,17 @@ static void usage(void) @@ -65,11 +65,17 @@ static void usage(void)
fprintf(stderr, fprintf(stderr,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
" ip [ -force ] -batch filename\n" " ip [ -force ] -batch filename\n"
@ -43,7 +43,7 @@
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n" " -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
@@ -91,37 +97,49 @@ static const struct cmd { @@ -92,37 +98,49 @@ static const struct cmd {
int (*func)(int argc, char **argv); int (*func)(int argc, char **argv);
} cmds[] = { } cmds[] = {
{ "address", do_ipaddr }, { "address", do_ipaddr },

View file

@ -11,9 +11,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
PKG_SOURCE_DATE:=2022-11-01 PKG_SOURCE_DATE:=2022-12-15
PKG_SOURCE_VERSION:=00aab871c50d944fd83269e460e69124cb11adb7 PKG_SOURCE_VERSION:=8d158096a9882d3090c7e180a296ca7b035b4865
PKG_MIRROR_HASH:=e915d53da916db333d62c396154612ed7557fbb27ed8884e70c19c321c08b12c PKG_MIRROR_HASH:=c376d3f2794fcef2956c038a16b4a1a4d30082ca4f2d2b955bd191d06e78f6ec
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View file

@ -2,8 +2,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=xdp-tools PKG_NAME:=xdp-tools
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=1.2.8 PKG_VERSION:=1.2.9
PKG_HASH:=2c575e5242e60055b0e7fc720f5b6ea87d74911f967dde3d50046d751f35bff0 PKG_HASH:=159ed8d3c8195d812ec3cde83bd736245a72743af372998320d39c2ba69ab142
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/xdp-project/xdp-tools/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/xdp-project/xdp-tools/tar.gz/v$(PKG_VERSION)?

View file

@ -1,6 +1,6 @@
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -138,7 +138,7 @@ int main(int argc, char **argv) { @@ -174,7 +174,7 @@ int main(int argc, char **argv) {
return 0; return 0;
} }
EOF EOF
@ -9,7 +9,7 @@
if [ "$?" -eq "0" ]; then if [ "$?" -eq "0" ]; then
echo "HAVE_PCAP:=y" >>$CONFIG echo "HAVE_PCAP:=y" >>$CONFIG
[ -n "$LIBPCAP_CFLAGS" ] && echo 'CFLAGS += ' $LIBPCAP_CFLAGS >> $CONFIG [ -n "$LIBPCAP_CFLAGS" ] && echo 'CFLAGS += ' $LIBPCAP_CFLAGS >> $CONFIG
@@ -186,7 +186,7 @@ int main(int argc, char **argv) { @@ -222,7 +222,7 @@ int main(int argc, char **argv) {
return 0; return 0;
} }
EOF EOF
@ -18,7 +18,7 @@
if [ "$?" -eq "0" ]; then if [ "$?" -eq "0" ]; then
echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG" echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG"
echo "yes" echo "yes"
@@ -253,7 +253,7 @@ int main(int argc, char **argv) { @@ -289,7 +289,7 @@ int main(int argc, char **argv) {
} }
EOF EOF

View file

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
PKG_MIRROR_HASH:=18137fa6904b1a7aec03a16a4c25fd9b9689b24ee14d431bacdda9f093339071 PKG_MIRROR_HASH:=87dab115512070d3ab566ebe47859bad3c148986271cdb2ac05a0952be262519
PKG_SOURCE_DATE:=2022-09-21 PKG_SOURCE_DATE:=2022-12-15
PKG_SOURCE_VERSION:=8c852b656bf1622dee1ae2cfa4c083f730c1c539 PKG_SOURCE_VERSION:=7de4820c87437033f6b7716018f3bfa60a3f7b12
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC PKG_LICENSE:=ISC
@ -68,8 +68,9 @@ endef
# 1: plugin name # 1: plugin name
# 2: extra dependencies # 2: additional dependencies
# 3: plugin title/description # 3: plugin title/description
# 4: extra dependencies
define BuildPlugin define BuildPlugin
PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_rpcd-mod-$(1) PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_rpcd-mod-$(1)
@ -78,6 +79,7 @@ define BuildPlugin
$(Package/rpcd/default) $(Package/rpcd/default)
TITLE+= ($(1) plugin) TITLE+= ($(1) plugin)
DEPENDS+=rpcd $(2) DEPENDS+=rpcd $(2)
EXTRA_DEPENDS:=$(4)
endef endef
define Package/rpcd-mod-$(1)/description define Package/rpcd-mod-$(1)/description
@ -101,5 +103,5 @@ endef
$(eval $(call BuildPackage,rpcd)) $(eval $(call BuildPackage,rpcd))
$(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.)) $(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,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
$(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.)) $(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.,libiwinfo (>= 2022-12-15)))
$(eval $(call BuildPlugin,ucode,+libucode,Allows implementing plugins using ucode scripts.)) $(eval $(call BuildPlugin,ucode,+libucode,Allows implementing plugins using ucode scripts.))

View file

@ -409,7 +409,7 @@ $(shell \
if git log -1 >/dev/null 2>/dev/null; then \ if git log -1 >/dev/null 2>/dev/null; then \
if [ -n "$(1)" ]; then \ if [ -n "$(1)" ]; then \
last_bump="$$(git log --pretty=format:'%h %s' . | \ last_bump="$$(git log --pretty=format:'%h %s' . | \
grep --max-count=1 -e ': [uU]pdate to ' -e ': [bB]ump to ' | \ grep -m 1 -e ': [uU]pdate to ' -e ': [bB]ump to ' | \
cut -f 1 -d ' ')"; \ cut -f 1 -d ' ')"; \
fi; \ fi; \
if [ -n "$$last_bump" ]; then \ if [ -n "$$last_bump" ]; then \

View file

@ -122,10 +122,26 @@
reg = <0x8c0000 0x700000>; reg = <0x8c0000 0x700000>;
}; };
art: partition@fc0000 { partition@fc0000 {
label = "ART"; label = "ART";
reg = <0xfc0000 0x040000>; reg = <0xfc0000 0x040000>;
read-only; 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>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
}; };
}; };
}; };
@ -149,22 +165,9 @@
wifi@0,0 { wifi@0,0 {
compatible = "pci168c,002a"; compatible = "pci168c,002a";
reg = <0x0000 0 0 0 0>; reg = <0x0000 0 0 0 0>;
qca,no-eeprom; nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
}; };
}; };
&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>;
};
};

View file

@ -41,7 +41,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
uboot: partition@0 { partition@0 {
label = "u-boot"; label = "u-boot";
reg = <0x0 0x40000>; reg = <0x0 0x40000>;
read-only; read-only;
@ -82,10 +82,26 @@
read-only; read-only;
}; };
art: partition@ff0000 { partition@ff0000 {
label = "art"; label = "art";
reg = <0xff0000 0x10000>; reg = <0xff0000 0x10000>;
read-only; 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>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
}; };
}; };
}; };
@ -105,18 +121,6 @@
&wifi { &wifi {
ubnt,hsr; ubnt,hsr;
}; nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
&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>;
};
}; };

View file

@ -68,14 +68,31 @@
read-only; read-only;
}; };
art: partition@7f0000 { partition@7f0000 {
label = "art"; label = "art";
reg = <0x7f0000 0x010000>; reg = <0x7f0000 0x010000>;
read-only; 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>;
}; };
}; };
}; };
}; };
};
&wifi {
nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
};
&eth0 { &eth0 {
nvmem-cells = <&macaddr_art_0>; nvmem-cells = <&macaddr_art_0>;
@ -85,13 +102,3 @@
&eth1 { &eth1 {
compatible = "syscon", "simple-mfd"; compatible = "syscon", "simple-mfd";
}; };
&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
};

View file

@ -26,7 +26,6 @@
wifi: wifi@0,0 { wifi: wifi@0,0 {
reg = <0x0000 0 0 0 0>; reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
}; };
}; };

View file

@ -133,10 +133,22 @@
label = "u-boot-env"; label = "u-boot-env";
}; };
art: partition@50000 { partition@50000 {
reg = <0x50000 0x10000>; reg = <0x50000 0x10000>;
label = "art"; label = "art";
read-only; read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_120c: macaddr@120c {
reg = <0x120c 0x6>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0xeb8>;
};
}; };
partition@60000 { partition@60000 {
@ -197,9 +209,8 @@
ath9k: wifi@0,0 { ath9k: wifi@0,0 {
compatible = "pci168c,002a"; compatible = "pci168c,002a";
reg = <0x0000 0 0 0 0>; reg = <0x0000 0 0 0 0>;
nvmem-cells = <&macaddr_art_120c>; nvmem-cells = <&macaddr_art_120c>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address", "calibration";
qca,no-eeprom;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
}; };
@ -212,13 +223,3 @@
&usb { &usb {
status = "okay"; status = "okay";
}; };
&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_120c: macaddr@120c {
reg = <0x120c 0x6>;
};
};

View file

@ -87,11 +87,10 @@
ath9k: wifi@0,0,0 { ath9k: wifi@0,0,0 {
compatible = "pci168c,0030"; compatible = "pci168c,0030";
reg = <0x0 0 0 0 0>; reg = <0x0 0 0 0 0>;
nvmem-cells = <&macaddr_art_0>; nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <1>; mac-address-increment = <1>;
qca,disable-5ghz; ieee80211-freq-limit = <2402000 2482000>;
qca,no-eeprom;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
}; };
@ -100,12 +99,10 @@
&wmac { &wmac {
status = "okay"; status = "okay";
qca,disable-2ghz; ieee80211-freq-limit = <4900000 5990000>;
mtd-cal-data = <&art 0x1000>; nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
mac-address-increment = <2>; mac-address-increment = <2>;
}; };
@ -117,4 +114,12 @@
macaddr_art_0: macaddr@0 { macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>; reg = <0x0 0x6>;
}; };
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
}; };

View file

@ -135,10 +135,30 @@
reg = <0x7e0000 0x010000>; reg = <0x7e0000 0x010000>;
}; };
art: partition@7f0000 { partition@7f0000 {
label = "art"; label = "art";
reg = <0x7f0000 0x010000>; reg = <0x7f0000 0x010000>;
read-only; 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>;
};
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
}; };
}; };
}; };
@ -204,7 +224,8 @@
ath9k: wifi@0,0 { ath9k: wifi@0,0 {
compatible = "pci168c,0030"; compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>; reg = <0x0000 0 0 0 0>;
qca,no-eeprom; nvmem-cells = <&calibration_art_5000>;
nvmem-cell-names = "calibration";
ieee80211-freq-limit = <4900000 5990000>; ieee80211-freq-limit = <4900000 5990000>;
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
@ -214,7 +235,8 @@
&wmac { &wmac {
status = "okay"; status = "okay";
mtd-cal-data = <&art 0x1000>; nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
}; };
&usb { &usb {
@ -224,17 +246,3 @@
&usb_phy { &usb_phy {
status = "okay"; status = "okay";
}; };
&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>;
};
};

View file

@ -36,14 +36,14 @@
&pcie { &pcie {
wifi@0,0,0 { wifi@0,0,0 {
nvmem-cells = <&macaddr_art_0>; nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address", "calibration";
}; };
}; };
&wmac { &wmac {
nvmem-cells = <&macaddr_art_0>; nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <(-1)>; mac-address-increment = <(-1)>;
}; };
@ -55,4 +55,12 @@
macaddr_art_0: macaddr@0 { macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>; reg = <0x0 0x6>;
}; };
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
}; };

View file

@ -30,15 +30,15 @@
&pcie { &pcie {
wifi@0,0,0 { wifi@0,0,0 {
nvmem-cells = <&macaddr_art_0>; nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <(-2)>; mac-address-increment = <(-2)>;
}; };
}; };
&wmac { &wmac {
nvmem-cells = <&macaddr_art_0>; nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address", "calibration";
mac-address-increment = <(-1)>; mac-address-increment = <(-1)>;
}; };
@ -50,4 +50,12 @@
macaddr_art_0: macaddr@0 { macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>; reg = <0x0 0x6>;
}; };
calibration_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
}; };

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