Merge Official Source
This commit is contained in:
commit
50e384747c
64
.github/workflows/toolchain.yml
vendored
Normal file
64
.github/workflows/toolchain.yml
vendored
Normal 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
|
||||
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .158
|
||||
LINUX_KERNEL_HASH-5.10.158 = 1e0a24bb5510caa18b3601b25e12cc2a1ce123948de551f4f2cdbb40aea707e7
|
||||
LINUX_VERSION-5.10 = .159
|
||||
LINUX_KERNEL_HASH-5.10.159 = 1ba9bf57b6bf36d76447d5044b80b746cb5fd61d981c811603dc763b7789cea7
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.15 = .82
|
||||
LINUX_KERNEL_HASH-5.15.82 = fceef6bb79bac494663ccde34453521fc616cd94272fd30564752b3742381b65
|
||||
LINUX_VERSION-5.15 = .83
|
||||
LINUX_KERNEL_HASH-5.15.83 = 40590843c04c85789105157f69efbd71a4efe87ae2568e40d1b7258c3f747ff3
|
||||
|
||||
@ -130,7 +130,7 @@ ifneq ($(HOST_OS),Linux)
|
||||
export SKIP_STACK_VALIDATION:=1
|
||||
endif
|
||||
|
||||
KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
|
||||
KERNEL_MAKEOPTS = -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
|
||||
|
||||
ifdef CONFIG_USE_SPARSE
|
||||
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
CI_KERNPART="${CI_KERNPART:-kernel}"
|
||||
|
||||
# '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}"
|
||||
|
||||
# 'rootfs' UBI volume on NAND contains the rootfs
|
||||
@ -104,7 +106,7 @@ identify_if_gzip() {
|
||||
}
|
||||
|
||||
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 )"
|
||||
if [ ! "$ubivol" ]; then
|
||||
ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
|
||||
@ -146,6 +148,42 @@ nand_remove_ubiblock() {
|
||||
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() {
|
||||
local ubipart="$1"
|
||||
|
||||
@ -177,40 +215,25 @@ nand_upgrade_prepare_ubi() {
|
||||
|
||||
local kernel_length="$3"
|
||||
local has_env="${4:-0}"
|
||||
local kern_ubidev
|
||||
local root_ubidev
|
||||
|
||||
[ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1
|
||||
|
||||
local mtdnum="$( find_mtd_index "$CI_UBIPART" )"
|
||||
if [ ! "$mtdnum" ]; then
|
||||
echo "cannot find ubi mtd partition $CI_UBIPART"
|
||||
return 1
|
||||
if [ -n "$CI_KERN_UBIPART" -a -n "$CI_ROOT_UBIPART" ]; then
|
||||
kern_ubidev="$( nand_attach_ubi "$CI_KERN_UBIPART" "$has_env" )"
|
||||
[ -n "$kern_ubidev" ] || 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
|
||||
|
||||
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
if [ ! "$ubidev" ]; then
|
||||
ubiattach -m "$mtdnum"
|
||||
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 )"
|
||||
local kern_ubivol="$( nand_find_volume $kern_ubidev "$CI_KERNPART" )"
|
||||
local root_ubivol="$( nand_find_volume $root_ubidev "$CI_ROOTPART" )"
|
||||
local data_ubivol="$( nand_find_volume $root_ubidev rootfs_data )"
|
||||
[ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol=
|
||||
|
||||
# remove ubiblocks
|
||||
@ -219,13 +242,13 @@ nand_upgrade_prepare_ubi() {
|
||||
[ "$data_ubivol" ] && { nand_remove_ubiblock $data_ubivol || return 1; }
|
||||
|
||||
# kill volumes
|
||||
[ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N "$CI_KERNPART" || :
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N "$CI_ROOTPART" || :
|
||||
[ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || :
|
||||
[ "$kern_ubivol" ] && ubirmvol /dev/$kern_ubidev -N "$CI_KERNPART" || :
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$root_ubidev -N "$CI_ROOTPART" || :
|
||||
[ "$data_ubivol" ] && ubirmvol /dev/$root_ubidev -N rootfs_data || :
|
||||
|
||||
# create kernel vol
|
||||
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"
|
||||
return 1;
|
||||
fi
|
||||
@ -239,7 +262,7 @@ nand_upgrade_prepare_ubi() {
|
||||
else
|
||||
rootfs_size_param="-s $rootfs_length"
|
||||
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"
|
||||
return 1;
|
||||
fi
|
||||
@ -251,8 +274,8 @@ nand_upgrade_prepare_ubi() {
|
||||
if [ -n "$rootfs_data_max" ]; then
|
||||
rootfs_data_size_param="-s $rootfs_data_max"
|
||||
fi
|
||||
if ! ubimkvol /dev/$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 $rootfs_data_size_param; then
|
||||
if ! ubimkvol /dev/$root_ubidev -N rootfs_data -m; then
|
||||
echo "cannot initialize rootfs_data volume"
|
||||
return 1
|
||||
fi
|
||||
@ -336,8 +359,8 @@ nand_upgrade_tar() {
|
||||
local has_env=0
|
||||
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
|
||||
local ubidev="$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )"
|
||||
local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
|
||||
tar xO${gz}f "$tar_file" "$board_dir/root" | \
|
||||
ubiupdatevol /dev/$root_ubivol -s "$rootfs_length" -
|
||||
@ -347,6 +370,7 @@ nand_upgrade_tar() {
|
||||
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
|
||||
mtd write - "$CI_KERNPART"
|
||||
else
|
||||
local ubidev="$( nand_find_ubi "${CI_KERN_UBIPART:-$CI_UBIPART}" )"
|
||||
local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )"
|
||||
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
|
||||
ubiupdatevol /dev/$kern_ubivol -s "$kernel_length" -
|
||||
|
||||
@ -34,7 +34,8 @@ bananapi,bpi-r3)
|
||||
;;
|
||||
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_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
|
||||
@ -33,6 +33,7 @@ ampedwireless,ally-r1900k)
|
||||
;;
|
||||
beeline,smartbox-giga|\
|
||||
beeline,smartbox-turbo|\
|
||||
etisalat,s3|\
|
||||
rostelecom,rt-sf-1)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
|
||||
;;
|
||||
@ -78,6 +79,11 @@ linksys,ea8100-v2|\
|
||||
mts,wg430223)
|
||||
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-4a-gigabit|\
|
||||
xiaomi,miwifi-3c)
|
||||
|
||||
@ -116,8 +116,8 @@ endef
|
||||
|
||||
define U-Boot/Marsboard_A10
|
||||
BUILD_SUBTARGET:=cortexa8
|
||||
NAME:=Marsboard
|
||||
BUILD_DEVICES:=marsboard_a10-marsboard
|
||||
NAME:=HAOYU Marsboard A10
|
||||
BUILD_DEVICES:=haoyu_a10-marsboard
|
||||
endef
|
||||
|
||||
define U-Boot/Mele_M9
|
||||
|
||||
@ -29,7 +29,7 @@ diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
|
||||
index b8a382d1539..ed3d360bb10 100644
|
||||
--- a/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-nanopi-neo2.dtb \
|
||||
sun50i-h5-nanopi-neo-plus2.dtb \
|
||||
|
||||
@ -66,6 +66,7 @@ CONFIGURE_ARGS+= \
|
||||
--without-mpc \
|
||||
--without-mpfr \
|
||||
--without-isl \
|
||||
--without-xxhash \
|
||||
--with-libgmp-prefix=$(STAGING_DIR)/usr
|
||||
|
||||
CONFIGURE_VARS+= \
|
||||
|
||||
@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=strace
|
||||
PKG_VERSION:=6.0
|
||||
PKG_VERSION:=6.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
|
||||
PKG_HASH:=92d720a666855e9f1c6a11512fd6e99674a82bbfe1442557815f2ce8e1293338
|
||||
PKG_HASH:=2579e9cec37dbb786f6ea0bebd15f40dd561ef2bde2a2a2ecdce5963b01859fd
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=LGPL-2.1-or-later
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=trace-cmd
|
||||
PKG_VERSION:=v3.1.4
|
||||
PKG_VERSION:=v3.1.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
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_HASH:=447e095dbdfb0d362ab8c2086d62d80c5a2ecf67aef09b8f6b0cc064c0e1bfb5
|
||||
PKG_HASH:=9af1ea00e312d03639470e126fa9c786789f03c16df93a57c0bc90eeffbc7d50
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define KernelPackage/ath10k-ct
|
||||
SUBMENU:=Wireless Drivers
|
||||
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:=\
|
||||
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
|
||||
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
|
||||
@ -111,8 +111,7 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
+$(KERNEL_MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) \
|
||||
M="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
modules
|
||||
|
||||
@ -99,8 +99,7 @@ define Package/nas/description
|
||||
proprietary Broadcom wl driver.
|
||||
endef
|
||||
|
||||
MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
MAKE_KMOD := $(KERNEL_MAKE) \
|
||||
PATH="$(TARGET_PATH)" \
|
||||
M="$(PKG_BUILD_DIR)/kmod" \
|
||||
|
||||
|
||||
@ -32,14 +32,8 @@ define KernelPackage/gpio-button-hotplug/description
|
||||
an overkill for OpenWrt simple needs.
|
||||
endef
|
||||
|
||||
MAKE_OPTS:= \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)"
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(MAKE_OPTS) \
|
||||
modules
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,gpio-button-hotplug))
|
||||
|
||||
@ -36,15 +36,11 @@ EXTRA_CFLAGS:= \
|
||||
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
|
||||
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
|
||||
|
||||
MAKE_OPTS:= \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
$(EXTRA_KCONFIG)
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(MAKE_OPTS) \
|
||||
$(KERNEL_MAKE) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
$(EXTRA_KCONFIG) \
|
||||
modules
|
||||
endef
|
||||
|
||||
|
||||
@ -19,8 +19,7 @@ define KernelPackage/hwmon-gsc/description
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(KERNEL_MAKE) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(BUILDFLAGS)" \
|
||||
modules
|
||||
|
||||
@ -51,8 +51,7 @@ define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
+$(KERNEL_MAKE) $(PKG_JOBS) \
|
||||
M="$(PKG_BUILD_DIR)/$(MAKE_PATH)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
34
package/kernel/leds-ws2812b/Makefile
Normal file
34
package/kernel/leds-ws2812b/Makefile
Normal 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))
|
||||
1
package/kernel/leds-ws2812b/src/Makefile
Normal file
1
package/kernel/leds-ws2812b/src/Makefile
Normal file
@ -0,0 +1 @@
|
||||
obj-m := leds-ws2812b.o
|
||||
233
package/kernel/leds-ws2812b/src/leds-ws2812b.c
Normal file
233
package/kernel/leds-ws2812b/src/leds-ws2812b.c
Normal 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");
|
||||
@ -163,7 +163,7 @@ endef
|
||||
define KernelPackage/mac80211-hwsim
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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
|
||||
AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
|
||||
endef
|
||||
@ -172,7 +172,7 @@ endef
|
||||
define KernelPackage/mt7601u
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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
|
||||
AUTOLOAD:=$(call AutoProbe,mt7601u)
|
||||
endef
|
||||
@ -180,7 +180,7 @@ endef
|
||||
define KernelPackage/rsi91x
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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
|
||||
endef
|
||||
|
||||
@ -204,7 +204,7 @@ endef
|
||||
define KernelPackage/wlcore
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=TI common driver part
|
||||
DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT
|
||||
DEPENDS+= +kmod-mmc +kmod-mac80211
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
|
||||
|
||||
@ -154,7 +154,7 @@ define KernelPackage/ath6kl
|
||||
TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb)
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
HIDDEN:=1
|
||||
DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT
|
||||
DEPENDS+= +kmod-ath
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko
|
||||
endef
|
||||
|
||||
@ -191,7 +191,7 @@ define KernelPackage/ath9k-common
|
||||
TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
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:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
|
||||
@ -255,7 +255,7 @@ define KernelPackage/ath10k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11ac wireless cards support
|
||||
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
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
|
||||
@ -294,7 +294,7 @@ endef
|
||||
define KernelPackage/carl9170
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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
|
||||
AUTOLOAD:=$(call AutoProbe,carl9170)
|
||||
endef
|
||||
|
||||
@ -381,7 +381,7 @@ define KernelPackage/brcmsmac
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
|
||||
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
|
||||
AUTOLOAD:=$(call AutoProbe,brcmsmac)
|
||||
MENU:=1
|
||||
@ -413,7 +413,7 @@ define KernelPackage/brcmfmac
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
|
||||
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 \
|
||||
+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
|
||||
|
||||
@ -167,6 +167,10 @@ detect_mac80211() {
|
||||
|
||||
path="$(iwinfo nl80211 path "$dev")"
|
||||
macaddr="$(cat /sys/class/ieee80211/${dev}/macaddress)"
|
||||
|
||||
# work around phy rename related race condition
|
||||
[ -n "$path" -o -n "$macaddr" ] || continue
|
||||
|
||||
board_dev=
|
||||
fallback_board_dev=
|
||||
json_for_each_item check_board_phy wlan
|
||||
|
||||
@ -6,7 +6,7 @@ config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
|
||||
|
||||
define KernelPackage/iwlwifi
|
||||
$(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
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \
|
||||
|
||||
@ -9,7 +9,7 @@ define KernelPackage/mwl8k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
|
||||
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
|
||||
AUTOLOAD:=$(call AutoProbe,mwl8k)
|
||||
endef
|
||||
@ -23,7 +23,7 @@ define KernelPackage/mwifiex-pcie
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards
|
||||
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:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko
|
||||
@ -38,7 +38,7 @@ define KernelPackage/mwifiex-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell 802.11n/802.11ac SDIO Wireless cards
|
||||
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:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_sdio.ko
|
||||
|
||||
@ -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;
|
||||
@ -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;
|
||||
|
||||
/*
|
||||
@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/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->hw_features |= ndev->features &
|
||||
MAC80211_SUPPORTED_FEATURES_TX;
|
||||
|
||||
@ -88,7 +88,7 @@ endef
|
||||
|
||||
define KernelPackage/rt2800-lib
|
||||
$(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
|
||||
TITLE+= (rt2800 LIB)
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800lib.ko
|
||||
|
||||
@ -38,7 +38,7 @@ endef
|
||||
define KernelPackage/rtlwifi
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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
|
||||
HIDDEN:=1
|
||||
endef
|
||||
@ -169,7 +169,7 @@ endef
|
||||
define KernelPackage/rtw88
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
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:=\
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \
|
||||
|
||||
@ -40,7 +40,7 @@ define KernelPackage/mt76-default
|
||||
SUBMENU:=Wireless Drivers
|
||||
DEPENDS:= \
|
||||
+kmod-mac80211 \
|
||||
+@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT
|
||||
+@DRIVER_11AC_SUPPORT
|
||||
endef
|
||||
|
||||
define KernelPackage/mt76
|
||||
@ -379,8 +379,7 @@ ifdef CONFIG_PACKAGE_kmod-mt7921e
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
+$(KERNEL_MAKE) $(PKG_JOBS) \
|
||||
$(PKG_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
|
||||
@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define KernelPackage/mwlwifi
|
||||
SUBMENU:=Wireless Drivers
|
||||
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
|
||||
AUTOLOAD:=$(call AutoLoad,50,mwlwifi)
|
||||
endef
|
||||
@ -45,8 +45,7 @@ NOSTDINC_FLAGS := \
|
||||
-Wno-unused-result
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
+$(KERNEL_MAKE) $(PKG_JOBS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
modules
|
||||
|
||||
@ -22,8 +22,7 @@ define KernelPackage/rtc-rv5c386a
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(KERNEL_MAKE) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(BUILDFLAGS)" \
|
||||
modules
|
||||
|
||||
@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define KernelPackage/rtl8812au-ct
|
||||
SUBMENU:=Wireless Drivers
|
||||
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:=\
|
||||
$(PKG_BUILD_DIR)/rtl8812au.ko
|
||||
AUTOLOAD:=$(call AutoProbe,rtl8812au)
|
||||
@ -44,8 +44,7 @@ NOSTDINC_FLAGS := \
|
||||
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
+$(KERNEL_MAKE) $(PKG_JOBS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
modules
|
||||
|
||||
@ -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;
|
||||
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtraceevent
|
||||
PKG_VERSION:=1.6.3
|
||||
PKG_VERSION:=1.7.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
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>
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtracefs
|
||||
PKG_VERSION:=1.6.2
|
||||
PKG_VERSION:=1.6.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
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>
|
||||
|
||||
|
||||
@ -68,10 +68,6 @@ config DRIVER_WEXT_SUPPORT
|
||||
select KERNEL_WIRELESS_EXT
|
||||
default n
|
||||
|
||||
config DRIVER_11N_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
config DRIVER_11AC_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
@ -28,7 +28,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_hostapd-mini \
|
||||
CONFIG_WPA_RFKILL_SUPPORT \
|
||||
CONFIG_DRIVER_WEXT_SUPPORT \
|
||||
CONFIG_DRIVER_11N_SUPPORT \
|
||||
CONFIG_DRIVER_11AC_SUPPORT \
|
||||
CONFIG_DRIVER_11AX_SUPPORT \
|
||||
CONFIG_WPA_ENABLE_WEP
|
||||
@ -71,11 +70,6 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
|
||||
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
|
||||
HOSTAPD_IEEE80211N:=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AC:=y
|
||||
endif
|
||||
@ -87,7 +81,6 @@ endif
|
||||
DRIVER_MAKEOPTS= \
|
||||
CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
|
||||
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
|
||||
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
|
||||
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
|
||||
|
||||
@ -614,7 +614,9 @@ hostapd_set_bss_options() {
|
||||
[ -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" ] && {
|
||||
append bss_conf "acct_server_addr=$acct_server" "$N"
|
||||
append bss_conf "acct_server_port=$acct_port" "$N"
|
||||
@ -690,7 +692,7 @@ hostapd_set_bss_options() {
|
||||
json_get_vars \
|
||||
auth_server auth_secret auth_port \
|
||||
dae_client dae_secret dae_port \
|
||||
ownip radius_client_addr \
|
||||
dynamic_ownip ownip radius_client_addr \
|
||||
eap_reauth_period request_cui \
|
||||
erp_domain mobility_domain \
|
||||
fils_realm fils_dhcp
|
||||
@ -698,6 +700,8 @@ hostapd_set_bss_options() {
|
||||
# radius can provide VLAN ID for clients
|
||||
vlan_possible=1
|
||||
|
||||
set_default dynamic_ownip 1
|
||||
|
||||
# legacy compatibility
|
||||
[ -n "$auth_server" ] || json_get_var auth_server server
|
||||
[ -n "$auth_port" ] || json_get_var auth_port port
|
||||
@ -746,7 +750,12 @@ hostapd_set_bss_options() {
|
||||
}
|
||||
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"
|
||||
append bss_conf "eapol_key_index_workaround=1" "$N"
|
||||
append bss_conf "ieee8021x=1" "$N"
|
||||
@ -908,7 +917,6 @@ hostapd_set_bss_options() {
|
||||
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 "reassociation_deadline=$reassociation_deadline" "$N"
|
||||
[ -n "$nasid" ] || append bss_conf "nas_identifier=${macaddr//\:}" "$N"
|
||||
|
||||
if [ "$ft_psk_generate_local" -eq "0" ]; then
|
||||
json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push
|
||||
|
||||
@ -13,6 +13,7 @@ start_service() {
|
||||
procd_open_instance hostapd
|
||||
procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global
|
||||
procd_set_param respawn 3600 1 0
|
||||
procd_set_param limits core="unlimited"
|
||||
[ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && {
|
||||
procd_add_jail hostapd
|
||||
procd_set_param capabilities /etc/capabilities/wpad.json
|
||||
@ -29,6 +30,7 @@ start_service() {
|
||||
procd_open_instance supplicant
|
||||
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 limits core="unlimited"
|
||||
[ -x /sbin/ujail -a -e /etc/capabilities/wpad.json ] && {
|
||||
procd_add_jail wpa_supplicant
|
||||
procd_set_param capabilities /etc/capabilities/wpad.json
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
bss->freq = 0;
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- 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);
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
@ -390,32 +390,6 @@ hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
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
|
||||
hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
|
||||
@ -7,10 +7,6 @@ static inline int has_feature(const char *feat)
|
||||
if (!strcmp(feat, "eap"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_IEEE80211N
|
||||
if (!strcmp(feat, "11n"))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef CONFIG_IEEE80211AC
|
||||
if (!strcmp(feat, "11ac"))
|
||||
return 1;
|
||||
|
||||
@ -11,9 +11,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
||||
PKG_SOURCE_DATE:=2022-11-01
|
||||
PKG_SOURCE_VERSION:=00aab871c50d944fd83269e460e69124cb11adb7
|
||||
PKG_MIRROR_HASH:=e915d53da916db333d62c396154612ed7557fbb27ed8884e70c19c321c08b12c
|
||||
PKG_SOURCE_DATE:=2022-12-15
|
||||
PKG_SOURCE_VERSION:=8d158096a9882d3090c7e180a296ca7b035b4865
|
||||
PKG_MIRROR_HASH:=c376d3f2794fcef2956c038a16b4a1a4d30082ca4f2d2b955bd191d06e78f6ec
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
|
||||
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
|
||||
PKG_MIRROR_HASH:=18137fa6904b1a7aec03a16a4c25fd9b9689b24ee14d431bacdda9f093339071
|
||||
PKG_SOURCE_DATE:=2022-09-21
|
||||
PKG_SOURCE_VERSION:=8c852b656bf1622dee1ae2cfa4c083f730c1c539
|
||||
PKG_MIRROR_HASH:=87dab115512070d3ab566ebe47859bad3c148986271cdb2ac05a0952be262519
|
||||
PKG_SOURCE_DATE:=2022-12-15
|
||||
PKG_SOURCE_VERSION:=7de4820c87437033f6b7716018f3bfa60a3f7b12
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
PKG_LICENSE:=ISC
|
||||
@ -68,8 +68,9 @@ endef
|
||||
|
||||
|
||||
# 1: plugin name
|
||||
# 2: extra dependencies
|
||||
# 2: additional dependencies
|
||||
# 3: plugin title/description
|
||||
# 4: extra dependencies
|
||||
define BuildPlugin
|
||||
|
||||
PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_rpcd-mod-$(1)
|
||||
@ -78,6 +79,7 @@ define BuildPlugin
|
||||
$(Package/rpcd/default)
|
||||
TITLE+= ($(1) plugin)
|
||||
DEPENDS+=rpcd $(2)
|
||||
EXTRA_DEPENDS:=$(4)
|
||||
endef
|
||||
|
||||
define Package/rpcd-mod-$(1)/description
|
||||
@ -101,5 +103,5 @@ endef
|
||||
$(eval $(call BuildPackage,rpcd))
|
||||
$(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
|
||||
$(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
|
||||
$(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))
|
||||
$(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.))
|
||||
|
||||
@ -122,10 +122,26 @@
|
||||
reg = <0x8c0000 0x700000>;
|
||||
};
|
||||
|
||||
art: partition@fc0000 {
|
||||
partition@fc0000 {
|
||||
label = "ART";
|
||||
reg = <0xfc0000 0x040000>;
|
||||
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 {
|
||||
compatible = "pci168c,002a";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&calibration_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
#gpio-cells = <2>;
|
||||
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>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
uboot: partition@0 {
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x0 0x40000>;
|
||||
read-only;
|
||||
@ -82,10 +82,26 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "art";
|
||||
reg = <0xff0000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
macaddr_art_6: macaddr@6 {
|
||||
reg = <0x6 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0xeb8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -105,18 +121,6 @@
|
||||
|
||||
&wifi {
|
||||
ubnt,hsr;
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
macaddr_art_6: macaddr@6 {
|
||||
reg = <0x6 0x6>;
|
||||
};
|
||||
nvmem-cells = <&calibration_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
|
||||
@ -68,15 +68,32 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@7f0000 {
|
||||
partition@7f0000 {
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&wifi {
|
||||
nvmem-cells = <&calibration_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
|
||||
ð0 {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
@ -85,13 +102,3 @@
|
||||
ð1 {
|
||||
compatible = "syscon", "simple-mfd";
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
|
||||
wifi: wifi@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -133,10 +133,22 @@
|
||||
label = "u-boot-env";
|
||||
};
|
||||
|
||||
art: partition@50000 {
|
||||
partition@50000 {
|
||||
reg = <0x50000 0x10000>;
|
||||
label = "art";
|
||||
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 {
|
||||
@ -197,9 +209,8 @@
|
||||
ath9k: wifi@0,0 {
|
||||
compatible = "pci168c,002a";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
nvmem-cells = <&macaddr_art_120c>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_art_120c>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
@ -212,13 +223,3 @@
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_120c: macaddr@120c {
|
||||
reg = <0x120c 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -87,11 +87,10 @@
|
||||
ath9k: wifi@0,0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0 0 0 0 0>;
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <1>;
|
||||
qca,disable-5ghz;
|
||||
qca,no-eeprom;
|
||||
ieee80211-freq-limit = <2402000 2482000>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
@ -100,12 +99,10 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
qca,disable-2ghz;
|
||||
ieee80211-freq-limit = <4900000 5990000>;
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <2>;
|
||||
};
|
||||
|
||||
@ -117,4 +114,12 @@
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -135,10 +135,30 @@
|
||||
reg = <0x7e0000 0x010000>;
|
||||
};
|
||||
|
||||
art: partition@7f0000 {
|
||||
partition@7f0000 {
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x010000>;
|
||||
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 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&calibration_art_5000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
ieee80211-freq-limit = <4900000 5990000>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
@ -214,7 +235,8 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&calibration_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
|
||||
&usb {
|
||||
@ -224,17 +246,3 @@
|
||||
&usb_phy {
|
||||
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>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -36,14 +36,14 @@
|
||||
|
||||
&pcie {
|
||||
wifi@0,0,0 {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <(-1)>;
|
||||
};
|
||||
|
||||
@ -55,4 +55,12 @@
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -30,15 +30,15 @@
|
||||
|
||||
&pcie {
|
||||
wifi@0,0,0 {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <(-2)>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <(-1)>;
|
||||
};
|
||||
|
||||
@ -50,4 +50,12 @@
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
uboot: partition@0 {
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x000000 0x040000>;
|
||||
read-only;
|
||||
@ -114,10 +114,34 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "art";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
macaddr_art_6: macaddr@6 {
|
||||
reg = <0x6 0x6>;
|
||||
};
|
||||
|
||||
macaddr_art_c: macaddr@c {
|
||||
reg = <0xc 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -129,9 +153,8 @@
|
||||
ath9k: wifi@0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
nvmem-cells = <&macaddr_art_c>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_art_c>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
@ -140,9 +163,8 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&macaddr_art_6>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_6>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
@ -175,21 +197,3 @@
|
||||
txd-delay = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&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>;
|
||||
};
|
||||
|
||||
macaddr_art_c: macaddr@c {
|
||||
reg = <0xc 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -70,10 +70,26 @@
|
||||
reg = <0x850000 0x7a0000>;
|
||||
};
|
||||
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "ART";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -111,9 +127,8 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
|
||||
@ -123,22 +138,11 @@
|
||||
ath9k: wifi@0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <8>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -148,10 +148,26 @@
|
||||
reg = <0x850000 0x7a0000>;
|
||||
};
|
||||
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "ART";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -198,9 +214,8 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <2>;
|
||||
};
|
||||
|
||||
@ -210,19 +225,8 @@
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <16>;
|
||||
};
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -63,6 +63,8 @@
|
||||
mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
|
||||
sck-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
num-chipselects = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
beamforming-2g-gpio@0 {
|
||||
compatible = "fairchild,74hc595";
|
||||
@ -79,6 +81,8 @@
|
||||
mosi-gpios = <&ath9k 15 GPIO_ACTIVE_HIGH>;
|
||||
sck-gpios = <&ath9k 14 GPIO_ACTIVE_HIGH>;
|
||||
num-chipselects = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
beamforming-5g-gpio@0 {
|
||||
compatible = "fairchild,74hc595";
|
||||
|
||||
@ -63,7 +63,6 @@
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0 0 0 0 0>;
|
||||
ieee80211-freq-limit = <2402000 2482000>;
|
||||
qca,no-eeprom;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
@ -73,6 +72,4 @@
|
||||
status = "okay";
|
||||
|
||||
ieee80211-freq-limit = <4900000 5990000>;
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
};
|
||||
|
||||
33
target/linux/ath79/dts/ar9344_tplink_cpe605-v1.dts
Normal file
33
target/linux/ath79/dts/ar9344_tplink_cpe605-v1.dts
Normal file
@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar9344_tplink_cpe.dtsi"
|
||||
|
||||
/ {
|
||||
model = "TP-Link CPE605 v1";
|
||||
compatible = "tplink,cpe605-v1", "qca,ar9344";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_lan;
|
||||
led-failsafe = &led_lan;
|
||||
led-upgrade = &led_lan;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_lan: lan {
|
||||
label = "green:lan";
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wlan5g {
|
||||
label = "green:wlan5g";
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð1 {
|
||||
compatible = "syscon", "simple-mfd";
|
||||
};
|
||||
@ -100,10 +100,26 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "art";
|
||||
reg = <0xff0000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -115,14 +131,16 @@
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,0033";
|
||||
reg = <0 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&calibration_art_5000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&calibration_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
@ -150,13 +168,3 @@
|
||||
phy-mode = "rgmii";
|
||||
phy-handle = <&phy0>;
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -63,13 +63,18 @@
|
||||
|
||||
&pcie {
|
||||
status = "disabled";
|
||||
|
||||
wifi@0,0,0 {
|
||||
nvmem-cells = <&calibration_art_5000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
/delete-property/ qca,disable-2ghz;
|
||||
/delete-property/ ieee80211-freq-limit;
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <(-2)>;
|
||||
};
|
||||
|
||||
@ -81,4 +86,12 @@
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -63,15 +63,15 @@
|
||||
|
||||
&pcie {
|
||||
wifi@0,0,0 {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <(-1)>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
nvmem-cells = <&macaddr_art_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <(-2)>;
|
||||
};
|
||||
|
||||
@ -83,4 +83,12 @@
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -119,16 +119,36 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@fe0000 {
|
||||
partition@fe0000 {
|
||||
label = "art";
|
||||
reg = <0xfe0000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
|
||||
addr: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "addr";
|
||||
reg = <0xff0000 0x10000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_addr_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -140,9 +160,8 @@
|
||||
ath9k: wifi@0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_addr_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_addr_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <0x10>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
@ -160,9 +179,8 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
mtd-cal-data = <&art 0x1000>;
|
||||
nvmem-cells = <&macaddr_addr_0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_addr_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
@ -193,12 +211,3 @@
|
||||
};
|
||||
};
|
||||
|
||||
&addr {
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_addr_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
194
target/linux/ath79/dts/qca9533_kuwfi_c910.dts
Normal file
194
target/linux/ath79/dts/qca9533_kuwfi_c910.dts
Normal file
@ -0,0 +1,194 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca953x.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/mtd/partitions/uimage.h>
|
||||
|
||||
/ {
|
||||
compatible = "kuwfi,c910", "qca,qca9533";
|
||||
model = "KuWFi C910";
|
||||
|
||||
aliases {
|
||||
label-mac-device = ð1;
|
||||
led-boot = &internet_red;
|
||||
led-failsafe = &internet_red;
|
||||
led-upgrade = &internet_red;
|
||||
};
|
||||
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
devices = <&fwconcat0 &fwconcat1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x0 0x0>;
|
||||
label = "firmware";
|
||||
compatible = "openwrt,uimage", "denx,uimage";
|
||||
openwrt,ih-magic = <IH_MAGIC_OKLI>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
internet_blue {
|
||||
label = "blue:internet";
|
||||
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wifi {
|
||||
label = "white:wifi";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
internet_green {
|
||||
label = "green:internet";
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wan {
|
||||
label = "white:wan";
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
lan2 {
|
||||
label = "white:lan2";
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
// gpio 12 enables or disables LTE (Quectel EC200T)
|
||||
|
||||
internet_red: internet_red {
|
||||
label = "red:internet";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
lan1 {
|
||||
label = "white:lan1";
|
||||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "winbond,w25q128", "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x000000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@20000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x020000 0x010000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@30000 {
|
||||
label = "config";
|
||||
reg = <0x030000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
fwconcat0: partition@50000 {
|
||||
label = "fwconcat0";
|
||||
reg = <0x050000 0xe30000>;
|
||||
};
|
||||
|
||||
partition@e80000 {
|
||||
label = "loader";
|
||||
reg = <0xe80000 0x10000>;
|
||||
};
|
||||
|
||||
fwconcat1: partition@e90000 {
|
||||
label = "fwconcat1";
|
||||
reg = <0xe90000 0x160000>;
|
||||
};
|
||||
|
||||
partition@ff0000 {
|
||||
label = "art";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
calibration_art_1000: macaddr@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
macaddr_art_1002: macaddr@1002 {
|
||||
reg = <0x1002 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&usb0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&swphy0>;
|
||||
|
||||
nvmem-cells = <&macaddr_art_1002>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
|
||||
ð1 {
|
||||
phy-handle = <&swphy4>;
|
||||
|
||||
nvmem-cells = <&macaddr_art_1002>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
gmac-config {
|
||||
device = <&gmac>;
|
||||
switch-phy-swap = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&calibration_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
@ -57,10 +57,26 @@
|
||||
};
|
||||
|
||||
&partitions {
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "art";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x844>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -89,7 +105,7 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_ath9k>;
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
@ -97,23 +113,7 @@
|
||||
&ath10k {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_ath10k>;
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <2>;
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_ath9k: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_ath10k: calibration@5000 {
|
||||
reg = <0x5000 0x844>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -57,10 +57,26 @@
|
||||
};
|
||||
|
||||
&partitions {
|
||||
art: partition@ff0000 {
|
||||
partition@ff0000 {
|
||||
label = "art";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_art_5000: calibration@5000 {
|
||||
reg = <0x5000 0x844>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -89,7 +105,7 @@
|
||||
&wmac {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_ath9k>;
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <1>;
|
||||
};
|
||||
@ -97,23 +113,7 @@
|
||||
&ath10k {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_ath10k>;
|
||||
nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
mac-address-increment = <2>;
|
||||
};
|
||||
|
||||
&art {
|
||||
compatible = "nvmem-cells";
|
||||
|
||||
macaddr_art_0: macaddr@0 {
|
||||
reg = <0x0 0x6>;
|
||||
};
|
||||
|
||||
calibration_ath9k: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
calibration_ath10k: calibration@5000 {
|
||||
reg = <0x5000 0x844>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -18,6 +18,7 @@ glinet,6416|\
|
||||
glinet,gl-ar300m-lite|\
|
||||
glinet,gl-ar300m16|\
|
||||
pcs,cap324|\
|
||||
tplink,cpe605-v1|\
|
||||
tplink,cpe610-v1|\
|
||||
tplink,cpe610-v2|\
|
||||
tplink,tl-wa1201-v2)
|
||||
@ -267,6 +268,11 @@ hiwifi,hc6361)
|
||||
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
|
||||
ucidef_set_led_wlan "wlan" "WLAN" "blue:wlan" "phy0tpt"
|
||||
;;
|
||||
kuwfi,c910)
|
||||
ucidef_set_led_netdev "wan" "WAN" "white:wan" "eth1"
|
||||
ucidef_set_led_switch "lan1" "LAN1" "white:lan1" "switch0" "0x10"
|
||||
ucidef_set_led_switch "lan2" "LAN2" "white:lan2" "switch0" "0x02"
|
||||
;;
|
||||
meraki,mr12|\
|
||||
tplink,cpe210-v2|\
|
||||
tplink,cpe210-v3)
|
||||
|
||||
@ -77,6 +77,7 @@ ath79_setup_interfaces()
|
||||
tplink,cpe210-v3|\
|
||||
tplink,cpe510-v2|\
|
||||
tplink,cpe510-v3|\
|
||||
tplink,cpe605-v1|\
|
||||
tplink,cpe610-v1|\
|
||||
tplink,cpe610-v2|\
|
||||
tplink,cpe710-v1|\
|
||||
@ -346,6 +347,11 @@ ath79_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
kuwfi,c910)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:2" "4:lan:1"
|
||||
;;
|
||||
letv,lba-047-ch)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch0" \
|
||||
|
||||
@ -83,27 +83,10 @@ case "$FIRMWARE" in
|
||||
;;
|
||||
"ath9k-eeprom-pci-0000:00:00.0.bin")
|
||||
case $board in
|
||||
araknis,an-300-ap-i-n|\
|
||||
atheros,db120|\
|
||||
engenius,eap600|\
|
||||
engenius,ecb600|\
|
||||
mercury,mw4530r-v1|\
|
||||
ocedo,raccoon|\
|
||||
ubnt,unifi-ap-pro|\
|
||||
watchguard,ap100|\
|
||||
watchguard,ap200|\
|
||||
winchannel,wb2000)
|
||||
caldata_extract "art" 0x5000 0x440
|
||||
;;
|
||||
avm,fritz300e)
|
||||
caldata_extract_reverse "urloader" 0x1541 0x440
|
||||
;;
|
||||
buffalo,wzr-hp-g302h-a1a0|\
|
||||
ubnt,unifi-ap-outdoor-plus)
|
||||
caldata_extract "art" 0x1000 0xeb8
|
||||
;;
|
||||
buffalo,wzr-hp-g450h|\
|
||||
ubnt,unifi)
|
||||
buffalo,wzr-hp-g450h)
|
||||
caldata_extract "art" 0x1000 0x440
|
||||
;;
|
||||
dlink,dir-825-c1|\
|
||||
@ -124,14 +107,6 @@ case "$FIRMWARE" in
|
||||
tplink,tl-wr842n-v1)
|
||||
caldata_extract "art" 0x1000 0x1000
|
||||
;;
|
||||
openmesh,mr600-v1|\
|
||||
openmesh,mr600-v2|\
|
||||
openmesh,om5p-an)
|
||||
caldata_extract "ART" 0x5000 0x440
|
||||
;;
|
||||
openmesh,om2p-v1)
|
||||
caldata_extract "ART" 0x1000 0x440
|
||||
;;
|
||||
wd,mynet-n600|\
|
||||
wd,mynet-n750)
|
||||
caldata_extract "art" 0x5000 0x440
|
||||
|
||||
@ -350,6 +350,16 @@ define Device/tplink_cpe510-v3
|
||||
endef
|
||||
TARGET_DEVICES += tplink_cpe510-v3
|
||||
|
||||
define Device/tplink_cpe605-v1
|
||||
$(Device/tplink-safeloader-okli)
|
||||
SOC := ar9344
|
||||
IMAGE_SIZE := 7680k
|
||||
DEVICE_MODEL := CPE605
|
||||
DEVICE_VARIANT := v1
|
||||
TPLINK_BOARD_ID := CPE605V1
|
||||
endef
|
||||
TARGET_DEVICES += tplink_cpe605-v1
|
||||
|
||||
define Device/tplink_cpe610-v1
|
||||
$(Device/tplink-safeloader-okli)
|
||||
SOC := ar9344
|
||||
|
||||
@ -1584,6 +1584,22 @@ define Device/joyit_jt-or750i
|
||||
endef
|
||||
TARGET_DEVICES += joyit_jt-or750i
|
||||
|
||||
define Device/kuwfi_c910
|
||||
$(Device/loader-okli-uimage)
|
||||
SOC := qca9533
|
||||
DEVICE_VENDOR := KuWFi
|
||||
DEVICE_MODEL := C910
|
||||
DEVICE_PACKAGES := kmod-usb2 kmod-usb-net-cdc-ether comgt-ncm
|
||||
LOADER_FLASH_OFFS := 0x50000
|
||||
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
|
||||
IMAGE_SIZE := 15936k
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
|
||||
append-rootfs | pad-rootfs | check-size | pad-to 14528k | \
|
||||
append-loader-okli-uimage $(1) | pad-to 64k
|
||||
endef
|
||||
TARGET_DEVICES += kuwfi_c910
|
||||
|
||||
define Device/letv_lba-047-ch
|
||||
$(Device/loader-okli-uimage)
|
||||
SOC := qca9531
|
||||
|
||||
@ -163,7 +163,8 @@ define Device/rpi-4
|
||||
cypress-firmware-43455-sdio \
|
||||
brcmfmac-nvram-43455-sdio \
|
||||
kmod-brcmfmac wpad-basic-openssl \
|
||||
kmod-usb-net-lan78xx
|
||||
kmod-usb-net-lan78xx \
|
||||
kmod-r8169
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | boot-2711 | sdcard-img | gzip
|
||||
endef
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
|
||||
--- a/drivers/media/common/videobuf2/videobuf2-core.c
|
||||
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
|
||||
@@ -2144,12 +2144,12 @@ static int __find_plane_by_offset(struct
|
||||
@@ -2195,12 +2195,12 @@ static int __find_plane_by_offset(struct
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
struct dma_buf *dbuf;
|
||||
|
||||
if (q->memory != VB2_MEMORY_MMAP) {
|
||||
@@ -2201,6 +2201,21 @@ int vb2_core_expbuf(struct vb2_queue *q,
|
||||
@@ -2252,6 +2252,21 @@ int vb2_core_expbuf(struct vb2_queue *q,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
#define USB_VENDOR_ID_BELKIN 0x050d
|
||||
#define USB_DEVICE_ID_FLIP_KVM 0x3201
|
||||
|
||||
@@ -1310,6 +1313,9 @@
|
||||
@@ -1313,6 +1316,9 @@
|
||||
#define USB_VENDOR_ID_XAT 0x2505
|
||||
#define USB_DEVICE_ID_XAT_CSR 0x0220
|
||||
|
||||
@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
|
||||
@@ -195,6 +196,7 @@ static const struct hid_device_id hid_qu
|
||||
@@ -198,6 +199,7 @@ static const struct hid_device_id hid_qu
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
|
||||
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
/* Device and char device-related information */
|
||||
static DEFINE_IDA(gpio_ida);
|
||||
static dev_t gpio_devt;
|
||||
@@ -2361,8 +2363,8 @@ int gpiod_direction_output(struct gpio_d
|
||||
@@ -2392,8 +2394,8 @@ int gpiod_direction_output(struct gpio_d
|
||||
value = !!value;
|
||||
|
||||
/* GPIOs used for enabled IRQs shall not be set as output */
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
gpiod_err(desc,
|
||||
"%s: tried to set a GPIO tied to an IRQ as output\n",
|
||||
__func__);
|
||||
@@ -3180,8 +3182,8 @@ int gpiochip_lock_as_irq(struct gpio_chi
|
||||
@@ -3211,8 +3213,8 @@ int gpiochip_lock_as_irq(struct gpio_chi
|
||||
}
|
||||
|
||||
/* To be valid for IRQ the line needs to be input or open drain */
|
||||
|
||||
@ -25,7 +25,7 @@ Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -17526,6 +17526,14 @@ T: git git://linuxtv.org/media_tree.git
|
||||
@@ -17521,6 +17521,14 @@ T: git git://linuxtv.org/media_tree.git
|
||||
F: Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
|
||||
F: drivers/media/i2c/imx412.c
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
|
||||
+...
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -17540,6 +17540,7 @@ M: Raspberry Pi Kernel Maintenance <kern
|
||||
@@ -17535,6 +17535,7 @@ M: Raspberry Pi Kernel Maintenance <kern
|
||||
L: linux-media@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://linuxtv.org/media_tree.git
|
||||
|
||||
@ -132,7 +132,7 @@ Signed-off-by: Lee Jackson <info@arducam.com>
|
||||
+...
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -17544,6 +17544,14 @@ F: Documentation/devicetree/bindings/med
|
||||
@@ -17539,6 +17539,14 @@ F: Documentation/devicetree/bindings/med
|
||||
F: Documentation/devicetree/bindings/media/i2c/imx477.yaml
|
||||
F: drivers/media/i2c/imx477.c
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
rate = clk_get_rate(clk);
|
||||
--- a/include/linux/clk.h
|
||||
+++ b/include/linux/clk.h
|
||||
@@ -987,6 +987,17 @@ static inline void clk_bulk_disable_unpr
|
||||
@@ -1096,6 +1096,17 @@ static inline void clk_bulk_disable_unpr
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -55,7 +55,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
KUNIT_CASE(clk_test_orphan_transparent_multiple_parent_mux_set_parent_set_range_modified),
|
||||
--- a/include/linux/clk.h
|
||||
+++ b/include/linux/clk.h
|
||||
@@ -744,8 +744,9 @@ int clk_set_parent(struct clk *clk, stru
|
||||
@@ -829,8 +829,9 @@ int clk_set_parent(struct clk *clk, stru
|
||||
* clk_get_parent - get the parent clock source for this clock
|
||||
* @clk: clock source
|
||||
*
|
||||
|
||||
@ -55,7 +55,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
*
|
||||
--- a/include/linux/clk.h
|
||||
+++ b/include/linux/clk.h
|
||||
@@ -714,6 +714,17 @@ bool clk_has_parent(struct clk *clk, str
|
||||
@@ -799,6 +799,17 @@ bool clk_has_parent(struct clk *clk, str
|
||||
int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max);
|
||||
|
||||
/**
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
* clk_set_min_rate - set a minimum clock rate for a clock source
|
||||
* @clk: clock source
|
||||
* @rate: desired minimum clock rate in Hz, inclusive
|
||||
@@ -909,6 +920,16 @@ static inline int clk_set_rate_range(str
|
||||
@@ -1018,6 +1029,16 @@ static inline int clk_set_rate_range(str
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
static inline int clk_set_min_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
return 0;
|
||||
@@ -999,6 +1020,44 @@ static inline int clk_drop_range(struct
|
||||
@@ -1108,6 +1129,44 @@ static inline int clk_drop_range(struct
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
From b9457a04eb89645049fdf427c13e6a18d5501895 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Tue, 11 Oct 2022 14:24:40 +0200
|
||||
Subject: [PATCH] bcma: support SPROM rev 11
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Rev 11 works fine for me to set the MAC address of gmac0 and
|
||||
gmac1 in the D-Link DWL-8610AP.
|
||||
|
||||
Cc: Rafał Miłecki <zajec5@gmail.com>
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/bcma/sprom.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/bcma/sprom.c
|
||||
+++ b/drivers/bcma/sprom.c
|
||||
@@ -165,7 +165,7 @@ static int bcma_sprom_valid(struct bcma_
|
||||
return err;
|
||||
|
||||
revision = sprom[words - 1] & SSB_SPROM_REVISION_REV;
|
||||
- if (revision != 8 && revision != 9 && revision != 10) {
|
||||
+ if (revision < 8 || revision > 11) {
|
||||
pr_err("Unsupported SPROM revision: %d\n", revision);
|
||||
return -ENOENT;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
From b9457a04eb89645049fdf427c13e6a18d5501895 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Tue, 11 Oct 2022 14:24:40 +0200
|
||||
Subject: [PATCH] bcma: support SPROM rev 11
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Rev 11 works fine for me to set the MAC address of gmac0 and
|
||||
gmac1 in the D-Link DWL-8610AP.
|
||||
|
||||
Cc: Rafał Miłecki <zajec5@gmail.com>
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/bcma/sprom.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/bcma/sprom.c
|
||||
+++ b/drivers/bcma/sprom.c
|
||||
@@ -165,7 +165,7 @@ static int bcma_sprom_valid(struct bcma_
|
||||
return err;
|
||||
|
||||
revision = sprom[words - 1] & SSB_SPROM_REVISION_REV;
|
||||
- if (revision != 8 && revision != 9 && revision != 10) {
|
||||
+ if (revision < 8 || revision > 11) {
|
||||
pr_err("Unsupported SPROM revision: %d\n", revision);
|
||||
return -ENOENT;
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Thu, 7 Jun 2018 19:29:12 +0200
|
||||
Subject: bcm53xx: add LED status label alias for Meraki MR32
|
||||
|
||||
add an led-status alias label. This is used by OpenWrt's LED
|
||||
DTS lookup function to identifiy the indicator LED
|
||||
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts
|
||||
+++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
aliases {
|
||||
serial1 = &uart2;
|
||||
+ led-status = &led_status;
|
||||
};
|
||||
|
||||
leds {
|
||||
@@ -66,7 +67,7 @@
|
||||
max-brightness = <255>;
|
||||
};
|
||||
|
||||
- green {
|
||||
+ led_status: green {
|
||||
/* SYS-LED 1 - Tricolor */
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||
}
|
||||
--- a/drivers/gpio/gpiolib.c
|
||||
+++ b/drivers/gpio/gpiolib.c
|
||||
@@ -1768,7 +1768,8 @@ int gpiochip_add_pingroup_range(struct g
|
||||
@@ -1799,7 +1799,8 @@ int gpiochip_add_pingroup_range(struct g
|
||||
|
||||
list_add_tail(&pin_range->node, &gdev->pin_ranges);
|
||||
|
||||
@ -126,7 +126,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range);
|
||||
|
||||
@@ -1825,7 +1826,7 @@ int gpiochip_add_pin_range(struct gpio_c
|
||||
@@ -1856,7 +1857,7 @@ int gpiochip_add_pin_range(struct gpio_c
|
||||
|
||||
list_add_tail(&pin_range->node, &gdev->pin_ranges);
|
||||
|
||||
|
||||
@ -9,16 +9,31 @@ dlink,dir-685)
|
||||
ucidef_set_interface "eth" device "eth0" protocol "none"
|
||||
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan"
|
||||
;;
|
||||
dlink,dns-313|\
|
||||
edimax,ns-2502|\
|
||||
raidsonic,ib-4220-b|\
|
||||
wiliboard,wbd111|\
|
||||
wiliboard,wbd222)
|
||||
# NAS machines with a single ethernet port
|
||||
ucidef_set_interface_lan "eth0" "dhcp"
|
||||
;;
|
||||
itian,sq201)
|
||||
# These are all connected to eth1 thru VSC7395
|
||||
ucidef_set_interface "eth" device "eth1" protocol "none"
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0"
|
||||
;;
|
||||
ssi,1328)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
storlink,gemini324)
|
||||
# These are all connected to eth1 thru VSC7385
|
||||
ucidef_set_interface "eth" device "eth1" protocol "none"
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0"
|
||||
;;
|
||||
teltonika,rut1xx)
|
||||
# One ethernet LAN which is offering DHCP
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
mdio = of_find_node_by_phandle(*ph);
|
||||
--- a/drivers/net/ethernet/aeroflex/greth.c
|
||||
+++ b/drivers/net/ethernet/aeroflex/greth.c
|
||||
@@ -1449,10 +1449,10 @@ static int greth_of_probe(struct platfor
|
||||
@@ -1450,10 +1450,10 @@ static int greth_of_probe(struct platfor
|
||||
break;
|
||||
}
|
||||
if (i == 6) {
|
||||
|
||||
@ -82,9 +82,9 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
memmove(skb->data - ETH_HLEN,
|
||||
--- a/net/dsa/tag_ksz.c
|
||||
+++ b/net/dsa/tag_ksz.c
|
||||
@@ -24,7 +24,7 @@ static struct sk_buff *ksz_common_rcv(st
|
||||
|
||||
pskb_trim_rcsum(skb, skb->len - len);
|
||||
@@ -25,7 +25,7 @@ static struct sk_buff *ksz_common_rcv(st
|
||||
if (pskb_trim_rcsum(skb, skb->len - len))
|
||||
return NULL;
|
||||
|
||||
- skb->offload_fwd_mark = true;
|
||||
+ dsa_default_offload_fwd_mark(skb);
|
||||
|
||||
@ -92,7 +92,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
|
||||
}
|
||||
--- a/include/linux/cgroup.h
|
||||
+++ b/include/linux/cgroup.h
|
||||
@@ -432,6 +432,18 @@ static inline void cgroup_put(struct cgr
|
||||
@@ -433,6 +433,18 @@ static inline void cgroup_put(struct cgr
|
||||
css_put(&cgrp->self);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
|
||||
/**
|
||||
* task_css_set_check - obtain a task's css_set with extra access conditions
|
||||
* @task: the task to obtain css_set for
|
||||
@@ -446,7 +458,6 @@ static inline void cgroup_put(struct cgr
|
||||
@@ -447,7 +459,6 @@ static inline void cgroup_put(struct cgr
|
||||
* as locks used during the cgroup_subsys::attach() methods.
|
||||
*/
|
||||
#ifdef CONFIG_PROVE_RCU
|
||||
@ -119,7 +119,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
|
||||
extern spinlock_t css_set_lock;
|
||||
#define task_css_set_check(task, __c) \
|
||||
rcu_dereference_check((task)->cgroups, \
|
||||
@@ -707,6 +718,8 @@ struct cgroup;
|
||||
@@ -708,6 +719,8 @@ struct cgroup;
|
||||
static inline u64 cgroup_id(const struct cgroup *cgrp) { return 1; }
|
||||
static inline void css_get(struct cgroup_subsys_state *css) {}
|
||||
static inline void css_put(struct cgroup_subsys_state *css) {}
|
||||
@ -593,7 +593,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
|
||||
VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING,
|
||||
--- a/mm/memcontrol.c
|
||||
+++ b/mm/memcontrol.c
|
||||
@@ -5226,6 +5226,7 @@ static struct mem_cgroup *mem_cgroup_all
|
||||
@@ -5237,6 +5237,7 @@ static struct mem_cgroup *mem_cgroup_all
|
||||
memcg->deferred_split_queue.split_queue_len = 0;
|
||||
#endif
|
||||
idr_replace(&mem_cgroup_idr, memcg, memcg->id.id);
|
||||
|
||||
@ -339,7 +339,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8
|
||||
/* will mmdrop() in finish_task_switch(). */
|
||||
--- a/mm/memcontrol.c
|
||||
+++ b/mm/memcontrol.c
|
||||
@@ -5163,6 +5163,7 @@ static void __mem_cgroup_free(struct mem
|
||||
@@ -5174,6 +5174,7 @@ static void __mem_cgroup_free(struct mem
|
||||
|
||||
static void mem_cgroup_free(struct mem_cgroup *memcg)
|
||||
{
|
||||
@ -347,7 +347,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8
|
||||
memcg_wb_domain_exit(memcg);
|
||||
__mem_cgroup_free(memcg);
|
||||
}
|
||||
@@ -6195,6 +6196,29 @@ static void mem_cgroup_move_task(void)
|
||||
@@ -6206,6 +6207,29 @@ static void mem_cgroup_move_task(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -377,7 +377,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8
|
||||
static int seq_puts_memcg_tunable(struct seq_file *m, unsigned long value)
|
||||
{
|
||||
if (value == PAGE_COUNTER_MAX)
|
||||
@@ -6538,6 +6562,7 @@ struct cgroup_subsys memory_cgrp_subsys
|
||||
@@ -6549,6 +6573,7 @@ struct cgroup_subsys memory_cgrp_subsys
|
||||
.css_reset = mem_cgroup_css_reset,
|
||||
.css_rstat_flush = mem_cgroup_css_rstat_flush,
|
||||
.can_attach = mem_cgroup_can_attach,
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -2263,6 +2263,23 @@ struct btmtk_section_map {
|
||||
@@ -2268,6 +2268,23 @@ struct btmtk_section_map {
|
||||
};
|
||||
} __packed;
|
||||
|
||||
@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
static void btusb_mtk_wmt_recv(struct urb *urb)
|
||||
{
|
||||
struct hci_dev *hdev = urb->context;
|
||||
@@ -3914,6 +3931,7 @@ static int btusb_probe(struct usb_interf
|
||||
@@ -3919,6 +3936,7 @@ static int btusb_probe(struct usb_interf
|
||||
hdev->shutdown = btusb_mtk_shutdown;
|
||||
hdev->manufacturer = 70;
|
||||
hdev->cmd_timeout = btusb_mtk_cmd_timeout;
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -2268,7 +2268,7 @@ static int btusb_set_bdaddr_mtk(struct h
|
||||
@@ -2273,7 +2273,7 @@ static int btusb_set_bdaddr_mtk(struct h
|
||||
struct sk_buff *skb;
|
||||
long ret;
|
||||
|
||||
|
||||
@ -2027,6 +2027,7 @@ CONFIG_FSNOTIFY=y
|
||||
# CONFIG_FUJITSU_ES is not set
|
||||
# CONFIG_FUJITSU_LAPTOP is not set
|
||||
# CONFIG_FUJITSU_TABLET is not set
|
||||
# CONFIG_FUNCTION_ERROR_INJECTION is not set
|
||||
# CONFIG_FUNCTION_TRACER is not set
|
||||
# CONFIG_FUSE_FS is not set
|
||||
# CONFIG_FUSION is not set
|
||||
@ -3078,6 +3079,7 @@ CONFIG_LIB_MEMNEQ=y
|
||||
CONFIG_LINEAR_RANGES=y
|
||||
# CONFIG_LIQUIDIO is not set
|
||||
# CONFIG_LIQUIDIO_VF is not set
|
||||
# CONFIG_LIRC is not set
|
||||
# CONFIG_LIS3L02DQ is not set
|
||||
# CONFIG_LKDTM is not set
|
||||
CONFIG_LLC=y
|
||||
|
||||
@ -2110,6 +2110,7 @@ CONFIG_FSNOTIFY=y
|
||||
# CONFIG_FUJITSU_ES is not set
|
||||
# CONFIG_FUJITSU_LAPTOP is not set
|
||||
# CONFIG_FUJITSU_TABLET is not set
|
||||
# CONFIG_FUNCTION_ERROR_INJECTION is not set
|
||||
# CONFIG_FUNCTION_TRACER is not set
|
||||
# CONFIG_FUSE_FS is not set
|
||||
# CONFIG_FUSION is not set
|
||||
@ -3191,6 +3192,7 @@ CONFIG_LIB_MEMNEQ=y
|
||||
CONFIG_LINEAR_RANGES=y
|
||||
# CONFIG_LIQUIDIO is not set
|
||||
# CONFIG_LIQUIDIO_VF is not set
|
||||
# CONFIG_LIRC is not set
|
||||
# CONFIG_LIS3L02DQ is not set
|
||||
# CONFIG_LITEX_LITEETH is not set
|
||||
# CONFIG_LITEX_SOC_CONTROLLER is not set
|
||||
|
||||
@ -22,7 +22,7 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
|
||||
+
|
||||
+ mac = nvmem_cell_read(cell, &len);
|
||||
+ if (IS_ERR(mac))
|
||||
+ return PTR_ERR(mac);
|
||||
+ return mac;
|
||||
+ if (len != ETH_ALEN) {
|
||||
+ kfree(mac);
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
@ -39,7 +39,7 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
|
||||
+
|
||||
+ mac_ascii = nvmem_cell_read(cell, &len);
|
||||
+ if (IS_ERR(mac_ascii))
|
||||
+ return PTR_ERR(mac_ascii);
|
||||
+ return mac_ascii;
|
||||
+ if (len != ETH_ALEN*2+5) {
|
||||
+ kfree(mac_ascii);
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user