Merge Official Source
This commit is contained in:
commit
3a8c6f9067
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
custom: [ 'https://openwrt.org/donate' ]
|
||||
26
.github/workflows/ci_helpers.sh
vendored
Normal file
26
.github/workflows/ci_helpers.sh
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
color_out() {
|
||||
printf "\e[0;$1m%s\e[0;0m\n" "$2"
|
||||
}
|
||||
|
||||
success() {
|
||||
color_out 32 "$1"
|
||||
}
|
||||
|
||||
info() {
|
||||
color_out 36 "$1"
|
||||
}
|
||||
|
||||
err() {
|
||||
color_out 31 "$1"
|
||||
}
|
||||
|
||||
warn() {
|
||||
color_out 33 "$1"
|
||||
}
|
||||
|
||||
err_die() {
|
||||
err "$1"
|
||||
exit 1
|
||||
}
|
||||
70
.github/workflows/formal.yml
vendored
Normal file
70
.github/workflows/formal.yml
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
name: Test Formalities
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test Formalities
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Determine branch name
|
||||
run: |
|
||||
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
|
||||
echo "Building for $BRANCH"
|
||||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||||
|
||||
- name: Test formalities
|
||||
run: |
|
||||
source .github/workflows/ci_helpers.sh
|
||||
|
||||
RET=0
|
||||
for commit in $(git rev-list HEAD ^origin/$BRANCH); do
|
||||
info "=== Checking commit '$commit'"
|
||||
if git show --format='%P' -s $commit | grep -qF ' '; then
|
||||
err "Pull request should not include merge commits"
|
||||
RET=1
|
||||
fi
|
||||
|
||||
author="$(git show -s --format=%aN $commit)"
|
||||
if echo $author | grep -q '\S\+\s\+\S\+'; then
|
||||
success "Author name ($author) seems ok"
|
||||
else
|
||||
err "Author name ($author) need to be your real name 'firstname lastname'"
|
||||
RET=1
|
||||
fi
|
||||
|
||||
subject="$(git show -s --format=%s $commit)"
|
||||
if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
|
||||
success "Commit subject line seems ok ($subject)"
|
||||
else
|
||||
err "Commit subject line MUST start with '<area>: ' ($subject)"
|
||||
RET=1
|
||||
fi
|
||||
|
||||
body="$(git show -s --format=%b $commit)"
|
||||
sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
|
||||
if echo "$body" | grep -qF "$sob"; then
|
||||
success "Signed-off-by match author"
|
||||
else
|
||||
err "Signed-off-by is missing or doesn't match author (should be '$sob')"
|
||||
RET=1
|
||||
fi
|
||||
|
||||
if echo "$body" | grep -v "Signed-off-by:"; then
|
||||
success "A commit message exists"
|
||||
else
|
||||
err "Missing commit message. Please describe your changes"
|
||||
RET=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $RET
|
||||
@ -1042,6 +1042,16 @@ if KERNEL_IPV6
|
||||
|
||||
endif
|
||||
|
||||
#
|
||||
# Miscellaneous network configuration
|
||||
#
|
||||
|
||||
config KERNEL_NET_L3_MASTER_DEV
|
||||
bool "L3 Master device support"
|
||||
help
|
||||
This module provides glue between core networking code and device
|
||||
drivers to support L3 master devices like VRF.
|
||||
|
||||
#
|
||||
# NFS related symbols
|
||||
#
|
||||
|
||||
@ -295,6 +295,11 @@ define Build/install-dtb
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/iptime-naspkg
|
||||
$(STAGING_DIR_HOST)/bin/iptime-naspkg $(1) $@ $@.new
|
||||
mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/jffs2
|
||||
rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
|
||||
mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .92
|
||||
LINUX_KERNEL_HASH-5.10.92 = d5750380a51d3f1d7ab1dd64451752e321c987e0b0099bcd452187d9a76ebb52
|
||||
LINUX_VERSION-5.10 = .96
|
||||
LINUX_KERNEL_HASH-5.10.96 = 35e5a042819dd37af891c47d151b209d93e078a22f2637b2f5171bdff5b2e048
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.4 = .172
|
||||
LINUX_KERNEL_HASH-5.4.172 = b19e890b67e8293008262d3518cab47be58462c63da43f2c9832d63644886ce4
|
||||
LINUX_VERSION-5.4 = .175
|
||||
LINUX_KERNEL_HASH-5.4.175 = ac901bdffb1488d6c730ca7ab42322163dd331b240e2f06ad83d199e251a4840
|
||||
|
||||
@ -98,7 +98,7 @@ define Host/Configure/Meson
|
||||
--native-file $(HOST_BUILD_DIR)/openwrt-native.txt \
|
||||
$(MESON_HOST_ARGS) \
|
||||
$(MESON_HOST_BUILD_DIR) \
|
||||
$(HOST_BUILD_DIR), \
|
||||
$(MESON_HOST_BUILD_DIR)/.., \
|
||||
$(MESON_HOST_VARS))
|
||||
endef
|
||||
|
||||
|
||||
@ -336,6 +336,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT_INET, $(P_XT)nft
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_META, $(P_EBT)nft_meta_bridge),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_REJECT, $(P_EBT)nft_reject_bridge),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NF_CONNTRACK_BRIDGE, $(P_EBT)nf_conntrack_bridge),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_chain_nat),))
|
||||
@ -353,6 +354,8 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_IPV6, $(P_V6)nft_fib
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_QUEUE,CONFIG_NFT_QUEUE, $(P_XT)nft_queue),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_COMPAT,CONFIG_NFT_COMPAT, $(P_XT)nft_compat),))
|
||||
|
||||
# userland only
|
||||
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
|
||||
IPT_BUILTIN += $(IPT_CORE-y) $(IPT_CORE-m)
|
||||
|
||||
@ -264,7 +264,7 @@ $(_endef)
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $$(PDIR_$(1))
|
||||
$(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
|
||||
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/bash $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
|
||||
@[ -f $$(IPKG_$(1)) ]
|
||||
|
||||
$(1)-clean:
|
||||
|
||||
@ -77,7 +77,7 @@ prepare-tmpinfo: FORCE
|
||||
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
|
||||
mkdir -p tmp/info
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
||||
for type in package target; do \
|
||||
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
|
||||
[ "$$t" -nt "$$f" ] || ./scripts/$${type}-metadata.pl $(_ignore) config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
[ -f /etc/banner ] && cat /etc/banner
|
||||
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
|
||||
|
||||
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
||||
grep -Fsq '/ overlay ro,' /proc/mounts && {
|
||||
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
||||
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uboot-envtools
|
||||
PKG_DISTNAME:=u-boot
|
||||
PKG_VERSION:=2021.01
|
||||
PKG_VERSION:=2022.01
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
|
||||
@ -17,7 +17,7 @@ PKG_SOURCE_URL:= \
|
||||
https://ftp.denx.de/pub/u-boot \
|
||||
https://mirror.cyberbits.eu/u-boot \
|
||||
ftp://ftp.denx.de/pub/u-boot
|
||||
PKG_HASH:=b407e1510a74e863b8b5cb42a24625344f0e0c2fc7582d8c866bd899367d0454
|
||||
PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ glinet,gl-ar750s-nor-nand|\
|
||||
librerouter,librerouter-v1|\
|
||||
netgear,ex6400|\
|
||||
netgear,ex7300|\
|
||||
netgear,ex7300-v2|\
|
||||
netgear,wndr4300-v2|\
|
||||
netgear,wndr4500-v3|\
|
||||
netgear,wnr1000-v2|\
|
||||
@ -121,6 +122,9 @@ qihoo,c301)
|
||||
wallys,dr531)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
|
||||
;;
|
||||
zte,mf286)
|
||||
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x20000" "0x10000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@ -70,6 +70,11 @@ zyxel,nr7101)
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
|
||||
;;
|
||||
xiaomi,mi-router-cr6606|\
|
||||
xiaomi,mi-router-cr6608|\
|
||||
xiaomi,mi-router-cr6609)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_VERSION:=2021.10
|
||||
PKG_VERSION:=2022.01
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_HASH:=cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4
|
||||
PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -36,6 +36,14 @@ define U-Boot/helios4
|
||||
UBOOT_IMAGE:=u-boot-spl.kwb
|
||||
endef
|
||||
|
||||
define U-Boot/omnia
|
||||
NAME:=Turris Omnia
|
||||
BUILD_DEVICES:=cznic_turris-omnia
|
||||
BUILD_SUBTARGET:=cortexa9
|
||||
UBOOT_CONFIG:=turris_omnia
|
||||
UBOOT_IMAGE:=u-boot-spl.kwb
|
||||
endef
|
||||
|
||||
define U-Boot/espressobin
|
||||
NAME:=Marvell ESPRESSObin
|
||||
BUILD_SUBTARGET:=cortexa53
|
||||
@ -50,6 +58,7 @@ endef
|
||||
UBOOT_TARGETS:= \
|
||||
clearfog \
|
||||
helios4 \
|
||||
omnia \
|
||||
espressobin \
|
||||
uDPU
|
||||
|
||||
|
||||
@ -0,0 +1,116 @@
|
||||
From 3fc92a215b69ad448c151489228eb340df9a8703 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <marek.behun@nic.cz>
|
||||
Date: Wed, 12 Jan 2022 17:06:59 +0100
|
||||
Subject: [PATCH] ddr: marvell: a38x: fix SPLIT_OUT_MIX state decision
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is a cleaned up and fixed version of a patch
|
||||
mv_ddr: a380: fix SPLIT_OUT_MIX state decision
|
||||
|
||||
in each pattern cycle the bus state can be changed
|
||||
in order to avoide it, need to back to the same bus state on each
|
||||
pattern cycle
|
||||
by
|
||||
Moti Boskula <motib@marvell.com>
|
||||
|
||||
The original patch is not in Marvell's mv-ddr-marvell repository. It was
|
||||
gives to us by Marvell to fix an issues with DDR training on some
|
||||
boards, but it cannot be applied as is to mv-ddr-marvell, because it is
|
||||
a very dirty draft patch that would certainly break other things, mainly
|
||||
DDR4 training code in mv-ddr-marvell, since it changes common functions.
|
||||
|
||||
I have cleaned up the patch and removed stuff that seemed unnecessary
|
||||
(when removed, it still fixed things). Note that I don't understand
|
||||
completely what the code does exactly, since I haven't studied the DDR
|
||||
training code extensively (and I suspect that no one besides some few
|
||||
people in Marvell understand the code completely).
|
||||
|
||||
Anyway after the cleanup the patch still fixes isssues with DDR training
|
||||
on the failing boards.
|
||||
|
||||
There was also a problem with the original patch on some of the Allied
|
||||
Telesis' x530 boards, reported by Chris Packham. I have asked Chris to
|
||||
send me some logs, and managed to fix it:
|
||||
- if you look at the change, you'll notice that it introduces
|
||||
subtraction of cur_start_win[] and cur_end_win[] members, depending on
|
||||
a bit set in the current_byte_status variable
|
||||
- the original patch subtracted cur_start_win[] if either
|
||||
BYTE_SPLIT_OUT_MIX or BYTE_HOMOGENEOUS_SPLIT_OUT bits were set, but
|
||||
subtracted cur_end_win[] only if the first one (BYTE_SPLIT_OUT_MIX)
|
||||
was set
|
||||
- from Chris Packham logs I discovered that the x530 board where the
|
||||
original patch introduced DDR training failure, only the
|
||||
BYTE_HOMOGENEOUS_SPLIT_OUT bit was set, and on our boards where the
|
||||
patch is needed only the BYTE_SPLIT_OUT_MIX is set in the
|
||||
current_byte_status variable
|
||||
- this led me to the hypothesis that both cur_start_win[] and
|
||||
cur_end_win[] should be subtracted only if BYTE_SPLIT_OUT_MIX bit is
|
||||
set, the BYTE_HOMOGENEOUS_SPLIT_OUT bit shouldn't be considered at all
|
||||
- this hypothesis also gains credibility when considering the commit
|
||||
title ("fix SPLIT_OUT_MIX state decision")
|
||||
|
||||
Hopefully this will fix things without breaking anything else.
|
||||
|
||||
Signed-off-by: Marek Behún <marek.behun@nic.cz>
|
||||
Reviewed-by: Stefan Roese <sr@denx.de>
|
||||
Tested-by: Chris Packham <judge.packham@gmail.com>
|
||||
---
|
||||
.../a38x/ddr3_training_centralization.c | 26 +++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
--- a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
|
||||
+++ b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
|
||||
@@ -55,6 +55,7 @@ static int ddr3_tip_centralization(u32 d
|
||||
enum hws_training_ip_stat training_result[MAX_INTERFACE_NUM];
|
||||
u32 if_id, pattern_id, bit_id;
|
||||
u8 bus_id;
|
||||
+ u8 current_byte_status;
|
||||
u8 cur_start_win[BUS_WIDTH_IN_BITS];
|
||||
u8 centralization_result[MAX_INTERFACE_NUM][BUS_WIDTH_IN_BITS];
|
||||
u8 cur_end_win[BUS_WIDTH_IN_BITS];
|
||||
@@ -166,6 +167,10 @@ static int ddr3_tip_centralization(u32 d
|
||||
result[search_dir_id][7]));
|
||||
}
|
||||
|
||||
+ current_byte_status =
|
||||
+ mv_ddr_tip_sub_phy_byte_status_get(if_id,
|
||||
+ bus_id);
|
||||
+
|
||||
for (bit_id = 0; bit_id < BUS_WIDTH_IN_BITS;
|
||||
bit_id++) {
|
||||
/* check if this code is valid for 2 edge, probably not :( */
|
||||
@@ -174,11 +179,32 @@ static int ddr3_tip_centralization(u32 d
|
||||
[HWS_LOW2HIGH]
|
||||
[bit_id],
|
||||
EDGE_1);
|
||||
+ if (current_byte_status &
|
||||
+ BYTE_SPLIT_OUT_MIX) {
|
||||
+ if (cur_start_win[bit_id] >= 64)
|
||||
+ cur_start_win[bit_id] -= 64;
|
||||
+ else
|
||||
+ cur_start_win[bit_id] = 0;
|
||||
+ DEBUG_CENTRALIZATION_ENGINE
|
||||
+ (DEBUG_LEVEL_INFO,
|
||||
+ ("pattern %d IF %d pup %d bit %d subtract 64 adll from start\n",
|
||||
+ pattern_id, if_id, bus_id, bit_id));
|
||||
+ }
|
||||
cur_end_win[bit_id] =
|
||||
GET_TAP_RESULT(result
|
||||
[HWS_HIGH2LOW]
|
||||
[bit_id],
|
||||
EDGE_1);
|
||||
+ if (cur_end_win[bit_id] >= 64 &&
|
||||
+ (current_byte_status &
|
||||
+ BYTE_SPLIT_OUT_MIX)) {
|
||||
+ cur_end_win[bit_id] -= 64;
|
||||
+ DEBUG_CENTRALIZATION_ENGINE
|
||||
+ (DEBUG_LEVEL_INFO,
|
||||
+ ("pattern %d IF %d pup %d bit %d subtract 64 adll from end\n",
|
||||
+ pattern_id, if_id, bus_id, bit_id));
|
||||
+ }
|
||||
+
|
||||
/* window length */
|
||||
current_window[bit_id] =
|
||||
cur_end_win[bit_id] -
|
||||
@ -0,0 +1,98 @@
|
||||
From eadc4f512fb43bba2fa4e842c982da919da664be Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <marek.behun@nic.cz>
|
||||
Date: Tue, 4 Jan 2022 15:57:49 +0100
|
||||
Subject: [PATCH] ddr: marvell: a38x: Fix Synchronous vs Asynchronous mode
|
||||
determination
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Before commit 4c289425752f ("mv_ddr: a38x: add support for ddr async
|
||||
mode"), Asynchornous Mode was only used when the CPU Subsystem Clock
|
||||
Options[4:0] field in the SAR1 register was set to value 0x13: CPU at
|
||||
2 GHz and DDR at 933 MHz.
|
||||
|
||||
Then commit 4c289425752f ("mv_ddr: a38x: add support for ddr async
|
||||
mode") added support for Asynchornous Modes with frequencies other than
|
||||
933 MHz (but at least 467 MHz), but the code it added to check for
|
||||
whether Asynchornous Mode should be used is wrong: it checks whether the
|
||||
frequency setting in board DDR topology map is set to value other than
|
||||
MV_DDR_FREQ_SAR.
|
||||
|
||||
Thus boards which define a specific value, greater than 400 MHz, for DDR
|
||||
frequency in their board topology (e.g. Turris Omnia defines
|
||||
MV_DDR_FREQ_800), are incorrectly put into Asynchornous Mode after that
|
||||
commit.
|
||||
|
||||
The A38x Functional Specification, section 10.12 DRAM Clocking, says:
|
||||
In Synchornous mode, the DRAM and CPU clocks are edge aligned and run
|
||||
in 1:2 or 1:3 CPU to DRAM frequency ratios.
|
||||
|
||||
Change the check for whether Asynchornous Mode should be used according
|
||||
to this explanation in Functional Specification.
|
||||
|
||||
Signed-off-by: Marek Behún <marek.behun@nic.cz>
|
||||
Tested-by: Chris Packham <judge.packham@gmail.com>
|
||||
Reviewed-by: Stefan Roese <sr@denx.de>
|
||||
---
|
||||
drivers/ddr/marvell/a38x/mv_ddr_plat.c | 19 ++++++++-----------
|
||||
1 file changed, 8 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/ddr/marvell/a38x/mv_ddr_plat.c
|
||||
+++ b/drivers/ddr/marvell/a38x/mv_ddr_plat.c
|
||||
@@ -167,8 +167,6 @@ static u16 a38x_vco_freq_per_sar_ref_clk
|
||||
};
|
||||
|
||||
|
||||
-static u32 async_mode_at_tf;
|
||||
-
|
||||
static u32 dq_bit_map_2_phy_pin[] = {
|
||||
1, 0, 2, 6, 9, 8, 3, 7, /* 0 */
|
||||
8, 9, 1, 7, 2, 6, 3, 0, /* 1 */
|
||||
@@ -734,7 +732,8 @@ static int ddr3_tip_a38x_set_divider(u8
|
||||
u32 divider = 0;
|
||||
u32 sar_val, ref_clk_satr;
|
||||
u32 async_val;
|
||||
- u32 freq = mv_ddr_freq_get(frequency);
|
||||
+ u32 cpu_freq;
|
||||
+ u32 ddr_freq = mv_ddr_freq_get(frequency);
|
||||
|
||||
if (if_id != 0) {
|
||||
DEBUG_TRAINING_ACCESS(DEBUG_LEVEL_ERROR,
|
||||
@@ -751,11 +750,14 @@ static int ddr3_tip_a38x_set_divider(u8
|
||||
ref_clk_satr = reg_read(DEVICE_SAMPLE_AT_RESET2_REG);
|
||||
if (((ref_clk_satr >> DEVICE_SAMPLE_AT_RESET2_REG_REFCLK_OFFSET) & 0x1) ==
|
||||
DEVICE_SAMPLE_AT_RESET2_REG_REFCLK_25MHZ)
|
||||
- divider = a38x_vco_freq_per_sar_ref_clk_25_mhz[sar_val] / freq;
|
||||
+ cpu_freq = a38x_vco_freq_per_sar_ref_clk_25_mhz[sar_val];
|
||||
else
|
||||
- divider = a38x_vco_freq_per_sar_ref_clk_40_mhz[sar_val] / freq;
|
||||
+ cpu_freq = a38x_vco_freq_per_sar_ref_clk_40_mhz[sar_val];
|
||||
+
|
||||
+ divider = cpu_freq / ddr_freq;
|
||||
|
||||
- if ((async_mode_at_tf == 1) && (freq > 400)) {
|
||||
+ if (((cpu_freq % ddr_freq != 0) || (divider != 2 && divider != 3)) &&
|
||||
+ (ddr_freq > 400)) {
|
||||
/* Set async mode */
|
||||
dunit_write(0x20220, 0x1000, 0x1000);
|
||||
dunit_write(0xe42f4, 0x200, 0x200);
|
||||
@@ -869,8 +871,6 @@ int ddr3_tip_ext_write(u32 dev_num, u32
|
||||
|
||||
int mv_ddr_early_init(void)
|
||||
{
|
||||
- struct mv_ddr_topology_map *tm = mv_ddr_topology_map_get();
|
||||
-
|
||||
/* FIXME: change this configuration per ddr type
|
||||
* configure a380 and a390 to work with receiver odt timing
|
||||
* the odt_config is defined:
|
||||
@@ -882,9 +882,6 @@ int mv_ddr_early_init(void)
|
||||
|
||||
mv_ddr_sw_db_init(0, 0);
|
||||
|
||||
- if (tm->interface_params[0].memory_freq != MV_DDR_FREQ_SAR)
|
||||
- async_mode_at_tf = 1;
|
||||
-
|
||||
return MV_OK;
|
||||
}
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gdb
|
||||
PKG_VERSION:=11.1
|
||||
PKG_VERSION:=11.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
PKG_HASH:=cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94
|
||||
PKG_HASH:=1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -27,7 +27,8 @@ include $(INCLUDE_DIR)/nls.mk
|
||||
define Package/perf
|
||||
SECTION:=devel
|
||||
CATEGORY:=Development
|
||||
DEPENDS:= +libcap +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS
|
||||
DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @KERNEL_PERF_EVENTS \
|
||||
+PACKAGE_libbfd:libbfd +PACKAGE_libopcodes:libopcodes
|
||||
TITLE:=Linux performance monitoring tool
|
||||
VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
|
||||
URL:=http://www.kernel.org
|
||||
|
||||
@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=strace
|
||||
PKG_VERSION:=5.14
|
||||
PKG_VERSION:=5.16
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
|
||||
PKG_HASH:=901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73
|
||||
PKG_HASH:=dc7db230ff3e57c249830ba94acab2b862da1fcaac55417e9b85041a833ca285
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=LGPL-2.1-or-later
|
||||
|
||||
@ -45,6 +45,7 @@ ALLWIFIBOARDS:= \
|
||||
linksys_ea8300 \
|
||||
linksys_mr8300-v0 \
|
||||
luma_wrtq-329acn \
|
||||
mikrotik_cap-ac \
|
||||
mikrotik_hap-ac2 \
|
||||
mikrotik_hap-ac3 \
|
||||
mikrotik_sxtsq-5-ac \
|
||||
@ -54,7 +55,8 @@ ALLWIFIBOARDS:= \
|
||||
plasmacloud_pa1200 \
|
||||
plasmacloud_pa2200 \
|
||||
qxwlan_e2600ac \
|
||||
teltonika_rutx
|
||||
teltonika_rutx \
|
||||
zte_mf286d
|
||||
|
||||
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
|
||||
|
||||
@ -135,6 +137,7 @@ $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
|
||||
$(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
|
||||
$(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300))
|
||||
$(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN))
|
||||
$(eval $(call generate-ipq-wifi-package,mikrotik_cap-ac,Mikrotik cAP ac))
|
||||
$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2))
|
||||
$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac3,Mikrotik hAP ac3))
|
||||
$(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac))
|
||||
@ -145,5 +148,6 @@ $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200))
|
||||
$(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200))
|
||||
$(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
|
||||
$(eval $(call generate-ipq-wifi-package,teltonika_rutx,Teltonika RUTX))
|
||||
$(eval $(call generate-ipq-wifi-package,zte_mf286d,ZTE MF286D))
|
||||
|
||||
$(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))
|
||||
|
||||
BIN
package/firmware/ipq-wifi/board-mikrotik_cap-ac.qca4019
Normal file
BIN
package/firmware/ipq-wifi/board-mikrotik_cap-ac.qca4019
Normal file
Binary file not shown.
BIN
package/firmware/ipq-wifi/board-zte_mf286d.qca4019
Normal file
BIN
package/firmware/ipq-wifi/board-zte_mf286d.qca4019
Normal file
Binary file not shown.
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=linux-firmware
|
||||
PKG_VERSION:=20211216
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
|
||||
@ -7,13 +7,6 @@ define Package/ibt-firmware/install
|
||||
endef
|
||||
$(eval $(call BuildPackage,ibt-firmware))
|
||||
|
||||
Package/iwlwifi-firmware-ax200 = $(call Package/firmware-default,Intel AX200 firmware)
|
||||
define Package/iwlwifi-firmware-ax200/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-cc-a0-62.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax200))
|
||||
|
||||
Package/iwl3945-firmware = $(call Package/firmware-default,Intel IWL3945 firmware)
|
||||
define Package/iwl3945-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
@ -175,6 +168,21 @@ define Package/iwlwifi-firmware-iwl9260/install
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl9260))
|
||||
|
||||
Package/iwlwifi-firmware-ax200 = $(call Package/firmware-default,Intel AX200 firmware)
|
||||
define Package/iwlwifi-firmware-ax200/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-cc-a0-62.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax200))
|
||||
|
||||
Package/iwlwifi-firmware-ax210 = $(call Package/firmware-default,Intel AX210 firmware)
|
||||
define Package/iwlwifi-firmware-ax210/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-ty-a0-gf-a0-66.ucode $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-ty-a0-gf-a0.pnvm $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax210))
|
||||
|
||||
Package/e100-firmware = $(call Package/firmware-default,Intel e100)
|
||||
define Package/e100-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/e100
|
||||
|
||||
@ -1,30 +1,14 @@
|
||||
QCA99X0_BOARD_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe
|
||||
QCA99X0_BOARD_REV:=e404444dfc0baf7d0fcde21ab8ec333608c9960c
|
||||
QCA99X0_BOARD_FILE:=board-2.bin.$(QCA99X0_BOARD_REV)
|
||||
|
||||
define Download/qca99x0-board
|
||||
URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0
|
||||
URL_FILE:=board-2.bin?id=$(QCA99X0_BOARD_REV)
|
||||
URL:=https://github.com/kvalo/ath10k-firmware/raw/master/QCA99X0/hw2.0/
|
||||
URL_FILE:=board-2.bin
|
||||
FILE:=$(QCA99X0_BOARD_FILE)
|
||||
HASH:=03711ac21e60ef59d3815e235eb721c0c22851b5410299411085aa6f2af45401
|
||||
HASH:=f91975dca2435fa6f8570146e6b255c2a70b9ffbdf5ef16a29d67bec7374c11a
|
||||
endef
|
||||
$(eval $(call Download,qca99x0-board))
|
||||
|
||||
define Download/qca99x0-board-5g
|
||||
URL:=https://github.com/kvalo/ath10k-firmware/raw/master/QCA99X0/hw2.0/
|
||||
URL_FILE:=boardData_AR900B_CUS239_5G_v2_001.bin
|
||||
FILE:=boardData_AR900B_CUS239_5G_v2_001.bin
|
||||
HASH:=3bf7561ee373b369025dcd366d276d038a97d3397ccae41ce841d98a58b30aff
|
||||
endef
|
||||
$(eval $(call Download,qca99x0-board-5g))
|
||||
|
||||
define Download/qca99x0-board-2g
|
||||
URL:=https://github.com/kvalo/ath10k-firmware/raw/master/QCA99X0/hw2.0/
|
||||
URL_FILE:=boardData_AR900B_CUS260_2G_v2_002.bin
|
||||
FILE:=boardData_AR900B_CUS260_2G_v2_002.bin
|
||||
HASH:=fd91ddf93a271633c28fb1831a1dc5e829c345fbf2aa8980e816585cf9b9e9ed
|
||||
endef
|
||||
$(eval $(call Download,qca99x0-board-2g))
|
||||
|
||||
Package/ath10k-board-qca4019 = $(call Package/firmware-default,ath10k qca4019 board firmware)
|
||||
define Package/ath10k-board-qca4019/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
|
||||
@ -135,30 +119,9 @@ define Package/ath10k-board-qca99x0/install
|
||||
$(INSTALL_DATA) \
|
||||
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
|
||||
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA99X0/hw2.0/board.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca99x0))
|
||||
|
||||
Package/ath10k-board-qca99x0-2g = $(call Package/firmware-default,ath10k qca99x0 board 2g precal firmware)
|
||||
define Package/ath10k-board-qca99x0-2g/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(DL_DIR)/boardData_AR900B_CUS260_2G_v2_002.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2g-precal.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca99x0-2g))
|
||||
|
||||
Package/ath10k-board-qca99x0-5g = $(call Package/firmware-default,ath10k qca99x0 board 5g precal firmware)
|
||||
define Package/ath10k-board-qca99x0-5g/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(DL_DIR)/boardData_AR900B_CUS239_5G_v2_001.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-5g-precal.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca99x0-5g))
|
||||
|
||||
Package/ath10k-firmware-qca99x0 = $(call Package/firmware-default,ath10k qca99x0 firmware,+ath10k-board-qca99x0)
|
||||
define Package/ath10k-firmware-qca99x0/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
|
||||
|
||||
@ -14,12 +14,16 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=linux
|
||||
PKG_PATCHVER:=5.10
|
||||
# Manually include kernel version and hash from kernel details file
|
||||
include $(INCLUDE_DIR)/kernel-$(PKG_PATCHVER)
|
||||
|
||||
PKG_VERSION:=$(PKG_PATCHVER)$(strip $(LINUX_VERSION-$(PKG_PATCHVER)))
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=$(LINUX_SITE)
|
||||
PKG_HASH:=$(LINUX_KERNEL_HASH-$(strip $(PKG_VERSION)))
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/bpf-headers/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
GENERIC_PLATFORM_DIR := $(CURDIR)/../../../target/linux/generic
|
||||
GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
||||
GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
||||
GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
||||
|
||||
@ -541,7 +541,7 @@ define KernelPackage/nf-nathelper-extra
|
||||
KCONFIG:=$(KCONFIG_NF_NATHELPER_EXTRA)
|
||||
FILES:=$(foreach mod,$(NF_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
|
||||
AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NATHELPER_EXTRA-m)))
|
||||
DEPENDS:=+kmod-nf-nat +kmod-lib-textsearch +kmod-ipt-raw +kmod-asn1-decoder
|
||||
DEPENDS:=+kmod-nf-nat +kmod-lib-textsearch +kmod-asn1-decoder
|
||||
endef
|
||||
|
||||
define KernelPackage/nf-nathelper-extra/description
|
||||
@ -1003,7 +1003,7 @@ define KernelPackage/nf-conntrack-netlink
|
||||
FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko
|
||||
KCONFIG:=CONFIG_NF_CT_NETLINK CONFIG_NF_CONNTRACK_EVENTS=y CONFIG_NETFILTER_NETLINK_GLUE_CT=y
|
||||
AUTOLOAD:=$(call AutoProbe,nf_conntrack_netlink)
|
||||
$(call AddDepends/nfnetlink,+kmod-ipt-conntrack)
|
||||
$(call AddDepends/nfnetlink,+kmod-nf-conntrack)
|
||||
endef
|
||||
|
||||
define KernelPackage/nf-conntrack-netlink/description
|
||||
@ -1178,3 +1178,14 @@ define KernelPackage/nft-queue
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,nft-queue))
|
||||
|
||||
define KernelPackage/nft-compat
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter nf_tables compat support
|
||||
DEPENDS:=+kmod-nft-core +kmod-nf-ipt
|
||||
FILES:=$(foreach mod,$(NFT_COMPAT-m),$(LINUX_DIR)/net/$(mod).ko)
|
||||
AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_COMPAT-m)))
|
||||
KCONFIG:=$(KCONFIG_NFT_COMPAT)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,nft-compat))
|
||||
|
||||
@ -564,6 +564,23 @@ endef
|
||||
$(eval $(call KernelPackage,veth))
|
||||
|
||||
|
||||
define KernelPackage/vrf
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Virtual Routing and Forwarding (Lite)
|
||||
DEPENDS:=@KERNEL_NET_L3_MASTER_DEV
|
||||
KCONFIG:=CONFIG_NET_VRF
|
||||
FILES:=$(LINUX_DIR)/drivers/net/vrf.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,vrf)
|
||||
endef
|
||||
|
||||
define KernelPackage/vrf/description
|
||||
This option enables the support for mapping interfaces into VRF's. The
|
||||
support enables VRF devices.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,vrf))
|
||||
|
||||
|
||||
define KernelPackage/slhc
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
HIDDEN:=1
|
||||
|
||||
@ -1204,7 +1204,7 @@ $(eval $(call KernelPackage,usb-net-kaweth))
|
||||
|
||||
define KernelPackage/usb-net-lan78xx
|
||||
TITLE:=USB-To-Ethernet Microchip LAN78XX convertors
|
||||
DEPENDS:=+kmod-fixed-phy +kmod-phy-microchip
|
||||
DEPENDS:=+kmod-fixed-phy +kmod-phy-microchip +PACKAGE_kmod-of-mdio:kmod-of-mdio
|
||||
KCONFIG:=CONFIG_USB_LAN78XX
|
||||
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/lan78xx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,lan78xx)
|
||||
@ -1713,7 +1713,7 @@ define KernelPackage/usb3
|
||||
+TARGET_bcm53xx:kmod-usb-bcma \
|
||||
+TARGET_bcm53xx:kmod-phy-bcm-ns-usb3 \
|
||||
+TARGET_ramips_mt7621:kmod-usb-xhci-mtk \
|
||||
+(TARGET_apm821xx_nand&&LINUX_5_10):kmod-usb-xhci-pci-renesas \
|
||||
+TARGET_apm821xx_nand:kmod-usb-xhci-pci-renesas \
|
||||
+TARGET_mvebu_cortexa9:kmod-usb-xhci-pci-renesas
|
||||
KCONFIG:= \
|
||||
CONFIG_USB_PCI=y \
|
||||
|
||||
@ -0,0 +1,172 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Fri, 12 Nov 2021 12:22:23 +0100
|
||||
Subject: [PATCH] mac80211: add support for .ndo_fill_forward_path
|
||||
|
||||
This allows drivers to provide a destination device + info for flow offload
|
||||
Only supported in combination with 802.3 encap offload
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
Tested-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20211112112223.1209-1-nbd@nbd.name
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -3937,6 +3937,8 @@ struct ieee80211_prep_tx_info {
|
||||
* twt structure.
|
||||
* @twt_teardown_request: Update the hw with TWT teardown request received
|
||||
* from the peer.
|
||||
+ * @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
|
||||
+ * resolve a path for hardware flow offloading
|
||||
*/
|
||||
struct ieee80211_ops {
|
||||
void (*tx)(struct ieee80211_hw *hw,
|
||||
@@ -4265,6 +4267,11 @@ struct ieee80211_ops {
|
||||
struct ieee80211_twt_setup *twt);
|
||||
void (*twt_teardown_request)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_sta *sta, u8 flowid);
|
||||
+ int (*net_fill_forward_path)(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_sta *sta,
|
||||
+ struct net_device_path_ctx *ctx,
|
||||
+ struct net_device_path *path);
|
||||
};
|
||||
|
||||
/**
|
||||
--- a/net/mac80211/driver-ops.h
|
||||
+++ b/net/mac80211/driver-ops.h
|
||||
@@ -1483,4 +1483,26 @@ static inline void drv_twt_teardown_requ
|
||||
trace_drv_return_void(local);
|
||||
}
|
||||
|
||||
+static inline int drv_net_fill_forward_path(struct ieee80211_local *local,
|
||||
+ struct ieee80211_sub_if_data *sdata,
|
||||
+ struct ieee80211_sta *sta,
|
||||
+ struct net_device_path_ctx *ctx,
|
||||
+ struct net_device_path *path)
|
||||
+{
|
||||
+ int ret = -EOPNOTSUPP;
|
||||
+
|
||||
+ sdata = get_bss_sdata(sdata);
|
||||
+ if (!check_sdata_in_driver(sdata))
|
||||
+ return -EIO;
|
||||
+
|
||||
+ trace_drv_net_fill_forward_path(local, sdata, sta);
|
||||
+ if (local->ops->net_fill_forward_path)
|
||||
+ ret = local->ops->net_fill_forward_path(&local->hw,
|
||||
+ &sdata->vif, sta,
|
||||
+ ctx, path);
|
||||
+ trace_drv_return_int(local, ret);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
#endif /* __MAC80211_DRIVER_OPS */
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1465,7 +1465,7 @@ struct ieee80211_local {
|
||||
};
|
||||
|
||||
static inline struct ieee80211_sub_if_data *
|
||||
-IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
|
||||
+IEEE80211_DEV_TO_SUB_IF(const struct net_device *dev)
|
||||
{
|
||||
return netdev_priv(dev);
|
||||
}
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -822,6 +822,66 @@ static const struct net_device_ops ieee8
|
||||
|
||||
};
|
||||
|
||||
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
||||
+static int ieee80211_netdev_fill_forward_path(struct net_device_path_ctx *ctx,
|
||||
+ struct net_device_path *path)
|
||||
+{
|
||||
+ struct ieee80211_sub_if_data *sdata;
|
||||
+ struct ieee80211_local *local;
|
||||
+ struct sta_info *sta;
|
||||
+ int ret = -ENOENT;
|
||||
+
|
||||
+ sdata = IEEE80211_DEV_TO_SUB_IF(ctx->dev);
|
||||
+ local = sdata->local;
|
||||
+
|
||||
+ if (!local->ops->net_fill_forward_path)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ rcu_read_lock();
|
||||
+ switch (sdata->vif.type) {
|
||||
+ case NL80211_IFTYPE_AP_VLAN:
|
||||
+ sta = rcu_dereference(sdata->u.vlan.sta);
|
||||
+ if (sta)
|
||||
+ break;
|
||||
+ if (sdata->wdev.use_4addr)
|
||||
+ goto out;
|
||||
+ if (is_multicast_ether_addr(ctx->daddr))
|
||||
+ goto out;
|
||||
+ sta = sta_info_get_bss(sdata, ctx->daddr);
|
||||
+ break;
|
||||
+ case NL80211_IFTYPE_AP:
|
||||
+ if (is_multicast_ether_addr(ctx->daddr))
|
||||
+ goto out;
|
||||
+ sta = sta_info_get(sdata, ctx->daddr);
|
||||
+ break;
|
||||
+ case NL80211_IFTYPE_STATION:
|
||||
+ if (sdata->wdev.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) {
|
||||
+ sta = sta_info_get(sdata, ctx->daddr);
|
||||
+ if (sta && test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
|
||||
+ if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH))
|
||||
+ goto out;
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ sta = sta_info_get(sdata, sdata->u.mgd.bssid);
|
||||
+ break;
|
||||
+ default:
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (!sta)
|
||||
+ goto out;
|
||||
+
|
||||
+ ret = drv_net_fill_forward_path(local, sdata, &sta->sta, ctx, path);
|
||||
+out:
|
||||
+ rcu_read_unlock();
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static const struct net_device_ops ieee80211_dataif_8023_ops = {
|
||||
#if LINUX_VERSION_IS_LESS(4,10,0)
|
||||
.ndo_change_mtu = __change_mtu,
|
||||
@@ -839,7 +899,9 @@ static const struct net_device_ops ieee8
|
||||
#else
|
||||
.ndo_get_stats64 = bp_ieee80211_get_stats64,
|
||||
#endif
|
||||
-
|
||||
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
||||
+ .ndo_fill_forward_path = ieee80211_netdev_fill_forward_path,
|
||||
+#endif
|
||||
};
|
||||
|
||||
static bool ieee80211_iftype_supports_hdr_offload(enum nl80211_iftype iftype)
|
||||
--- a/net/mac80211/trace.h
|
||||
+++ b/net/mac80211/trace.h
|
||||
@@ -2892,6 +2892,13 @@ TRACE_EVENT(drv_twt_teardown_request,
|
||||
)
|
||||
);
|
||||
|
||||
+DEFINE_EVENT(sta_event, drv_net_fill_forward_path,
|
||||
+ TP_PROTO(struct ieee80211_local *local,
|
||||
+ struct ieee80211_sub_if_data *sdata,
|
||||
+ struct ieee80211_sta *sta),
|
||||
+ TP_ARGS(local, sdata, sta)
|
||||
+);
|
||||
+
|
||||
#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
@ -0,0 +1,262 @@
|
||||
From: Aloka Dixit <alokad@codeaurora.org>
|
||||
Date: Tue, 5 Oct 2021 21:09:36 -0700
|
||||
Subject: [PATCH] mac80211: split beacon retrieval functions
|
||||
|
||||
Split __ieee80211_beacon_get() into a separate function for AP mode
|
||||
ieee80211_beacon_get_ap().
|
||||
Also, move the code common to all modes (AP, adhoc and mesh) to
|
||||
a separate function ieee80211_beacon_get_finish().
|
||||
|
||||
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Link: https://lore.kernel.org/r/20211006040938.9531-2-alokad@codeaurora.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -4987,6 +4987,115 @@ static int ieee80211_beacon_protect(stru
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void
|
||||
+ieee80211_beacon_get_finish(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_mutable_offsets *offs,
|
||||
+ struct beacon_data *beacon,
|
||||
+ struct sk_buff *skb,
|
||||
+ struct ieee80211_chanctx_conf *chanctx_conf,
|
||||
+ u16 csa_off_base)
|
||||
+{
|
||||
+ struct ieee80211_local *local = hw_to_local(hw);
|
||||
+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
|
||||
+ struct ieee80211_tx_info *info;
|
||||
+ enum nl80211_band band;
|
||||
+ struct ieee80211_tx_rate_control txrc;
|
||||
+
|
||||
+ /* CSA offsets */
|
||||
+ if (offs && beacon) {
|
||||
+ u16 i;
|
||||
+
|
||||
+ for (i = 0; i < IEEE80211_MAX_CNTDWN_COUNTERS_NUM; i++) {
|
||||
+ u16 csa_off = beacon->cntdwn_counter_offsets[i];
|
||||
+
|
||||
+ if (!csa_off)
|
||||
+ continue;
|
||||
+
|
||||
+ offs->cntdwn_counter_offs[i] = csa_off_base + csa_off;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ band = chanctx_conf->def.chan->band;
|
||||
+ info = IEEE80211_SKB_CB(skb);
|
||||
+ info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
|
||||
+ info->flags |= IEEE80211_TX_CTL_NO_ACK;
|
||||
+ info->band = band;
|
||||
+
|
||||
+ memset(&txrc, 0, sizeof(txrc));
|
||||
+ txrc.hw = hw;
|
||||
+ txrc.sband = local->hw.wiphy->bands[band];
|
||||
+ txrc.bss_conf = &sdata->vif.bss_conf;
|
||||
+ txrc.skb = skb;
|
||||
+ txrc.reported_rate.idx = -1;
|
||||
+ if (sdata->beacon_rate_set && sdata->beacon_rateidx_mask[band])
|
||||
+ txrc.rate_idx_mask = sdata->beacon_rateidx_mask[band];
|
||||
+ else
|
||||
+ txrc.rate_idx_mask = sdata->rc_rateidx_mask[band];
|
||||
+ txrc.bss = true;
|
||||
+ rate_control_get_rate(sdata, NULL, &txrc);
|
||||
+
|
||||
+ info->control.vif = vif;
|
||||
+ info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT |
|
||||
+ IEEE80211_TX_CTL_ASSIGN_SEQ |
|
||||
+ IEEE80211_TX_CTL_FIRST_FRAGMENT;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *
|
||||
+ieee80211_beacon_get_ap(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_mutable_offsets *offs,
|
||||
+ bool is_template,
|
||||
+ struct beacon_data *beacon,
|
||||
+ struct ieee80211_chanctx_conf *chanctx_conf)
|
||||
+{
|
||||
+ struct ieee80211_local *local = hw_to_local(hw);
|
||||
+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
|
||||
+ struct ieee80211_if_ap *ap = &sdata->u.ap;
|
||||
+ struct sk_buff *skb = NULL;
|
||||
+ u16 csa_off_base = 0;
|
||||
+
|
||||
+ if (beacon->cntdwn_counter_offsets[0]) {
|
||||
+ if (!is_template)
|
||||
+ ieee80211_beacon_update_cntdwn(vif);
|
||||
+
|
||||
+ ieee80211_set_beacon_cntdwn(sdata, beacon);
|
||||
+ }
|
||||
+
|
||||
+ /* headroom, head length,
|
||||
+ * tail length and maximum TIM length
|
||||
+ */
|
||||
+ skb = dev_alloc_skb(local->tx_headroom + beacon->head_len +
|
||||
+ beacon->tail_len + 256 +
|
||||
+ local->hw.extra_beacon_tailroom);
|
||||
+ if (!skb)
|
||||
+ return NULL;
|
||||
+
|
||||
+ skb_reserve(skb, local->tx_headroom);
|
||||
+ skb_put_data(skb, beacon->head, beacon->head_len);
|
||||
+
|
||||
+ ieee80211_beacon_add_tim(sdata, &ap->ps, skb, is_template);
|
||||
+
|
||||
+ if (offs) {
|
||||
+ offs->tim_offset = beacon->head_len;
|
||||
+ offs->tim_length = skb->len - beacon->head_len;
|
||||
+ offs->cntdwn_counter_offs[0] = beacon->cntdwn_counter_offsets[0];
|
||||
+
|
||||
+ /* for AP the csa offsets are from tail */
|
||||
+ csa_off_base = skb->len;
|
||||
+ }
|
||||
+
|
||||
+ if (beacon->tail)
|
||||
+ skb_put_data(skb, beacon->tail, beacon->tail_len);
|
||||
+
|
||||
+ if (ieee80211_beacon_protect(skb, local, sdata) < 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ ieee80211_beacon_get_finish(hw, vif, offs, beacon, skb, chanctx_conf,
|
||||
+ csa_off_base);
|
||||
+ return skb;
|
||||
+}
|
||||
+
|
||||
static struct sk_buff *
|
||||
__ieee80211_beacon_get(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
@@ -4996,12 +5105,8 @@ __ieee80211_beacon_get(struct ieee80211_
|
||||
struct ieee80211_local *local = hw_to_local(hw);
|
||||
struct beacon_data *beacon = NULL;
|
||||
struct sk_buff *skb = NULL;
|
||||
- struct ieee80211_tx_info *info;
|
||||
struct ieee80211_sub_if_data *sdata = NULL;
|
||||
- enum nl80211_band band;
|
||||
- struct ieee80211_tx_rate_control txrc;
|
||||
struct ieee80211_chanctx_conf *chanctx_conf;
|
||||
- int csa_off_base = 0;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
@@ -5018,48 +5123,11 @@ __ieee80211_beacon_get(struct ieee80211_
|
||||
struct ieee80211_if_ap *ap = &sdata->u.ap;
|
||||
|
||||
beacon = rcu_dereference(ap->beacon);
|
||||
- if (beacon) {
|
||||
- if (beacon->cntdwn_counter_offsets[0]) {
|
||||
- if (!is_template)
|
||||
- ieee80211_beacon_update_cntdwn(vif);
|
||||
-
|
||||
- ieee80211_set_beacon_cntdwn(sdata, beacon);
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * headroom, head length,
|
||||
- * tail length and maximum TIM length
|
||||
- */
|
||||
- skb = dev_alloc_skb(local->tx_headroom +
|
||||
- beacon->head_len +
|
||||
- beacon->tail_len + 256 +
|
||||
- local->hw.extra_beacon_tailroom);
|
||||
- if (!skb)
|
||||
- goto out;
|
||||
-
|
||||
- skb_reserve(skb, local->tx_headroom);
|
||||
- skb_put_data(skb, beacon->head, beacon->head_len);
|
||||
-
|
||||
- ieee80211_beacon_add_tim(sdata, &ap->ps, skb,
|
||||
- is_template);
|
||||
-
|
||||
- if (offs) {
|
||||
- offs->tim_offset = beacon->head_len;
|
||||
- offs->tim_length = skb->len - beacon->head_len;
|
||||
- offs->cntdwn_counter_offs[0] = beacon->cntdwn_counter_offsets[0];
|
||||
-
|
||||
- /* for AP the csa offsets are from tail */
|
||||
- csa_off_base = skb->len;
|
||||
- }
|
||||
-
|
||||
- if (beacon->tail)
|
||||
- skb_put_data(skb, beacon->tail,
|
||||
- beacon->tail_len);
|
||||
-
|
||||
- if (ieee80211_beacon_protect(skb, local, sdata) < 0)
|
||||
- goto out;
|
||||
- } else
|
||||
+ if (!beacon)
|
||||
goto out;
|
||||
+
|
||||
+ skb = ieee80211_beacon_get_ap(hw, vif, offs, is_template,
|
||||
+ beacon, chanctx_conf);
|
||||
} else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
|
||||
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
|
||||
struct ieee80211_hdr *hdr;
|
||||
@@ -5085,6 +5153,9 @@ __ieee80211_beacon_get(struct ieee80211_
|
||||
hdr = (struct ieee80211_hdr *) skb->data;
|
||||
hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
|
||||
IEEE80211_STYPE_BEACON);
|
||||
+
|
||||
+ ieee80211_beacon_get_finish(hw, vif, offs, beacon, skb,
|
||||
+ chanctx_conf, 0);
|
||||
} else if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||
|
||||
@@ -5124,51 +5195,13 @@ __ieee80211_beacon_get(struct ieee80211_
|
||||
}
|
||||
|
||||
skb_put_data(skb, beacon->tail, beacon->tail_len);
|
||||
+ ieee80211_beacon_get_finish(hw, vif, offs, beacon, skb,
|
||||
+ chanctx_conf, 0);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /* CSA offsets */
|
||||
- if (offs && beacon) {
|
||||
- int i;
|
||||
-
|
||||
- for (i = 0; i < IEEE80211_MAX_CNTDWN_COUNTERS_NUM; i++) {
|
||||
- u16 csa_off = beacon->cntdwn_counter_offsets[i];
|
||||
-
|
||||
- if (!csa_off)
|
||||
- continue;
|
||||
-
|
||||
- offs->cntdwn_counter_offs[i] = csa_off_base + csa_off;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- band = chanctx_conf->def.chan->band;
|
||||
-
|
||||
- info = IEEE80211_SKB_CB(skb);
|
||||
-
|
||||
- info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
|
||||
- info->flags |= IEEE80211_TX_CTL_NO_ACK;
|
||||
- info->band = band;
|
||||
-
|
||||
- memset(&txrc, 0, sizeof(txrc));
|
||||
- txrc.hw = hw;
|
||||
- txrc.sband = local->hw.wiphy->bands[band];
|
||||
- txrc.bss_conf = &sdata->vif.bss_conf;
|
||||
- txrc.skb = skb;
|
||||
- txrc.reported_rate.idx = -1;
|
||||
- if (sdata->beacon_rate_set && sdata->beacon_rateidx_mask[band])
|
||||
- txrc.rate_idx_mask = sdata->beacon_rateidx_mask[band];
|
||||
- else
|
||||
- txrc.rate_idx_mask = sdata->rc_rateidx_mask[band];
|
||||
- txrc.bss = true;
|
||||
- rate_control_get_rate(sdata, NULL, &txrc);
|
||||
-
|
||||
- info->control.vif = vif;
|
||||
-
|
||||
- info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT |
|
||||
- IEEE80211_TX_CTL_ASSIGN_SEQ |
|
||||
- IEEE80211_TX_CTL_FIRST_FRAGMENT;
|
||||
out:
|
||||
rcu_read_unlock();
|
||||
return skb;
|
||||
@ -0,0 +1,493 @@
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Wed, 15 Sep 2021 19:54:34 -0700
|
||||
Subject: [PATCH] nl80211: MBSSID and EMA support in AP mode
|
||||
|
||||
Add new attributes to configure support for multiple BSSID
|
||||
and advanced multi-BSSID advertisements (EMA) in AP mode.
|
||||
|
||||
- NL80211_ATTR_MBSSID_CONFIG used for per interface configuration.
|
||||
- NL80211_ATTR_MBSSID_ELEMS used to MBSSID elements for beacons.
|
||||
|
||||
Memory for the elements is allocated dynamically. This change frees
|
||||
the memory in existing functions which call nl80211_parse_beacon(),
|
||||
a comment is added to indicate the new references to do the same.
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
|
||||
Link: https://lore.kernel.org/r/20210916025437.29138-2-alokad@codeaurora.org
|
||||
[don't leave ERR_PTR hanging around]
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -1046,6 +1046,36 @@ struct cfg80211_crypto_settings {
|
||||
};
|
||||
|
||||
/**
|
||||
+ * struct cfg80211_mbssid_config - AP settings for multi bssid
|
||||
+ *
|
||||
+ * @tx_wdev: pointer to the transmitted interface in the MBSSID set
|
||||
+ * @index: index of this AP in the multi bssid group.
|
||||
+ * @ema: set to true if the beacons should be sent out in EMA mode.
|
||||
+ */
|
||||
+struct cfg80211_mbssid_config {
|
||||
+ struct wireless_dev *tx_wdev;
|
||||
+ u8 index;
|
||||
+ bool ema;
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * struct cfg80211_mbssid_elems - Multiple BSSID elements
|
||||
+ *
|
||||
+ * @cnt: Number of elements in array %elems.
|
||||
+ *
|
||||
+ * @elem: Array of multiple BSSID element(s) to be added into Beacon frames.
|
||||
+ * @elem.data: Data for multiple BSSID elements.
|
||||
+ * @elem.len: Length of data.
|
||||
+ */
|
||||
+struct cfg80211_mbssid_elems {
|
||||
+ u8 cnt;
|
||||
+ struct {
|
||||
+ const u8 *data;
|
||||
+ size_t len;
|
||||
+ } elem[];
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
* struct cfg80211_beacon_data - beacon data
|
||||
* @head: head portion of beacon (before TIM IE)
|
||||
* or %NULL if not changed
|
||||
@@ -1063,6 +1093,7 @@ struct cfg80211_crypto_settings {
|
||||
* @assocresp_ies_len: length of assocresp_ies in octets
|
||||
* @probe_resp_len: length of probe response template (@probe_resp)
|
||||
* @probe_resp: probe response template (AP mode only)
|
||||
+ * @mbssid_ies: multiple BSSID elements
|
||||
* @ftm_responder: enable FTM responder functionality; -1 for no change
|
||||
* (which also implies no change in LCI/civic location data)
|
||||
* @lci: Measurement Report element content, starting with Measurement Token
|
||||
@@ -1080,6 +1111,7 @@ struct cfg80211_beacon_data {
|
||||
const u8 *probe_resp;
|
||||
const u8 *lci;
|
||||
const u8 *civicloc;
|
||||
+ struct cfg80211_mbssid_elems *mbssid_ies;
|
||||
s8 ftm_responder;
|
||||
|
||||
size_t head_len, tail_len;
|
||||
@@ -1194,6 +1226,7 @@ enum cfg80211_ap_settings_flags {
|
||||
* @he_oper: HE operation IE (or %NULL if HE isn't enabled)
|
||||
* @fils_discovery: FILS discovery transmission parameters
|
||||
* @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
|
||||
+ * @mbssid_config: AP settings for multiple bssid
|
||||
*/
|
||||
struct cfg80211_ap_settings {
|
||||
struct cfg80211_chan_def chandef;
|
||||
@@ -1226,6 +1259,7 @@ struct cfg80211_ap_settings {
|
||||
struct cfg80211_he_bss_color he_bss_color;
|
||||
struct cfg80211_fils_discovery fils_discovery;
|
||||
struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
|
||||
+ struct cfg80211_mbssid_config mbssid_config;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -4986,6 +5020,13 @@ struct wiphy_iftype_akm_suites {
|
||||
* %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes
|
||||
* @sar_capa: SAR control capabilities
|
||||
* @rfkill: a pointer to the rfkill structure
|
||||
+ *
|
||||
+ * @mbssid_max_interfaces: maximum number of interfaces supported by the driver
|
||||
+ * in a multiple BSSID set. This field must be set to a non-zero value
|
||||
+ * by the driver to advertise MBSSID support.
|
||||
+ * @mbssid_max_ema_profile_periodicity: maximum profile periodicity supported by
|
||||
+ * the driver. Setting this field to a non-zero value indicates that the
|
||||
+ * driver supports enhanced multi-BSSID advertisements (EMA AP).
|
||||
*/
|
||||
struct wiphy {
|
||||
struct mutex mtx;
|
||||
@@ -5133,6 +5174,9 @@ struct wiphy {
|
||||
|
||||
struct rfkill *rfkill;
|
||||
|
||||
+ u8 mbssid_max_interfaces;
|
||||
+ u8 ema_max_profile_periodicity;
|
||||
+
|
||||
char priv[] __aligned(NETDEV_ALIGN);
|
||||
};
|
||||
|
||||
--- a/include/uapi/linux/nl80211.h
|
||||
+++ b/include/uapi/linux/nl80211.h
|
||||
@@ -337,7 +337,10 @@
|
||||
* @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
|
||||
* %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
|
||||
* userspace to request deletion of a virtual interface, then requires
|
||||
- * attribute %NL80211_ATTR_IFINDEX.
|
||||
+ * attribute %NL80211_ATTR_IFINDEX. If multiple BSSID advertisements are
|
||||
+ * enabled using %NL80211_ATTR_MBSSID_CONFIG, %NL80211_ATTR_MBSSID_ELEMS,
|
||||
+ * and if this command is used for the transmitting interface, then all
|
||||
+ * the non-transmitting interfaces are deleted as well.
|
||||
*
|
||||
* @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
|
||||
* by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
|
||||
@@ -2593,6 +2596,18 @@ enum nl80211_commands {
|
||||
* @NL80211_ATTR_COLOR_CHANGE_ELEMS: Nested set of attributes containing the IE
|
||||
* information for the time while performing a color switch.
|
||||
*
|
||||
+ * @NL80211_ATTR_MBSSID_CONFIG: Nested attribute for multiple BSSID
|
||||
+ * advertisements (MBSSID) parameters in AP mode.
|
||||
+ * Kernel uses this attribute to indicate the driver's support for MBSSID
|
||||
+ * and enhanced multi-BSSID advertisements (EMA AP) to the userspace.
|
||||
+ * Userspace should use this attribute to configure per interface MBSSID
|
||||
+ * parameters.
|
||||
+ * See &enum nl80211_mbssid_config_attributes for details.
|
||||
+ *
|
||||
+ * @NL80211_ATTR_MBSSID_ELEMS: Nested parameter to pass multiple BSSID elements.
|
||||
+ * Mandatory parameter for the transmitting interface to enable MBSSID.
|
||||
+ * Optional for the non-transmitting interfaces.
|
||||
+ *
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -3096,6 +3111,9 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_COLOR_CHANGE_COLOR,
|
||||
NL80211_ATTR_COLOR_CHANGE_ELEMS,
|
||||
|
||||
+ NL80211_ATTR_MBSSID_CONFIG,
|
||||
+ NL80211_ATTR_MBSSID_ELEMS,
|
||||
+
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
@@ -7349,4 +7367,60 @@ enum nl80211_sar_specs_attrs {
|
||||
NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1,
|
||||
};
|
||||
|
||||
+/**
|
||||
+ * enum nl80211_mbssid_config_attributes - multiple BSSID (MBSSID) and enhanced
|
||||
+ * multi-BSSID advertisements (EMA) in AP mode.
|
||||
+ * Kernel uses some of these attributes to advertise driver's support for
|
||||
+ * MBSSID and EMA.
|
||||
+ * Remaining attributes should be used by the userspace to configure the
|
||||
+ * features.
|
||||
+ *
|
||||
+ * @__NL80211_MBSSID_CONFIG_ATTR_INVALID: Invalid
|
||||
+ *
|
||||
+ * @NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES: Used by the kernel to advertise
|
||||
+ * the maximum number of MBSSID interfaces supported by the driver.
|
||||
+ * Driver should indicate MBSSID support by setting
|
||||
+ * wiphy->mbssid_max_interfaces to a value more than or equal to 2.
|
||||
+ *
|
||||
+ * @NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY: Used by the kernel
|
||||
+ * to advertise the maximum profile periodicity supported by the driver
|
||||
+ * if EMA is enabled. Driver should indicate EMA support to the userspace
|
||||
+ * by setting wiphy->mbssid_max_ema_profile_periodicity to
|
||||
+ * a non-zero value.
|
||||
+ *
|
||||
+ * @NL80211_MBSSID_CONFIG_ATTR_INDEX: Mandatory parameter to pass the index of
|
||||
+ * this BSS (u8) in the multiple BSSID set.
|
||||
+ * Value must be set to 0 for the transmitting interface and non-zero for
|
||||
+ * all non-transmitting interfaces. The userspace will be responsible
|
||||
+ * for using unique indices for the interfaces.
|
||||
+ * Range: 0 to wiphy->mbssid_max_interfaces-1.
|
||||
+ *
|
||||
+ * @NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX: Mandatory parameter for
|
||||
+ * a non-transmitted profile which provides the interface index (u32) of
|
||||
+ * the transmitted profile. The value must match one of the interface
|
||||
+ * indices advertised by the kernel. Optional if the interface being set up
|
||||
+ * is the transmitting one, however, if provided then the value must match
|
||||
+ * the interface index of the same.
|
||||
+ *
|
||||
+ * @NL80211_MBSSID_CONFIG_ATTR_EMA: Flag used to enable EMA AP feature.
|
||||
+ * Setting this flag is permitted only if the driver advertises EMA support
|
||||
+ * by setting wiphy->mbssid_max_ema_profile_periodicity to non-zero.
|
||||
+ *
|
||||
+ * @__NL80211_MBSSID_CONFIG_ATTR_LAST: Internal
|
||||
+ * @NL80211_MBSSID_CONFIG_ATTR_MAX: highest attribute
|
||||
+ */
|
||||
+enum nl80211_mbssid_config_attributes {
|
||||
+ __NL80211_MBSSID_CONFIG_ATTR_INVALID,
|
||||
+
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES,
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY,
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_INDEX,
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX,
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_EMA,
|
||||
+
|
||||
+ /* keep last */
|
||||
+ __NL80211_MBSSID_CONFIG_ATTR_LAST,
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
|
||||
+};
|
||||
+
|
||||
#endif /* __LINUX_NL80211_H */
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -439,6 +439,16 @@ sar_policy[NL80211_SAR_ATTR_MAX + 1] = {
|
||||
[NL80211_SAR_ATTR_SPECS] = NLA_POLICY_NESTED_ARRAY(sar_specs_policy),
|
||||
};
|
||||
|
||||
+static const struct nla_policy
|
||||
+nl80211_mbssid_config_policy[NL80211_MBSSID_CONFIG_ATTR_MAX + 1] = {
|
||||
+ [NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES] = NLA_POLICY_MIN(NLA_U8, 2),
|
||||
+ [NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY] =
|
||||
+ NLA_POLICY_MIN(NLA_U8, 1),
|
||||
+ [NL80211_MBSSID_CONFIG_ATTR_INDEX] = { .type = NLA_U8 },
|
||||
+ [NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX] = { .type = NLA_U32 },
|
||||
+ [NL80211_MBSSID_CONFIG_ATTR_EMA] = { .type = NLA_FLAG },
|
||||
+};
|
||||
+
|
||||
static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
|
||||
[0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD },
|
||||
[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
|
||||
@@ -780,6 +790,9 @@ static const struct nla_policy nl80211_p
|
||||
[NL80211_ATTR_COLOR_CHANGE_COUNT] = { .type = NLA_U8 },
|
||||
[NL80211_ATTR_COLOR_CHANGE_COLOR] = { .type = NLA_U8 },
|
||||
[NL80211_ATTR_COLOR_CHANGE_ELEMS] = NLA_POLICY_NESTED(nl80211_policy),
|
||||
+ [NL80211_ATTR_MBSSID_CONFIG] =
|
||||
+ NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
|
||||
+ [NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -2228,6 +2241,35 @@ fail:
|
||||
return -ENOBUFS;
|
||||
}
|
||||
|
||||
+static int nl80211_put_mbssid_support(struct wiphy *wiphy, struct sk_buff *msg)
|
||||
+{
|
||||
+ struct nlattr *config;
|
||||
+
|
||||
+ if (!wiphy->mbssid_max_interfaces)
|
||||
+ return 0;
|
||||
+
|
||||
+ config = nla_nest_start(msg, NL80211_ATTR_MBSSID_CONFIG);
|
||||
+ if (!config)
|
||||
+ return -ENOBUFS;
|
||||
+
|
||||
+ if (nla_put_u8(msg, NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES,
|
||||
+ wiphy->mbssid_max_interfaces))
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (wiphy->ema_max_profile_periodicity &&
|
||||
+ nla_put_u8(msg,
|
||||
+ NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY,
|
||||
+ wiphy->ema_max_profile_periodicity))
|
||||
+ goto fail;
|
||||
+
|
||||
+ nla_nest_end(msg, config);
|
||||
+ return 0;
|
||||
+
|
||||
+fail:
|
||||
+ nla_nest_cancel(msg, config);
|
||||
+ return -ENOBUFS;
|
||||
+}
|
||||
+
|
||||
struct nl80211_dump_wiphy_state {
|
||||
s64 filter_wiphy;
|
||||
long start;
|
||||
@@ -2813,6 +2855,9 @@ static int nl80211_send_wiphy(struct cfg
|
||||
if (nl80211_put_sar_specs(rdev, msg))
|
||||
goto nla_put_failure;
|
||||
|
||||
+ if (nl80211_put_mbssid_support(&rdev->wiphy, msg))
|
||||
+ goto nla_put_failure;
|
||||
+
|
||||
/* done */
|
||||
state->split_start = 0;
|
||||
break;
|
||||
@@ -5002,6 +5047,96 @@ static int validate_beacon_tx_rate(struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int nl80211_parse_mbssid_config(struct wiphy *wiphy,
|
||||
+ struct net_device *dev,
|
||||
+ struct nlattr *attrs,
|
||||
+ struct cfg80211_mbssid_config *config,
|
||||
+ u8 num_elems)
|
||||
+{
|
||||
+ struct nlattr *tb[NL80211_MBSSID_CONFIG_ATTR_MAX + 1];
|
||||
+
|
||||
+ if (!wiphy->mbssid_max_interfaces)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ if (nla_parse_nested(tb, NL80211_MBSSID_CONFIG_ATTR_MAX, attrs, NULL,
|
||||
+ NULL) ||
|
||||
+ !tb[NL80211_MBSSID_CONFIG_ATTR_INDEX])
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ config->ema = nla_get_flag(tb[NL80211_MBSSID_CONFIG_ATTR_EMA]);
|
||||
+ if (config->ema) {
|
||||
+ if (!wiphy->ema_max_profile_periodicity)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ if (num_elems > wiphy->ema_max_profile_periodicity)
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ config->index = nla_get_u8(tb[NL80211_MBSSID_CONFIG_ATTR_INDEX]);
|
||||
+ if (config->index >= wiphy->mbssid_max_interfaces ||
|
||||
+ (!config->index && !num_elems))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (tb[NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX]) {
|
||||
+ u32 tx_ifindex =
|
||||
+ nla_get_u32(tb[NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX]);
|
||||
+
|
||||
+ if ((!config->index && tx_ifindex != dev->ifindex) ||
|
||||
+ (config->index && tx_ifindex == dev->ifindex))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (tx_ifindex != dev->ifindex) {
|
||||
+ struct net_device *tx_netdev =
|
||||
+ dev_get_by_index(wiphy_net(wiphy), tx_ifindex);
|
||||
+
|
||||
+ if (!tx_netdev || !tx_netdev->ieee80211_ptr ||
|
||||
+ tx_netdev->ieee80211_ptr->wiphy != wiphy ||
|
||||
+ tx_netdev->ieee80211_ptr->iftype !=
|
||||
+ NL80211_IFTYPE_AP) {
|
||||
+ dev_put(tx_netdev);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ config->tx_wdev = tx_netdev->ieee80211_ptr;
|
||||
+ } else {
|
||||
+ config->tx_wdev = dev->ieee80211_ptr;
|
||||
+ }
|
||||
+ } else if (!config->index) {
|
||||
+ config->tx_wdev = dev->ieee80211_ptr;
|
||||
+ } else {
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct cfg80211_mbssid_elems *
|
||||
+nl80211_parse_mbssid_elems(struct wiphy *wiphy, struct nlattr *attrs)
|
||||
+{
|
||||
+ struct nlattr *nl_elems;
|
||||
+ struct cfg80211_mbssid_elems *elems;
|
||||
+ int rem_elems;
|
||||
+ u8 i = 0, num_elems = 0;
|
||||
+
|
||||
+ if (!wiphy->mbssid_max_interfaces)
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
+
|
||||
+ nla_for_each_nested(nl_elems, attrs, rem_elems)
|
||||
+ num_elems++;
|
||||
+
|
||||
+ elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL);
|
||||
+ if (!elems)
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
+
|
||||
+ nla_for_each_nested(nl_elems, attrs, rem_elems) {
|
||||
+ elems->elem[i].data = nla_data(nl_elems);
|
||||
+ elems->elem[i].len = nla_len(nl_elems);
|
||||
+ i++;
|
||||
+ }
|
||||
+ elems->cnt = num_elems;
|
||||
+ return elems;
|
||||
+}
|
||||
+
|
||||
static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev,
|
||||
struct nlattr *attrs[],
|
||||
struct cfg80211_beacon_data *bcn)
|
||||
@@ -5082,6 +5217,17 @@ static int nl80211_parse_beacon(struct c
|
||||
bcn->ftm_responder = -1;
|
||||
}
|
||||
|
||||
+ if (attrs[NL80211_ATTR_MBSSID_ELEMS]) {
|
||||
+ struct cfg80211_mbssid_elems *mbssid =
|
||||
+ nl80211_parse_mbssid_elems(&rdev->wiphy,
|
||||
+ attrs[NL80211_ATTR_MBSSID_ELEMS]);
|
||||
+
|
||||
+ if (IS_ERR(mbssid))
|
||||
+ return PTR_ERR(mbssid);
|
||||
+
|
||||
+ bcn->mbssid_ies = mbssid;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5538,6 +5684,17 @@ static int nl80211_start_ap(struct sk_bu
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (info->attrs[NL80211_ATTR_MBSSID_CONFIG]) {
|
||||
+ err = nl80211_parse_mbssid_config(&rdev->wiphy, dev,
|
||||
+ info->attrs[NL80211_ATTR_MBSSID_CONFIG],
|
||||
+ ¶ms.mbssid_config,
|
||||
+ params.beacon.mbssid_ies ?
|
||||
+ params.beacon.mbssid_ies->cnt :
|
||||
+ 0);
|
||||
+ if (err)
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
nl80211_calculate_ap_params(¶ms);
|
||||
|
||||
if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
|
||||
@@ -5559,6 +5716,11 @@ static int nl80211_start_ap(struct sk_bu
|
||||
|
||||
out:
|
||||
kfree(params.acl);
|
||||
+ kfree(params.beacon.mbssid_ies);
|
||||
+ if (params.mbssid_config.tx_wdev &&
|
||||
+ params.mbssid_config.tx_wdev->netdev &&
|
||||
+ params.mbssid_config.tx_wdev->netdev != dev)
|
||||
+ dev_put(params.mbssid_config.tx_wdev->netdev);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -5583,12 +5745,14 @@ static int nl80211_set_beacon(struct sk_
|
||||
|
||||
err = nl80211_parse_beacon(rdev, info->attrs, ¶ms);
|
||||
if (err)
|
||||
- return err;
|
||||
+ goto out;
|
||||
|
||||
wdev_lock(wdev);
|
||||
err = rdev_change_beacon(rdev, dev, ¶ms);
|
||||
wdev_unlock(wdev);
|
||||
|
||||
+out:
|
||||
+ kfree(params.mbssid_ies);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -9265,12 +9429,14 @@ static int nl80211_channel_switch(struct
|
||||
|
||||
err = nl80211_parse_beacon(rdev, info->attrs, ¶ms.beacon_after);
|
||||
if (err)
|
||||
- return err;
|
||||
+ goto free;
|
||||
|
||||
csa_attrs = kcalloc(NL80211_ATTR_MAX + 1, sizeof(*csa_attrs),
|
||||
GFP_KERNEL);
|
||||
- if (!csa_attrs)
|
||||
- return -ENOMEM;
|
||||
+ if (!csa_attrs) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto free;
|
||||
+ }
|
||||
|
||||
err = nla_parse_nested_deprecated(csa_attrs, NL80211_ATTR_MAX,
|
||||
info->attrs[NL80211_ATTR_CSA_IES],
|
||||
@@ -9389,6 +9555,8 @@ skip_beacons:
|
||||
wdev_unlock(wdev);
|
||||
|
||||
free:
|
||||
+ kfree(params.beacon_after.mbssid_ies);
|
||||
+ kfree(params.beacon_csa.mbssid_ies);
|
||||
kfree(csa_attrs);
|
||||
return err;
|
||||
}
|
||||
@@ -14924,6 +15092,8 @@ static int nl80211_color_change(struct s
|
||||
wdev_unlock(wdev);
|
||||
|
||||
out:
|
||||
+ kfree(params.beacon_next.mbssid_ies);
|
||||
+ kfree(params.beacon_color_change.mbssid_ies);
|
||||
kfree(tb);
|
||||
return err;
|
||||
}
|
||||
@ -0,0 +1,378 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Sat, 23 Oct 2021 11:10:50 +0200
|
||||
Subject: [PATCH] cfg80211: implement APIs for dedicated radar detection HW
|
||||
|
||||
If a dedicated (off-channel) radar detection hardware (chain)
|
||||
is available in the hardware/driver, allow this to be used by
|
||||
calling the NL80211_CMD_RADAR_DETECT command with a new flag
|
||||
attribute requesting off-channel radar detection is used.
|
||||
|
||||
Offchannel CAC (channel availability check) avoids the CAC
|
||||
downtime when switching to a radar channel or when turning on
|
||||
the AP.
|
||||
|
||||
Drivers advertise support for this using the new feature flag
|
||||
NL80211_EXT_FEATURE_RADAR_OFFCHAN.
|
||||
|
||||
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/7468e291ef5d05d692c1738d25b8f778d8ea5c3f.1634979655.git.lorenzo@kernel.org
|
||||
Link: https://lore.kernel.org/r/1e60e60fef00e14401adae81c3d49f3e5f307537.1634979655.git.lorenzo@kernel.org
|
||||
Link: https://lore.kernel.org/r/85fa50f57fc3adb2934c8d9ca0be30394de6b7e8.1634979655.git.lorenzo@kernel.org
|
||||
Link: https://lore.kernel.org/r/4b6c08671ad59aae0ac46fc94c02f31b1610eb72.1634979655.git.lorenzo@kernel.org
|
||||
Link: https://lore.kernel.org/r/241849ccaf2c228873c6f8495bf87b19159ba458.1634979655.git.lorenzo@kernel.org
|
||||
[remove offchan_mutex, fix cfg80211_stop_offchan_radar_detection(),
|
||||
remove gfp_t argument, fix documentation, fix tracing]
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -4057,6 +4057,15 @@ struct mgmt_frame_regs {
|
||||
* @set_sar_specs: Update the SAR (TX power) settings.
|
||||
*
|
||||
* @color_change: Initiate a color change.
|
||||
+ *
|
||||
+ * @set_radar_offchan: Configure dedicated offchannel chain available for
|
||||
+ * radar/CAC detection on some hw. This chain can't be used to transmit
|
||||
+ * or receive frames and it is bounded to a running wdev.
|
||||
+ * Offchannel radar/CAC detection allows to avoid the CAC downtime
|
||||
+ * switching to a different channel during CAC detection on the selected
|
||||
+ * radar channel.
|
||||
+ * The caller is expected to set chandef pointer to NULL in order to
|
||||
+ * disable offchannel CAC/radar detection.
|
||||
*/
|
||||
struct cfg80211_ops {
|
||||
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
|
||||
@@ -4387,6 +4396,8 @@ struct cfg80211_ops {
|
||||
int (*color_change)(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
struct cfg80211_color_change_settings *params);
|
||||
+ int (*set_radar_offchan)(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -7608,6 +7619,20 @@ void cfg80211_cac_event(struct net_devic
|
||||
const struct cfg80211_chan_def *chandef,
|
||||
enum nl80211_radar_event event, gfp_t gfp);
|
||||
|
||||
+/**
|
||||
+ * cfg80211_offchan_cac_event - Channel Availability Check (CAC) offchan event
|
||||
+ * @wiphy: the wiphy
|
||||
+ * @chandef: chandef for the current channel
|
||||
+ * @event: type of event
|
||||
+ *
|
||||
+ * This function is called when a Channel Availability Check (CAC) is finished,
|
||||
+ * started or aborted by a offchannel dedicated chain.
|
||||
+ *
|
||||
+ * Note that this acquires the wiphy lock.
|
||||
+ */
|
||||
+void cfg80211_offchan_cac_event(struct wiphy *wiphy,
|
||||
+ const struct cfg80211_chan_def *chandef,
|
||||
+ enum nl80211_radar_event event);
|
||||
|
||||
/**
|
||||
* cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
|
||||
--- a/include/uapi/linux/nl80211.h
|
||||
+++ b/include/uapi/linux/nl80211.h
|
||||
@@ -2608,6 +2608,13 @@ enum nl80211_commands {
|
||||
* Mandatory parameter for the transmitting interface to enable MBSSID.
|
||||
* Optional for the non-transmitting interfaces.
|
||||
*
|
||||
+ * @NL80211_ATTR_RADAR_OFFCHAN: Configure dedicated offchannel chain available for
|
||||
+ * radar/CAC detection on some hw. This chain can't be used to transmit
|
||||
+ * or receive frames and it is bounded to a running wdev.
|
||||
+ * Offchannel radar/CAC detection allows to avoid the CAC downtime
|
||||
+ * switching on a different channel during CAC detection on the selected
|
||||
+ * radar channel.
|
||||
+ *
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -3114,6 +3121,8 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_MBSSID_CONFIG,
|
||||
NL80211_ATTR_MBSSID_ELEMS,
|
||||
|
||||
+ NL80211_ATTR_RADAR_OFFCHAN,
|
||||
+
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
@@ -6013,6 +6022,9 @@ enum nl80211_feature_flags {
|
||||
* @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
|
||||
* detection and change announcemnts.
|
||||
*
|
||||
+ * @NL80211_EXT_FEATURE_RADAR_OFFCHAN: Device supports offchannel radar/CAC
|
||||
+ * detection.
|
||||
+ *
|
||||
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
||||
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
|
||||
*/
|
||||
@@ -6078,6 +6090,7 @@ enum nl80211_ext_feature_index {
|
||||
NL80211_EXT_FEATURE_SECURE_RTT,
|
||||
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
|
||||
NL80211_EXT_FEATURE_BSS_COLOR,
|
||||
+ NL80211_EXT_FEATURE_RADAR_OFFCHAN,
|
||||
|
||||
/* add new features before the definition below */
|
||||
NUM_NL80211_EXT_FEATURES,
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -552,6 +552,7 @@ use_default_name:
|
||||
INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
|
||||
INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
|
||||
INIT_WORK(&rdev->event_work, cfg80211_event_work);
|
||||
+ INIT_DELAYED_WORK(&rdev->offchan_cac_work, cfg80211_offchan_cac_work);
|
||||
|
||||
init_waitqueue_head(&rdev->dev_wait);
|
||||
|
||||
@@ -1214,6 +1215,8 @@ void __cfg80211_leave(struct cfg80211_re
|
||||
|
||||
cfg80211_pmsr_wdev_down(wdev);
|
||||
|
||||
+ cfg80211_stop_offchan_radar_detection(wdev);
|
||||
+
|
||||
switch (wdev->iftype) {
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
__cfg80211_leave_ibss(rdev, dev, true);
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -84,6 +84,10 @@ struct cfg80211_registered_device {
|
||||
|
||||
struct delayed_work dfs_update_channels_wk;
|
||||
|
||||
+ struct wireless_dev *offchan_radar_wdev;
|
||||
+ struct cfg80211_chan_def offchan_radar_chandef;
|
||||
+ struct delayed_work offchan_cac_work;
|
||||
+
|
||||
/* netlink port which started critical protocol (0 means not started) */
|
||||
u32 crit_proto_nlportid;
|
||||
|
||||
@@ -491,6 +495,15 @@ cfg80211_chandef_dfs_cac_time(struct wip
|
||||
|
||||
void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
|
||||
|
||||
+int
|
||||
+cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
+ struct wireless_dev *wdev,
|
||||
+ struct cfg80211_chan_def *chandef);
|
||||
+
|
||||
+void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev);
|
||||
+
|
||||
+void cfg80211_offchan_cac_work(struct work_struct *work);
|
||||
+
|
||||
bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *chan);
|
||||
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -970,3 +970,116 @@ void cfg80211_cac_event(struct net_devic
|
||||
nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_cac_event);
|
||||
+
|
||||
+void cfg80211_offchan_cac_work(struct work_struct *work)
|
||||
+{
|
||||
+ struct delayed_work *delayed_work = to_delayed_work(work);
|
||||
+ struct cfg80211_registered_device *rdev;
|
||||
+
|
||||
+ rdev = container_of(delayed_work, struct cfg80211_registered_device,
|
||||
+ offchan_cac_work);
|
||||
+ cfg80211_offchan_cac_event(&rdev->wiphy, &rdev->offchan_radar_chandef,
|
||||
+ NL80211_RADAR_CAC_FINISHED);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+__cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
|
||||
+ struct wireless_dev *wdev,
|
||||
+ const struct cfg80211_chan_def *chandef,
|
||||
+ enum nl80211_radar_event event)
|
||||
+{
|
||||
+ struct wiphy *wiphy = &rdev->wiphy;
|
||||
+ struct net_device *netdev;
|
||||
+
|
||||
+ lockdep_assert_wiphy(&rdev->wiphy);
|
||||
+
|
||||
+ if (event != NL80211_RADAR_CAC_STARTED && !rdev->offchan_radar_wdev)
|
||||
+ return;
|
||||
+
|
||||
+ switch (event) {
|
||||
+ case NL80211_RADAR_CAC_FINISHED:
|
||||
+ cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE);
|
||||
+ memcpy(&rdev->cac_done_chandef, chandef, sizeof(*chandef));
|
||||
+ queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
|
||||
+ cfg80211_sched_dfs_chan_update(rdev);
|
||||
+ wdev = rdev->offchan_radar_wdev;
|
||||
+ rdev->offchan_radar_wdev = NULL;
|
||||
+ break;
|
||||
+ case NL80211_RADAR_CAC_ABORTED:
|
||||
+ cancel_delayed_work(&rdev->offchan_cac_work);
|
||||
+ wdev = rdev->offchan_radar_wdev;
|
||||
+ rdev->offchan_radar_wdev = NULL;
|
||||
+ break;
|
||||
+ case NL80211_RADAR_CAC_STARTED:
|
||||
+ WARN_ON(!wdev);
|
||||
+ rdev->offchan_radar_wdev = wdev;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ netdev = wdev ? wdev->netdev : NULL;
|
||||
+ nl80211_radar_notify(rdev, chandef, event, netdev, GFP_KERNEL);
|
||||
+}
|
||||
+
|
||||
+void cfg80211_offchan_cac_event(struct wiphy *wiphy,
|
||||
+ const struct cfg80211_chan_def *chandef,
|
||||
+ enum nl80211_radar_event event)
|
||||
+{
|
||||
+ struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
+
|
||||
+ wiphy_lock(wiphy);
|
||||
+ __cfg80211_offchan_cac_event(rdev, NULL, chandef, event);
|
||||
+ wiphy_unlock(wiphy);
|
||||
+}
|
||||
+EXPORT_SYMBOL(cfg80211_offchan_cac_event);
|
||||
+
|
||||
+int
|
||||
+cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
+ struct wireless_dev *wdev,
|
||||
+ struct cfg80211_chan_def *chandef)
|
||||
+{
|
||||
+ unsigned int cac_time_ms;
|
||||
+ int err;
|
||||
+
|
||||
+ lockdep_assert_wiphy(&rdev->wiphy);
|
||||
+
|
||||
+ if (!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||
+ NL80211_EXT_FEATURE_RADAR_OFFCHAN))
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ if (rdev->offchan_radar_wdev)
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ err = rdev_set_radar_offchan(rdev, chandef);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ cac_time_ms = cfg80211_chandef_dfs_cac_time(&rdev->wiphy, chandef);
|
||||
+ if (!cac_time_ms)
|
||||
+ cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
|
||||
+
|
||||
+ rdev->offchan_radar_chandef = *chandef;
|
||||
+ __cfg80211_offchan_cac_event(rdev, wdev, chandef,
|
||||
+ NL80211_RADAR_CAC_STARTED);
|
||||
+ queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_work,
|
||||
+ msecs_to_jiffies(cac_time_ms));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev)
|
||||
+{
|
||||
+ struct wiphy *wiphy = wdev->wiphy;
|
||||
+ struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
+
|
||||
+ lockdep_assert_wiphy(wiphy);
|
||||
+
|
||||
+ if (wdev != rdev->offchan_radar_wdev)
|
||||
+ return;
|
||||
+
|
||||
+ rdev_set_radar_offchan(rdev, NULL);
|
||||
+
|
||||
+ __cfg80211_offchan_cac_event(rdev, NULL, NULL,
|
||||
+ NL80211_RADAR_CAC_ABORTED);
|
||||
+}
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -793,6 +793,7 @@ static const struct nla_policy nl80211_p
|
||||
[NL80211_ATTR_MBSSID_CONFIG] =
|
||||
NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
|
||||
[NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
|
||||
+ [NL80211_ATTR_RADAR_OFFCHAN] = { .type = NLA_FLAG },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -9269,12 +9270,6 @@ static int nl80211_start_radar_detection
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- if (netif_carrier_ok(dev))
|
||||
- return -EBUSY;
|
||||
-
|
||||
- if (wdev->cac_started)
|
||||
- return -EBUSY;
|
||||
-
|
||||
err = cfg80211_chandef_dfs_required(wiphy, &chandef, wdev->iftype);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -9285,6 +9280,16 @@ static int nl80211_start_radar_detection
|
||||
if (!cfg80211_chandef_dfs_usable(wiphy, &chandef))
|
||||
return -EINVAL;
|
||||
|
||||
+ if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN]))
|
||||
+ return cfg80211_start_offchan_radar_detection(rdev, wdev,
|
||||
+ &chandef);
|
||||
+
|
||||
+ if (netif_carrier_ok(dev))
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ if (wdev->cac_started)
|
||||
+ return -EBUSY;
|
||||
+
|
||||
/* CAC start is offloaded to HW and can't be started manually */
|
||||
if (wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD))
|
||||
return -EOPNOTSUPP;
|
||||
--- a/net/wireless/rdev-ops.h
|
||||
+++ b/net/wireless/rdev-ops.h
|
||||
@@ -1381,4 +1381,21 @@ static inline int rdev_color_change(stru
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static inline int
|
||||
+rdev_set_radar_offchan(struct cfg80211_registered_device *rdev,
|
||||
+ struct cfg80211_chan_def *chandef)
|
||||
+{
|
||||
+ struct wiphy *wiphy = &rdev->wiphy;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!rdev->ops->set_radar_offchan)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ trace_rdev_set_radar_offchan(wiphy, chandef);
|
||||
+ ret = rdev->ops->set_radar_offchan(wiphy, chandef);
|
||||
+ trace_rdev_return_int(wiphy, ret);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
#endif /* __CFG80211_RDEV_OPS */
|
||||
--- a/net/wireless/trace.h
|
||||
+++ b/net/wireless/trace.h
|
||||
@@ -3643,6 +3643,25 @@ TRACE_EVENT(cfg80211_bss_color_notify,
|
||||
__entry->color_bitmap)
|
||||
);
|
||||
|
||||
+TRACE_EVENT(rdev_set_radar_offchan,
|
||||
+ TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
|
||||
+
|
||||
+ TP_ARGS(wiphy, chandef),
|
||||
+
|
||||
+ TP_STRUCT__entry(
|
||||
+ WIPHY_ENTRY
|
||||
+ CHAN_DEF_ENTRY
|
||||
+ ),
|
||||
+
|
||||
+ TP_fast_assign(
|
||||
+ WIPHY_ASSIGN;
|
||||
+ CHAN_DEF_ASSIGN(chandef)
|
||||
+ ),
|
||||
+
|
||||
+ TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
|
||||
+ WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
|
||||
+);
|
||||
+
|
||||
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
@ -0,0 +1,183 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Wed, 27 Oct 2021 11:03:42 +0200
|
||||
Subject: [PATCH] cfg80211: move offchan_cac_event to a dedicated work
|
||||
|
||||
In order to make cfg80211_offchan_cac_abort() (renamed from
|
||||
cfg80211_offchan_cac_event) callable in other contexts and
|
||||
without so much locking restrictions, make it trigger a new
|
||||
work instead of operating directly.
|
||||
|
||||
Do some other renames while at it to clarify.
|
||||
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/6145c3d0f30400a568023f67981981d24c7c6133.1635325205.git.lorenzo@kernel.org
|
||||
[rewrite commit log]
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -7620,19 +7620,13 @@ void cfg80211_cac_event(struct net_devic
|
||||
enum nl80211_radar_event event, gfp_t gfp);
|
||||
|
||||
/**
|
||||
- * cfg80211_offchan_cac_event - Channel Availability Check (CAC) offchan event
|
||||
+ * cfg80211_offchan_cac_abort - Channel Availability Check offchan abort event
|
||||
* @wiphy: the wiphy
|
||||
- * @chandef: chandef for the current channel
|
||||
- * @event: type of event
|
||||
*
|
||||
- * This function is called when a Channel Availability Check (CAC) is finished,
|
||||
- * started or aborted by a offchannel dedicated chain.
|
||||
- *
|
||||
- * Note that this acquires the wiphy lock.
|
||||
+ * This function is called by the driver when a Channel Availability Check
|
||||
+ * (CAC) is aborted by a offchannel dedicated chain.
|
||||
*/
|
||||
-void cfg80211_offchan_cac_event(struct wiphy *wiphy,
|
||||
- const struct cfg80211_chan_def *chandef,
|
||||
- enum nl80211_radar_event event);
|
||||
+void cfg80211_offchan_cac_abort(struct wiphy *wiphy);
|
||||
|
||||
/**
|
||||
* cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -552,7 +552,9 @@ use_default_name:
|
||||
INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
|
||||
INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
|
||||
INIT_WORK(&rdev->event_work, cfg80211_event_work);
|
||||
- INIT_DELAYED_WORK(&rdev->offchan_cac_work, cfg80211_offchan_cac_work);
|
||||
+ INIT_WORK(&rdev->offchan_cac_abort_wk, cfg80211_offchan_cac_abort_wk);
|
||||
+ INIT_DELAYED_WORK(&rdev->offchan_cac_done_wk,
|
||||
+ cfg80211_offchan_cac_done_wk);
|
||||
|
||||
init_waitqueue_head(&rdev->dev_wait);
|
||||
|
||||
@@ -1062,11 +1064,13 @@ void wiphy_unregister(struct wiphy *wiph
|
||||
cancel_work_sync(&rdev->conn_work);
|
||||
flush_work(&rdev->event_work);
|
||||
cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
|
||||
+ cancel_delayed_work_sync(&rdev->offchan_cac_done_wk);
|
||||
flush_work(&rdev->destroy_work);
|
||||
flush_work(&rdev->sched_scan_stop_wk);
|
||||
flush_work(&rdev->propagate_radar_detect_wk);
|
||||
flush_work(&rdev->propagate_cac_done_wk);
|
||||
flush_work(&rdev->mgmt_registrations_update_wk);
|
||||
+ flush_work(&rdev->offchan_cac_abort_wk);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -86,7 +86,8 @@ struct cfg80211_registered_device {
|
||||
|
||||
struct wireless_dev *offchan_radar_wdev;
|
||||
struct cfg80211_chan_def offchan_radar_chandef;
|
||||
- struct delayed_work offchan_cac_work;
|
||||
+ struct delayed_work offchan_cac_done_wk;
|
||||
+ struct work_struct offchan_cac_abort_wk;
|
||||
|
||||
/* netlink port which started critical protocol (0 means not started) */
|
||||
u32 crit_proto_nlportid;
|
||||
@@ -502,7 +503,9 @@ cfg80211_start_offchan_radar_detection(s
|
||||
|
||||
void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev);
|
||||
|
||||
-void cfg80211_offchan_cac_work(struct work_struct *work);
|
||||
+void cfg80211_offchan_cac_done_wk(struct work_struct *work);
|
||||
+
|
||||
+void cfg80211_offchan_cac_abort_wk(struct work_struct *work);
|
||||
|
||||
bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *chan);
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -971,17 +971,6 @@ void cfg80211_cac_event(struct net_devic
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_cac_event);
|
||||
|
||||
-void cfg80211_offchan_cac_work(struct work_struct *work)
|
||||
-{
|
||||
- struct delayed_work *delayed_work = to_delayed_work(work);
|
||||
- struct cfg80211_registered_device *rdev;
|
||||
-
|
||||
- rdev = container_of(delayed_work, struct cfg80211_registered_device,
|
||||
- offchan_cac_work);
|
||||
- cfg80211_offchan_cac_event(&rdev->wiphy, &rdev->offchan_radar_chandef,
|
||||
- NL80211_RADAR_CAC_FINISHED);
|
||||
-}
|
||||
-
|
||||
static void
|
||||
__cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
|
||||
struct wireless_dev *wdev,
|
||||
@@ -1006,7 +995,7 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
rdev->offchan_radar_wdev = NULL;
|
||||
break;
|
||||
case NL80211_RADAR_CAC_ABORTED:
|
||||
- cancel_delayed_work(&rdev->offchan_cac_work);
|
||||
+ cancel_delayed_work(&rdev->offchan_cac_done_wk);
|
||||
wdev = rdev->offchan_radar_wdev;
|
||||
rdev->offchan_radar_wdev = NULL;
|
||||
break;
|
||||
@@ -1022,17 +1011,44 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
nl80211_radar_notify(rdev, chandef, event, netdev, GFP_KERNEL);
|
||||
}
|
||||
|
||||
-void cfg80211_offchan_cac_event(struct wiphy *wiphy,
|
||||
- const struct cfg80211_chan_def *chandef,
|
||||
- enum nl80211_radar_event event)
|
||||
+static void
|
||||
+cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
|
||||
+ const struct cfg80211_chan_def *chandef,
|
||||
+ enum nl80211_radar_event event)
|
||||
+{
|
||||
+ wiphy_lock(&rdev->wiphy);
|
||||
+ __cfg80211_offchan_cac_event(rdev, NULL, chandef, event);
|
||||
+ wiphy_unlock(&rdev->wiphy);
|
||||
+}
|
||||
+
|
||||
+void cfg80211_offchan_cac_done_wk(struct work_struct *work)
|
||||
+{
|
||||
+ struct delayed_work *delayed_work = to_delayed_work(work);
|
||||
+ struct cfg80211_registered_device *rdev;
|
||||
+
|
||||
+ rdev = container_of(delayed_work, struct cfg80211_registered_device,
|
||||
+ offchan_cac_done_wk);
|
||||
+ cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,
|
||||
+ NL80211_RADAR_CAC_FINISHED);
|
||||
+}
|
||||
+
|
||||
+void cfg80211_offchan_cac_abort_wk(struct work_struct *work)
|
||||
+{
|
||||
+ struct cfg80211_registered_device *rdev;
|
||||
+
|
||||
+ rdev = container_of(work, struct cfg80211_registered_device,
|
||||
+ offchan_cac_abort_wk);
|
||||
+ cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,
|
||||
+ NL80211_RADAR_CAC_ABORTED);
|
||||
+}
|
||||
+
|
||||
+void cfg80211_offchan_cac_abort(struct wiphy *wiphy)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
|
||||
- wiphy_lock(wiphy);
|
||||
- __cfg80211_offchan_cac_event(rdev, NULL, chandef, event);
|
||||
- wiphy_unlock(wiphy);
|
||||
+ queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
|
||||
}
|
||||
-EXPORT_SYMBOL(cfg80211_offchan_cac_event);
|
||||
+EXPORT_SYMBOL(cfg80211_offchan_cac_abort);
|
||||
|
||||
int
|
||||
cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
@@ -1062,7 +1078,7 @@ cfg80211_start_offchan_radar_detection(s
|
||||
rdev->offchan_radar_chandef = *chandef;
|
||||
__cfg80211_offchan_cac_event(rdev, wdev, chandef,
|
||||
NL80211_RADAR_CAC_STARTED);
|
||||
- queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_work,
|
||||
+ queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_done_wk,
|
||||
msecs_to_jiffies(cac_time_ms));
|
||||
|
||||
return 0;
|
||||
@ -0,0 +1,99 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Wed, 3 Nov 2021 18:02:35 +0100
|
||||
Subject: [PATCH] cfg80211: fix possible NULL pointer dereference in
|
||||
cfg80211_stop_offchan_radar_detection
|
||||
|
||||
Fix the following NULL pointer dereference in
|
||||
cfg80211_stop_offchan_radar_detection routine that occurs when hostapd
|
||||
is stopped during the CAC on offchannel chain:
|
||||
|
||||
Sat Jan 1 0[ 779.567851] ESR = 0x96000005
|
||||
0:12:50 2000 dae[ 779.572346] EC = 0x25: DABT (current EL), IL = 32 bits
|
||||
mon.debug hostap[ 779.578984] SET = 0, FnV = 0
|
||||
d: hostapd_inter[ 779.583445] EA = 0, S1PTW = 0
|
||||
face_deinit_free[ 779.587936] Data abort info:
|
||||
: num_bss=1 conf[ 779.592224] ISV = 0, ISS = 0x00000005
|
||||
->num_bss=1
|
||||
Sat[ 779.597403] CM = 0, WnR = 0
|
||||
Jan 1 00:12:50[ 779.601749] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000418b2000
|
||||
2000 daemon.deb[ 779.609601] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
|
||||
ug hostapd: host[ 779.619657] Internal error: Oops: 96000005 [#1] SMP
|
||||
[ 779.770810] CPU: 0 PID: 2202 Comm: hostapd Not tainted 5.10.75 #0
|
||||
[ 779.776892] Hardware name: MediaTek MT7622 RFB1 board (DT)
|
||||
[ 779.782370] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
|
||||
[ 779.788384] pc : cfg80211_chandef_valid+0x10/0x490 [cfg80211]
|
||||
[ 779.794128] lr : cfg80211_check_station_change+0x3190/0x3950 [cfg80211]
|
||||
[ 779.800731] sp : ffffffc01204b7e0
|
||||
[ 779.804036] x29: ffffffc01204b7e0 x28: ffffff80039bdc00
|
||||
[ 779.809340] x27: 0000000000000000 x26: ffffffc008cb3050
|
||||
[ 779.814644] x25: 0000000000000000 x24: 0000000000000002
|
||||
[ 779.819948] x23: ffffff8002630000 x22: ffffff8003e748d0
|
||||
[ 779.825252] x21: 0000000000000cc0 x20: ffffff8003da4a00
|
||||
[ 779.830556] x19: 0000000000000000 x18: ffffff8001bf7ce0
|
||||
[ 779.835860] x17: 00000000ffffffff x16: 0000000000000000
|
||||
[ 779.841164] x15: 0000000040d59200 x14: 00000000000019c0
|
||||
[ 779.846467] x13: 00000000000001c8 x12: 000636b9e9dab1c6
|
||||
[ 779.851771] x11: 0000000000000141 x10: 0000000000000820
|
||||
[ 779.857076] x9 : 0000000000000000 x8 : ffffff8003d7d038
|
||||
[ 779.862380] x7 : 0000000000000000 x6 : ffffff8003d7d038
|
||||
[ 779.867683] x5 : 0000000000000e90 x4 : 0000000000000038
|
||||
[ 779.872987] x3 : 0000000000000002 x2 : 0000000000000004
|
||||
[ 779.878291] x1 : 0000000000000000 x0 : 0000000000000000
|
||||
[ 779.883594] Call trace:
|
||||
[ 779.886039] cfg80211_chandef_valid+0x10/0x490 [cfg80211]
|
||||
[ 779.891434] cfg80211_check_station_change+0x3190/0x3950 [cfg80211]
|
||||
[ 779.897697] nl80211_radar_notify+0x138/0x19c [cfg80211]
|
||||
[ 779.903005] cfg80211_stop_offchan_radar_detection+0x7c/0x8c [cfg80211]
|
||||
[ 779.909616] __cfg80211_leave+0x2c/0x190 [cfg80211]
|
||||
[ 779.914490] cfg80211_register_netdevice+0x1c0/0x6d0 [cfg80211]
|
||||
[ 779.920404] raw_notifier_call_chain+0x50/0x70
|
||||
[ 779.924841] call_netdevice_notifiers_info+0x54/0xa0
|
||||
[ 779.929796] __dev_close_many+0x40/0x100
|
||||
[ 779.933712] __dev_change_flags+0x98/0x190
|
||||
[ 779.937800] dev_change_flags+0x20/0x60
|
||||
[ 779.941628] devinet_ioctl+0x534/0x6d0
|
||||
[ 779.945370] inet_ioctl+0x1bc/0x230
|
||||
[ 779.948849] sock_do_ioctl+0x44/0x200
|
||||
[ 779.952502] sock_ioctl+0x268/0x4c0
|
||||
[ 779.955985] __arm64_sys_ioctl+0xac/0xd0
|
||||
[ 779.959900] el0_svc_common.constprop.0+0x60/0x110
|
||||
[ 779.964682] do_el0_svc+0x1c/0x24
|
||||
[ 779.967990] el0_svc+0x10/0x1c
|
||||
[ 779.971036] el0_sync_handler+0x9c/0x120
|
||||
[ 779.974950] el0_sync+0x148/0x180
|
||||
[ 779.978259] Code: a9bc7bfd 910003fd a90153f3 aa0003f3 (f9400000)
|
||||
[ 779.984344] ---[ end trace 0e67b4f5d6cdeec7 ]---
|
||||
[ 779.996400] Kernel panic - not syncing: Oops: Fatal exception
|
||||
[ 780.002139] SMP: stopping secondary CPUs
|
||||
[ 780.006057] Kernel Offset: disabled
|
||||
[ 780.009537] CPU features: 0x0000002,04002004
|
||||
[ 780.013796] Memory Limit: none
|
||||
|
||||
Fixes: b8f5facf286b ("cfg80211: implement APIs for dedicated radar detection HW")
|
||||
Reported-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
|
||||
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/c2e34c065bf8839c5ffa45498ae154021a72a520.1635958796.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -982,6 +982,9 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
|
||||
lockdep_assert_wiphy(&rdev->wiphy);
|
||||
|
||||
+ if (!cfg80211_chandef_valid(chandef))
|
||||
+ return;
|
||||
+
|
||||
if (event != NL80211_RADAR_CAC_STARTED && !rdev->offchan_radar_wdev)
|
||||
return;
|
||||
|
||||
@@ -1096,6 +1099,6 @@ void cfg80211_stop_offchan_radar_detecti
|
||||
|
||||
rdev_set_radar_offchan(rdev, NULL);
|
||||
|
||||
- __cfg80211_offchan_cac_event(rdev, NULL, NULL,
|
||||
+ __cfg80211_offchan_cac_event(rdev, wdev, &rdev->offchan_radar_chandef,
|
||||
NL80211_RADAR_CAC_ABORTED);
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 16 Nov 2021 12:41:52 +0100
|
||||
Subject: [PATCH] cfg80211: schedule offchan_cac_abort_wk in
|
||||
cfg80211_radar_event
|
||||
|
||||
If necessary schedule offchan_cac_abort_wk work in cfg80211_radar_event
|
||||
routine adding offchan parameter to cfg80211_radar_event signature.
|
||||
Rename cfg80211_radar_event in __cfg80211_radar_event and introduce
|
||||
the two following inline helpers:
|
||||
- cfg80211_radar_event
|
||||
- cfg80211_offchan_radar_event
|
||||
Doing so the drv will not need to run cfg80211_offchan_cac_abort() after
|
||||
radar detection on the offchannel chain.
|
||||
|
||||
Tested-by: Owen Peng <owen.peng@mediatek.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/3ff583e021e3343a3ced54a7b09b5e184d1880dc.1637062727.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -7580,15 +7580,33 @@ void cfg80211_cqm_txe_notify(struct net_
|
||||
void cfg80211_cqm_beacon_loss_notify(struct net_device *dev, gfp_t gfp);
|
||||
|
||||
/**
|
||||
- * cfg80211_radar_event - radar detection event
|
||||
+ * __cfg80211_radar_event - radar detection event
|
||||
* @wiphy: the wiphy
|
||||
* @chandef: chandef for the current channel
|
||||
+ * @offchan: the radar has been detected on the offchannel chain
|
||||
* @gfp: context flags
|
||||
*
|
||||
* This function is called when a radar is detected on the current chanenl.
|
||||
*/
|
||||
-void cfg80211_radar_event(struct wiphy *wiphy,
|
||||
- struct cfg80211_chan_def *chandef, gfp_t gfp);
|
||||
+void __cfg80211_radar_event(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef,
|
||||
+ bool offchan, gfp_t gfp);
|
||||
+
|
||||
+static inline void
|
||||
+cfg80211_radar_event(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef,
|
||||
+ gfp_t gfp)
|
||||
+{
|
||||
+ __cfg80211_radar_event(wiphy, chandef, false, gfp);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+cfg80211_offchan_radar_event(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef,
|
||||
+ gfp_t gfp)
|
||||
+{
|
||||
+ __cfg80211_radar_event(wiphy, chandef, true, gfp);
|
||||
+}
|
||||
|
||||
/**
|
||||
* cfg80211_sta_opmode_change_notify - STA's ht/vht operation mode change event
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -905,13 +905,13 @@ void cfg80211_dfs_channels_update_work(s
|
||||
}
|
||||
|
||||
|
||||
-void cfg80211_radar_event(struct wiphy *wiphy,
|
||||
- struct cfg80211_chan_def *chandef,
|
||||
- gfp_t gfp)
|
||||
+void __cfg80211_radar_event(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef,
|
||||
+ bool offchan, gfp_t gfp)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
|
||||
- trace_cfg80211_radar_event(wiphy, chandef);
|
||||
+ trace_cfg80211_radar_event(wiphy, chandef, offchan);
|
||||
|
||||
/* only set the chandef supplied channel to unavailable, in
|
||||
* case the radar is detected on only one of multiple channels
|
||||
@@ -919,6 +919,9 @@ void cfg80211_radar_event(struct wiphy *
|
||||
*/
|
||||
cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE);
|
||||
|
||||
+ if (offchan)
|
||||
+ queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
|
||||
+
|
||||
cfg80211_sched_dfs_chan_update(rdev);
|
||||
|
||||
nl80211_radar_notify(rdev, chandef, NL80211_RADAR_DETECTED, NULL, gfp);
|
||||
@@ -926,7 +929,7 @@ void cfg80211_radar_event(struct wiphy *
|
||||
memcpy(&rdev->radar_chandef, chandef, sizeof(struct cfg80211_chan_def));
|
||||
queue_work(cfg80211_wq, &rdev->propagate_radar_detect_wk);
|
||||
}
|
||||
-EXPORT_SYMBOL(cfg80211_radar_event);
|
||||
+EXPORT_SYMBOL(__cfg80211_radar_event);
|
||||
|
||||
void cfg80211_cac_event(struct net_device *netdev,
|
||||
const struct cfg80211_chan_def *chandef,
|
||||
@@ -998,7 +1001,8 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
rdev->offchan_radar_wdev = NULL;
|
||||
break;
|
||||
case NL80211_RADAR_CAC_ABORTED:
|
||||
- cancel_delayed_work(&rdev->offchan_cac_done_wk);
|
||||
+ if (!cancel_delayed_work(&rdev->offchan_cac_done_wk))
|
||||
+ return;
|
||||
wdev = rdev->offchan_radar_wdev;
|
||||
rdev->offchan_radar_wdev = NULL;
|
||||
break;
|
||||
--- a/net/wireless/trace.h
|
||||
+++ b/net/wireless/trace.h
|
||||
@@ -3022,18 +3022,21 @@ TRACE_EVENT(cfg80211_ch_switch_started_n
|
||||
);
|
||||
|
||||
TRACE_EVENT(cfg80211_radar_event,
|
||||
- TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
|
||||
- TP_ARGS(wiphy, chandef),
|
||||
+ TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
|
||||
+ bool offchan),
|
||||
+ TP_ARGS(wiphy, chandef, offchan),
|
||||
TP_STRUCT__entry(
|
||||
WIPHY_ENTRY
|
||||
CHAN_DEF_ENTRY
|
||||
+ __field(bool, offchan)
|
||||
),
|
||||
TP_fast_assign(
|
||||
WIPHY_ASSIGN;
|
||||
CHAN_DEF_ASSIGN(chandef);
|
||||
+ __entry->offchan = offchan;
|
||||
),
|
||||
- TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
|
||||
- WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
|
||||
+ TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", offchan %d",
|
||||
+ WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->offchan)
|
||||
);
|
||||
|
||||
TRACE_EVENT(cfg80211_cac_event,
|
||||
@ -0,0 +1,220 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 16 Nov 2021 15:03:36 +0100
|
||||
Subject: [PATCH] cfg80211: allow continuous radar monitoring on offchannel
|
||||
chain
|
||||
|
||||
Allow continuous radar detection on the offchannel chain in order
|
||||
to switch to the monitored channel whenever the underlying driver
|
||||
reports a radar pattern on the main channel.
|
||||
|
||||
Tested-by: Owen Peng <owen.peng@mediatek.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/d46217310a49b14ff0e9c002f0a6e0547d70fd2c.1637071350.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/chan.c
|
||||
+++ b/net/wireless/chan.c
|
||||
@@ -712,6 +712,19 @@ static bool cfg80211_is_wiphy_oper_chan(
|
||||
return false;
|
||||
}
|
||||
|
||||
+static bool
|
||||
+cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev,
|
||||
+ struct ieee80211_channel *channel)
|
||||
+{
|
||||
+ if (!rdev->offchan_radar_wdev)
|
||||
+ return false;
|
||||
+
|
||||
+ if (!cfg80211_chandef_valid(&rdev->offchan_radar_chandef))
|
||||
+ return false;
|
||||
+
|
||||
+ return cfg80211_is_sub_chan(&rdev->offchan_radar_chandef, channel);
|
||||
+}
|
||||
+
|
||||
bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *chan)
|
||||
{
|
||||
@@ -728,6 +741,9 @@ bool cfg80211_any_wiphy_oper_chan(struct
|
||||
|
||||
if (cfg80211_is_wiphy_oper_chan(&rdev->wiphy, chan))
|
||||
return true;
|
||||
+
|
||||
+ if (cfg80211_offchan_chain_is_active(rdev, chan))
|
||||
+ return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -988,7 +988,7 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
if (!cfg80211_chandef_valid(chandef))
|
||||
return;
|
||||
|
||||
- if (event != NL80211_RADAR_CAC_STARTED && !rdev->offchan_radar_wdev)
|
||||
+ if (!rdev->offchan_radar_wdev)
|
||||
return;
|
||||
|
||||
switch (event) {
|
||||
@@ -998,17 +998,13 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
|
||||
cfg80211_sched_dfs_chan_update(rdev);
|
||||
wdev = rdev->offchan_radar_wdev;
|
||||
- rdev->offchan_radar_wdev = NULL;
|
||||
break;
|
||||
case NL80211_RADAR_CAC_ABORTED:
|
||||
if (!cancel_delayed_work(&rdev->offchan_cac_done_wk))
|
||||
return;
|
||||
wdev = rdev->offchan_radar_wdev;
|
||||
- rdev->offchan_radar_wdev = NULL;
|
||||
break;
|
||||
case NL80211_RADAR_CAC_STARTED:
|
||||
- WARN_ON(!wdev);
|
||||
- rdev->offchan_radar_wdev = wdev;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -1024,7 +1020,8 @@ cfg80211_offchan_cac_event(struct cfg802
|
||||
enum nl80211_radar_event event)
|
||||
{
|
||||
wiphy_lock(&rdev->wiphy);
|
||||
- __cfg80211_offchan_cac_event(rdev, NULL, chandef, event);
|
||||
+ __cfg80211_offchan_cac_event(rdev, rdev->offchan_radar_wdev,
|
||||
+ chandef, event);
|
||||
wiphy_unlock(&rdev->wiphy);
|
||||
}
|
||||
|
||||
@@ -1071,7 +1068,13 @@ cfg80211_start_offchan_radar_detection(s
|
||||
NL80211_EXT_FEATURE_RADAR_OFFCHAN))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
- if (rdev->offchan_radar_wdev)
|
||||
+ /* Offchannel chain already locked by another wdev */
|
||||
+ if (rdev->offchan_radar_wdev && rdev->offchan_radar_wdev != wdev)
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ /* CAC already in progress on the offchannel chain */
|
||||
+ if (rdev->offchan_radar_wdev == wdev &&
|
||||
+ delayed_work_pending(&rdev->offchan_cac_done_wk))
|
||||
return -EBUSY;
|
||||
|
||||
err = rdev_set_radar_offchan(rdev, chandef);
|
||||
@@ -1083,6 +1086,8 @@ cfg80211_start_offchan_radar_detection(s
|
||||
cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
|
||||
|
||||
rdev->offchan_radar_chandef = *chandef;
|
||||
+ rdev->offchan_radar_wdev = wdev; /* Get offchain ownership */
|
||||
+
|
||||
__cfg80211_offchan_cac_event(rdev, wdev, chandef,
|
||||
NL80211_RADAR_CAC_STARTED);
|
||||
queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_done_wk,
|
||||
@@ -1102,6 +1107,7 @@ void cfg80211_stop_offchan_radar_detecti
|
||||
return;
|
||||
|
||||
rdev_set_radar_offchan(rdev, NULL);
|
||||
+ rdev->offchan_radar_wdev = NULL; /* Release offchain ownership */
|
||||
|
||||
__cfg80211_offchan_cac_event(rdev, wdev, &rdev->offchan_radar_chandef,
|
||||
NL80211_RADAR_CAC_ABORTED);
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -9260,42 +9260,60 @@ static int nl80211_start_radar_detection
|
||||
struct cfg80211_chan_def chandef;
|
||||
enum nl80211_dfs_regions dfs_region;
|
||||
unsigned int cac_time_ms;
|
||||
- int err;
|
||||
+ int err = -EINVAL;
|
||||
+
|
||||
+ flush_delayed_work(&rdev->dfs_update_channels_wk);
|
||||
+
|
||||
+ wiphy_lock(wiphy);
|
||||
|
||||
dfs_region = reg_get_dfs_region(wiphy);
|
||||
if (dfs_region == NL80211_DFS_UNSET)
|
||||
- return -EINVAL;
|
||||
+ goto unlock;
|
||||
|
||||
err = nl80211_parse_chandef(rdev, info, &chandef);
|
||||
if (err)
|
||||
- return err;
|
||||
+ goto unlock;
|
||||
|
||||
err = cfg80211_chandef_dfs_required(wiphy, &chandef, wdev->iftype);
|
||||
if (err < 0)
|
||||
- return err;
|
||||
+ goto unlock;
|
||||
|
||||
- if (err == 0)
|
||||
- return -EINVAL;
|
||||
+ if (err == 0) {
|
||||
+ err = -EINVAL;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
- if (!cfg80211_chandef_dfs_usable(wiphy, &chandef))
|
||||
- return -EINVAL;
|
||||
+ if (!cfg80211_chandef_dfs_usable(wiphy, &chandef)) {
|
||||
+ err = -EINVAL;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
- if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN]))
|
||||
- return cfg80211_start_offchan_radar_detection(rdev, wdev,
|
||||
- &chandef);
|
||||
+ if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN])) {
|
||||
+ err = cfg80211_start_offchan_radar_detection(rdev, wdev,
|
||||
+ &chandef);
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
- if (netif_carrier_ok(dev))
|
||||
- return -EBUSY;
|
||||
+ if (netif_carrier_ok(dev)) {
|
||||
+ err = -EBUSY;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
- if (wdev->cac_started)
|
||||
- return -EBUSY;
|
||||
+ if (wdev->cac_started) {
|
||||
+ err = -EBUSY;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
/* CAC start is offloaded to HW and can't be started manually */
|
||||
- if (wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD))
|
||||
- return -EOPNOTSUPP;
|
||||
+ if (wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD)) {
|
||||
+ err = -EOPNOTSUPP;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
- if (!rdev->ops->start_radar_detection)
|
||||
- return -EOPNOTSUPP;
|
||||
+ if (!rdev->ops->start_radar_detection) {
|
||||
+ err = -EOPNOTSUPP;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
|
||||
cac_time_ms = cfg80211_chandef_dfs_cac_time(&rdev->wiphy, &chandef);
|
||||
if (WARN_ON(!cac_time_ms))
|
||||
@@ -9308,6 +9326,9 @@ static int nl80211_start_radar_detection
|
||||
wdev->cac_start_time = jiffies;
|
||||
wdev->cac_time_ms = cac_time_ms;
|
||||
}
|
||||
+unlock:
|
||||
+ wiphy_unlock(wiphy);
|
||||
+
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -15926,7 +15947,8 @@ static const struct genl_small_ops nl802
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = nl80211_start_radar_detection,
|
||||
.flags = GENL_UNS_ADMIN_PERM,
|
||||
- .internal_flags = NL80211_FLAG_NEED_NETDEV_UP,
|
||||
+ .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
|
||||
+ NL80211_FLAG_NO_WIPHY_MTX,
|
||||
},
|
||||
{
|
||||
.cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,
|
||||
@ -0,0 +1,67 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Sat, 23 Oct 2021 11:10:51 +0200
|
||||
Subject: [PATCH] mac80211: introduce set_radar_offchan callback
|
||||
|
||||
Similar to cfg80211, introduce set_radar_offchan callback in mac80211_ops
|
||||
in order to configure a dedicated offchannel chain available on some hw
|
||||
(e.g. mt7915) to perform offchannel CAC detection and avoid tx/rx downtime.
|
||||
|
||||
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/201110606d4f3a7dfdf31440e351f2e2c375d4f0.1634979655.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -3937,6 +3937,14 @@ struct ieee80211_prep_tx_info {
|
||||
* twt structure.
|
||||
* @twt_teardown_request: Update the hw with TWT teardown request received
|
||||
* from the peer.
|
||||
+ * @set_radar_offchan: Configure dedicated offchannel chain available for
|
||||
+ * radar/CAC detection on some hw. This chain can't be used to transmit
|
||||
+ * or receive frames and it is bounded to a running wdev.
|
||||
+ * Offchannel radar/CAC detection allows to avoid the CAC downtime
|
||||
+ * switching to a different channel during CAC detection on the selected
|
||||
+ * radar channel.
|
||||
+ * The caller is expected to set chandef pointer to NULL in order to
|
||||
+ * disable offchannel CAC/radar detection.
|
||||
* @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
|
||||
* resolve a path for hardware flow offloading
|
||||
*/
|
||||
@@ -4267,6 +4275,8 @@ struct ieee80211_ops {
|
||||
struct ieee80211_twt_setup *twt);
|
||||
void (*twt_teardown_request)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_sta *sta, u8 flowid);
|
||||
+ int (*set_radar_offchan)(struct ieee80211_hw *hw,
|
||||
+ struct cfg80211_chan_def *chandef);
|
||||
int (*net_fill_forward_path)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta,
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -4344,6 +4344,18 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
+static int
|
||||
+ieee80211_set_radar_offchan(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef)
|
||||
+{
|
||||
+ struct ieee80211_local *local = wiphy_priv(wiphy);
|
||||
+
|
||||
+ if (!local->ops->set_radar_offchan)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return local->ops->set_radar_offchan(&local->hw, chandef);
|
||||
+}
|
||||
+
|
||||
const struct cfg80211_ops mac80211_config_ops = {
|
||||
.add_virtual_intf = ieee80211_add_iface,
|
||||
.del_virtual_intf = ieee80211_del_iface,
|
||||
@@ -4448,4 +4460,5 @@ const struct cfg80211_ops mac80211_confi
|
||||
.reset_tid_config = ieee80211_reset_tid_config,
|
||||
.set_sar_specs = ieee80211_set_sar_specs,
|
||||
.color_change = ieee80211_color_change,
|
||||
+ .set_radar_offchan = ieee80211_set_radar_offchan,
|
||||
};
|
||||
@ -0,0 +1,532 @@
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Mon, 29 Nov 2021 14:11:24 +0100
|
||||
Subject: [PATCH] cfg80211: rename offchannel_chain structs to background_chain
|
||||
to avoid confusion with ETSI standard
|
||||
|
||||
ETSI standard defines "Offchannel CAC" as:
|
||||
"Off-Channel CAC is performed by a number of non-continuous checks
|
||||
spread over a period in time. This period, which is required to
|
||||
determine the presence of radar signals, is defined as the Off-Channel
|
||||
CAC Time..
|
||||
Minimum Off-Channel CAC Time 6 minutes and Maximum Off-Channel CAC Time
|
||||
4 hours..".
|
||||
mac80211 implementation refers to a dedicated hw chain used for continuous
|
||||
radar monitoring. Rename offchannel_* references to background_* in
|
||||
order to avoid confusion with ETSI standard.
|
||||
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/r/4204cc1d648d76b44557981713231e030a3bd991.1638190762.git.lorenzo@kernel.org
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -4058,14 +4058,14 @@ struct mgmt_frame_regs {
|
||||
*
|
||||
* @color_change: Initiate a color change.
|
||||
*
|
||||
- * @set_radar_offchan: Configure dedicated offchannel chain available for
|
||||
+ * @set_radar_background: Configure dedicated offchannel chain available for
|
||||
* radar/CAC detection on some hw. This chain can't be used to transmit
|
||||
* or receive frames and it is bounded to a running wdev.
|
||||
- * Offchannel radar/CAC detection allows to avoid the CAC downtime
|
||||
+ * Background radar/CAC detection allows to avoid the CAC downtime
|
||||
* switching to a different channel during CAC detection on the selected
|
||||
* radar channel.
|
||||
* The caller is expected to set chandef pointer to NULL in order to
|
||||
- * disable offchannel CAC/radar detection.
|
||||
+ * disable background CAC/radar detection.
|
||||
*/
|
||||
struct cfg80211_ops {
|
||||
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
|
||||
@@ -4396,8 +4396,8 @@ struct cfg80211_ops {
|
||||
int (*color_change)(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
struct cfg80211_color_change_settings *params);
|
||||
- int (*set_radar_offchan)(struct wiphy *wiphy,
|
||||
- struct cfg80211_chan_def *chandef);
|
||||
+ int (*set_radar_background)(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -7601,9 +7601,9 @@ cfg80211_radar_event(struct wiphy *wiphy
|
||||
}
|
||||
|
||||
static inline void
|
||||
-cfg80211_offchan_radar_event(struct wiphy *wiphy,
|
||||
- struct cfg80211_chan_def *chandef,
|
||||
- gfp_t gfp)
|
||||
+cfg80211_background_radar_event(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef,
|
||||
+ gfp_t gfp)
|
||||
{
|
||||
__cfg80211_radar_event(wiphy, chandef, true, gfp);
|
||||
}
|
||||
@@ -7638,13 +7638,13 @@ void cfg80211_cac_event(struct net_devic
|
||||
enum nl80211_radar_event event, gfp_t gfp);
|
||||
|
||||
/**
|
||||
- * cfg80211_offchan_cac_abort - Channel Availability Check offchan abort event
|
||||
+ * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
|
||||
* @wiphy: the wiphy
|
||||
*
|
||||
* This function is called by the driver when a Channel Availability Check
|
||||
* (CAC) is aborted by a offchannel dedicated chain.
|
||||
*/
|
||||
-void cfg80211_offchan_cac_abort(struct wiphy *wiphy);
|
||||
+void cfg80211_background_cac_abort(struct wiphy *wiphy);
|
||||
|
||||
/**
|
||||
* cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -3937,14 +3937,14 @@ struct ieee80211_prep_tx_info {
|
||||
* twt structure.
|
||||
* @twt_teardown_request: Update the hw with TWT teardown request received
|
||||
* from the peer.
|
||||
- * @set_radar_offchan: Configure dedicated offchannel chain available for
|
||||
+ * @set_radar_background: Configure dedicated offchannel chain available for
|
||||
* radar/CAC detection on some hw. This chain can't be used to transmit
|
||||
* or receive frames and it is bounded to a running wdev.
|
||||
- * Offchannel radar/CAC detection allows to avoid the CAC downtime
|
||||
+ * Background radar/CAC detection allows to avoid the CAC downtime
|
||||
* switching to a different channel during CAC detection on the selected
|
||||
* radar channel.
|
||||
* The caller is expected to set chandef pointer to NULL in order to
|
||||
- * disable offchannel CAC/radar detection.
|
||||
+ * disable background CAC/radar detection.
|
||||
* @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
|
||||
* resolve a path for hardware flow offloading
|
||||
*/
|
||||
@@ -4275,8 +4275,8 @@ struct ieee80211_ops {
|
||||
struct ieee80211_twt_setup *twt);
|
||||
void (*twt_teardown_request)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_sta *sta, u8 flowid);
|
||||
- int (*set_radar_offchan)(struct ieee80211_hw *hw,
|
||||
- struct cfg80211_chan_def *chandef);
|
||||
+ int (*set_radar_background)(struct ieee80211_hw *hw,
|
||||
+ struct cfg80211_chan_def *chandef);
|
||||
int (*net_fill_forward_path)(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta,
|
||||
--- a/include/uapi/linux/nl80211.h
|
||||
+++ b/include/uapi/linux/nl80211.h
|
||||
@@ -2608,10 +2608,10 @@ enum nl80211_commands {
|
||||
* Mandatory parameter for the transmitting interface to enable MBSSID.
|
||||
* Optional for the non-transmitting interfaces.
|
||||
*
|
||||
- * @NL80211_ATTR_RADAR_OFFCHAN: Configure dedicated offchannel chain available for
|
||||
- * radar/CAC detection on some hw. This chain can't be used to transmit
|
||||
- * or receive frames and it is bounded to a running wdev.
|
||||
- * Offchannel radar/CAC detection allows to avoid the CAC downtime
|
||||
+ * @NL80211_ATTR_RADAR_BACKGROUND: Configure dedicated offchannel chain
|
||||
+ * available for radar/CAC detection on some hw. This chain can't be used
|
||||
+ * to transmit or receive frames and it is bounded to a running wdev.
|
||||
+ * Background radar/CAC detection allows to avoid the CAC downtime
|
||||
* switching on a different channel during CAC detection on the selected
|
||||
* radar channel.
|
||||
*
|
||||
@@ -3121,7 +3121,7 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_MBSSID_CONFIG,
|
||||
NL80211_ATTR_MBSSID_ELEMS,
|
||||
|
||||
- NL80211_ATTR_RADAR_OFFCHAN,
|
||||
+ NL80211_ATTR_RADAR_BACKGROUND,
|
||||
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
@@ -6022,7 +6022,7 @@ enum nl80211_feature_flags {
|
||||
* @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
|
||||
* detection and change announcemnts.
|
||||
*
|
||||
- * @NL80211_EXT_FEATURE_RADAR_OFFCHAN: Device supports offchannel radar/CAC
|
||||
+ * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
|
||||
* detection.
|
||||
*
|
||||
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
||||
@@ -6090,7 +6090,7 @@ enum nl80211_ext_feature_index {
|
||||
NL80211_EXT_FEATURE_SECURE_RTT,
|
||||
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
|
||||
NL80211_EXT_FEATURE_BSS_COLOR,
|
||||
- NL80211_EXT_FEATURE_RADAR_OFFCHAN,
|
||||
+ NL80211_EXT_FEATURE_RADAR_BACKGROUND,
|
||||
|
||||
/* add new features before the definition below */
|
||||
NUM_NL80211_EXT_FEATURES,
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -4345,15 +4345,15 @@ out:
|
||||
}
|
||||
|
||||
static int
|
||||
-ieee80211_set_radar_offchan(struct wiphy *wiphy,
|
||||
- struct cfg80211_chan_def *chandef)
|
||||
+ieee80211_set_radar_background(struct wiphy *wiphy,
|
||||
+ struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
struct ieee80211_local *local = wiphy_priv(wiphy);
|
||||
|
||||
- if (!local->ops->set_radar_offchan)
|
||||
+ if (!local->ops->set_radar_background)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
- return local->ops->set_radar_offchan(&local->hw, chandef);
|
||||
+ return local->ops->set_radar_background(&local->hw, chandef);
|
||||
}
|
||||
|
||||
const struct cfg80211_ops mac80211_config_ops = {
|
||||
@@ -4460,5 +4460,5 @@ const struct cfg80211_ops mac80211_confi
|
||||
.reset_tid_config = ieee80211_reset_tid_config,
|
||||
.set_sar_specs = ieee80211_set_sar_specs,
|
||||
.color_change = ieee80211_color_change,
|
||||
- .set_radar_offchan = ieee80211_set_radar_offchan,
|
||||
+ .set_radar_background = ieee80211_set_radar_background,
|
||||
};
|
||||
--- a/net/wireless/chan.c
|
||||
+++ b/net/wireless/chan.c
|
||||
@@ -716,13 +716,13 @@ static bool
|
||||
cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev,
|
||||
struct ieee80211_channel *channel)
|
||||
{
|
||||
- if (!rdev->offchan_radar_wdev)
|
||||
+ if (!rdev->background_radar_wdev)
|
||||
return false;
|
||||
|
||||
- if (!cfg80211_chandef_valid(&rdev->offchan_radar_chandef))
|
||||
+ if (!cfg80211_chandef_valid(&rdev->background_radar_chandef))
|
||||
return false;
|
||||
|
||||
- return cfg80211_is_sub_chan(&rdev->offchan_radar_chandef, channel);
|
||||
+ return cfg80211_is_sub_chan(&rdev->background_radar_chandef, channel);
|
||||
}
|
||||
|
||||
bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -552,9 +552,10 @@ use_default_name:
|
||||
INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
|
||||
INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
|
||||
INIT_WORK(&rdev->event_work, cfg80211_event_work);
|
||||
- INIT_WORK(&rdev->offchan_cac_abort_wk, cfg80211_offchan_cac_abort_wk);
|
||||
- INIT_DELAYED_WORK(&rdev->offchan_cac_done_wk,
|
||||
- cfg80211_offchan_cac_done_wk);
|
||||
+ INIT_WORK(&rdev->background_cac_abort_wk,
|
||||
+ cfg80211_background_cac_abort_wk);
|
||||
+ INIT_DELAYED_WORK(&rdev->background_cac_done_wk,
|
||||
+ cfg80211_background_cac_done_wk);
|
||||
|
||||
init_waitqueue_head(&rdev->dev_wait);
|
||||
|
||||
@@ -1064,13 +1065,13 @@ void wiphy_unregister(struct wiphy *wiph
|
||||
cancel_work_sync(&rdev->conn_work);
|
||||
flush_work(&rdev->event_work);
|
||||
cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
|
||||
- cancel_delayed_work_sync(&rdev->offchan_cac_done_wk);
|
||||
+ cancel_delayed_work_sync(&rdev->background_cac_done_wk);
|
||||
flush_work(&rdev->destroy_work);
|
||||
flush_work(&rdev->sched_scan_stop_wk);
|
||||
flush_work(&rdev->propagate_radar_detect_wk);
|
||||
flush_work(&rdev->propagate_cac_done_wk);
|
||||
flush_work(&rdev->mgmt_registrations_update_wk);
|
||||
- flush_work(&rdev->offchan_cac_abort_wk);
|
||||
+ flush_work(&rdev->background_cac_abort_wk);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
|
||||
@@ -1219,7 +1220,7 @@ void __cfg80211_leave(struct cfg80211_re
|
||||
|
||||
cfg80211_pmsr_wdev_down(wdev);
|
||||
|
||||
- cfg80211_stop_offchan_radar_detection(wdev);
|
||||
+ cfg80211_stop_background_radar_detection(wdev);
|
||||
|
||||
switch (wdev->iftype) {
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -84,10 +84,10 @@ struct cfg80211_registered_device {
|
||||
|
||||
struct delayed_work dfs_update_channels_wk;
|
||||
|
||||
- struct wireless_dev *offchan_radar_wdev;
|
||||
- struct cfg80211_chan_def offchan_radar_chandef;
|
||||
- struct delayed_work offchan_cac_done_wk;
|
||||
- struct work_struct offchan_cac_abort_wk;
|
||||
+ struct wireless_dev *background_radar_wdev;
|
||||
+ struct cfg80211_chan_def background_radar_chandef;
|
||||
+ struct delayed_work background_cac_done_wk;
|
||||
+ struct work_struct background_cac_abort_wk;
|
||||
|
||||
/* netlink port which started critical protocol (0 means not started) */
|
||||
u32 crit_proto_nlportid;
|
||||
@@ -497,15 +497,15 @@ cfg80211_chandef_dfs_cac_time(struct wip
|
||||
void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
|
||||
|
||||
int
|
||||
-cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
- struct wireless_dev *wdev,
|
||||
- struct cfg80211_chan_def *chandef);
|
||||
+cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
+ struct wireless_dev *wdev,
|
||||
+ struct cfg80211_chan_def *chandef);
|
||||
|
||||
-void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev);
|
||||
+void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev);
|
||||
|
||||
-void cfg80211_offchan_cac_done_wk(struct work_struct *work);
|
||||
+void cfg80211_background_cac_done_wk(struct work_struct *work);
|
||||
|
||||
-void cfg80211_offchan_cac_abort_wk(struct work_struct *work);
|
||||
+void cfg80211_background_cac_abort_wk(struct work_struct *work);
|
||||
|
||||
bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *chan);
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -920,7 +920,7 @@ void __cfg80211_radar_event(struct wiphy
|
||||
cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE);
|
||||
|
||||
if (offchan)
|
||||
- queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
|
||||
+ queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
|
||||
|
||||
cfg80211_sched_dfs_chan_update(rdev);
|
||||
|
||||
@@ -975,10 +975,10 @@ void cfg80211_cac_event(struct net_devic
|
||||
EXPORT_SYMBOL(cfg80211_cac_event);
|
||||
|
||||
static void
|
||||
-__cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
|
||||
- struct wireless_dev *wdev,
|
||||
- const struct cfg80211_chan_def *chandef,
|
||||
- enum nl80211_radar_event event)
|
||||
+__cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
|
||||
+ struct wireless_dev *wdev,
|
||||
+ const struct cfg80211_chan_def *chandef,
|
||||
+ enum nl80211_radar_event event)
|
||||
{
|
||||
struct wiphy *wiphy = &rdev->wiphy;
|
||||
struct net_device *netdev;
|
||||
@@ -988,7 +988,7 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
if (!cfg80211_chandef_valid(chandef))
|
||||
return;
|
||||
|
||||
- if (!rdev->offchan_radar_wdev)
|
||||
+ if (!rdev->background_radar_wdev)
|
||||
return;
|
||||
|
||||
switch (event) {
|
||||
@@ -997,12 +997,12 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
memcpy(&rdev->cac_done_chandef, chandef, sizeof(*chandef));
|
||||
queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
|
||||
cfg80211_sched_dfs_chan_update(rdev);
|
||||
- wdev = rdev->offchan_radar_wdev;
|
||||
+ wdev = rdev->background_radar_wdev;
|
||||
break;
|
||||
case NL80211_RADAR_CAC_ABORTED:
|
||||
- if (!cancel_delayed_work(&rdev->offchan_cac_done_wk))
|
||||
+ if (!cancel_delayed_work(&rdev->background_cac_done_wk))
|
||||
return;
|
||||
- wdev = rdev->offchan_radar_wdev;
|
||||
+ wdev = rdev->background_radar_wdev;
|
||||
break;
|
||||
case NL80211_RADAR_CAC_STARTED:
|
||||
break;
|
||||
@@ -1015,49 +1015,49 @@ __cfg80211_offchan_cac_event(struct cfg8
|
||||
}
|
||||
|
||||
static void
|
||||
-cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
|
||||
- const struct cfg80211_chan_def *chandef,
|
||||
- enum nl80211_radar_event event)
|
||||
+cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
|
||||
+ const struct cfg80211_chan_def *chandef,
|
||||
+ enum nl80211_radar_event event)
|
||||
{
|
||||
wiphy_lock(&rdev->wiphy);
|
||||
- __cfg80211_offchan_cac_event(rdev, rdev->offchan_radar_wdev,
|
||||
- chandef, event);
|
||||
+ __cfg80211_background_cac_event(rdev, rdev->background_radar_wdev,
|
||||
+ chandef, event);
|
||||
wiphy_unlock(&rdev->wiphy);
|
||||
}
|
||||
|
||||
-void cfg80211_offchan_cac_done_wk(struct work_struct *work)
|
||||
+void cfg80211_background_cac_done_wk(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *delayed_work = to_delayed_work(work);
|
||||
struct cfg80211_registered_device *rdev;
|
||||
|
||||
rdev = container_of(delayed_work, struct cfg80211_registered_device,
|
||||
- offchan_cac_done_wk);
|
||||
- cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,
|
||||
- NL80211_RADAR_CAC_FINISHED);
|
||||
+ background_cac_done_wk);
|
||||
+ cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef,
|
||||
+ NL80211_RADAR_CAC_FINISHED);
|
||||
}
|
||||
|
||||
-void cfg80211_offchan_cac_abort_wk(struct work_struct *work)
|
||||
+void cfg80211_background_cac_abort_wk(struct work_struct *work)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev;
|
||||
|
||||
rdev = container_of(work, struct cfg80211_registered_device,
|
||||
- offchan_cac_abort_wk);
|
||||
- cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,
|
||||
- NL80211_RADAR_CAC_ABORTED);
|
||||
+ background_cac_abort_wk);
|
||||
+ cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef,
|
||||
+ NL80211_RADAR_CAC_ABORTED);
|
||||
}
|
||||
|
||||
-void cfg80211_offchan_cac_abort(struct wiphy *wiphy)
|
||||
+void cfg80211_background_cac_abort(struct wiphy *wiphy)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
|
||||
- queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
|
||||
+ queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
|
||||
}
|
||||
-EXPORT_SYMBOL(cfg80211_offchan_cac_abort);
|
||||
+EXPORT_SYMBOL(cfg80211_background_cac_abort);
|
||||
|
||||
int
|
||||
-cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
- struct wireless_dev *wdev,
|
||||
- struct cfg80211_chan_def *chandef)
|
||||
+cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
|
||||
+ struct wireless_dev *wdev,
|
||||
+ struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
unsigned int cac_time_ms;
|
||||
int err;
|
||||
@@ -1065,19 +1065,19 @@ cfg80211_start_offchan_radar_detection(s
|
||||
lockdep_assert_wiphy(&rdev->wiphy);
|
||||
|
||||
if (!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||
- NL80211_EXT_FEATURE_RADAR_OFFCHAN))
|
||||
+ NL80211_EXT_FEATURE_RADAR_BACKGROUND))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* Offchannel chain already locked by another wdev */
|
||||
- if (rdev->offchan_radar_wdev && rdev->offchan_radar_wdev != wdev)
|
||||
+ if (rdev->background_radar_wdev && rdev->background_radar_wdev != wdev)
|
||||
return -EBUSY;
|
||||
|
||||
/* CAC already in progress on the offchannel chain */
|
||||
- if (rdev->offchan_radar_wdev == wdev &&
|
||||
- delayed_work_pending(&rdev->offchan_cac_done_wk))
|
||||
+ if (rdev->background_radar_wdev == wdev &&
|
||||
+ delayed_work_pending(&rdev->background_cac_done_wk))
|
||||
return -EBUSY;
|
||||
|
||||
- err = rdev_set_radar_offchan(rdev, chandef);
|
||||
+ err = rdev_set_radar_background(rdev, chandef);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1085,30 +1085,31 @@ cfg80211_start_offchan_radar_detection(s
|
||||
if (!cac_time_ms)
|
||||
cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
|
||||
|
||||
- rdev->offchan_radar_chandef = *chandef;
|
||||
- rdev->offchan_radar_wdev = wdev; /* Get offchain ownership */
|
||||
+ rdev->background_radar_chandef = *chandef;
|
||||
+ rdev->background_radar_wdev = wdev; /* Get offchain ownership */
|
||||
|
||||
- __cfg80211_offchan_cac_event(rdev, wdev, chandef,
|
||||
- NL80211_RADAR_CAC_STARTED);
|
||||
- queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_done_wk,
|
||||
+ __cfg80211_background_cac_event(rdev, wdev, chandef,
|
||||
+ NL80211_RADAR_CAC_STARTED);
|
||||
+ queue_delayed_work(cfg80211_wq, &rdev->background_cac_done_wk,
|
||||
msecs_to_jiffies(cac_time_ms));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev)
|
||||
+void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev)
|
||||
{
|
||||
struct wiphy *wiphy = wdev->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
|
||||
|
||||
lockdep_assert_wiphy(wiphy);
|
||||
|
||||
- if (wdev != rdev->offchan_radar_wdev)
|
||||
+ if (wdev != rdev->background_radar_wdev)
|
||||
return;
|
||||
|
||||
- rdev_set_radar_offchan(rdev, NULL);
|
||||
- rdev->offchan_radar_wdev = NULL; /* Release offchain ownership */
|
||||
+ rdev_set_radar_background(rdev, NULL);
|
||||
+ rdev->background_radar_wdev = NULL; /* Release offchain ownership */
|
||||
|
||||
- __cfg80211_offchan_cac_event(rdev, wdev, &rdev->offchan_radar_chandef,
|
||||
- NL80211_RADAR_CAC_ABORTED);
|
||||
+ __cfg80211_background_cac_event(rdev, wdev,
|
||||
+ &rdev->background_radar_chandef,
|
||||
+ NL80211_RADAR_CAC_ABORTED);
|
||||
}
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -793,7 +793,7 @@ static const struct nla_policy nl80211_p
|
||||
[NL80211_ATTR_MBSSID_CONFIG] =
|
||||
NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
|
||||
[NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
|
||||
- [NL80211_ATTR_RADAR_OFFCHAN] = { .type = NLA_FLAG },
|
||||
+ [NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -9288,9 +9288,9 @@ static int nl80211_start_radar_detection
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
- if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN])) {
|
||||
- err = cfg80211_start_offchan_radar_detection(rdev, wdev,
|
||||
- &chandef);
|
||||
+ if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_BACKGROUND])) {
|
||||
+ err = cfg80211_start_background_radar_detection(rdev, wdev,
|
||||
+ &chandef);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
--- a/net/wireless/rdev-ops.h
|
||||
+++ b/net/wireless/rdev-ops.h
|
||||
@@ -1382,17 +1382,17 @@ static inline int rdev_color_change(stru
|
||||
}
|
||||
|
||||
static inline int
|
||||
-rdev_set_radar_offchan(struct cfg80211_registered_device *rdev,
|
||||
- struct cfg80211_chan_def *chandef)
|
||||
+rdev_set_radar_background(struct cfg80211_registered_device *rdev,
|
||||
+ struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
struct wiphy *wiphy = &rdev->wiphy;
|
||||
int ret;
|
||||
|
||||
- if (!rdev->ops->set_radar_offchan)
|
||||
+ if (!rdev->ops->set_radar_background)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
- trace_rdev_set_radar_offchan(wiphy, chandef);
|
||||
- ret = rdev->ops->set_radar_offchan(wiphy, chandef);
|
||||
+ trace_rdev_set_radar_background(wiphy, chandef);
|
||||
+ ret = rdev->ops->set_radar_background(wiphy, chandef);
|
||||
trace_rdev_return_int(wiphy, ret);
|
||||
|
||||
return ret;
|
||||
--- a/net/wireless/trace.h
|
||||
+++ b/net/wireless/trace.h
|
||||
@@ -3646,7 +3646,7 @@ TRACE_EVENT(cfg80211_bss_color_notify,
|
||||
__entry->color_bitmap)
|
||||
);
|
||||
|
||||
-TRACE_EVENT(rdev_set_radar_offchan,
|
||||
+TRACE_EVENT(rdev_set_radar_background,
|
||||
TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
|
||||
|
||||
TP_ARGS(wiphy, chandef),
|
||||
@ -5,7 +5,7 @@ and we should ignore this.
|
||||
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -630,21 +630,6 @@ static int wiphy_verify_combinations(str
|
||||
@@ -634,21 +634,6 @@ static int wiphy_verify_combinations(str
|
||||
c->limits[j].max > 1))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -3835,6 +3835,7 @@ struct mgmt_frame_regs {
|
||||
@@ -3869,6 +3869,7 @@ struct mgmt_frame_regs {
|
||||
* (as advertised by the nl80211 feature flag.)
|
||||
* @get_tx_power: store the current TX power into the dbm variable;
|
||||
* return 0 if successful
|
||||
@ -8,7 +8,7 @@
|
||||
*
|
||||
* @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
|
||||
* functions to adjust rfkill hw state
|
||||
@@ -4159,6 +4160,7 @@ struct cfg80211_ops {
|
||||
@@ -4202,6 +4203,7 @@ struct cfg80211_ops {
|
||||
enum nl80211_tx_power_setting type, int mbm);
|
||||
int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
int *dbm);
|
||||
@ -36,9 +36,9 @@
|
||||
u8 ps_dtim_period;
|
||||
--- a/include/uapi/linux/nl80211.h
|
||||
+++ b/include/uapi/linux/nl80211.h
|
||||
@@ -2593,6 +2593,9 @@ enum nl80211_commands {
|
||||
* @NL80211_ATTR_COLOR_CHANGE_ELEMS: Nested set of attributes containing the IE
|
||||
* information for the time while performing a color switch.
|
||||
@@ -2615,6 +2615,9 @@ enum nl80211_commands {
|
||||
* switching on a different channel during CAC detection on the selected
|
||||
* radar channel.
|
||||
*
|
||||
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
|
||||
+ * transmit power to stay within regulatory limits. u32, dBi.
|
||||
@ -46,9 +46,9 @@
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -3096,6 +3099,8 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_COLOR_CHANGE_COLOR,
|
||||
NL80211_ATTR_COLOR_CHANGE_ELEMS,
|
||||
@@ -3123,6 +3126,8 @@ enum nl80211_attrs {
|
||||
|
||||
NL80211_ATTR_RADAR_BACKGROUND,
|
||||
|
||||
+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
|
||||
+
|
||||
@ -77,7 +77,7 @@
|
||||
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
|
||||
{
|
||||
struct ieee80211_local *local = wiphy_priv(wiphy);
|
||||
@@ -4399,6 +4412,7 @@ const struct cfg80211_ops mac80211_confi
|
||||
@@ -4411,6 +4424,7 @@ const struct cfg80211_ops mac80211_confi
|
||||
.set_wiphy_params = ieee80211_set_wiphy_params,
|
||||
.set_tx_power = ieee80211_set_tx_power,
|
||||
.get_tx_power = ieee80211_get_tx_power,
|
||||
@ -129,19 +129,18 @@
|
||||
local->hw.max_mtu = IEEE80211_MAX_DATA_LEN;
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -780,6 +780,7 @@ static const struct nla_policy nl80211_p
|
||||
[NL80211_ATTR_COLOR_CHANGE_COUNT] = { .type = NLA_U8 },
|
||||
[NL80211_ATTR_COLOR_CHANGE_COLOR] = { .type = NLA_U8 },
|
||||
[NL80211_ATTR_COLOR_CHANGE_ELEMS] = NLA_POLICY_NESTED(nl80211_policy),
|
||||
@@ -794,6 +794,7 @@ static const struct nla_policy nl80211_p
|
||||
NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
|
||||
[NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
|
||||
[NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG },
|
||||
+ [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -3328,6 +3329,22 @@ static int nl80211_set_wiphy(struct sk_b
|
||||
if (result)
|
||||
@@ -3375,6 +3376,22 @@ static int nl80211_set_wiphy(struct sk_b
|
||||
goto out;
|
||||
}
|
||||
+
|
||||
|
||||
+ if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_GAIN]) {
|
||||
+ int idx, dbi = 0;
|
||||
+
|
||||
@ -157,6 +156,7 @@
|
||||
+ if (result)
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
+
|
||||
if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) {
|
||||
struct wireless_dev *txp_wdev = wdev;
|
||||
enum nl80211_tx_power_setting type;
|
||||
|
||||
@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-12-03
|
||||
PKG_SOURCE_VERSION:=678071ef70297b7264661c356ddb3c8cf7f3c87b
|
||||
PKG_MIRROR_HASH:=b1f8613f7c65ca6a893f83ed9efc3f7ce72b9b4904fd11b89264f57f4f2a3b5e
|
||||
PKG_SOURCE_DATE:=2022-02-03
|
||||
PKG_SOURCE_VERSION:=ab9b8078427a9a886b11516d5725190f0e7763b0
|
||||
PKG_MIRROR_HASH:=60562cf2ac2e97e654a8202bd6af2c928ca96b129edb168af29f227b6ffbc873
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
@ -221,7 +221,7 @@ endef
|
||||
define KernelPackage/mt7915e
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT7915e wireless driver
|
||||
DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT
|
||||
DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY
|
||||
FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mt7915e)
|
||||
endef
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=om-watchdog
|
||||
PKG_RELEASE:=4
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/om-watchdog
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=om watchdog
|
||||
URL:=http://openwrt.org/
|
||||
endef
|
||||
|
||||
define Package/om-watchdog/description
|
||||
This package contains the hw watchdog script for the OM1P and OM2P device.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/om-watchdog/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/sbin/
|
||||
$(INSTALL_BIN) ./files/om-watchdog.init $(1)/etc/init.d/om-watchdog
|
||||
$(INSTALL_BIN) ./files/om-watchdog $(1)/sbin/om-watchdog
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,om-watchdog))
|
||||
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
GPIO=$1
|
||||
|
||||
trap "" INT HUP
|
||||
|
||||
echo $GPIO > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${GPIO}/direction
|
||||
|
||||
while true; do
|
||||
echo 1 > /sys/class/gpio/gpio${GPIO}/value
|
||||
sleep 1
|
||||
echo 0 > /sys/class/gpio/gpio${GPIO}/value
|
||||
sleep 180
|
||||
done
|
||||
@ -1,36 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2011 OpenWrt.org
|
||||
#
|
||||
|
||||
START=11
|
||||
STOP=11
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=om-watchdog
|
||||
PROG=/sbin/om-watchdog
|
||||
|
||||
get_gpio() {
|
||||
local board=$(board_name)
|
||||
|
||||
if [ "$board" = "teltonika,rut5xx" ]; then
|
||||
# ramips
|
||||
return 11
|
||||
else
|
||||
#we assume it is om1p in this case
|
||||
return 3
|
||||
fi
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
start_service() {
|
||||
get_gpio
|
||||
gpio="$?"
|
||||
[ "$gpio" != "255" ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "${PROG}" "${gpio}"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcap
|
||||
PKG_VERSION:=2.51
|
||||
PKG_VERSION:=2.63
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
|
||||
PKG_HASH:=6609f3ab7aebcc8f9277f53a577c657d9f3056d1352ea623da7fd7c0f00890f9
|
||||
PKG_HASH:=0c637b8f44fc7d8627787e9cf57f15ac06c1ddccb53e41feec5496be3466f77f
|
||||
|
||||
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
@ -74,6 +74,8 @@ MAKE_FLAGS += \
|
||||
DYNAMIC="yes" \
|
||||
lib="lib"
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
|
||||
TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
|
||||
endif
|
||||
|
||||
@ -7,4 +7,4 @@
|
||||
- $(MAKE) -C tests $@
|
||||
$(MAKE) -C progs $@
|
||||
$(MAKE) -C doc $@
|
||||
$(MAKE) -C kdebug $@
|
||||
|
||||
|
||||
@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mbedtls
|
||||
PKG_VERSION:=2.16.11
|
||||
PKG_VERSION:=2.16.12
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=c18e7e9abf95e69e425260493720470021384a1728417042060a35d0b7b18b41
|
||||
PKG_HASH:=294871ab1864a65d0b74325e9219d5bcd6e91c34a3c59270c357bb9ae4d5c393
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=gpl-2.0.txt
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wolfssl
|
||||
PKG_VERSION:=4.8.1-stable
|
||||
PKG_VERSION:=5.1.1-stable
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
|
||||
PKG_HASH:=d3e0544dbe7e9587c0f6538cdc671b6492663bb7a4281819538abe6c99cdbd92
|
||||
|
||||
PKG_FIXUP:=libtool libtool-abiver
|
||||
PKG_INSTALL:=1
|
||||
@ -64,7 +64,6 @@ TARGET_CFLAGS += \
|
||||
-fomit-frame-pointer \
|
||||
-flto \
|
||||
-DFP_MAX_BITS=8192 \
|
||||
-DWOLFSSL_ALT_CERT_CHAINS \
|
||||
$(if $(CONFIG_WOLFSSL_ALT_NAMES),-DWOLFSSL_ALT_NAMES)
|
||||
|
||||
TARGET_LDFLAGS += -flto
|
||||
@ -77,6 +76,7 @@ CONFIGURE_ARGS += \
|
||||
--enable-opensslextra \
|
||||
--enable-sni \
|
||||
--enable-stunnel \
|
||||
--enable-altcertchains \
|
||||
--disable-crypttests \
|
||||
--disable-examples \
|
||||
--disable-jobserver \
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001
|
||||
From: Sean Parkinson <sean@wolfssl.com>
|
||||
Date: Fri, 20 Aug 2021 10:23:38 +1000
|
||||
Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling
|
||||
|
||||
TFM:
|
||||
Use register or memory for c0, c1, c2 in SQRADD and SQRADD2.
|
||||
SP:
|
||||
Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD,
|
||||
SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
|
||||
---
|
||||
wolfcrypt/src/asm.c | 29 ++++++++++++++++++++---------
|
||||
wolfcrypt/src/sp_int.c | 6 +++---
|
||||
2 files changed, 23 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/wolfcrypt/src/asm.c
|
||||
+++ b/wolfcrypt/src/asm.c
|
||||
@@ -698,33 +698,39 @@ __asm__( \
|
||||
|
||||
#define SQRADD(i, j) \
|
||||
__asm__( \
|
||||
- "movl %6,%%eax \n\t" \
|
||||
+ "movl %3,%%eax \n\t" \
|
||||
"mull %%eax \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc");
|
||||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
|
||||
+ : "m"(i) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
__asm__( \
|
||||
- "movl %6,%%eax \n\t" \
|
||||
- "mull %7 \n\t" \
|
||||
+ "movl %3,%%eax \n\t" \
|
||||
+ "mull %4 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc");
|
||||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
|
||||
+ : "m"(i), "m"(j) \
|
||||
+ :"%eax","%edx", "cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
-__asm__( \
|
||||
+__asm__( \
|
||||
"movl %3,%%eax \n\t" \
|
||||
"mull %4 \n\t" \
|
||||
"movl %%eax,%0 \n\t" \
|
||||
"movl %%edx,%1 \n\t" \
|
||||
"xorl %2,%2 \n\t" \
|
||||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
|
||||
+ : "g"(i), "g"(j) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
__asm__( \
|
||||
@@ -733,7 +739,9 @@ __asm__(
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
|
||||
+ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
__asm__( \
|
||||
@@ -743,7 +751,10 @@ __asm__(
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
|
||||
+ :"=r"(c0), "=r"(c1), "=r"(c2) \
|
||||
+ : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), \
|
||||
+ "r"(sc2) \
|
||||
+ : "cc");
|
||||
|
||||
#elif defined(TFM_X86_64)
|
||||
/* x86-64 optimized */
|
||||
--- a/wolfcrypt/src/sp_int.c
|
||||
+++ b/wolfcrypt/src/sp_int.c
|
||||
@@ -476,7 +476,7 @@ static WC_INLINE sp_int_digit sp_div_wor
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "r" (va), [b] "r" (vb) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@@ -502,7 +502,7 @@ static WC_INLINE sp_int_digit sp_div_wor
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "r" (va), [b] "r" (vb) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@@ -541,7 +541,7 @@ static WC_INLINE sp_int_digit sp_div_wor
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "m" (va) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@ -1,22 +0,0 @@
|
||||
From f447e4c1fa4c932c0286fa0331966756e243db81 Mon Sep 17 00:00:00 2001
|
||||
From: JacobBarthelmeh <jacob@wolfssl.com>
|
||||
Date: Fri, 17 Sep 2021 15:06:13 -0700
|
||||
Subject: [PATCH] update macro guard on SHA256 transform call
|
||||
|
||||
---
|
||||
src/ssl.c | 3 ++-
|
||||
tests/api.c | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/ssl.c
|
||||
+++ b/src/ssl.c
|
||||
@@ -17639,7 +17639,8 @@ size_t wolfSSL_get_client_random(const W
|
||||
|
||||
#if defined(OPENSSL_EXTRA)
|
||||
#if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \
|
||||
- (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2)))
|
||||
+ (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2))) && \
|
||||
+ !defined(WOLFSSL_DEVCRYPTO_HASH) && !defined(WOLFSSL_AFALG_HASH)
|
||||
/* Apply SHA256 transformation to the data */
|
||||
int wolfSSL_SHA256_Transform(WOLFSSL_SHA256_CTX* sha256,
|
||||
const unsigned char* data)
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wolfssl/wolfcrypt/settings.h
|
||||
+++ b/wolfssl/wolfcrypt/settings.h
|
||||
@@ -2274,7 +2274,7 @@ extern void uITRON4_free(void *p) ;
|
||||
@@ -2346,7 +2346,7 @@ extern void uITRON4_free(void *p) ;
|
||||
#endif
|
||||
|
||||
/* warning for not using harden build options (default with ./configure) */
|
||||
|
||||
@ -11,7 +11,7 @@ RNG regardless of the built settings for wolfssl.
|
||||
|
||||
--- a/wolfcrypt/src/ecc.c
|
||||
+++ b/wolfcrypt/src/ecc.c
|
||||
@@ -10938,21 +10938,21 @@ void wc_ecc_fp_free(void)
|
||||
@@ -11647,21 +11647,21 @@ void wc_ecc_fp_free(void)
|
||||
|
||||
#endif /* FP_ECC */
|
||||
|
||||
@ -37,7 +37,7 @@ RNG regardless of the built settings for wolfssl.
|
||||
|
||||
--- a/wolfssl/wolfcrypt/ecc.h
|
||||
+++ b/wolfssl/wolfcrypt/ecc.h
|
||||
@@ -616,10 +616,8 @@ WOLFSSL_API
|
||||
@@ -647,10 +647,8 @@ WOLFSSL_API
|
||||
void wc_ecc_fp_free(void);
|
||||
WOLFSSL_LOCAL
|
||||
void wc_ecc_fp_init(void);
|
||||
|
||||
@ -9,9 +9,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git
|
||||
PKG_SOURCE_DATE:=2022-01-09
|
||||
PKG_SOURCE_VERSION:=07579df54f38d75afea44b2a3b41a6d9af9497a1
|
||||
PKG_MIRROR_HASH:=3326e5e9fd53fe9f679b62cdada83aea4951aefe95ed6d2b5eca5a4695add45c
|
||||
PKG_SOURCE_DATE:=2022-02-07.1
|
||||
PKG_SOURCE_VERSION:=a0518b6d0273ad3267e65953e52989a1589fefab
|
||||
PKG_MIRROR_HASH:=feebf9cbcdf6e5f702edea711c8b36dbaa7609c32e4fe5a2abbf1aa288dc7c6a
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
@ -26,6 +26,7 @@ define Package/firewall4
|
||||
+kmod-nft-nat +kmod-nft-nat6 \
|
||||
+nftables-json \
|
||||
+ucode +ucode-mod-fs +ucode-mod-ubus +ucode-mod-uci
|
||||
EXTRA_DEPENDS:=ucode (>= 2022-01-26)
|
||||
PROVIDES:=uci-firewall
|
||||
endef
|
||||
|
||||
|
||||
@ -5,9 +5,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
|
||||
PKG_SOURCE_DATE:=2022-01-22
|
||||
PKG_SOURCE_VERSION:=ed7187684685430ee6de49e551775badbee39761
|
||||
PKG_MIRROR_HASH:=f26e968c79e61b1a4495b29f51e4adfb2238ede16c0d7349cce38ac009b72969
|
||||
PKG_SOURCE_DATE:=2022-02-04
|
||||
PKG_SOURCE_VERSION:=fd4c9e17c8f22b866c1bf386c580074e3e678910
|
||||
PKG_MIRROR_HASH:=ffd3eed50fb8eb354258922053cd098ead6f739c9fda67f8058a6ec9bd0167c4
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@ -9,9 +9,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-05-22
|
||||
PKG_SOURCE_VERSION:=b102f19bcc53c7f7db3951424d4d46709b4f1986
|
||||
PKG_MIRROR_HASH:=cb3cb968883042fc582752be1607586696c18e6ecf9808c9a8ac50e204584367
|
||||
PKG_SOURCE_DATE:=2022-01-16
|
||||
PKG_SOURCE_VERSION:=cff80b4f7d3c0a47c052e8187d671710f48939e4
|
||||
PKG_MIRROR_HASH:=712965bfa11a2e601d3e1c9a51a2cf3cffc6db89abafb3df3eb0cfd83c64705b
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@ -16,7 +16,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point *
|
||||
@@ -1307,6 +1307,7 @@ int ecc_projective_add_point(ecc_point *
|
||||
|
||||
struct crypto_ec {
|
||||
ecc_key key;
|
||||
@ -24,7 +24,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
mp_int a;
|
||||
mp_int prime;
|
||||
mp_int order;
|
||||
@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int gr
|
||||
@@ -1361,6 +1362,8 @@ struct crypto_ec * crypto_ec_init(int gr
|
||||
return NULL;
|
||||
|
||||
if (wc_ecc_init(&e->key) != 0 ||
|
||||
@ -33,7 +33,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
wc_ecc_set_curve(&e->key, 0, curve_id) != 0 ||
|
||||
mp_init(&e->a) != MP_OKAY ||
|
||||
mp_init(&e->prime) != MP_OKAY ||
|
||||
@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec*
|
||||
@@ -1392,6 +1395,7 @@ void crypto_ec_deinit(struct crypto_ec*
|
||||
mp_clear(&e->order);
|
||||
mp_clear(&e->prime);
|
||||
mp_clear(&e->a);
|
||||
|
||||
@ -14,16 +14,37 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2395,6 +2395,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2409,7 +2409,7 @@ static int drv_supports_vht(struct wpa_s
|
||||
}
|
||||
|
||||
|
||||
-static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
|
||||
+static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode, bool dfs_enabled)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2418,7 +2418,10 @@ static bool ibss_mesh_is_80mhz_avail(int
|
||||
|
||||
chan = hw_get_channel_chan(mode, i, NULL);
|
||||
if (!chan ||
|
||||
- chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
+ return false;
|
||||
+
|
||||
+ if (!dfs_enabled && chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2447,6 +2450,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int chwidth, seg0, seg1;
|
||||
u32 vht_caps = 0;
|
||||
int is_24ghz;
|
||||
+ int dfs_enabled = wpa_s->conf->country[0] &&
|
||||
bool is_24ghz, is_6ghz;
|
||||
+ bool dfs_enabled = wpa_s->conf->country[0] &&
|
||||
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
||||
|
||||
freq->freq = ssid->frequency;
|
||||
|
||||
@@ -2484,8 +2486,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2543,8 +2548,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check primary channel flags */
|
||||
@ -36,7 +57,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
freq->channel = pri_chan->chan;
|
||||
|
||||
@@ -2518,8 +2523,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2577,8 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check secondary channel flags */
|
||||
@ -49,20 +70,25 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
if (ht40 == -1) {
|
||||
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
||||
@@ -2612,8 +2620,11 @@ skip_ht40:
|
||||
@@ -2667,7 +2678,7 @@ skip_to_6ghz:
|
||||
return;
|
||||
|
||||
/* Back to HT configuration if channel not usable */
|
||||
- if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
- if (!ibss_mesh_is_80mhz_avail(channel, mode))
|
||||
+ if (!ibss_mesh_is_80mhz_avail(channel, mode, dfs_enabled))
|
||||
return;
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
}
|
||||
|
||||
chwidth = CHANWIDTH_80MHZ;
|
||||
@@ -2633,10 +2644,12 @@ skip_ht40:
|
||||
@@ -2681,7 +2692,7 @@ skip_to_6ghz:
|
||||
* above; check the remaining four 20 MHz channels for the total
|
||||
* of 160 MHz bandwidth.
|
||||
*/
|
||||
- if (!ibss_mesh_is_80mhz_avail(channel + 16, mode))
|
||||
+ if (!ibss_mesh_is_80mhz_avail(channel + 16, mode, dfs_enabled))
|
||||
return;
|
||||
|
||||
for (j = 0; j < ARRAY_SIZE(bw160); j++) {
|
||||
@@ -2711,10 +2722,12 @@ skip_to_6ghz:
|
||||
if (!chan)
|
||||
continue;
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
|
||||
|
||||
static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)
|
||||
@@ -480,9 +481,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
@@ -483,9 +484,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
int num_available_chandefs;
|
||||
int chan_idx, chan_idx2;
|
||||
int sec_chan_idx_80p80 = -1;
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
||||
*secondary_channel = 0;
|
||||
*oper_centr_freq_seg0_idx = 0;
|
||||
@@ -502,8 +508,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
@@ -505,8 +511,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
if (num_available_chandefs == 0)
|
||||
return NULL;
|
||||
|
||||
@ -68,7 +68,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
if (!chan) {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -9872,6 +9872,10 @@ static int nl80211_switch_channel(void *
|
||||
@@ -9895,6 +9895,10 @@ static int nl80211_switch_channel(void *
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
|
||||
@ -1,219 +0,0 @@
|
||||
From 90fe6429624fc48bc0e5d2d7eeecb7498708b5e3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 18 Apr 2018 19:24:31 +0200
|
||||
Subject: [PATCH 18/18] mesh: make forwarding configurable
|
||||
|
||||
Allow mesh_fwding to be specified in a mesh bss config, pass that
|
||||
to the driver (only nl80211 implemented for now) and announce
|
||||
forwarding capability accordingly.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
src/ap/ap_config.h | 2 ++
|
||||
src/drivers/driver.h | 2 ++
|
||||
src/drivers/driver_nl80211.c | 3 +++
|
||||
wpa_supplicant/config.c | 4 ++++
|
||||
wpa_supplicant/config.h | 9 +++++++++
|
||||
wpa_supplicant/config_file.c | 4 ++++
|
||||
wpa_supplicant/config_ssid.h | 5 +++++
|
||||
wpa_supplicant/mesh.c | 6 ++++++
|
||||
wpa_supplicant/mesh_mpm.c | 4 ++--
|
||||
wpa_supplicant/wpa_supplicant.conf | 3 +++
|
||||
10 files changed, 40 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -51,6 +51,7 @@ struct mesh_conf {
|
||||
int dot11MeshRetryTimeout; /* msec */
|
||||
int dot11MeshConfirmTimeout; /* msec */
|
||||
int dot11MeshHoldingTimeout; /* msec */
|
||||
+ int mesh_fwding;
|
||||
};
|
||||
|
||||
#define MAX_STA_COUNT 2007
|
||||
@@ -696,6 +697,7 @@ struct hostapd_bss_config {
|
||||
|
||||
#define MESH_ENABLED BIT(0)
|
||||
int mesh;
|
||||
+ int mesh_fwding;
|
||||
|
||||
u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1584,6 +1584,7 @@ struct wpa_driver_mesh_bss_params {
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
|
||||
+#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
|
||||
/*
|
||||
* TODO: Other mesh configuration parameters would go here.
|
||||
* See NL80211_MESHCONF_* for all the mesh config parameters.
|
||||
@@ -1593,6 +1594,7 @@ struct wpa_driver_mesh_bss_params {
|
||||
int peer_link_timeout;
|
||||
int max_peer_links;
|
||||
int rssi_threshold;
|
||||
+ int forwarding;
|
||||
u16 ht_opmode;
|
||||
};
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -10456,6 +10456,9 @@ static int nl80211_put_mesh_config(struc
|
||||
if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
|
||||
nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
|
||||
params->auto_plinks)) ||
|
||||
+ ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_FORWARDING) &&
|
||||
+ nla_put_u8(msg, NL80211_MESHCONF_FORWARDING,
|
||||
+ params->forwarding)) ||
|
||||
((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) &&
|
||||
nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
|
||||
params->max_peer_links)) ||
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -2527,6 +2527,7 @@ static const struct parse_data ssid_fiel
|
||||
#ifdef CONFIG_MESH
|
||||
{ INT_RANGE(mode, 0, 5) },
|
||||
{ INT_RANGE(no_auto_peer, 0, 1) },
|
||||
+ { INT_RANGE(mesh_fwding, 0, 1) },
|
||||
{ INT_RANGE(mesh_rssi_threshold, -255, 1) },
|
||||
#else /* CONFIG_MESH */
|
||||
{ INT_RANGE(mode, 0, 4) },
|
||||
@@ -3106,6 +3107,7 @@ void wpa_config_set_network_defaults(str
|
||||
ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT;
|
||||
ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT;
|
||||
ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT;
|
||||
+ ssid->mesh_fwding = DEFAULT_MESH_FWDING;
|
||||
ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD;
|
||||
#endif /* CONFIG_MESH */
|
||||
#ifdef CONFIG_HT_OVERRIDES
|
||||
@@ -4347,6 +4349,7 @@ struct wpa_config * wpa_config_alloc_emp
|
||||
config->user_mpm = DEFAULT_USER_MPM;
|
||||
config->max_peer_links = DEFAULT_MAX_PEER_LINKS;
|
||||
config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY;
|
||||
+ config->mesh_fwding = DEFAULT_MESH_FWDING;
|
||||
config->dot11RSNASAERetransPeriod =
|
||||
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD;
|
||||
config->fast_reauth = DEFAULT_FAST_REAUTH;
|
||||
@@ -5047,6 +5050,7 @@ static const struct global_parse_data gl
|
||||
{ INT(user_mpm), 0 },
|
||||
{ INT_RANGE(max_peer_links, 0, 255), 0 },
|
||||
{ INT(mesh_max_inactivity), 0 },
|
||||
+ { INT_RANGE(mesh_fwding, 0, 1), 0 },
|
||||
{ INT(dot11RSNASAERetransPeriod), 0 },
|
||||
#endif /* CONFIG_MESH */
|
||||
{ INT(disable_scan_offload), 0 },
|
||||
--- a/wpa_supplicant/config.h
|
||||
+++ b/wpa_supplicant/config.h
|
||||
@@ -18,6 +18,7 @@
|
||||
#define DEFAULT_USER_MPM 1
|
||||
#define DEFAULT_MAX_PEER_LINKS 99
|
||||
#define DEFAULT_MESH_MAX_INACTIVITY 300
|
||||
+#define DEFAULT_MESH_FWDING 1
|
||||
/*
|
||||
* The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard,
|
||||
* but use 1000 ms in practice to avoid issues on low power CPUs.
|
||||
@@ -1378,6 +1379,14 @@ struct wpa_config {
|
||||
int mesh_max_inactivity;
|
||||
|
||||
/**
|
||||
+ * mesh_fwding - Mesh network layer-2 forwarding
|
||||
+ *
|
||||
+ * This controls whether to enable layer-2 forwarding.
|
||||
+ * By default: 1: enabled
|
||||
+ */
|
||||
+ int mesh_fwding;
|
||||
+
|
||||
+ /**
|
||||
* dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame
|
||||
*
|
||||
* This timeout value is used in mesh STA to retransmit
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
+ INT(mesh_fwding);
|
||||
INT(frequency);
|
||||
INT(enable_edmg);
|
||||
INT(edmg_channel);
|
||||
@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE
|
||||
fprintf(f, "mesh_max_inactivity=%d\n",
|
||||
config->mesh_max_inactivity);
|
||||
|
||||
+ if (config->mesh_fwding != DEFAULT_MESH_FWDING)
|
||||
+ fprintf(f, "mesh_fwding=%d\n", config->mesh_fwding);
|
||||
+
|
||||
if (config->dot11RSNASAERetransPeriod !=
|
||||
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD)
|
||||
fprintf(f, "dot11RSNASAERetransPeriod=%d\n",
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -546,6 +546,11 @@ struct wpa_ssid {
|
||||
int dot11MeshConfirmTimeout; /* msec */
|
||||
int dot11MeshHoldingTimeout; /* msec */
|
||||
|
||||
+ /**
|
||||
+ * Mesh network layer-2 forwarding
|
||||
+ */
|
||||
+ int mesh_fwding;
|
||||
+
|
||||
int ht;
|
||||
int ht40;
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -140,6 +140,7 @@ static struct mesh_conf * mesh_config_cr
|
||||
conf->mesh_cc_id = 0;
|
||||
conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET;
|
||||
conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0;
|
||||
+ conf->mesh_fwding = ssid->mesh_fwding;
|
||||
conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries;
|
||||
conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout;
|
||||
conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout;
|
||||
@@ -441,6 +442,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
bss->conf->start_disabled = 1;
|
||||
bss->conf->mesh = MESH_ENABLED;
|
||||
bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity;
|
||||
+ bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding;
|
||||
|
||||
if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
|
||||
wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
|
||||
@@ -655,6 +657,10 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
}
|
||||
params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
|
||||
|
||||
+ /* always explicitely set forwarding to on or off for now */
|
||||
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_FORWARDING;
|
||||
+ params->conf.forwarding = ssid->mesh_fwding;
|
||||
+
|
||||
os_free(wpa_s->mesh_params);
|
||||
wpa_s->mesh_params = params;
|
||||
if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) {
|
||||
--- a/wpa_supplicant/mesh_mpm.c
|
||||
+++ b/wpa_supplicant/mesh_mpm.c
|
||||
@@ -303,9 +303,9 @@ static void mesh_mpm_send_plink_action(s
|
||||
info = (bss->num_plinks > 63 ? 63 : bss->num_plinks) << 1;
|
||||
/* TODO: Add Connected to Mesh Gate/AS subfields */
|
||||
wpabuf_put_u8(buf, info);
|
||||
- /* always forwarding & accepting plinks for now */
|
||||
+ /* set forwarding & always accepting plinks for now */
|
||||
wpabuf_put_u8(buf, MESH_CAP_ACCEPT_ADDITIONAL_PEER |
|
||||
- MESH_CAP_FORWARDING);
|
||||
+ (conf->mesh_fwding ? MESH_CAP_FORWARDING : 0));
|
||||
} else { /* Peer closing frame */
|
||||
/* IE: Mesh ID */
|
||||
wpabuf_put_u8(buf, WLAN_EID_MESH_ID);
|
||||
--- a/wpa_supplicant/wpa_supplicant.conf
|
||||
+++ b/wpa_supplicant/wpa_supplicant.conf
|
||||
@@ -150,6 +150,9 @@ ap_scan=1
|
||||
# This timeout value is used in mesh STA to clean up inactive stations.
|
||||
#mesh_max_inactivity=300
|
||||
|
||||
+# Enable 802.11s layer-2 routing and forwarding
|
||||
+#mesh_fwding=1
|
||||
+
|
||||
# cert_in_cb - Whether to include a peer certificate dump in events
|
||||
# This controls whether peer certificates for authentication server and
|
||||
# its certificate chain are included in EAP peer certificate events. This is
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -4942,6 +4942,13 @@ static int add_associated_sta(struct hos
|
||||
@@ -4944,6 +4944,13 @@ static int add_associated_sta(struct hos
|
||||
* drivers to accept the STA parameter configuration. Since this is
|
||||
* after a new FT-over-DS exchange, a new TK has been derived, so key
|
||||
* reinstallation is not a concern for this case.
|
||||
@ -14,7 +14,7 @@
|
||||
*/
|
||||
wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR
|
||||
" (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)",
|
||||
@@ -4955,7 +4962,8 @@ static int add_associated_sta(struct hos
|
||||
@@ -4957,7 +4964,8 @@ static int add_associated_sta(struct hos
|
||||
(!(sta->flags & WLAN_STA_AUTHORIZED) ||
|
||||
(reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
|
||||
(!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
|
||||
|
||||
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <netpacket/packet.h>
|
||||
#include <linux/errqueue.h>
|
||||
@@ -5284,26 +5281,29 @@ fail:
|
||||
@@ -5300,26 +5297,29 @@ fail:
|
||||
|
||||
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
|
||||
{
|
||||
@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (err < 0) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
|
||||
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
|
||||
@@ -5313,9 +5313,8 @@ static void rtnl_neigh_delete_fdb_entry(
|
||||
@@ -5329,9 +5329,8 @@ static void rtnl_neigh_delete_fdb_entry(
|
||||
MACSTR, MAC2STR(addr));
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
|
||||
@@ -7691,7 +7690,6 @@ static void *i802_init(struct hostapd_da
|
||||
@@ -7714,7 +7713,6 @@ static void *i802_init(struct hostapd_da
|
||||
(params->num_bridge == 0 || !params->bridge[0]))
|
||||
add_ifidx(drv, br_ifindex, drv->ifindex);
|
||||
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (bss->added_if_into_bridge || bss->already_in_bridge) {
|
||||
int err;
|
||||
|
||||
@@ -7708,7 +7706,6 @@ static void *i802_init(struct hostapd_da
|
||||
@@ -7731,7 +7729,6 @@ static void *i802_init(struct hostapd_da
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -10655,13 +10652,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
@@ -10678,13 +10675,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
const u8 *ipaddr, int prefixlen,
|
||||
const u8 *addr)
|
||||
{
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
int res;
|
||||
|
||||
if (!ipaddr || prefixlen == 0 || !addr)
|
||||
@@ -10680,85 +10678,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
@@ -10703,85 +10701,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
}
|
||||
|
||||
if (version == 4) {
|
||||
@ -220,7 +220,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
@@ -10776,41 +10755,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
@@ -10799,41 +10778,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
CFLAGS += -DCONFIG_FILS_SK_PFS
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -309,6 +309,7 @@ endif
|
||||
@@ -312,6 +312,7 @@ endif
|
||||
ifdef CONFIG_FILS
|
||||
CFLAGS += -DCONFIG_FILS
|
||||
NEED_SHA384=y
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
LIBS += $(DRV_AP_LIBS)
|
||||
|
||||
ifdef CONFIG_L2_PACKET
|
||||
@@ -1278,6 +1284,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
|
||||
@@ -1281,6 +1287,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
|
||||
_OBJS_VAR := OBJS
|
||||
include ../src/objs.mk
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
hostapd: $(OBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
@@ -1352,6 +1364,12 @@ include ../src/objs.mk
|
||||
@@ -1355,6 +1367,12 @@ include ../src/objs.mk
|
||||
_OBJS_VAR := SOBJS
|
||||
include ../src/objs.mk
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
include ../src/build.rules
|
||||
|
||||
ifdef LIBS
|
||||
@@ -360,7 +361,9 @@ endif
|
||||
@@ -363,7 +364,9 @@ endif
|
||||
ifdef CONFIG_IBSS_RSN
|
||||
NEED_RSN_AUTHENTICATOR=y
|
||||
CFLAGS += -DCONFIG_IBSS_RSN
|
||||
@ -82,7 +82,7 @@
|
||||
OBJS += ibss_rsn.o
|
||||
endif
|
||||
|
||||
@@ -898,6 +901,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
|
||||
@@ -900,6 +903,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
|
||||
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
|
||||
LIBS += -ldl -rdynamic
|
||||
endif
|
||||
@ -93,7 +93,7 @@
|
||||
endif
|
||||
|
||||
ifdef CONFIG_AP
|
||||
@@ -905,9 +912,11 @@ NEED_EAP_COMMON=y
|
||||
@@ -907,9 +914,11 @@ NEED_EAP_COMMON=y
|
||||
NEED_RSN_AUTHENTICATOR=y
|
||||
CFLAGS += -DCONFIG_AP
|
||||
OBJS += ap.o
|
||||
@ -105,7 +105,7 @@
|
||||
OBJS += ../src/ap/hostapd.o
|
||||
OBJS += ../src/ap/wpa_auth_glue.o
|
||||
OBJS += ../src/ap/utils.o
|
||||
@@ -987,6 +996,12 @@ endif
|
||||
@@ -989,6 +998,12 @@ endif
|
||||
ifdef CONFIG_HS20
|
||||
OBJS += ../src/ap/hs20.o
|
||||
endif
|
||||
@ -118,7 +118,7 @@
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MBO
|
||||
@@ -995,7 +1010,9 @@ CFLAGS += -DCONFIG_MBO
|
||||
@@ -997,7 +1012,9 @@ CFLAGS += -DCONFIG_MBO
|
||||
endif
|
||||
|
||||
ifdef NEED_RSN_AUTHENTICATOR
|
||||
@ -128,7 +128,7 @@
|
||||
NEED_AES_WRAP=y
|
||||
OBJS += ../src/ap/wpa_auth.o
|
||||
OBJS += ../src/ap/wpa_auth_ie.o
|
||||
@@ -1890,6 +1907,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
|
||||
@@ -1891,6 +1908,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
|
||||
|
||||
_OBJS_VAR := OBJS
|
||||
include ../src/objs.mk
|
||||
@ -141,7 +141,7 @@
|
||||
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
|
||||
@$(E) " LD " $@
|
||||
@@ -2022,6 +2045,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
|
||||
@@ -2023,6 +2046,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
|
||||
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
|
||||
@$(E) " sed" $<
|
||||
|
||||
@ -156,7 +156,7 @@
|
||||
wpa_cli.exe: wpa_cli
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -6025,8 +6025,8 @@ union wpa_event_data {
|
||||
@@ -6033,8 +6033,8 @@ union wpa_event_data {
|
||||
* Driver wrapper code should call this function whenever an event is received
|
||||
* from the driver.
|
||||
*/
|
||||
@ -167,7 +167,7 @@
|
||||
|
||||
/**
|
||||
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
|
||||
@@ -6038,7 +6038,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -6046,7 +6046,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
* Same as wpa_supplicant_event(), but we search for the interface in
|
||||
* wpa_global.
|
||||
*/
|
||||
@ -178,7 +178,7 @@
|
||||
/*
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -1836,8 +1836,8 @@ err:
|
||||
@@ -1842,8 +1842,8 @@ err:
|
||||
#endif /* CONFIG_OWE */
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@
|
||||
{
|
||||
struct hostapd_data *hapd = ctx;
|
||||
#ifndef CONFIG_NO_STDOUT_DEBUG
|
||||
@@ -2082,7 +2082,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -2088,7 +2088,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
@ -231,7 +231,7 @@
|
||||
os_memset(&global, 0, sizeof(global));
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4665,8 +4665,8 @@ static void wpas_event_unprot_beacon(str
|
||||
@@ -4891,8 +4891,8 @@ static void wpas_event_unprot_beacon(str
|
||||
}
|
||||
|
||||
|
||||
@ -242,7 +242,7 @@
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = ctx;
|
||||
int resched;
|
||||
@@ -5511,7 +5511,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -5745,7 +5745,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@
|
||||
struct wpa_supplicant *wpa_s;
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -6819,7 +6819,6 @@ struct wpa_interface * wpa_supplicant_ma
|
||||
@@ -7043,7 +7043,6 @@ struct wpa_interface * wpa_supplicant_ma
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@
|
||||
/**
|
||||
* wpa_supplicant_match_existing - Match existing interfaces
|
||||
* @global: Pointer to global data from wpa_supplicant_init()
|
||||
@@ -6854,6 +6853,11 @@ static int wpa_supplicant_match_existing
|
||||
@@ -7078,6 +7077,11 @@ static int wpa_supplicant_match_existing
|
||||
|
||||
#endif /* CONFIG_MATCH_IFACE */
|
||||
|
||||
@ -273,7 +273,7 @@
|
||||
|
||||
/**
|
||||
* wpa_supplicant_add_iface - Add a new network interface
|
||||
@@ -7110,6 +7114,8 @@ struct wpa_global * wpa_supplicant_init(
|
||||
@@ -7334,6 +7338,8 @@ struct wpa_global * wpa_supplicant_init(
|
||||
#ifndef CONFIG_NO_WPA_MSG
|
||||
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
|
||||
#endif /* CONFIG_NO_WPA_MSG */
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3459,6 +3459,10 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3474,6 +3474,10 @@ static int hostapd_config_fill(struct ho
|
||||
if (bss->ocv && !bss->ieee80211w)
|
||||
bss->ieee80211w = 1;
|
||||
#endif /* CONFIG_OCV */
|
||||
@ -13,7 +13,7 @@
|
||||
} else if (os_strcmp(buf, "ht_capab") == 0) {
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -1009,6 +1009,8 @@ struct hostapd_config {
|
||||
@@ -1014,6 +1014,8 @@ struct hostapd_config {
|
||||
|
||||
int ht_op_mode_fixed;
|
||||
u16 ht_capab;
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
{ STR(id_str) },
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL
|
||||
@@ -769,6 +769,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
@ -20,7 +20,7 @@
|
||||
INT(enable_edmg);
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
@@ -505,6 +505,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
frequency);
|
||||
goto out_free;
|
||||
}
|
||||
@ -31,14 +31,17 @@
|
||||
/*
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2384,12 +2384,12 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2436,7 +2436,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
|
||||
enum hostapd_hw_mode hw_mode;
|
||||
struct hostapd_hw_modes *mode = NULL;
|
||||
- int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
|
||||
+ int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
|
||||
184, 192 };
|
||||
int vht80[] = { 36, 52, 100, 116, 132, 149 };
|
||||
int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
|
||||
6035, 6115, 6195, 6275, 6355, 6435, 6515,
|
||||
@@ -2444,7 +2444,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 };
|
||||
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
|
||||
u8 channel;
|
||||
- int i, chan_idx, ht40 = -1, res, obss_scan = 1;
|
||||
@ -46,7 +49,7 @@
|
||||
unsigned int j, k;
|
||||
struct hostapd_freq_params vht_freq;
|
||||
int chwidth, seg0, seg1;
|
||||
@@ -2473,7 +2473,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2535,7 +2535,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
#endif /* CONFIG_HE_OVERRIDES */
|
||||
|
||||
/* Setup higher BW only for 5 GHz */
|
||||
@ -57,7 +60,7 @@
|
||||
for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -971,6 +971,8 @@ struct wpa_ssid {
|
||||
@@ -974,6 +974,8 @@ struct wpa_ssid {
|
||||
*/
|
||||
int no_auto_peer;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -5154,7 +5154,7 @@ wpa_supplicant_alloc(struct wpa_supplica
|
||||
@@ -5377,7 +5377,7 @@ wpa_supplicant_alloc(struct wpa_supplica
|
||||
if (wpa_s == NULL)
|
||||
return NULL;
|
||||
wpa_s->scan_req = INITIAL_SCAN_REQ;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4970,7 +4970,7 @@ static int nl80211_set_channel(struct i8
|
||||
@@ -4986,7 +4986,7 @@ static int nl80211_set_channel(struct i8
|
||||
freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled,
|
||||
freq->bandwidth, freq->center_freq1, freq->center_freq2);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic
|
||||
@@ -1611,15 +1611,35 @@ int ap_switch_channel(struct wpa_supplic
|
||||
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -2915,10 +2915,15 @@ static int wpa_driver_nl80211_del_beacon
|
||||
@@ -2931,10 +2931,15 @@ static int wpa_driver_nl80211_del_beacon
|
||||
struct nl_msg *msg;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -5601,7 +5606,7 @@ static void nl80211_teardown_ap(struct i
|
||||
@@ -5617,7 +5622,7 @@ static void nl80211_teardown_ap(struct i
|
||||
nl80211_mgmt_unsubscribe(bss, "AP teardown");
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -8048,8 +8053,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
@@ -8071,8 +8076,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
|
||||
nl80211_teardown_ap(bss);
|
||||
@ -36,7 +36,7 @@
|
||||
nl80211_destroy_bss(bss);
|
||||
if (!bss->added_if)
|
||||
i802_set_iface_flags(bss, 0);
|
||||
@@ -8446,7 +8449,6 @@ static int wpa_driver_nl80211_deinit_ap(
|
||||
@@ -8469,7 +8472,6 @@ static int wpa_driver_nl80211_deinit_ap(
|
||||
if (!is_ap_interface(drv->nlmode))
|
||||
return -1;
|
||||
wpa_driver_nl80211_del_beacon(bss);
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
/*
|
||||
* If the P2P GO interface was dynamically added, then it is
|
||||
@@ -8466,7 +8468,6 @@ static int wpa_driver_nl80211_stop_ap(vo
|
||||
@@ -8489,7 +8491,6 @@ static int wpa_driver_nl80211_stop_ap(vo
|
||||
if (!is_ap_interface(drv->nlmode))
|
||||
return -1;
|
||||
wpa_driver_nl80211_del_beacon(bss);
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
#ifdef NEED_AP_MLME
|
||||
static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd,
|
||||
@@ -3754,6 +3811,8 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
@@ -3771,6 +3828,8 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
|
||||
reply_size);
|
||||
@ -89,7 +89,7 @@
|
||||
#ifdef RADIUS_SERVER
|
||||
--- a/src/ap/ctrl_iface_ap.c
|
||||
+++ b/src/ap/ctrl_iface_ap.c
|
||||
@@ -919,7 +919,13 @@ int hostapd_parse_csa_settings(const cha
|
||||
@@ -927,7 +927,13 @@ int hostapd_parse_csa_settings(const cha
|
||||
|
||||
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
|
||||
{
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
/* Configure default/group WEP keys for static WEP */
|
||||
@@ -1007,6 +1055,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
@@ -1015,6 +1063,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
|
||||
sme_sched_obss_scan(wpa_s, 1);
|
||||
|
||||
@ -163,7 +163,7 @@
|
||||
#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
|
||||
if (!fils_hlp_sent && ssid && ssid->eap.erp)
|
||||
update_fils_connect_params = true;
|
||||
@@ -1017,6 +1067,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
@@ -1025,6 +1075,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
#endif /* CONFIG_OWE */
|
||||
} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
|
||||
state == WPA_ASSOCIATED) {
|
||||
@ -172,7 +172,7 @@
|
||||
wpa_s->new_connection = 1;
|
||||
wpa_drv_set_operstate(wpa_s, 0);
|
||||
#ifndef IEEE8021X_EAPOL
|
||||
@@ -2276,6 +2328,8 @@ void wpa_supplicant_associate(struct wpa
|
||||
@@ -2308,6 +2360,8 @@ void wpa_supplicant_associate(struct wpa
|
||||
return;
|
||||
}
|
||||
wpa_s->current_bss = bss;
|
||||
@ -181,7 +181,7 @@
|
||||
#else /* CONFIG_MESH */
|
||||
wpa_msg(wpa_s, MSG_ERROR,
|
||||
"mesh mode support not included in the build");
|
||||
@@ -6426,6 +6480,16 @@ static int wpa_supplicant_init_iface(str
|
||||
@@ -6650,6 +6704,16 @@ static int wpa_supplicant_init_iface(str
|
||||
sizeof(wpa_s->bridge_ifname));
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@
|
||||
/* RSNA Supplicant Key Management - INITIALIZE */
|
||||
eapol_sm_notify_portEnabled(wpa_s->eapol, false);
|
||||
eapol_sm_notify_portValid(wpa_s->eapol, false);
|
||||
@@ -6763,6 +6827,11 @@ static void wpa_supplicant_deinit_iface(
|
||||
@@ -6987,6 +7051,11 @@ static void wpa_supplicant_deinit_iface(
|
||||
if (terminate)
|
||||
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
|
||||
|
||||
@ -212,7 +212,7 @@
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant_i.h
|
||||
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
||||
@@ -103,6 +103,11 @@ struct wpa_interface {
|
||||
@@ -104,6 +104,11 @@ struct wpa_interface {
|
||||
const char *ifname;
|
||||
|
||||
/**
|
||||
@ -224,7 +224,7 @@
|
||||
* bridge_ifname - Optional bridge interface name
|
||||
*
|
||||
* If the driver interface (ifname) is included in a Linux bridge
|
||||
@@ -615,6 +620,8 @@ struct wpa_supplicant {
|
||||
@@ -718,6 +723,8 @@ struct wpa_supplicant {
|
||||
#endif /* CONFIG_CTRL_IFACE_BINDER */
|
||||
char bridge_ifname[16];
|
||||
|
||||
@ -235,7 +235,7 @@
|
||||
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -2883,6 +2883,12 @@ static int hostapd_ctrl_iface_chan_switc
|
||||
@@ -2889,6 +2889,12 @@ static int hostapd_ctrl_iface_chan_switc
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@
|
||||
/* Save CHAN_SWITCH VHT and HE config */
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -1758,11 +1758,6 @@ int ieee802_11_set_beacon(struct hostapd
|
||||
@@ -1791,11 +1791,6 @@ static int __ieee802_11_set_beacon(struc
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@
|
||||
if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4665,6 +4665,60 @@ static void wpas_event_unprot_beacon(str
|
||||
@@ -4891,6 +4891,60 @@ static void wpas_event_unprot_beacon(str
|
||||
}
|
||||
|
||||
|
||||
@ -325,7 +325,7 @@
|
||||
void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
@@ -4980,8 +5034,10 @@ void supplicant_event(void *ctx, enum wp
|
||||
@@ -5206,8 +5260,10 @@ void supplicant_event(void *ctx, enum wp
|
||||
channel_width_to_string(data->ch_switch.ch_width),
|
||||
data->ch_switch.cf1,
|
||||
data->ch_switch.cf2);
|
||||
@ -339,7 +339,7 @@
|
||||
wpa_s->current_ssid->frequency = data->ch_switch.freq;
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -5829,6 +5829,7 @@ union wpa_event_data {
|
||||
@@ -5837,6 +5837,7 @@ union wpa_event_data {
|
||||
|
||||
/**
|
||||
* struct ch_switch
|
||||
@ -347,7 +347,7 @@
|
||||
* @freq: Frequency of new channel in MHz
|
||||
* @ht_enabled: Whether this is an HT channel
|
||||
* @ch_offset: Secondary channel offset
|
||||
@@ -5837,6 +5838,7 @@ union wpa_event_data {
|
||||
@@ -5845,6 +5846,7 @@ union wpa_event_data {
|
||||
* @cf2: Center frequency 2
|
||||
*/
|
||||
struct ch_switch {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
else
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -3570,6 +3570,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
@@ -3587,6 +3587,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
reply_size);
|
||||
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
|
||||
reply_len = hostapd_drv_status(hapd, reply, reply_size);
|
||||
@ -20,7 +20,7 @@
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -3611,6 +3612,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
@@ -3628,6 +3629,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
|
||||
reply_size);
|
||||
@ -30,7 +30,7 @@
|
||||
reply_len = -1;
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -956,6 +956,9 @@ ifdef CONFIG_FILS
|
||||
@@ -958,6 +958,9 @@ ifdef CONFIG_FILS
|
||||
OBJS += ../src/ap/fils_hlp.o
|
||||
endif
|
||||
ifdef CONFIG_CTRL_IFACE
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
--- a/wpa_supplicant/ctrl_iface.c
|
||||
+++ b/wpa_supplicant/ctrl_iface.c
|
||||
@@ -2308,7 +2308,7 @@ static int wpa_supplicant_ctrl_iface_sta
|
||||
@@ -2314,7 +2314,7 @@ static int wpa_supplicant_ctrl_iface_sta
|
||||
pos += ret;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
if (wpa_s->ap_iface) {
|
||||
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
|
||||
end - pos,
|
||||
@@ -10919,6 +10919,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -11494,6 +11494,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = -1;
|
||||
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
|
||||
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
|
||||
@ -59,7 +59,7 @@
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -10931,6 +10932,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -11506,6 +11507,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_size - reply_len);
|
||||
#endif /* CONFIG_MACSEC */
|
||||
}
|
||||
@ -67,7 +67,7 @@
|
||||
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
|
||||
reply_len = wpa_supplicant_ctrl_iface_status(
|
||||
wpa_s, buf + 6, reply, reply_size);
|
||||
@@ -11419,6 +11421,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -11994,6 +11996,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = wpa_supplicant_ctrl_iface_bss(
|
||||
wpa_s, buf + 4, reply, reply_size);
|
||||
#ifdef CONFIG_AP
|
||||
@ -75,7 +75,7 @@
|
||||
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
|
||||
} else if (os_strncmp(buf, "STA ", 4) == 0) {
|
||||
@@ -11427,12 +11430,15 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -12002,12 +12005,15 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
|
||||
reply_size);
|
||||
@ -101,7 +101,7 @@
|
||||
|
||||
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
|
||||
size_t curr_len, const u8 *mcs_set)
|
||||
@@ -451,6 +452,7 @@ int hostapd_ctrl_iface_sta_next(struct h
|
||||
@@ -459,6 +460,7 @@ int hostapd_ctrl_iface_sta_next(struct h
|
||||
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
#ifdef CONFIG_P2P_MANAGER
|
||||
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
|
||||
@@ -807,12 +809,12 @@ int hostapd_ctrl_iface_status(struct hos
|
||||
@@ -815,12 +817,12 @@ int hostapd_ctrl_iface_status(struct hos
|
||||
return len;
|
||||
len += ret;
|
||||
}
|
||||
@ -163,7 +163,7 @@
|
||||
{
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -2767,6 +2767,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
@@ -2777,6 +2777,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
}
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
|
||||
@@ -2848,6 +2850,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
@@ -2858,6 +2860,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
|
||||
return (int) len;
|
||||
}
|
||||
@ -182,7 +182,7 @@
|
||||
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru
|
||||
@@ -1462,7 +1462,7 @@ int wpas_ap_wps_nfc_report_handover(stru
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
bss->wpa_pairwise |= WPA_CIPHER_TKIP;
|
||||
#endif /* CONFIG_NO_TKIP */
|
||||
bss->rsn_pairwise = bss->wpa_pairwise;
|
||||
@@ -1178,8 +1177,7 @@ int hostapd_init_wps(struct hostapd_data
|
||||
@@ -1180,8 +1179,7 @@ int hostapd_init_wps(struct hostapd_data
|
||||
WPA_CIPHER_GCMP_256)) {
|
||||
wps->encr_types |= WPS_ENCR_AES;
|
||||
wps->encr_types_rsn |= WPS_ENCR_AES;
|
||||
|
||||
@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
#include "common/defs.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "common/wpa_common.h"
|
||||
@@ -851,6 +852,9 @@ struct wpa_driver_associate_params {
|
||||
@@ -857,6 +858,9 @@ struct wpa_driver_associate_params {
|
||||
* responsible for selecting with which BSS to associate. */
|
||||
const u8 *bssid;
|
||||
|
||||
@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
|
||||
|
||||
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
|
||||
@@ -843,6 +845,9 @@ struct wpa_ssid {
|
||||
@@ -846,6 +848,9 @@ struct wpa_ssid {
|
||||
*/
|
||||
void *parent_cred;
|
||||
|
||||
@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
* macsec_policy - Determines the policy for MACsec secure session
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -3726,6 +3726,12 @@ static void wpas_start_assoc_cb(struct w
|
||||
@@ -3865,6 +3865,12 @@ static void wpas_start_assoc_cb(struct w
|
||||
params.beacon_int = ssid->beacon_int;
|
||||
else
|
||||
params.beacon_int = wpa_s->conf->beacon_int;
|
||||
|
||||
@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -5950,7 +5950,7 @@ static int wpa_driver_nl80211_ibss(struc
|
||||
@@ -5966,7 +5966,7 @@ static int wpa_driver_nl80211_ibss(struc
|
||||
struct wpa_driver_associate_params *params)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
int count = 0;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
|
||||
@@ -5977,6 +5977,37 @@ retry:
|
||||
@@ -5993,6 +5993,37 @@ retry:
|
||||
nl80211_put_beacon_int(msg, params->beacon_int))
|
||||
goto fail;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1618,6 +1618,7 @@ struct wpa_driver_mesh_join_params {
|
||||
@@ -1624,6 +1624,7 @@ struct wpa_driver_mesh_join_params {
|
||||
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
|
||||
unsigned int flags;
|
||||
bool handle_dfs;
|
||||
@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
struct wpa_driver_set_key_params {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -10473,6 +10473,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
@@ -10496,6 +10496,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
static int nl80211_put_mesh_config(struct nl_msg *msg,
|
||||
struct wpa_driver_mesh_bss_params *params)
|
||||
{
|
||||
@@ -10534,6 +10546,7 @@ static int nl80211_join_mesh(struct i802
|
||||
@@ -10557,6 +10569,7 @@ static int nl80211_join_mesh(struct i802
|
||||
nl80211_put_basic_rates(msg, params->basic_rates) ||
|
||||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
@@ -631,6 +631,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
|
||||
params->meshid = ssid->ssid;
|
||||
params->meshid_len = ssid->ssid_len;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2457,11 +2457,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2512,11 +2512,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
for (j = 0; j < wpa_s->last_scan_res_used; j++) {
|
||||
struct wpa_bss *bss = wpa_s->last_scan_res[j];
|
||||
|
||||
|
||||
@ -1,26 +1,6 @@
|
||||
--- a/src/ap/acs.c
|
||||
+++ b/src/ap/acs.c
|
||||
@@ -302,18 +302,12 @@ static void acs_fail(struct hostapd_ifac
|
||||
static long double
|
||||
acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
|
||||
{
|
||||
- long double factor, busy, total;
|
||||
+ long double factor, busy = 0, total;
|
||||
|
||||
if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
|
||||
busy = survey->channel_time_busy;
|
||||
else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
|
||||
busy = survey->channel_time_rx;
|
||||
- else {
|
||||
- /* This shouldn't really happen as survey data is checked in
|
||||
- * acs_sanity_check() */
|
||||
- wpa_printf(MSG_ERROR, "ACS: Survey data missing");
|
||||
- return 0;
|
||||
- }
|
||||
|
||||
total = survey->channel_time;
|
||||
|
||||
@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s
|
||||
@@ -420,20 +420,19 @@ static int acs_usable_bw160_chan(const s
|
||||
static int acs_survey_is_sufficient(struct freq_survey *survey)
|
||||
{
|
||||
if (!(survey->filled & SURVEY_HAS_NF)) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -1294,7 +1294,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
|
||||
@@ -1297,7 +1297,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
|
||||
@$(AR) cr $@ hostapd_multi.o $(OBJS)
|
||||
|
||||
hostapd: $(OBJS)
|
||||
@ -9,7 +9,7 @@
|
||||
@$(E) " LD " $@
|
||||
|
||||
ifdef CONFIG_WPA_TRACE
|
||||
@@ -1305,7 +1305,7 @@ _OBJS_VAR := OBJS_c
|
||||
@@ -1308,7 +1308,7 @@ _OBJS_VAR := OBJS_c
|
||||
include ../src/objs.mk
|
||||
|
||||
hostapd_cli: $(OBJS_c)
|
||||
@ -20,7 +20,7 @@
|
||||
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -1919,31 +1919,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
|
||||
@@ -1920,31 +1920,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
|
||||
@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
|
||||
|
||||
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
|
||||
@ -1,99 +0,0 @@
|
||||
From 1b26807938815d0b0b266caf31d8ef0019607e64 Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Mon, 27 Sep 2021 15:41:48 +0200
|
||||
Subject: [PATCH] WNM: allow specifying dialog-token
|
||||
|
||||
This commit adds the ability to specify the dialog token of a WNM BSS
|
||||
Transition request frame via the hostapd control socket.
|
||||
|
||||
FOr this, the new 'dialog_token' option can be used. It accepts values
|
||||
as a 8 bit unsigned integer. If not specified, the dialog token is set
|
||||
to 1 like before.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
hostapd/ctrl_iface.c | 10 ++++++++--
|
||||
src/ap/wnm_ap.c | 11 ++++++-----
|
||||
src/ap/wnm_ap.h | 4 ++--
|
||||
3 files changed, 16 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -897,7 +897,7 @@ static int hostapd_ctrl_iface_bss_tm_req
|
||||
const char *pos, *end;
|
||||
int disassoc_timer = 0;
|
||||
struct sta_info *sta;
|
||||
- u8 req_mode = 0, valid_int = 0x01;
|
||||
+ u8 req_mode = 0, valid_int = 0x01, dialog_token = 0x01;
|
||||
u8 bss_term_dur[12];
|
||||
char *url = NULL;
|
||||
int ret;
|
||||
@@ -935,6 +935,12 @@ static int hostapd_ctrl_iface_bss_tm_req
|
||||
valid_int = atoi(pos);
|
||||
}
|
||||
|
||||
+ pos = os_strstr(cmd, " dialog_token=");
|
||||
+ if (pos) {
|
||||
+ pos += 14;
|
||||
+ dialog_token = atoi(pos);
|
||||
+ }
|
||||
+
|
||||
pos = os_strstr(cmd, " bss_term=");
|
||||
if (pos) {
|
||||
pos += 10;
|
||||
@@ -1041,7 +1047,7 @@ static int hostapd_ctrl_iface_bss_tm_req
|
||||
#endif /* CONFIG_MBO */
|
||||
|
||||
ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer,
|
||||
- valid_int, bss_term_dur, url,
|
||||
+ valid_int, bss_term_dur, dialog_token, url,
|
||||
nei_len ? nei_rep : NULL, nei_len,
|
||||
mbo_len ? mbo : NULL, mbo_len);
|
||||
#ifdef CONFIG_MBO
|
||||
--- a/src/ap/wnm_ap.c
|
||||
+++ b/src/ap/wnm_ap.c
|
||||
@@ -788,8 +788,8 @@ int wnm_send_ess_disassoc_imminent(struc
|
||||
|
||||
int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
u8 req_mode, int disassoc_timer, u8 valid_int,
|
||||
- const u8 *bss_term_dur, const char *url,
|
||||
- const u8 *nei_rep, size_t nei_rep_len,
|
||||
+ const u8 *bss_term_dur, u8 dialog_token,
|
||||
+ const char *url, const u8 *nei_rep, size_t nei_rep_len,
|
||||
const u8 *mbo_attrs, size_t mbo_len)
|
||||
{
|
||||
u8 *buf, *pos;
|
||||
@@ -797,8 +797,9 @@ int wnm_send_bss_tm_req(struct hostapd_d
|
||||
size_t url_len;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
|
||||
- MACSTR " req_mode=0x%x disassoc_timer=%d valid_int=0x%x",
|
||||
- MAC2STR(sta->addr), req_mode, disassoc_timer, valid_int);
|
||||
+ MACSTR " req_mode=0x%x disassoc_timer=%d valid_int=0x%x "
|
||||
+ "dialog_token=%x",
|
||||
+ MAC2STR(sta->addr), req_mode, disassoc_timer, valid_int, dialog_token);
|
||||
buf = os_zalloc(1000 + nei_rep_len + mbo_len);
|
||||
if (buf == NULL)
|
||||
return -1;
|
||||
@@ -810,7 +811,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
|
||||
os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN);
|
||||
mgmt->u.action.category = WLAN_ACTION_WNM;
|
||||
mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ;
|
||||
- mgmt->u.action.u.bss_tm_req.dialog_token = 1;
|
||||
+ mgmt->u.action.u.bss_tm_req.dialog_token = dialog_token;
|
||||
mgmt->u.action.u.bss_tm_req.req_mode = req_mode;
|
||||
mgmt->u.action.u.bss_tm_req.disassoc_timer =
|
||||
host_to_le16(disassoc_timer);
|
||||
--- a/src/ap/wnm_ap.h
|
||||
+++ b/src/ap/wnm_ap.h
|
||||
@@ -20,8 +20,8 @@ int wnm_send_ess_disassoc_imminent(struc
|
||||
int disassoc_timer);
|
||||
int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
u8 req_mode, int disassoc_timer, u8 valid_int,
|
||||
- const u8 *bss_term_dur, const char *url,
|
||||
- const u8 *nei_rep, size_t nei_rep_len,
|
||||
+ const u8 *bss_term_dur, u8 dialog_token,
|
||||
+ const char *url, const u8 *nei_rep, size_t nei_rep_len,
|
||||
const u8 *mbo_attrs, size_t mbo_len);
|
||||
void ap_sta_reset_steer_flag_timer(void *eloop_ctx, void *timeout_ctx);
|
||||
int wnm_send_coloc_intf_req(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -148,6 +148,21 @@ struct hostapd_sae_commit_queue {
|
||||
@@ -150,6 +150,21 @@ struct hostapd_sae_commit_queue {
|
||||
};
|
||||
|
||||
/**
|
||||
@ -22,7 +22,7 @@
|
||||
* struct hostapd_data - hostapd per-BSS data structure
|
||||
*/
|
||||
struct hostapd_data {
|
||||
@@ -161,6 +176,9 @@ struct hostapd_data {
|
||||
@@ -163,6 +178,9 @@ struct hostapd_data {
|
||||
|
||||
u8 own_addr[ETH_ALEN];
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
if (disassoc_timer) {
|
||||
/* send disassociation frame after time-out */
|
||||
set_disassoc_timer(hapd, sta, disassoc_timer);
|
||||
@@ -856,6 +861,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
|
||||
@@ -857,6 +862,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
|
||||
}
|
||||
os_free(buf);
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
};
|
||||
|
||||
enum hostapd_chan_status {
|
||||
@@ -169,6 +170,7 @@ struct hostapd_data {
|
||||
@@ -171,6 +172,7 @@ struct hostapd_data {
|
||||
struct hostapd_iface *iface;
|
||||
struct hostapd_config *iconf;
|
||||
struct hostapd_bss_config *conf;
|
||||
@ -39,7 +39,7 @@
|
||||
int interface_added; /* virtual interface added for this BSS */
|
||||
unsigned int started:1;
|
||||
unsigned int disabled:1;
|
||||
@@ -628,6 +630,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
@@ -630,6 +632,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
struct hostapd_bss_config *bss);
|
||||
int hostapd_setup_interface(struct hostapd_iface *iface);
|
||||
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
|
||||
@ -126,7 +126,7 @@
|
||||
if (res == HOSTAPD_ACL_PENDING)
|
||||
return;
|
||||
|
||||
@@ -5445,7 +5457,7 @@ static void handle_assoc(struct hostapd_
|
||||
@@ -5447,7 +5459,7 @@ static void handle_assoc(struct hostapd_
|
||||
int resp = WLAN_STATUS_SUCCESS;
|
||||
u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
const u8 *pos;
|
||||
@ -135,7 +135,7 @@
|
||||
struct sta_info *sta;
|
||||
u8 *tmp = NULL;
|
||||
#ifdef CONFIG_FILS
|
||||
@@ -5658,6 +5670,11 @@ static void handle_assoc(struct hostapd_
|
||||
@@ -5660,6 +5672,11 @@ static void handle_assoc(struct hostapd_
|
||||
left = res;
|
||||
}
|
||||
#endif /* CONFIG_FILS */
|
||||
@ -147,7 +147,7 @@
|
||||
|
||||
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
|
||||
* is used */
|
||||
@@ -5756,6 +5773,13 @@ static void handle_assoc(struct hostapd_
|
||||
@@ -5758,6 +5775,13 @@ static void handle_assoc(struct hostapd_
|
||||
}
|
||||
#endif /* CONFIG_FILS */
|
||||
|
||||
@ -161,7 +161,7 @@
|
||||
fail:
|
||||
|
||||
/*
|
||||
@@ -5849,6 +5873,7 @@ static void handle_disassoc(struct hosta
|
||||
@@ -5851,6 +5875,7 @@ static void handle_disassoc(struct hosta
|
||||
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
|
||||
MAC2STR(mgmt->sa),
|
||||
le_to_host16(mgmt->u.disassoc.reason_code));
|
||||
@ -169,7 +169,7 @@
|
||||
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
if (sta == NULL) {
|
||||
@@ -5918,6 +5943,8 @@ static void handle_deauth(struct hostapd
|
||||
@@ -5920,6 +5945,8 @@ static void handle_deauth(struct hostapd
|
||||
/* Clear the PTKSA cache entries for PASN */
|
||||
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
|
||||
|
||||
@ -180,7 +180,7 @@
|
||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
@@ -852,6 +852,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
u16 csa_offs[2];
|
||||
size_t csa_offs_len;
|
||||
struct radius_sta rad_info;
|
||||
@ -193,7 +193,7 @@
|
||||
|
||||
if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
|
||||
ssi_signal < hapd->iconf->rssi_ignore_probe_request)
|
||||
@@ -1009,6 +1015,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
@@ -1038,6 +1044,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
@ -283,7 +283,7 @@
|
||||
ifdef CONFIG_CODE_COVERAGE
|
||||
CFLAGS += -O0 -fprofile-arcs -ftest-coverage
|
||||
LIBS += -lgcov
|
||||
@@ -960,6 +966,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
|
||||
@@ -962,6 +968,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
endif
|
||||
OBJS += ../src/ap/ctrl_iface_ap.o
|
||||
@ -295,7 +295,7 @@
|
||||
CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -7017,6 +7017,8 @@ struct wpa_supplicant * wpa_supplicant_a
|
||||
@@ -7241,6 +7241,8 @@ struct wpa_supplicant * wpa_supplicant_a
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
@ -304,7 +304,7 @@
|
||||
return wpa_s;
|
||||
}
|
||||
|
||||
@@ -7043,6 +7045,8 @@ int wpa_supplicant_remove_iface(struct w
|
||||
@@ -7267,6 +7269,8 @@ int wpa_supplicant_remove_iface(struct w
|
||||
struct wpa_supplicant *parent = wpa_s->parent;
|
||||
#endif /* CONFIG_MESH */
|
||||
|
||||
@ -313,7 +313,7 @@
|
||||
/* Remove interface from the global list of interfaces */
|
||||
prev = global->ifaces;
|
||||
if (prev == wpa_s) {
|
||||
@@ -7346,8 +7350,12 @@ int wpa_supplicant_run(struct wpa_global
|
||||
@@ -7570,8 +7574,12 @@ int wpa_supplicant_run(struct wpa_global
|
||||
eloop_register_signal_terminate(wpa_supplicant_terminate, global);
|
||||
eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
|
||||
|
||||
@ -336,7 +336,7 @@
|
||||
|
||||
extern const char *const wpa_supplicant_version;
|
||||
extern const char *const wpa_supplicant_license;
|
||||
@@ -321,6 +322,8 @@ struct wpa_global {
|
||||
@@ -322,6 +323,8 @@ struct wpa_global {
|
||||
#endif /* CONFIG_WIFI_DISPLAY */
|
||||
|
||||
struct psk_list_entry *add_psk; /* From group formation */
|
||||
@ -345,7 +345,7 @@
|
||||
};
|
||||
|
||||
|
||||
@@ -605,6 +608,7 @@ struct wpa_supplicant {
|
||||
@@ -708,6 +711,7 @@ struct wpa_supplicant {
|
||||
unsigned char own_addr[ETH_ALEN];
|
||||
unsigned char perm_addr[ETH_ALEN];
|
||||
char ifname[100];
|
||||
@ -363,7 +363,7 @@
|
||||
|
||||
|
||||
#ifndef WPS_PIN_SCAN_IGNORE_SEL_REG
|
||||
@@ -392,6 +393,8 @@ static int wpa_supplicant_wps_cred(void
|
||||
@@ -393,6 +394,8 @@ static int wpa_supplicant_wps_cred(void
|
||||
wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute",
|
||||
cred->cred_attr, cred->cred_attr_len);
|
||||
|
||||
@ -463,7 +463,7 @@
|
||||
|
||||
--- a/src/ap/dfs.c
|
||||
+++ b/src/ap/dfs.c
|
||||
@@ -1193,6 +1193,8 @@ int hostapd_dfs_radar_detected(struct ho
|
||||
@@ -1196,6 +1196,8 @@ int hostapd_dfs_radar_detected(struct ho
|
||||
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
|
||||
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2453,6 +2453,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -2458,6 +2458,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->isolate = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ap_max_inactivity") == 0) {
|
||||
bss->ap_max_inactivity = atoi(pos);
|
||||
@ -9,7 +9,7 @@
|
||||
} else if (os_strcmp(buf, "skip_inactivity_poll") == 0) {
|
||||
bss->skip_inactivity_poll = atoi(pos);
|
||||
} else if (os_strcmp(buf, "country_code") == 0) {
|
||||
@@ -3153,6 +3155,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3158,6 +3160,8 @@ static int hostapd_config_fill(struct ho
|
||||
}
|
||||
} else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
|
||||
conf->acs_exclude_dfs = atoi(pos);
|
||||
@ -20,7 +20,7 @@
|
||||
} else if (os_strcmp(buf, "channel") == 0) {
|
||||
--- a/src/ap/ap_config.c
|
||||
+++ b/src/ap/ap_config.c
|
||||
@@ -791,6 +791,7 @@ void hostapd_config_free_bss(struct host
|
||||
@@ -792,6 +792,7 @@ void hostapd_config_free_bss(struct host
|
||||
os_free(conf->radius_req_attr_sqlite);
|
||||
os_free(conf->rsn_preauth_interfaces);
|
||||
os_free(conf->ctrl_interface);
|
||||
@ -28,7 +28,7 @@
|
||||
os_free(conf->ca_cert);
|
||||
os_free(conf->server_cert);
|
||||
os_free(conf->server_cert2);
|
||||
@@ -987,6 +988,7 @@ void hostapd_config_free(struct hostapd_
|
||||
@@ -988,6 +989,7 @@ void hostapd_config_free(struct hostapd_
|
||||
|
||||
for (i = 0; i < conf->num_bss; i++)
|
||||
hostapd_config_free_bss(conf->bss[i]);
|
||||
@ -47,7 +47,7 @@
|
||||
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
|
||||
|
||||
unsigned int logger_syslog; /* module bitfield */
|
||||
@@ -938,6 +940,7 @@ struct spatial_reuse {
|
||||
@@ -942,6 +944,7 @@ struct spatial_reuse {
|
||||
struct hostapd_config {
|
||||
struct hostapd_bss_config **bss, *last_bss;
|
||||
size_t num_bss;
|
||||
@ -156,7 +156,7 @@
|
||||
struct hostapd_config * (*config_read_cb)(const char *config_fname);
|
||||
int (*ctrl_iface_init)(struct hostapd_data *hapd);
|
||||
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
|
||||
@@ -171,6 +171,7 @@ struct hostapd_data {
|
||||
@@ -173,6 +173,7 @@ struct hostapd_data {
|
||||
struct hostapd_config *iconf;
|
||||
struct hostapd_bss_config *conf;
|
||||
struct hostapd_ubus_bss ubus;
|
||||
@ -164,7 +164,7 @@
|
||||
int interface_added; /* virtual interface added for this BSS */
|
||||
unsigned int started:1;
|
||||
unsigned int disabled:1;
|
||||
@@ -622,7 +623,7 @@ struct hostapd_iface {
|
||||
@@ -624,7 +625,7 @@ struct hostapd_iface {
|
||||
int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
|
||||
int (*cb)(struct hostapd_iface *iface,
|
||||
void *ctx), void *ctx);
|
||||
@ -175,7 +175,7 @@
|
||||
hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4817,6 +4817,9 @@ static int wpa_driver_nl80211_set_ap(voi
|
||||
@@ -4833,6 +4833,9 @@ static int wpa_driver_nl80211_set_ap(voi
|
||||
if (ret) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
|
||||
ret, strerror(-ret));
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3381,6 +3381,8 @@ static int hostapd_config_fill(struct ho
|
||||
#ifndef CONFIG_NO_VLAN
|
||||
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
|
||||
bss->ssid.dynamic_vlan = atoi(pos);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -2358,6 +2358,8 @@ static int hostapd_config_fill(struct ho
|
||||
sizeof(conf->bss[0]->iface));
|
||||
} else if (os_strcmp(buf, "bridge") == 0) {
|
||||
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From 5a24286ed6315e1fef755ca1970792554f59b1fc Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Wed, 26 May 2021 22:15:35 +0200
|
||||
Subject: [PATCH] ACS: fix channel 100 frequency
|
||||
|
||||
Channel 100 is a valid channel to choose for 80MHz operation. However,
|
||||
it's assigned to 5500 MHz, not 5550MHz. In fact, there is no channel
|
||||
assigned to this frequency.
|
||||
|
||||
Fix this obbvious typo to allow ACS to select channel 100 for 80 MHz
|
||||
operation again.
|
||||
|
||||
Fixes commit bef5eee4f7b2 ("Convert channel to frequency based selection for AP mode ACS")
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
src/ap/acs.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/ap/acs.c
|
||||
+++ b/src/ap/acs.c
|
||||
@@ -386,7 +386,7 @@ static int acs_usable_bw40_chan(const st
|
||||
|
||||
static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan)
|
||||
{
|
||||
- const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745, 5955, 6035,
|
||||
+ const int allowed[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035,
|
||||
6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675,
|
||||
6755, 6835, 6915, 6995 };
|
||||
unsigned int i;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user