* [PATCH v3 1/3] dt-bindings: remoteproc: qcom,wcnss-pil: Add wcn3610 compatible
From: Kerigan Creighton @ 2026-03-06 0:43 UTC (permalink / raw)
To: linux-wireless
Cc: loic.poulain, wcn36xx, andersson, mathieu.poirier,
linux-remoteproc, linux-arm-msm, robh, krzk+dt, conor+dt,
devicetree, linux-kernel, Kerigan Creighton
In-Reply-To: <20260306004344.10968-1-kerigancreighton@gmail.com>
The Qualcomm WCN3610 is a 2.4GHz-only WLAN/BT combo chip.
It's similar to the WCN3620, though more basic. Add a
wcn3610 compatible for use in device trees.
It needs its own compatible because of chip-specific
configuration done in wcn36xx.
Signed-off-by: Kerigan Creighton <kerigancreighton@gmail.com>
---
Changes in v2:
- Move the Documentation patch to the beginning of the patch set.
Changes in v3:
- Describe the hardware rather than the driver in the
dt-bindings patch [Krzysztof].
---
Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
index 117fb4d0c4..018cdf5177 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml
@@ -109,6 +109,7 @@ properties:
properties:
compatible:
enum:
+ - qcom,wcn3610
- qcom,wcn3620
- qcom,wcn3660
- qcom,wcn3660b
--
2.53.0
^ permalink raw reply related
* [PATCH v3 0/3] Add support for Qualcomm WCN3610
From: Kerigan Creighton @ 2026-03-06 0:43 UTC (permalink / raw)
To: linux-wireless
Cc: loic.poulain, wcn36xx, andersson, mathieu.poirier,
linux-remoteproc, linux-arm-msm, robh, krzk+dt, conor+dt,
devicetree, linux-kernel, Kerigan Creighton
The WCN3610 is a 2.4GHz-only WLAN/BT combo chip used in some
cheaper Android and Windows phones such as the Lumia 550, and
IoT devices like the Anki Vector robot. It shares a lot in
common with the WCN3620.
This series adds support for the WCN3610 across the necessary
subsystems:
* Document the new compatible string (patch 1).
* Add compatible string in qcom_wcnss_iris (patch 2).
* Add rf_id and CFGs for the WCN3610 in wcn36xx, disable
powersave for this specific chip, ensure it is 2.4GHz-only
(patch 3).
Tested on an Anki Vector 1.0 and 2.0 robot. Support for other
WCN36xx chips has not been affected.
Changes in v2:
- Move the Documentation patch to the beginning of the patch set.
- Move remoteproc compatible string addition to the middle of
the patch set.
- Add Reviewed-by Dmitry (thanks!) to remoteproc compatible patch.
- Move wcn36xx driver changes to the end of the patch set.
Changes in v3:
- Describe the hardware rather than the driver in the
dt-bindings patch [Krzysztof].
- Describe why we need a new compatible in the remoteproc
patch [Krzysztof].
- Describe where the CFG values came from in the wcn36xx
driver patch [Konrad].
Kerigan Creighton (3):
dt-bindings: remoteproc: qcom,wcnss-pil: Add wcn3610 compatible
remoteproc: qcom_wcnss_iris: Add support for WCN3610
wifi: wcn36xx: Add support for WCN3610
.../bindings/remoteproc/qcom,wcnss-pil.yaml | 1 +
drivers/net/wireless/ath/wcn36xx/main.c | 4 +-
drivers/net/wireless/ath/wcn36xx/smd.c | 61 ++++++++++++++++++-
drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
drivers/remoteproc/qcom_wcnss_iris.c | 1 +
5 files changed, 66 insertions(+), 2 deletions(-)
--
2.53.0
^ permalink raw reply
* Re: wireless-regdb: Update IN regulatory domain for lower 6 GHz (5925-6425 MHz)
From: Gaurav Kansal @ 2026-03-05 4:20 UTC (permalink / raw)
To: wens; +Cc: Degrader Snehil, linux-wireless, wireless-regdb
In-Reply-To: <CAGb2v6617V-jLnLrBYEZfSiv-2c8QsN2HMCmQbaXdm9NVwGGEA@mail.gmail.com>
Hi ChenYu,
Didn't the information is already merged as per my last patch submission?
Regards,
Gaurav Kansal
From: Chen-Yu Tsai <wens@kernel.org>
To: "Degrader Snehil"<degradersnehil@gmail.com>
Cc: <linux-wireless@vger.kernel.org>, "wireless-regdb"<wireless-regdb@lists.infradead.org>
Date: Thu, 05 Mar 2026 09:08:56 +0530
Subject: Re: wireless-regdb: Update IN regulatory domain for lower 6 GHz (5925-6425 MHz)
> Hi,
>
> On Thu, Mar 5, 2026 at 3:16 AM Degrader Snehil <degradersnehil@gmail.com> wrote:
> >
> > Hi,
> >
> > I would like to request an update to the IN (India) regulatory domain in wireless-regdb to add the newly permitted lower 6 GHz band (5925–6425 MHz).
>
> Thank you for the information. Would you like to provide a patch?
> If not, I can write up a patch and tag you as the reporter.
>
> > The Government of India has officially opened this band for licence-exempt use via Gazette Notification G.S.R. 47(E), dated January 20, 2026, published January 21, 2026, issued by the Ministry of Communications under the Indian Telegraph Act, 1885 and the Indian Wireless Telegraphy Act, 1933.
> >
> > Gazette details:
> > Title : Use of Low Power and Very Low Power Wireless Access System
> > including Radio Local Area Network in Lower 6 GHz Band
> > (Exemption from Licensing Requirement) Rules, 2026
> > File No : 24-04/2025-UBB
> > Gazette : No. 47, CG-DL-E-21012026-269488
> > Signed : Devendra Kumar Rai, Joint Secretary, Ministry of Communications
> > URL : https://www.dot.gov.in/static/uploads/2026/02/88f0ac8c74eb6f6907934d17d0015ab5.pdf
> > The Gazette defines two device classes for 5925–6425 MHz:
> >
> > 1. Low power indoor
> > - Max EIRP : 30 dBm
> > - Max PSD : 11 dBm/MHz
> > - Max bandwidth : 320 MHz
> > - Restriction : Indoor use only (Rule 5)
> >
> > 2. Very low power outdoor
> > - Max EIRP : 14 dBm
> > - Max PSD : 1 dBm/MHz
> > - Max bandwidth : 320 MHz
> > - Restriction : None
> >
> > Additional operational restrictions per Rule 5 of the Gazette:
> > - Band is prohibited on oil platforms
> > - Indoor use prohibited on land vehicles, boats and aircraft below 10,000 ft
> > - Communication with and control of drones/UAS is prohibited
> > - Contention-based protocol is mandatory for all devices (Rule 4)
> >
> > Out-of-band emission limit: -27 dBm/MHz outside 5925–6425 MHz (Rule 6)
> >
> > Proposed addition to the existing country IN entry in db.txt:
> >
> > country IN:
> > (2402 - 2482 @ 40), (30)
> > (5150 - 5250 @ 80), (30)
> > (5250 - 5350 @ 80), (24), DFS
> > (5470 - 5725 @ 160), (24), DFS
> > (5725 - 5875 @ 80), (30)
> > (5925 - 6425 @ 320), (30), NO-OUTDOOR # low power indoor
> > (5925 - 6425 @ 320), (14) # very low power outdoor
> >
> > Note: Since both device classes share the same frequency range but have different EIRP limits and indoor/outdoor restrictions, I have represented them as two separate lines. Please advise if a different encoding is more appropriate.
>
> Unfortunately we currently only support one rule per band. I'm inclined
> to add the VLP one so outdoor usage is allowed.
>
> > I have attached the official Gazette notification PDF as supporting evidence.
> >
> > Intel has also submitted a related update (Intel® Wireless Wi-Fi Drivers 24.20.2) for this band for India. I am not certain whether that patch covers wireless-regdb (db.txt) or only their iwlwifi driver internals, so I am submitting this request for wireless-regdb independently to ensure the authoritative database is updated.
>
> AFAIK Intel manages regulatory requirements in their firmware, so it is
> unrelated to the database we maintain.
>
> > Intel's Regulatory Domain Info was found in Release notes of their Intel® Wireless Wi-Fi Drivers 24.20.2 available at page 2 of https://downloadmirror.intel.com/914148/ReleaseNotes_WiFi_24.20.2.pdf.
> > Please let me know if any further information is needed.
>
> The information you provided is very detailed. Thanks!
>
>
> ChenYu
>
>
^ permalink raw reply
* [PATCH] wifi: radiotap: Add SPDX ids to files in the wireless subsystem
From: Tim Bird @ 2026-03-05 22:04 UTC (permalink / raw)
To: johannes, andy, lrodriquez, beni.lev
Cc: tim.bird, linux-wireless, linux-spdx, linux-kernel
Add SPDX-License-Identifier lines to some files where
they are missing in the net/wireless directory.
Remove licensing text from individual files headers (where
present) to canonicalize the library references.
Use (mostly) either GPL-2.0 or ISC, depending on the
license wording (or not) in the files.
radiotap.c does not mention which BSD variant it intends for the
license. My selection of 'OR BSD-2-Clause' for radiotap.c was
based on research into this code's history and its licensing
elsewhere. In OpenBSD, radiotap code (which likely either
derived from this code, or this code was derived from) has the
BSD-2-Clause license. Very similar code in the radiotap library
user space tool, by the same authors Andy Green and Johannes
Berg, has an ISC license. Also the ISC license is used by
Johannes for other contributions in the Linux wireless system.
Since the radiotap.c license text here mentions BSD, but not a
specific version, I chose the closest BSD variant to ISC, which
is BSD-2-Clause.
Signed-off-by: Tim Bird <tim.bird@sony.com>
---
Note that the ISC license says it must be retained, but we
count the file in LICENSES/deprecated/ISC as retention of
'this permission notice', for Linux source.
---
net/wireless/of.c | 13 +------------
net/wireless/radiotap.c | 10 +---------
net/wireless/reg.c | 13 +------------
net/wireless/reg.h | 13 +------------
net/wireless/trace.c | 1 +
net/wireless/wext-core.c | 3 +--
net/wireless/wext-priv.c | 3 +--
net/wireless/wext-proc.c | 3 +--
8 files changed, 8 insertions(+), 51 deletions(-)
diff --git a/net/wireless/of.c b/net/wireless/of.c
index 60a864465331..99acbea3beee 100644
--- a/net/wireless/of.c
+++ b/net/wireless/of.c
@@ -1,17 +1,6 @@
+// SPDX-License-Identifier: ISC
/*
* Copyright (C) 2017 Rafał Miłecki <rafal@milecki.pl>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <linux/of.h>
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c
index c85eaa583a46..df29048a0449 100644
--- a/net/wireless/radiotap.c
+++ b/net/wireless/radiotap.c
@@ -1,17 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
/*
* Radiotap parser
*
* Copyright 2007 Andy Green <andy@warmcat.com>
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See COPYING for more details.
*/
#include <linux/kernel.h>
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1c5c38d18feb..20bba7e491c5 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
/*
* Copyright 2002-2005, Instant802 Networks, Inc.
* Copyright 2005-2006, Devicescape Software, Inc.
@@ -6,18 +7,6 @@
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2017 Intel Deutschland GmbH
* Copyright (C) 2018 - 2026 Intel Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index e1b211c4f75c..fc31c5f9a61a 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: ISC */
#ifndef __NET_WIRELESS_REG_H
#define __NET_WIRELESS_REG_H
@@ -6,18 +7,6 @@
/*
* Copyright 2008-2011 Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
* Copyright (C) 2019, 2023 Intel Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
enum ieee80211_regd_source {
diff --git a/net/wireless/trace.c b/net/wireless/trace.c
index 95f997fad755..7cb93acf1a8f 100644
--- a/net/wireless/trace.c
+++ b/net/wireless/trace.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/module.h>
#ifndef __CHECKER__
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index 7b8e94214b07..c19dece2bc6e 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file implement the Wireless Extensions core API.
*
@@ -5,8 +6,6 @@
* Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
* Copyright (C) 2024 Intel Corporation
- *
- * (As all part of the Linux kernel, this file is GPL)
*/
#include <linux/kernel.h>
#include <linux/netdevice.h>
diff --git a/net/wireless/wext-priv.c b/net/wireless/wext-priv.c
index 37d1147019c2..ce9022843dfd 100644
--- a/net/wireless/wext-priv.c
+++ b/net/wireless/wext-priv.c
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file implement the Wireless Extensions priv API.
*
* Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
* Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
- *
- * (As all part of the Linux kernel, this file is GPL)
*/
#include <linux/slab.h>
#include <linux/wireless.h>
diff --git a/net/wireless/wext-proc.c b/net/wireless/wext-proc.c
index cadcf8613af2..be6b2b695bf9 100644
--- a/net/wireless/wext-proc.c
+++ b/net/wireless/wext-proc.c
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file implement the Wireless Extensions proc API.
*
* Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
* Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
- *
- * (As all part of the Linux kernel, this file is GPL)
*/
/*
--
2.43.0
^ permalink raw reply related
* Re: [PATCH] wifi: mac80211: Fix static_branch_dec() underflow for aql_disable.
From: Kuniyuki Iwashima @ 2026-03-05 19:40 UTC (permalink / raw)
To: Johannes Berg
Cc: Lorenzo Bianconi, Kuniyuki Iwashima, linux-wireless,
syzbot+feb9ce36a95341bb47a4
In-Reply-To: <0d823e5cd52792cae3e42afb6125c5c822554faa.camel@sipsolutions.net>
On Thu, Mar 5, 2026 at 2:20 AM Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Wed, 2026-03-04 at 20:43 +0000, Kuniyuki Iwashima wrote:
> > syzbot reported static_branch_dec() underflow in aql_enable_write().
> >
> > The problem is that aql_enable_write() does not serialise concurrent
> > write()s to the debugfs.
> >
> > aql_enable_write() checks static_key_false(&aql_disable.key) and
> > later calls static_branch_inc() or static_branch_dec(), but the
> > state may change between the two calls.
>
> Fun.
>
> > Let's add a static mutex and move static_key_false() there.
>
> Wouldn't it be simpler to use static_branch_enable()/disable() and never
> even bother checking the previous state?
Exactly, it already have a mutex and we don't need to
track inc/dec counters actually.
Will update v2.
Thanks !
^ permalink raw reply
* Re: [PATCH v2 3/3] wifi: wcn36xx: add support for WCN3610
From: Kerigan Creighton @ 2026-03-05 19:33 UTC (permalink / raw)
To: Loic Poulain
Cc: Konrad Dybcio, linux-wireless, wcn36xx, andersson,
mathieu.poirier, linux-remoteproc, linux-arm-msm, robh, krzk+dt,
conor+dt, devicetree, linux-kernel
In-Reply-To: <CAFEp6-3JVicAVJB_+5ceSar2Jqstexo-0tyemg3C=qcznQsmxA@mail.gmail.com>
On Thu, Mar 5, 2026 at 1:16 PM Loic Poulain
<loic.poulain@oss.qualcomm.com> wrote:
>
> Could you please add these details to the commit message?
>
> Regards,
> Loic
Yes, I will send a v3 with more detailed commit messages for all patches.
I was asked to wait 24 hours between sending patch set revisions.
Apologies for my poor etiquette (sending HTML email).
Thanks,
- Kerigan
^ permalink raw reply
* Re: [PATCH v2 3/3] wifi: wcn36xx: add support for WCN3610
From: Loic Poulain @ 2026-03-05 19:16 UTC (permalink / raw)
To: Kerigan Creighton
Cc: Konrad Dybcio, linux-wireless, wcn36xx, andersson,
mathieu.poirier, linux-remoteproc, linux-arm-msm, robh, krzk+dt,
conor+dt, devicetree, linux-kernel
In-Reply-To: <CAN6+ztxfcNR8xR1qwgHQcHHM=zoQbMd-8oggb785ssPZ7f=y4w@mail.gmail.com>
On Thu, Mar 5, 2026 at 4:51 PM Kerigan Creighton
<kerigancreighton@gmail.com> wrote:
>
> [resending to the correct people]
>
> Some of it is observed behavior, some of it came from seeing what
> the downstream prima driver does.
>
> With the default configuration the WCN3610 shows extremely high
> packet loss (~95%). Setting ENABLE_DYNAMIC_RA_START_RATE=0
> (as done in the downstream prima driver) improves this significantly to
> around 5% packet loss.
>
> Further experimentation showed that configuring
> BTC_EXECUTION_MODE=2 eliminates the remaining packet loss.
> With the firmware default (BTC_EXECUTION_MODE=0) the chip emits
> BTC-related SMD events that the wcn36xx driver does not currently handle.
>
> BTC_EXECUTION_MODE=2 forces PTA_ONLY coexistence which avoids
> those events and results in stable operation. The downside is that this may
> increase power consumption because PA remains active.
Could you please add these details to the commit message?
Regards,
Loic
^ permalink raw reply
* [BUG] wifi: mt76: mt7925u: probe with driver mt7925u failed with error -110
From: Nick @ 2026-03-05 18:28 UTC (permalink / raw)
To: linux-wireless, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
Shayne Chen, Sean Wang, Deren Wu, Leon Yen
Reference: https://github.com/morrownr/USB-WiFi/issues/688#issuecomment-3999038526
The above thread is rather lengthy as we have been working on this
issue since Dec. 25.
Testing with a Netgear A9000 USB WiFi adapter (mt7925u driver). Kernel
7.0 rc2 and a x86_64 system. Additional testing with older kernels was
also performed with the same results.
Problem description:
Cold boot shows the adapter coming up and operating normally.
Removing the adapter from the USB port and replacing it shows the
adapter coming up and operating normally.
A warm reboot does not provide a WiFi interface and shows the
following in the system log:
mt7925u 2-3.2:1.0: probe with driver mt7925u failed with error -110
Using the commands rmmod and modeprobe do not provide a WiFi interface.
Thoughts: The problem likely is not the module teardown. The problem
seems to be that the firmware (or the mt7925u driver) leaves the
adapter in a strange state such that a power cycle of the adapter
hardware is needed before the mt7925u driver can properly initialize
it a second time.
Also: Testing with an adapter that uses the mt7921u driver does not
show this problem.
^ permalink raw reply
* [PATCH wireless] mac80211: fix crash in ieee80211_chan_bw_change for AP_VLAN stations
From: Felix Fietkau @ 2026-03-05 17:08 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes
ieee80211_chan_bw_change() iterates all stations and accesses
link->reserved.oper via sta->sdata->link[link_id]. For stations on
AP_VLAN interfaces (e.g. 4addr WDS clients), sta->sdata points to
the VLAN sdata, whose link never participates in chanctx reservations.
This leaves link->reserved.oper zero-initialized with chan == NULL,
causing a NULL pointer dereference in __ieee80211_sta_cap_rx_bw()
when accessing chandef->chan->band during CSA.
Resolve the VLAN sdata to its parent AP sdata using get_bss_sdata()
before accessing link data.
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/chan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 4447cf03c41b..f382b144ebac 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -561,13 +561,15 @@ static void ieee80211_chan_bw_change(struct ieee80211_local *local,
rcu_read_lock();
list_for_each_entry_rcu(sta, &local->sta_list,
list) {
- struct ieee80211_sub_if_data *sdata = sta->sdata;
+ struct ieee80211_sub_if_data *sdata;
enum ieee80211_sta_rx_bandwidth new_sta_bw;
unsigned int link_id;
if (!ieee80211_sdata_running(sta->sdata))
continue;
+ sdata = get_bss_sdata(sta->sdata);
+
for (link_id = 0; link_id < ARRAY_SIZE(sta->sdata->link); link_id++) {
struct ieee80211_link_data *link =
rcu_dereference(sdata->link[link_id]);
--
2.51.0
^ permalink raw reply related
* Re: [PATCH 1/2] ath6kl: add WQ_PERCPU to alloc_workqueue users
From: Frederic Weisbecker @ 2026-03-05 17:20 UTC (permalink / raw)
To: Marco Crivellari
Cc: linux-kernel, linux-wireless, Tejun Heo, Lai Jiangshan,
Sebastian Andrzej Siewior, Michal Hocko, Kalle Valo,
Andrew Morton
In-Reply-To: <CAAofZF5oAd18VV6ipoJDjiWvCeRxUh5KtdEZvPQ_DS71X_Vkzw@mail.gmail.com>
Le Thu, Mar 05, 2026 at 05:44:04PM +0100, Marco Crivellari a écrit :
> On Thu, Nov 13, 2025 at 5:12 PM Marco Crivellari
> <marco.crivellari@suse.com> wrote:
> >
> > Currently if a user enqueues a work item using schedule_delayed_work() the
> > used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
> > WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
> > schedule_work() that is using system_wq and queue_work(), that makes use
> > again of WORK_CPU_UNBOUND.
> >
> > This lack of consistency cannot be addressed without refactoring the API.
> > For more details see the Link tag below.
> >
> > alloc_workqueue() treats all queues as per-CPU by default, while unbound
> > workqueues must opt-in via WQ_UNBOUND.
> >
> > This default is suboptimal: most workloads benefit from unbound queues,
> > allowing the scheduler to place worker threads where they’re needed and
> > reducing noise when CPUs are isolated.
> >
> > This continues the effort to refactor workqueue APIs, which began with
> > the introduction of new workqueues and a new alloc_workqueue flag in:
> >
> > commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
> > commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
> >
> > This change adds a new WQ_PERCPU flag to explicitly request
> > alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.
> >
> > With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND),
> > any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND
> > must now use WQ_PERCPU.
> >
> > Once migration is complete, WQ_UNBOUND can be removed and unbound will
> > become the implicit default.
> >
> > Suggested-by: Tejun Heo <tj@kernel.org>
> > Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
> > Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
> > ---
> > drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
> > index 38bb501fc553..bfb21725d779 100644
> > --- a/drivers/net/wireless/ath/ath6kl/usb.c
> > +++ b/drivers/net/wireless/ath/ath6kl/usb.c
> > @@ -637,7 +637,7 @@ static struct ath6kl_usb *ath6kl_usb_create(struct usb_interface *interface)
> > ar_usb = kzalloc(sizeof(struct ath6kl_usb), GFP_KERNEL);
> > if (ar_usb == NULL)
> > return NULL;
> > - ar_usb->wq = alloc_workqueue("ath6kl_wq", 0, 0);
> > + ar_usb->wq = alloc_workqueue("ath6kl_wq", WQ_PERCPU, 0);
> > if (!ar_usb->wq) {
> > kfree(ar_usb);
> > return NULL;
>
> [ Cc-ing Andrew Morton ]
>
> Hello Andrew,
>
> This file is orphaned. Can you help me in order to have this patch merged?
>
> Thank you!
>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply
* Re: [PATCH 10/13] wifi: rt2x00: drop redundant device reference
From: Stanislaw Gruszka @ 2026-03-05 16:52 UTC (permalink / raw)
To: Johan Hovold
Cc: linux-wireless, Brian Norris, Francesco Dolcini, Felix Fietkau,
Lorenzo Bianconi, Ryder Lee, Shayne Chen, Sean Wang,
Jakub Kicinski, Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Matthias Brugger, AngeloGioacchino Del Regno, libertas-dev,
linux-kernel
In-Reply-To: <20260305110713.17725-11-johan@kernel.org>
On Thu, Mar 05, 2026 at 12:07:10PM +0100, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
>
> Drop the redundant device reference to reduce cargo culting, make it
> easier to spot drivers where an extra reference is needed, and reduce
> the risk of memory leaks when drivers fail to release it.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
> ---
> drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
> index 54599cad78f9..83d00b6baf64 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
> @@ -802,14 +802,12 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
> struct rt2x00_dev *rt2x00dev;
> int retval;
>
> - usb_dev = usb_get_dev(usb_dev);
> usb_reset_device(usb_dev);
>
> hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
> if (!hw) {
> rt2x00_probe_err("Failed to allocate hardware\n");
> - retval = -ENOMEM;
> - goto exit_put_device;
> + return -ENOMEM;
> }
>
> usb_set_intfdata(usb_intf, hw);
> @@ -851,10 +849,6 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
>
> exit_free_device:
> ieee80211_free_hw(hw);
> -
> -exit_put_device:
> - usb_put_dev(usb_dev);
> -
> usb_set_intfdata(usb_intf, NULL);
>
> return retval;
> @@ -873,11 +867,7 @@ void rt2x00usb_disconnect(struct usb_interface *usb_intf)
> rt2x00usb_free_reg(rt2x00dev);
> ieee80211_free_hw(hw);
>
> - /*
> - * Free the USB device data.
> - */
> usb_set_intfdata(usb_intf, NULL);
> - usb_put_dev(interface_to_usbdev(usb_intf));
> }
> EXPORT_SYMBOL_GPL(rt2x00usb_disconnect);
>
> --
> 2.52.0
>
^ permalink raw reply
* Re: [PATCH 1/2] ath6kl: add WQ_PERCPU to alloc_workqueue users
From: Marco Crivellari @ 2026-03-05 16:44 UTC (permalink / raw)
To: linux-kernel, linux-wireless
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Kalle Valo,
Andrew Morton
In-Reply-To: <20251113161248.387964-2-marco.crivellari@suse.com>
On Thu, Nov 13, 2025 at 5:12 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
>
> Currently if a user enqueues a work item using schedule_delayed_work() the
> used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
> WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
> schedule_work() that is using system_wq and queue_work(), that makes use
> again of WORK_CPU_UNBOUND.
>
> This lack of consistency cannot be addressed without refactoring the API.
> For more details see the Link tag below.
>
> alloc_workqueue() treats all queues as per-CPU by default, while unbound
> workqueues must opt-in via WQ_UNBOUND.
>
> This default is suboptimal: most workloads benefit from unbound queues,
> allowing the scheduler to place worker threads where they’re needed and
> reducing noise when CPUs are isolated.
>
> This continues the effort to refactor workqueue APIs, which began with
> the introduction of new workqueues and a new alloc_workqueue flag in:
>
> commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
> commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
>
> This change adds a new WQ_PERCPU flag to explicitly request
> alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.
>
> With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND),
> any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND
> must now use WQ_PERCPU.
>
> Once migration is complete, WQ_UNBOUND can be removed and unbound will
> become the implicit default.
>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
> Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
> ---
> drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
> index 38bb501fc553..bfb21725d779 100644
> --- a/drivers/net/wireless/ath/ath6kl/usb.c
> +++ b/drivers/net/wireless/ath/ath6kl/usb.c
> @@ -637,7 +637,7 @@ static struct ath6kl_usb *ath6kl_usb_create(struct usb_interface *interface)
> ar_usb = kzalloc(sizeof(struct ath6kl_usb), GFP_KERNEL);
> if (ar_usb == NULL)
> return NULL;
> - ar_usb->wq = alloc_workqueue("ath6kl_wq", 0, 0);
> + ar_usb->wq = alloc_workqueue("ath6kl_wq", WQ_PERCPU, 0);
> if (!ar_usb->wq) {
> kfree(ar_usb);
> return NULL;
[ Cc-ing Andrew Morton ]
Hello Andrew,
This file is orphaned. Can you help me in order to have this patch merged?
Thank you!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply
* Re: wireless-regdb: Update IN regulatory domain for lower 6 GHz (5925-6425 MHz)
From: Gaurav Kansal @ 2026-03-05 4:51 UTC (permalink / raw)
To: wens; +Cc: Degrader Snehil, linux-wireless, wireless-regdb
In-Reply-To: <CAGb2v6406826bWiKEQ0jf0TSPL9xtNx+i=_YCRJNnUjUftF0_w@mail.gmail.com>
Hi ChenYu,
Oh my miss.
Reagards,
Gaurav Kansal
From: Chen-Yu Tsai <wens@kernel.org>
To: "Gaurav Kansal"<gaurav.kansal@nic.gov.in>
Cc: "Degrader Snehil"<degradersnehil@gmail.com>, "linux-wireless"<linux-wireless@vger.kernel.org>, "wireless-regdb"<wireless-regdb@lists.infradead.org>
Date: Thu, 05 Mar 2026 10:01:05 +0530
Subject: Re: wireless-regdb: Update IN regulatory domain for lower 6 GHz (5925-6425 MHz)
> Hi,
>
> On Thu, Mar 5, 2026 at 1:28 PM Gaurav Kansal <gaurav.kansal@nic.gov.in> wrote:
> >
> > Hi ChenYu,
> >
> > Didn't the information is already merged as per my last patch submission?
>
> It looks like I requested some changes, and you agreed to send an update,
> but I never got it.
>
> ChenYu
>
> > Regards,
> > Gaurav Kansal
> >
> >
> >
> >
> > From: Chen-Yu Tsai <wens@kernel.org>
> > To: "Degrader Snehil"<degradersnehil@gmail.com>
> > Cc: <linux-wireless@vger.kernel.org>, "wireless-regdb"<wireless-regdb@lists.infradead.org>
> > Date: Thu, 05 Mar 2026 09:08:56 +0530
> > Subject: Re: wireless-regdb: Update IN regulatory domain for lower 6 GHz (5925-6425 MHz)
> >
> > > Hi,
> > >
> > > On Thu, Mar 5, 2026 at 3:16 AM Degrader Snehil <degradersnehil@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I would like to request an update to the IN (India) regulatory domain in wireless-regdb to add the newly permitted lower 6 GHz band (5925–6425 MHz).
> > >
> > > Thank you for the information. Would you like to provide a patch?
> > > If not, I can write up a patch and tag you as the reporter.
> > >
> > > > The Government of India has officially opened this band for licence-exempt use via Gazette Notification G.S.R. 47(E), dated January 20, 2026, published January 21, 2026, issued by the Ministry of Communications under the Indian Telegraph Act, 1885 and the Indian Wireless Telegraphy Act, 1933.
> > > >
> > > > Gazette details:
> > > > Title : Use of Low Power and Very Low Power Wireless Access System
> > > > including Radio Local Area Network in Lower 6 GHz Band
> > > > (Exemption from Licensing Requirement) Rules, 2026
> > > > File No : 24-04/2025-UBB
> > > > Gazette : No. 47, CG-DL-E-21012026-269488
> > > > Signed : Devendra Kumar Rai, Joint Secretary, Ministry of Communications
> > > > URL : https://www.dot.gov.in/static/uploads/2026/02/88f0ac8c74eb6f6907934d17d0015ab5.pdf
> > > > The Gazette defines two device classes for 5925–6425 MHz:
> > > >
> > > > 1. Low power indoor
> > > > - Max EIRP : 30 dBm
> > > > - Max PSD : 11 dBm/MHz
> > > > - Max bandwidth : 320 MHz
> > > > - Restriction : Indoor use only (Rule 5)
> > > >
> > > > 2. Very low power outdoor
> > > > - Max EIRP : 14 dBm
> > > > - Max PSD : 1 dBm/MHz
> > > > - Max bandwidth : 320 MHz
> > > > - Restriction : None
> > > >
> > > > Additional operational restrictions per Rule 5 of the Gazette:
> > > > - Band is prohibited on oil platforms
> > > > - Indoor use prohibited on land vehicles, boats and aircraft below 10,000 ft
> > > > - Communication with and control of drones/UAS is prohibited
> > > > - Contention-based protocol is mandatory for all devices (Rule 4)
> > > >
> > > > Out-of-band emission limit: -27 dBm/MHz outside 5925–6425 MHz (Rule 6)
> > > >
> > > > Proposed addition to the existing country IN entry in db.txt:
> > > >
> > > > country IN:
> > > > (2402 - 2482 @ 40), (30)
> > > > (5150 - 5250 @ 80), (30)
> > > > (5250 - 5350 @ 80), (24), DFS
> > > > (5470 - 5725 @ 160), (24), DFS
> > > > (5725 - 5875 @ 80), (30)
> > > > (5925 - 6425 @ 320), (30), NO-OUTDOOR # low power indoor
> > > > (5925 - 6425 @ 320), (14) # very low power outdoor
> > > >
> > > > Note: Since both device classes share the same frequency range but have different EIRP limits and indoor/outdoor restrictions, I have represented them as two separate lines. Please advise if a different encoding is more appropriate.
> > >
> > > Unfortunately we currently only support one rule per band. I'm inclined
> > > to add the VLP one so outdoor usage is allowed.
> > >
> > > > I have attached the official Gazette notification PDF as supporting evidence.
> > > >
> > > > Intel has also submitted a related update (Intel® Wireless Wi-Fi Drivers 24.20.2) for this band for India. I am not certain whether that patch covers wireless-regdb (db.txt) or only their iwlwifi driver internals, so I am submitting this request for wireless-regdb independently to ensure the authoritative database is updated.
> > >
> > > AFAIK Intel manages regulatory requirements in their firmware, so it is
> > > unrelated to the database we maintain.
> > >
> > > > Intel's Regulatory Domain Info was found in Release notes of their Intel® Wireless Wi-Fi Drivers 24.20.2 available at page 2 of https://downloadmirror.intel.com/914148/ReleaseNotes_WiFi_24.20.2.pdf.
> > > > Please let me know if any further information is needed.
> > >
> > > The information you provided is very detailed. Thanks!
> > >
> > >
> > > ChenYu
> > >
> > >
> >
> >
>
^ permalink raw reply
* [PATCH wireless-next v3 15/15] wifi: mac80211_hwsim: Add support for extended FTM ranging
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
From: Kavita Kavita <kavita.kavita@oss.qualcomm.com>
Introduce support for continuous ranging and advanced timing parameters
in the FTM (Fine Timing Measurement) request, response, and capability
paths. This enables more flexible ranging scenarios with improved
control over measurement timing and session management.
Signed-off-by: Kavita Kavita <kavita.kavita@oss.qualcomm.com>
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
drivers/net/wireless/virtual/mac80211_hwsim.c | 166 ++++++++++++++++++
1 file changed, 166 insertions(+)
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
index 32897d88bda3..31366ce1a1b7 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -846,6 +846,18 @@ hwsim_ftm_result_policy[NL80211_PMSR_FTM_RESP_ATTR_MAX + 1] = {
[NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD] = { .type = NLA_U64 },
[NL80211_PMSR_FTM_RESP_ATTR_LCI] = { .type = NLA_STRING },
[NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC] = { .type = NLA_STRING },
+ [NL80211_PMSR_FTM_RESP_ATTR_TX_LTF_REPETITION_COUNT] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_RX_LTF_REPETITION_COUNT] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_NUM_TX_SPATIAL_STREAMS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_NUM_RX_SPATIAL_STREAMS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_NOMINAL_TIME] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_AVAILABILITY_WINDOW] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_MEASUREMENTS_PER_AW] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_CHANNEL_WIDTH] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_PREAMBLE] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_RESP_ATTR_IS_DELAYED_LMR] = { .type = NLA_FLAG },
};
static const struct nla_policy
@@ -891,6 +903,16 @@ hwsim_ftm_capa_policy[NL80211_PMSR_FTM_CAPA_ATTR_MAX + 1] = {
[NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST] = NLA_POLICY_MAX(NLA_U8, 31),
[NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED] = { .type = NLA_FLAG },
[NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED] = { .type = NLA_FLAG },
+ [NL80211_PMSR_FTM_CAPA_ATTR_EDCA_BASED_RESPONDER] = { .type = NLA_FLAG },
+ [NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_PREAMBLES] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_CAPA_ATTR_RANGE_REPORT] = { .type = NLA_FLAG },
};
static const struct nla_policy
@@ -905,6 +927,12 @@ hwsim_pmsr_capa_policy[NL80211_PMSR_ATTR_MAX + 1] = {
[NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR] = { .type = NLA_FLAG },
[NL80211_PMSR_ATTR_TYPE_CAPA] = NLA_POLICY_NESTED(hwsim_pmsr_capa_type_policy),
[NL80211_PMSR_ATTR_PEERS] = { .type = NLA_REJECT }, // only for request.
+ [NL80211_PMSR_ATTR_PD_SUPPORT] = { .type = NLA_FLAG },
+ [NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT] = {
+ .type = NLA_FLAG
+ },
+ [NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE] = { .type = NLA_U32 },
+ [NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE] = { .type = NLA_U32 },
};
static const struct nla_policy hwsim_genl_policy[HWSIM_ATTR_MAX + 1] = {
@@ -3563,6 +3591,49 @@ static int mac80211_hwsim_send_pmsr_ftm_request_peer(struct sk_buff *msg,
if (nla_put_u8(msg, NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR, request->bss_color))
return -ENOBUFS;
+ if (request->min_time_between_measurements &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS,
+ request->min_time_between_measurements))
+ return -ENOBUFS;
+
+ if (request->max_time_between_measurements &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS,
+ request->max_time_between_measurements))
+ return -ENOBUFS;
+
+ if (request->availability_window &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION,
+ request->availability_window))
+ return -ENOBUFS;
+
+ if (request->nominal_time &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME,
+ request->nominal_time))
+ return -ENOBUFS;
+
+ if (request->measurements_per_aw &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW,
+ request->measurements_per_aw))
+ return -ENOBUFS;
+
+ if (request->ingress_distancemm &&
+ nla_put_u64_64bit(msg, NL80211_PMSR_FTM_REQ_ATTR_INGRESS,
+ request->ingress_distancemm, NL80211_PMSR_FTM_REQ_ATTR_PAD))
+ return -ENOBUFS;
+
+ if (request->egress_distancemm &&
+ nla_put_u64_64bit(msg, NL80211_PMSR_FTM_REQ_ATTR_EGRESS,
+ request->egress_distancemm, NL80211_PMSR_FTM_REQ_ATTR_PAD))
+ return -ENOBUFS;
+
+ if (request->range_report &&
+ nla_put_flag(msg, NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT))
+ return -ENOBUFS;
+
+ if (request->pd_suppress_range_results &&
+ nla_put_flag(msg, NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS))
+ return -ENOBUFS;
+
nla_nest_end(msg, ftm);
return 0;
@@ -3932,6 +4003,57 @@ static int mac80211_hwsim_parse_ftm_result(struct nlattr *ftm,
result->civicloc_len = nla_len(tb[NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC]);
}
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_TX_LTF_REPETITION_COUNT])
+ result->tx_ltf_repetition_count =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_TX_LTF_REPETITION_COUNT]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_RX_LTF_REPETITION_COUNT])
+ result->rx_ltf_repetition_count =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_RX_LTF_REPETITION_COUNT]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS])
+ result->max_time_between_measurements =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS])
+ result->min_time_between_measurements =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_NUM_TX_SPATIAL_STREAMS])
+ result->num_tx_spatial_streams =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_NUM_TX_SPATIAL_STREAMS]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_NUM_RX_SPATIAL_STREAMS])
+ result->num_rx_spatial_streams =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_NUM_RX_SPATIAL_STREAMS]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_NOMINAL_TIME])
+ result->nominal_time =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_NOMINAL_TIME]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_AVAILABILITY_WINDOW])
+ result->availability_window =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_AVAILABILITY_WINDOW]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_MEASUREMENTS_PER_AW])
+ result->measurements_per_aw =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_MEASUREMENTS_PER_AW]);
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_CHANNEL_WIDTH]) {
+ result->chan_width_valid = 1;
+ result->chan_width =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_CHANNEL_WIDTH]);
+ }
+
+ if (tb[NL80211_PMSR_FTM_RESP_ATTR_PREAMBLE]) {
+ result->preamble_valid = 1;
+ result->preamble =
+ nla_get_u32(tb[NL80211_PMSR_FTM_RESP_ATTR_PREAMBLE]);
+ }
+
+ result->is_delayed_lmr =
+ nla_get_flag(tb[NL80211_PMSR_FTM_RESP_ATTR_IS_DELAYED_LMR]);
+
return 0;
}
@@ -6433,6 +6555,41 @@ static int parse_ftm_capa(const struct nlattr *ftm_capa, struct cfg80211_pmsr_ca
out->ftm.request_civicloc = !!tb[NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC];
out->ftm.trigger_based = !!tb[NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED];
out->ftm.non_trigger_based = !!tb[NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED];
+ out->ftm.support_edca_responder = !!tb[NL80211_PMSR_FTM_CAPA_ATTR_EDCA_BASED_RESPONDER];
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS])
+ out->ftm.max_no_of_tx_antennas =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS])
+ out->ftm.max_no_of_rx_antennas =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA])
+ out->ftm.min_allowed_ranging_interval_edca =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB])
+ out->ftm.min_allowed_ranging_interval_ntb =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_PREAMBLES])
+ out->ftm.pd_edca_preambles =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_PREAMBLES]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES])
+ out->ftm.pd_ntb_preambles =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS])
+ out->ftm.pd_edca_bandwidths =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS]);
+
+ if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS])
+ out->ftm.pd_ntb_bandwidths =
+ nla_get_u32(tb[NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS]);
+
+ out->ftm.support_range_report = !!tb[NL80211_PMSR_FTM_CAPA_ATTR_RANGE_REPORT];
return 0;
}
@@ -6455,6 +6612,15 @@ static int parse_pmsr_capa(const struct nlattr *pmsr_capa, struct cfg80211_pmsr_
out->max_peers = nla_get_u32(tb[NL80211_PMSR_ATTR_MAX_PEERS]);
out->report_ap_tsf = !!tb[NL80211_PMSR_ATTR_REPORT_AP_TSF];
out->randomize_mac_addr = !!tb[NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR];
+ out->pd_support = !!tb[NL80211_PMSR_ATTR_PD_SUPPORT];
+ out->pd_concurrent_ista_rsta_support =
+ !!tb[NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT];
+ if (tb[NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE])
+ out->pd_max_peer_ista_role =
+ nla_get_u32(tb[NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE]);
+ if (tb[NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE])
+ out->pd_max_peer_rsta_role =
+ nla_get_u32(tb[NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE]);
if (!tb[NL80211_PMSR_ATTR_TYPE_CAPA]) {
NL_SET_ERR_MSG_ATTR(info->extack, tb[NL80211_PMSR_ATTR_TYPE_CAPA],
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 14/15] wifi: cfg80211: add LTF keyseed support for secure ranging
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Currently there is no way to install an LTF key seed that can be
used in non-trigger-based (NTB) and trigger-based (TB) FTM ranging
to protect NDP frames. Without this, drivers cannot enable PHY-layer
security for peer measurement sessions, leaving ranging measurements
vulnerable to eavesdropping and manipulation.
Introduce NL80211_KEY_LTF_SEED attribute and the dedicated extended
feature flag NL80211_EXT_FEATURE_SET_KEY_LTF_SEED to allow drivers
to advertise and install LTF key seeds via nl80211. The key seed
must be configured beforehand to ensure the peer measurement session
is secure. The driver must advertise both NL80211_EXT_FEATURE_SECURE_LTF
and NL80211_EXT_FEATURE_SET_KEY_LTF_SEED for the key seed installation
to be permitted.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/linux/ieee80211.h | 1 +
include/net/cfg80211.h | 4 ++++
include/uapi/linux/nl80211.h | 14 ++++++++++++++
net/wireless/nl80211.c | 13 +++++++++++++
4 files changed, 32 insertions(+)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 3651b2e6c518..20e243cef210 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2241,6 +2241,7 @@ struct ieee80211_multiple_bssid_configuration {
#define WLAN_AKM_SUITE_WFA_DPP SUITE(WLAN_OUI_WFA, 2)
#define WLAN_MAX_KEY_LEN 32
+#define WLAN_MAX_SECURE_LTF_KEYSEED_LEN 48
#define WLAN_PMK_NAME_LEN 16
#define WLAN_PMKID_LEN 16
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8dc2ccafb88b..66ea250f0b27 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -830,6 +830,8 @@ struct vif_params {
* @seq_len: length of @seq.
* @vlan_id: vlan_id for VLAN group key (if nonzero)
* @mode: key install mode (RX_TX, NO_TX or SET_TX)
+ * @ltf_keyseed: LTF key seed material
+ * @ltf_keyseed_len: length of LTF key seed material
*/
struct key_params {
const u8 *key;
@@ -839,6 +841,8 @@ struct key_params {
u16 vlan_id;
u32 cipher;
enum nl80211_key_mode mode;
+ const u8 *ltf_keyseed;
+ size_t ltf_keyseed_len;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index cafa73280758..923d2396b8f6 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -5602,6 +5602,14 @@ enum nl80211_key_default_types {
* @NL80211_KEY_MODE: the mode from enum nl80211_key_mode.
* Defaults to @NL80211_KEY_RX_TX.
* @NL80211_KEY_DEFAULT_BEACON: flag indicating default Beacon frame key
+ * @NL80211_KEY_LTF_SEED: LTF key seed is used by the driver to generate
+ * secure LTF keys used in case of peer measurement request with FTM
+ * request type as either %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED
+ * or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, secure LTF key seeds will
+ * help enable PHY security in peer measurement session. The corresponding
+ * keys need to be configured beforehand to ensure peer measurement
+ * session is secure. Only valid if %NL80211_EXT_FEATURE_SET_KEY_LTF_SEED
+ * and %NL80211_EXT_FEATURE_SECURE_LTF is set.
*
* @__NL80211_KEY_AFTER_LAST: internal
* @NL80211_KEY_MAX: highest key attribute
@@ -5618,6 +5626,7 @@ enum nl80211_key_attributes {
NL80211_KEY_DEFAULT_TYPES,
NL80211_KEY_MODE,
NL80211_KEY_DEFAULT_BEACON,
+ NL80211_KEY_LTF_SEED,
/* keep last */
__NL80211_KEY_AFTER_LAST,
@@ -6847,6 +6856,10 @@ enum nl80211_feature_flags {
* forward frames with a matching MAC address to userspace during
* the off-channel period.
*
+ * @NL80211_EXT_FEATURE_SET_KEY_LTF_SEED: Driver supports installing the
+ * LTF key seed via %NL80211_KEY_LTF_SEED. The seed is used to generate
+ * secure LTF keys for secure LTF measurement sessions.
+ *
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/
@@ -6927,6 +6940,7 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION,
NL80211_EXT_FEATURE_IEEE8021X_AUTH,
NL80211_EXT_FEATURE_ROC_ADDR_FILTER,
+ NL80211_EXT_FEATURE_SET_KEY_LTF_SEED,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 313bad0d4a77..43dbd6faed4a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -975,6 +975,8 @@ static const struct nla_policy nl80211_key_policy[NL80211_KEY_MAX + 1] = {
[NL80211_KEY_TYPE] = NLA_POLICY_MAX(NLA_U32, NUM_NL80211_KEYTYPES - 1),
[NL80211_KEY_DEFAULT_TYPES] = { .type = NLA_NESTED },
[NL80211_KEY_MODE] = NLA_POLICY_RANGE(NLA_U8, 0, NL80211_KEY_SET_TX),
+ [NL80211_KEY_LTF_SEED] = { .type = NLA_BINARY,
+ .len = WLAN_MAX_SECURE_LTF_KEYSEED_LEN },
};
/* policy for the key default flags */
@@ -1451,6 +1453,7 @@ struct key_parse {
static int nl80211_parse_key_new(struct genl_info *info, struct nlattr *key,
struct key_parse *k)
{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct nlattr *tb[NL80211_KEY_MAX + 1];
int err = nla_parse_nested_deprecated(tb, NL80211_KEY_MAX, key,
nl80211_key_policy,
@@ -1506,6 +1509,16 @@ static int nl80211_parse_key_new(struct genl_info *info, struct nlattr *key,
if (tb[NL80211_KEY_MODE])
k->p.mode = nla_get_u8(tb[NL80211_KEY_MODE]);
+ if (tb[NL80211_KEY_LTF_SEED]) {
+ if (!wiphy_ext_feature_isset(&rdev->wiphy,
+ NL80211_EXT_FEATURE_SECURE_LTF) ||
+ !wiphy_ext_feature_isset(&rdev->wiphy,
+ NL80211_EXT_FEATURE_SET_KEY_LTF_SEED))
+ return -EOPNOTSUPP;
+ k->p.ltf_keyseed = nla_data(tb[NL80211_KEY_LTF_SEED]);
+ k->p.ltf_keyseed_len = nla_len(tb[NL80211_KEY_LTF_SEED]);
+ }
+
return 0;
}
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 13/15] wifi: cfg80211: add result reporting control for PD requests
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Proximity detection applications may not need detailed ranging
measurements for every request, yet currently receive all results
causing unnecessary data transfer, host wakeups, and processing
overhead. Currently, there is no mechanism for applications to
suppress result reporting when only proximity detection is needed.
Introduce optional result suppression control that drivers can use
to implement selective result reporting. Add a flag allowing
applications to disable ranging reports when only proximity detection
is needed, enabling drivers to reduce unnecessary data transfer and
host wakeups. This flag cannot be combined with range report or LMR
feedback requests in RSTA mode as these require result reporting.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 8 +++++++-
include/uapi/linux/nl80211.h | 7 +++++++
net/wireless/nl80211.c | 1 +
net/wireless/pmsr.c | 18 ++++++++++++++++++
4 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e398a594082a..8dc2ccafb88b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4448,6 +4448,11 @@ struct cfg80211_pmsr_result {
* basis in this case.
* @range_report: negotiate for FTM range report. Only valid for
* EDCA based ranging.
+ * @pd_suppress_range_results: flag to suppress ranging results for PD
+ * requests. When set, ranging measurements are performed but results
+ * are not reported to userspace, regardless of ranging role or type.
+ * Only valid when @pd_request is set. Cannot be used with @range_report
+ * or @lmr_feedback as these require result reporting.
*
* See also nl80211 for the respective attribute documentation.
*/
@@ -4474,7 +4479,8 @@ struct cfg80211_pmsr_ftm_request_peer {
u32 measurements_per_aw;
u64 ingress_distancemm;
u64 egress_distancemm;
- u8 range_report:1;
+ u8 range_report:1,
+ pd_suppress_range_results:1;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index a70dcb2aa111..cafa73280758 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -8082,6 +8082,12 @@ enum nl80211_peer_measurement_ftm_capa {
* (units mm, u64)
* @NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT: Negotiate Range report in case of
* EDCA based ranging (flag).
+ * @NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS: Flag to suppress ranging
+ * results for PD requests. When set, ranging measurements are performed
+ * but results are not reported to userspace, regardless of ranging role
+ * or type. Only valid when %NL80211_PMSR_PEER_ATTR_PD_REQUEST is set.
+ * Cannot be used with %NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT or
+ * %NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK as these require result reporting.
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -8112,6 +8118,7 @@ enum nl80211_peer_measurement_ftm_req {
NL80211_PMSR_FTM_REQ_ATTR_INGRESS,
NL80211_PMSR_FTM_REQ_ATTR_EGRESS,
NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT,
+ NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS,
/* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 69f972af7e64..313bad0d4a77 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -384,6 +384,7 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
[NL80211_PMSR_FTM_REQ_ATTR_INGRESS] = { .type = NLA_U64 },
[NL80211_PMSR_FTM_REQ_ATTR_EGRESS] = { .type = NLA_U64 },
[NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT] = { .type = NLA_FLAG },
+ [NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS] = { .type = NLA_FLAG },
};
static const struct nla_policy
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index 9a2e84805a31..eb372c2a6744 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -277,6 +277,24 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
return -EINVAL;
}
+ out->ftm.pd_suppress_range_results =
+ nla_get_flag(tb[NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS]);
+
+ if (!out->pd_request && out->ftm.pd_suppress_range_results) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS],
+ "FTM: suppress range result flag only valid for PD requests");
+ return -EINVAL;
+ }
+
+ if (out->ftm.pd_suppress_range_results && out->ftm.rsta &&
+ (out->ftm.range_report || out->ftm.lmr_feedback)) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_FTM_REQ_ATTR_PD_SUPPRESS_RESULTS],
+ "FTM: cannot report with suppressed results");
+ return -EINVAL;
+ }
+
return 0;
}
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 12/15] wifi: cfg80211: add FTM range report negotiation support
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Non-trigger based and trigger-based ranging use Location Measurement
Report for result exchange. EDCA-based ranging lacks an equivalent
mechanism to negotiate whether range measurement reports should be
exchanged after the FTM session.
Introduce FTM range report negotiation for EDCA-based ranging as
specified in "Proximity Ranging (PR) Implementation Consideration
Draft 1.9 Rev 1, section 5.2.2". Add a capability flag and request
attribute allowing devices to advertise support and applications
to request range reports for EDCA sessions.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 8 +++++++-
include/uapi/linux/nl80211.h | 6 ++++++
net/wireless/nl80211.c | 4 ++++
net/wireless/pmsr.c | 18 ++++++++++++++++++
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 61651ecc3c9d..e398a594082a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4446,6 +4446,8 @@ struct cfg80211_pmsr_result {
* to be indicated in case the device moves out of this range.
* (units mm, u64). measurement results need to be sent on a burst index
* basis in this case.
+ * @range_report: negotiate for FTM range report. Only valid for
+ * EDCA based ranging.
*
* See also nl80211 for the respective attribute documentation.
*/
@@ -4472,6 +4474,7 @@ struct cfg80211_pmsr_ftm_request_peer {
u32 measurements_per_aw;
u64 ingress_distancemm;
u64 egress_distancemm;
+ u8 range_report:1;
};
/**
@@ -5832,6 +5835,8 @@ cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
* @ftm.support_rsta: supports operating as RSTA in PMSR FTM request
* @ftm.support_edca_responder: supports operating as FTM responder in PMSR FTM
* request for EDCA-based ranging
+ * @ftm.support_range_report: capable of negotiating for FTM range report. Only
+ * valid for EDCA based ranging.
* @ftm.pd_edca_preambles: bitmap of preambles supported
* (&enum nl80211_preamble) in case of PD request with EDCA based
* initiator or responder role. ignored if @pd_support is not set.
@@ -5878,7 +5883,8 @@ struct cfg80211_pmsr_capabilities {
u32 min_allowed_ranging_interval_edca;
u32 min_allowed_ranging_interval_ntb;
u8 support_rsta:1,
- support_edca_responder:1;
+ support_edca_responder:1,
+ support_range_report:1;
u32 pd_edca_preambles;
u32 pd_ntb_preambles;
u32 pd_edca_bandwidths;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f064d6a260fb..a70dcb2aa111 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -7960,6 +7960,8 @@ enum nl80211_peer_measurement_attrs {
* Note that a higher channel bandwidth may be configured to allow for
* other measurements types with different bandwidth requirement in the
* same measurement.
+ * @NL80211_PMSR_FTM_CAPA_ATTR_RANGE_REPORT: flag indicating if range report
+ * negotiation and reporting is supported in case of EDCA based ranging.
*
* @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
@@ -7994,6 +7996,7 @@ enum nl80211_peer_measurement_ftm_capa {
NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES,
NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS,
NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS,
+ NL80211_PMSR_FTM_CAPA_ATTR_RANGE_REPORT,
/* keep last */
NUM_NL80211_PMSR_FTM_CAPA_ATTR,
@@ -8077,6 +8080,8 @@ enum nl80211_peer_measurement_ftm_capa {
* @NL80211_PMSR_FTM_REQ_ATTR_EGRESS: the measurement result of the peer needs
* to be indicated in case the device moves out of this range.
* (units mm, u64)
+ * @NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT: Negotiate Range report in case of
+ * EDCA based ranging (flag).
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -8106,6 +8111,7 @@ enum nl80211_peer_measurement_ftm_req {
NL80211_PMSR_FTM_REQ_ATTR_PAD,
NL80211_PMSR_FTM_REQ_ATTR_INGRESS,
NL80211_PMSR_FTM_REQ_ATTR_EGRESS,
+ NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT,
/* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4de5ec8c5aaf..69f972af7e64 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -383,6 +383,7 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
[NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW] = NLA_POLICY_MAX(NLA_U32, 4),
[NL80211_PMSR_FTM_REQ_ATTR_INGRESS] = { .type = NLA_U64 },
[NL80211_PMSR_FTM_REQ_ATTR_EGRESS] = { .type = NLA_U64 },
+ [NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT] = { .type = NLA_FLAG },
};
static const struct nla_policy
@@ -2419,6 +2420,9 @@ nl80211_send_pmsr_ftm_capa(const struct cfg80211_pmsr_capabilities *cap,
if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS,
cap->ftm.pd_ntb_bandwidths))
return -ENOBUFS;
+ if (cap->ftm.support_range_report &&
+ nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_RANGE_REPORT))
+ return -ENOBUFS;
nla_nest_end(msg, ftm);
return 0;
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index 364034843df7..9a2e84805a31 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -259,6 +259,24 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
out->ftm.egress_distancemm =
nla_get_u64(tb[NL80211_PMSR_FTM_REQ_ATTR_EGRESS]);
+ out->ftm.range_report =
+ nla_get_flag(tb[NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT]);
+
+ if (!capa->ftm.support_range_report && out->ftm.range_report) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT],
+ "FTM: Range report negotiation not supported");
+ return -EOPNOTSUPP;
+ }
+
+ if ((out->ftm.non_trigger_based || out->ftm.trigger_based) &&
+ out->ftm.range_report) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_FTM_REQ_ATTR_RANGE_REPORT],
+ "FTM: Range report request is not valid for TB/NTB ranging");
+ return -EINVAL;
+ }
+
return 0;
}
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 11/15] wifi: cfg80211: add PD-specific preamble and bandwidth capabilities
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Some devices support different preamble and bandwidth configurations
for proximity detection (PD) versus standard ranging, but capabilities
currently report only a single set for all FTM measurements.
Introduce separate preamble and bandwidth capability reporting for PD
requests with EDCA and NTB-based ranging, allowing devices to advertise
different supported preambles and bandwidths for PD operations.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 16 ++++++++++++++++
include/uapi/linux/nl80211.h | 22 ++++++++++++++++++++++
net/wireless/nl80211.c | 12 ++++++++++++
net/wireless/pmsr.c | 21 +++++++++++++++++++--
4 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1b663627a0e6..61651ecc3c9d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5832,6 +5832,18 @@ cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
* @ftm.support_rsta: supports operating as RSTA in PMSR FTM request
* @ftm.support_edca_responder: supports operating as FTM responder in PMSR FTM
* request for EDCA-based ranging
+ * @ftm.pd_edca_preambles: bitmap of preambles supported
+ * (&enum nl80211_preamble) in case of PD request with EDCA based
+ * initiator or responder role. ignored if @pd_support is not set.
+ * @ftm.pd_ntb_preambles: bitmap of preambles supported
+ * (&enum nl80211_preamble) in case of PD request with NTB based
+ * initiator or responder role. ignored if @pd_support is not set.
+ * @ftm.pd_edca_bandwidths: bitmap of bandwidths supported
+ * (&enum nl80211_chan_width) in case of PD request with EDCA based
+ * initiator or responder role. ignored if @pd_support is not set.
+ * @ftm.pd_ntb_bandwidths: bitmap of bandwidths supported
+ * (&enum nl80211_chan_width) in case of PD request with NTB based
+ * initiator or responder role. ignored if @pd_support is not set.
*/
struct cfg80211_pmsr_capabilities {
unsigned int max_peers;
@@ -5867,6 +5879,10 @@ struct cfg80211_pmsr_capabilities {
u32 min_allowed_ranging_interval_ntb;
u8 support_rsta:1,
support_edca_responder:1;
+ u32 pd_edca_preambles;
+ u32 pd_ntb_preambles;
+ u32 pd_edca_bandwidths;
+ u32 pd_ntb_bandwidths;
} ftm;
};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 174592017486..f064d6a260fb 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -7942,6 +7942,24 @@ enum nl80211_peer_measurement_attrs {
* @NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB: u32 attribute indicating
* the minimum NTB ranging interval supported by the device
* in milli seconds. (0 means unknown)
+ * @NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_PREAMBLES: u32 bitmap of values from
+ * &enum nl80211_preamble indicating the supported preambles for FTM in
+ * case of PD based EDCA initiator or responder role.
+ * @NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES: u32 bitmap of values from
+ * &enum nl80211_preamble indicating the supported preambles for FTM in
+ * case of PD based NTB initiator or responder role.
+ * @NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS: u32 bitmap of values from
+ * &enum nl80211_chan_width indicating the supported channel
+ * bandwidths for FTM in case of PD based EDCA initiator or responder role.
+ * Note that a higher channel bandwidth may be configured to allow for
+ * other measurements types with different bandwidth requirement in the
+ * same measurement.
+ * @NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS: u32 bitmap of values from
+ * &enum nl80211_chan_width indicating the supported channel
+ * bandwidths for FTM in case of PD based NTB initiator or responder role.
+ * Note that a higher channel bandwidth may be configured to allow for
+ * other measurements types with different bandwidth requirement in the
+ * same measurement.
*
* @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
@@ -7972,6 +7990,10 @@ enum nl80211_peer_measurement_ftm_capa {
NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS,
NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA,
NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB,
+ NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_PREAMBLES,
+ NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES,
+ NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS,
+ NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS,
/* keep last */
NUM_NL80211_PMSR_FTM_CAPA_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index adbc53808135..4de5ec8c5aaf 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2407,6 +2407,18 @@ nl80211_send_pmsr_ftm_capa(const struct cfg80211_pmsr_capabilities *cap,
nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB,
cap->ftm.min_allowed_ranging_interval_ntb))
return -ENOBUFS;
+ if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_PREAMBLES,
+ cap->ftm.pd_edca_preambles))
+ return -ENOBUFS;
+ if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_PREAMBLES,
+ cap->ftm.pd_ntb_preambles))
+ return -ENOBUFS;
+ if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_PD_EDCA_BANDWIDTHS,
+ cap->ftm.pd_edca_bandwidths))
+ return -ENOBUFS;
+ if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_PD_NTB_BANDWIDTHS,
+ cap->ftm.pd_ntb_bandwidths))
+ return -ENOBUFS;
nla_nest_end(msg, ftm);
return 0;
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index b7e3f3a33460..364034843df7 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -17,11 +17,19 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
u32 preamble = NL80211_PREAMBLE_DMG; /* only optional in DMG */
/* validate existing data */
- if (!(rdev->wiphy.pmsr_capa->ftm.bandwidths & BIT(out->chandef.width))) {
+ if (!out->pd_request &&
+ !(rdev->wiphy.pmsr_capa->ftm.bandwidths & BIT(out->chandef.width))) {
NL_SET_ERR_MSG(info->extack, "FTM: unsupported bandwidth");
return -EINVAL;
}
+ if (out->pd_request &&
+ !(rdev->wiphy.pmsr_capa->ftm.pd_edca_bandwidths & BIT(out->chandef.width)) &&
+ !(rdev->wiphy.pmsr_capa->ftm.pd_ntb_bandwidths & BIT(out->chandef.width))) {
+ NL_SET_ERR_MSG(info->extack, "FTM: unsupported bandwidth for pd request");
+ return -EINVAL;
+ }
+
/* no validation needed - was already done via nested policy */
nla_parse_nested_deprecated(tb, NL80211_PMSR_FTM_REQ_ATTR_MAX, ftmreq,
NULL, NULL);
@@ -44,13 +52,22 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
}
}
- if (!(capa->ftm.preambles & BIT(preamble))) {
+ if (!out->pd_request && !(capa->ftm.preambles & BIT(preamble))) {
NL_SET_ERR_MSG_ATTR(info->extack,
tb[NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE],
"FTM: invalid preamble");
return -EINVAL;
}
+ if (out->pd_request &&
+ !(capa->ftm.pd_ntb_preambles & BIT(preamble)) &&
+ !(capa->ftm.pd_edca_preambles & BIT(preamble))) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE],
+ "FTM: invalid preamble for PD request");
+ return -EINVAL;
+ }
+
out->ftm.preamble = preamble;
out->ftm.burst_period = 0;
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 10/15] wifi: cfg80211: add ingress/egress distance thresholds for FTM
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Proximity detection applications need to receive measurement results
only when devices cross specific distance boundaries to avoid
unnecessary host wakeups and reduce power consumption. Currently,
there is no mechanism for applications to specify these distance
thresholds.
Introduce configurable distance-based reporting thresholds that
drivers can use to implement selective result reporting. Add
ingress and egress distance parameters allowing applications to
specify when results should be reported as peers cross these
boundaries, enabling drivers to reduce unnecessary data transfer
and host wakeups.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 9 +++++++++
include/uapi/linux/nl80211.h | 9 +++++++++
net/wireless/nl80211.c | 2 ++
net/wireless/pmsr.c | 8 ++++++++
4 files changed, 28 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8bbca2a98ac1..1b663627a0e6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4439,6 +4439,13 @@ struct cfg80211_pmsr_result {
* in units of milli seconds. Only valid if @non_trigger_based is set.
* @measurements_per_aw: number of measurement attempts per availability window
* with a maximum value of 4. Only valid if @non_trigger_based is set.
+ * @ingress_distancemm: the measurement result of the peer needs
+ * to be indicated in case the device moves into this range.(units mm, u64)
+ * measurement results need to be sent on a burst index basis in this case.
+ * @egress_distancemm: the measurement result of the peer needs
+ * to be indicated in case the device moves out of this range.
+ * (units mm, u64). measurement results need to be sent on a burst index
+ * basis in this case.
*
* See also nl80211 for the respective attribute documentation.
*/
@@ -4463,6 +4470,8 @@ struct cfg80211_pmsr_ftm_request_peer {
u32 availability_window;
u32 nominal_time;
u32 measurements_per_aw;
+ u64 ingress_distancemm;
+ u64 egress_distancemm;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 83d2a822c770..174592017486 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -8049,6 +8049,12 @@ enum nl80211_peer_measurement_ftm_capa {
* @NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW: meas per AW field shall indicate the
* number of measurements attempts per AW with a maximum value of 4 (u32).
* Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+ * @NL80211_PMSR_FTM_REQ_ATTR_PAD: ignore, for u64/s64 padding only
+ * @NL80211_PMSR_FTM_REQ_ATTR_INGRESS: the measurement result of the peer needs
+ * to be indicated in case the device moves into this range.(units mm, u64)
+ * @NL80211_PMSR_FTM_REQ_ATTR_EGRESS: the measurement result of the peer needs
+ * to be indicated in case the device moves out of this range.
+ * (units mm, u64)
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -8075,6 +8081,9 @@ enum nl80211_peer_measurement_ftm_req {
NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME,
NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION,
NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW,
+ NL80211_PMSR_FTM_REQ_ATTR_PAD,
+ NL80211_PMSR_FTM_REQ_ATTR_INGRESS,
+ NL80211_PMSR_FTM_REQ_ATTR_EGRESS,
/* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0642b7a31a32..adbc53808135 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -381,6 +381,8 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
[NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME] = { .type = NLA_U32 },
[NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION] = NLA_POLICY_MAX(NLA_U32, 255),
[NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW] = NLA_POLICY_MAX(NLA_U32, 4),
+ [NL80211_PMSR_FTM_REQ_ATTR_INGRESS] = { .type = NLA_U64 },
+ [NL80211_PMSR_FTM_REQ_ATTR_EGRESS] = { .type = NLA_U64 },
};
static const struct nla_policy
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index ab25fe07c946..b7e3f3a33460 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -234,6 +234,14 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
return -EINVAL;
}
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_INGRESS])
+ out->ftm.ingress_distancemm =
+ nla_get_u64(tb[NL80211_PMSR_FTM_REQ_ATTR_INGRESS]);
+
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_EGRESS])
+ out->ftm.egress_distancemm =
+ nla_get_u64(tb[NL80211_PMSR_FTM_REQ_ATTR_EGRESS]);
+
return 0;
}
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 09/15] wifi: cfg80211: add role-based PD peer limits
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Peer measurement capabilities currently advertise a single maximum
peer count regardless of device role for proximity detection (PD).
Some devices support different peer limits when operating as PD
initiator versus PD responder.
Introduce separate peer limit capabilities for each PD role. When a
device supports concurrent initiator and responder operation,
enforce the sum of both limits to prevent resource oversubscription.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 12 ++++++++++++
include/uapi/linux/nl80211.h | 16 ++++++++++++++++
net/wireless/nl80211.c | 10 ++++++++++
net/wireless/pmsr.c | 32 ++++++++++++++++++++++++++++----
4 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index febd7bf50d88..8bbca2a98ac1 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5776,6 +5776,16 @@ cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
* multi-peer request this will indicate if the device can act
* simultaneously as initiator and a responder. Only valid if @pd_support
* is set.
+ * @pd_max_peer_ista_role: Maximum number of peers allowed for a device
+ * operating in the ISTA role under proximity detection. Only valid if
+ * @pd_support is set. Sum of both @pd_max_peer_ista_role and
+ * @pd_max_peer_rsta_role is considered to enforce the max peers supported
+ * in case the request is of peer-to-peer PD type.
+ * @pd_max_peer_rsta_role: Maximum number of peers allowed for a device
+ * operating in the RSTA role under proximity detection. Only valid if
+ * @pd_support is set. Sum of both @pd_max_peer_ista_role and
+ * @pd_max_peer_rsta_role is considered to enforce the max peers supported
+ * in case the request is of peer-to-peer PD type
* @ftm: FTM measurement data
* @ftm.supported: FTM measurement is supported
* @ftm.asap: ASAP-mode is supported
@@ -5820,6 +5830,8 @@ struct cfg80211_pmsr_capabilities {
randomize_mac_addr:1,
pd_support:1,
pd_concurrent_ista_rsta_support:1;
+ u32 pd_max_peer_ista_role;
+ u32 pd_max_peer_rsta_role;
struct {
u32 preambles;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 67cc1ce6d2a1..83d2a822c770 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -7841,6 +7841,20 @@ enum nl80211_peer_measurement_peer_attrs {
* multi-peer request, the device can act simultaneously as initiator and
* a responder, where the multiple requests are being processed
* simultaneously
+ * @NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE: u32 attribute indicating the
+ * maximum number of peers allowed for a device operating in the ISTA
+ * (Initiator STA) role under proximity detection. Only valid if
+ * %NL80211_PMSR_ATTR_PD_SUPPORT is set. Sum of both
+ * %NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE and
+ * %NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE is considered to enforce the
+ * max peers supported in case the request is of peer-to-peer PD type
+ * @NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE: u32 attribute indicating the
+ * maximum number of peers allowed for a device operating in the RSTA
+ * (Responder STA) role under proximity detection. Only valid if
+ * %NL80211_PMSR_ATTR_PD_SUPPORT is set. Sum of both
+ * %NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE and
+ * %NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE is considered to enforce the
+ * max peers supported in case the request is of peer-to-peer PD type
*
* @NUM_NL80211_PMSR_ATTR: internal
* @NL80211_PMSR_ATTR_MAX: highest attribute number
@@ -7855,6 +7869,8 @@ enum nl80211_peer_measurement_attrs {
NL80211_PMSR_ATTR_PEERS,
NL80211_PMSR_ATTR_PD_SUPPORT,
NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT,
+ NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE,
+ NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE,
/* keep last */
NUM_NL80211_PMSR_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 01a70f1898bc..0642b7a31a32 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2447,6 +2447,16 @@ static int nl80211_send_pmsr_capa(struct cfg80211_registered_device *rdev,
nla_put_flag(msg,
NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT))
return -ENOBUFS;
+
+ if (cap->pd_max_peer_ista_role &&
+ nla_put_u32(msg, NL80211_PMSR_ATTR_PD_MAX_PEER_ISTA_ROLE,
+ cap->pd_max_peer_ista_role))
+ return -ENOBUFS;
+
+ if (cap->pd_max_peer_rsta_role &&
+ nla_put_u32(msg, NL80211_PMSR_ATTR_PD_MAX_PEER_RSTA_ROLE,
+ cap->pd_max_peer_rsta_role))
+ return -ENOBUFS;
}
caps = nla_nest_start_noflag(msg, NL80211_PMSR_ATTR_TYPE_CAPA);
if (!caps)
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index a0c07fd841d8..ab25fe07c946 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -326,12 +326,15 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info)
{
struct nlattr *reqattr = info->attrs[NL80211_ATTR_PEER_MEASUREMENTS];
struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ int count, rem, err, idx, pd_count, max_pd_peers;
struct wireless_dev *wdev = info->user_ptr[1];
+ const struct cfg80211_pmsr_capabilities *capa;
struct cfg80211_pmsr_request *req;
struct nlattr *peers, *peer;
- int count, rem, err, idx;
- if (!rdev->wiphy.pmsr_capa)
+ capa = rdev->wiphy.pmsr_capa;
+
+ if (!capa)
return -EOPNOTSUPP;
if (!reqattr)
@@ -346,7 +349,7 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info)
nla_for_each_nested(peer, peers, rem) {
count++;
- if (count > rdev->wiphy.pmsr_capa->max_peers) {
+ if (count > capa->max_peers) {
NL_SET_ERR_MSG_ATTR(info->extack, peer,
"Too many peers used");
return -EINVAL;
@@ -362,7 +365,7 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info)
req->timeout = nla_get_u32(info->attrs[NL80211_ATTR_TIMEOUT]);
if (info->attrs[NL80211_ATTR_MAC]) {
- if (!rdev->wiphy.pmsr_capa->randomize_mac_addr) {
+ if (!capa->randomize_mac_addr) {
NL_SET_ERR_MSG_ATTR(info->extack,
info->attrs[NL80211_ATTR_MAC],
"device cannot randomize MAC address");
@@ -387,6 +390,27 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info)
goto out_err;
idx++;
}
+
+ /* Count PD requests and validate against PD peer limits */
+ if (capa->pd_support) {
+ pd_count = 0;
+
+ max_pd_peers = capa->pd_max_peer_ista_role +
+ capa->pd_max_peer_rsta_role;
+
+ for (idx = 0; idx < req->n_peers; idx++) {
+ if (req->peers[idx].pd_request) {
+ pd_count++;
+
+ if (pd_count > max_pd_peers) {
+ NL_SET_ERR_MSG(info->extack,
+ "Too many PD peers used");
+ err = -EINVAL;
+ goto out_err;
+ }
+ }
+ }
+ }
req->cookie = cfg80211_assign_cookie(rdev);
req->nl_portid = info->snd_portid;
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 08/15] wifi: cfg80211: extend PMSR FTM response for proximity ranging
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Applications need negotiated session parameters to interpret
proximity ranging results and perform post-processing. Currently,
the FTM response lacks LTF repetition counts, time constraints,
spatial stream configuration, and availability window parameters.
Extend the FTM response structure to report these negotiated
parameters, enabling applications to track session configuration
and use them in post-processing to increase ranging precision.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 61 ++++++++++++++++++++++++++++++++++--
include/uapi/linux/nl80211.h | 42 ++++++++++++++++++++++++-
net/wireless/pmsr.c | 16 ++++++++++
3 files changed, 116 insertions(+), 3 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b66300497312..febd7bf50d88 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4260,6 +4260,27 @@ struct cfg80211_ftm_responder_stats {
* (must have either this or @rtt_avg)
* @dist_variance: variance of distances measured (see also @rtt_variance)
* @dist_spread: spread of distances measured (see also @rtt_spread)
+ * @tx_ltf_repetition_count: negotiated value of number of tx ltf repetitions
+ * in NDP frames
+ * @rx_ltf_repetition_count: negotiated value of number of rx ltf repetitions
+ * in NDP frames
+ * @max_time_between_measurements: the negotiated maximum interval (in units of
+ * 10 ms) by which the ISTA must complete the next measurement cycle.
+ * @min_time_between_measurements: the negotiated minimum interval (in units of
+ * 100 us) between two consecutive range measurements initiated by the
+ * ISTA.
+ * @num_tx_spatial_streams: number of Tx space-time streams used in the NDP
+ * frame during the measurement sounding phase.
+ * @num_rx_spatial_streams: number of Rx space-time streams used in the NDP
+ * frame during the measurement sounding phase.
+ * @nominal_time: negotiated nominal duration between adjacent availability
+ * windows in units of milliseconds (u32).
+ * @availability_window: negotiated availability window time used in this
+ * session in units of milliseconds (u32).
+ * @measurements_per_aw: negotiated number of measurement attempts per
+ * availability window.
+ * @chan_width: band width used for measurement.
+ * @preamble: preamble used for measurement.
* @num_ftmr_attempts_valid: @num_ftmr_attempts is valid
* @num_ftmr_successes_valid: @num_ftmr_successes is valid
* @rssi_avg_valid: @rssi_avg is valid
@@ -4272,6 +4293,19 @@ struct cfg80211_ftm_responder_stats {
* @dist_avg_valid: @dist_avg is valid
* @dist_variance_valid: @dist_variance is valid
* @dist_spread_valid: @dist_spread is valid
+ * @tx_ltf_repetition_count_valid: @tx_ltf_repetition_count is valid
+ * @rx_ltf_repetition_count_valid: @rx_ltf_repetition_count is valid
+ * @max_time_between_measurements_valid: @max_time_between_measurements is valid
+ * @min_time_between_measurements_valid: @min_time_between_measurements is valid
+ * @num_tx_spatial_streams_valid: @num_tx_spatial_streams is valid
+ * @num_rx_spatial_streams_valid: @num_rx_spatial_streams is valid
+ * @nominal_time_valid: @nominal_time is valid
+ * @availability_window_valid: @availability_window is valid
+ * @measurements_per_aw_valid: @measurements_per_aw is valid
+ * @chan_width_valid: @chan_width is valid.
+ * @preamble_valid: @preamble is valid.
+ * @is_delayed_lmr: indicates if the reported LMR is of the current burst or the
+ * previous burst, flag.
*/
struct cfg80211_pmsr_ftm_result {
const u8 *lci;
@@ -4295,8 +4329,19 @@ struct cfg80211_pmsr_ftm_result {
s64 dist_avg;
s64 dist_variance;
s64 dist_spread;
+ u32 tx_ltf_repetition_count;
+ u32 rx_ltf_repetition_count;
+ u32 max_time_between_measurements;
+ u32 min_time_between_measurements;
+ u32 num_tx_spatial_streams;
+ u32 num_rx_spatial_streams;
+ u32 nominal_time;
+ u32 availability_window;
+ u32 measurements_per_aw;
+ enum nl80211_chan_width chan_width;
+ enum nl80211_preamble preamble;
- u16 num_ftmr_attempts_valid:1,
+ u32 num_ftmr_attempts_valid:1,
num_ftmr_successes_valid:1,
rssi_avg_valid:1,
rssi_spread_valid:1,
@@ -4307,7 +4352,19 @@ struct cfg80211_pmsr_ftm_result {
rtt_spread_valid:1,
dist_avg_valid:1,
dist_variance_valid:1,
- dist_spread_valid:1;
+ dist_spread_valid:1,
+ tx_ltf_repetition_count_valid:1,
+ rx_ltf_repetition_count_valid:1,
+ max_time_between_measurements_valid:1,
+ min_time_between_measurements_valid:1,
+ num_tx_spatial_streams_valid:1,
+ num_rx_spatial_streams_valid:1,
+ nominal_time_valid:1,
+ availability_window_valid:1,
+ measurements_per_aw_valid:1,
+ chan_width_valid:1,
+ preamble_valid:1,
+ is_delayed_lmr:1;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 4dafaf25b0f6..67cc1ce6d2a1 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -8145,7 +8145,35 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
* @NL80211_PMSR_FTM_RESP_ATTR_PAD: ignore, for u64/s64 padding only
* @NL80211_PMSR_FTM_RESP_ATTR_BURST_PERIOD: actual burst period used by
* the responder (similar to request, u16)
- *
+ * @NL80211_PMSR_FTM_RESP_ATTR_TX_LTF_REPETITION_COUNT: negotiated value of
+ * number of tx ltf repetitions in NDP frames (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_RX_LTF_REPETITION_COUNT: negotiated value of
+ * number of rx ltf repetitions in NDP frames (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS: negotiated value
+ * where latest time by which the ISTA needs to complete the next round of
+ * measurements, in units of 10 ms (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS: negotiated
+ * minimum time between two consecutive range measurements initiated by an
+ * ISTA, in units of 100 us (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_NUM_TX_SPATIAL_STREAMS: number of Tx space-time
+ * streams used in NDP frames during the measurement sounding phase
+ * (u32, optional).
+ * @NL80211_PMSR_FTM_RESP_ATTR_NUM_RX_SPATIAL_STREAMS: number of Rx space-time
+ * streams used in the NDP frames during the measurement sounding phase
+ * (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_NOMINAL_TIME: negotiated nominal time used in
+ * this session in milliseconds. (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_AVAILABILITY_WINDOW: negotiated availability
+ * window time used in this session, in units of milli seconds.
+ * (u32, optional)
+ * @NL80211_PMSR_FTM_RESP_ATTR_MEASUREMENTS_PER_AW: negotiated measurements
+ * per availability window (u32, optional, max value 4)
+ * @NL80211_PMSR_FTM_RESP_ATTR_CHANNEL_WIDTH: u32 attribute indicating channel
+ * width used for measurement, see &enum nl80211_chan_width (optional).
+ * @NL80211_PMSR_FTM_RESP_ATTR_PREAMBLE: u32 attribute indicating the preamble
+ * type used for the measurement, see &enum nl80211_preamble (optional).
+ * @NL80211_PMSR_FTM_RESP_ATTR_IS_DELAYED_LMR: flag, indicates if the
+ * current result is delayed LMR data.
* @NUM_NL80211_PMSR_FTM_RESP_ATTR: internal
* @NL80211_PMSR_FTM_RESP_ATTR_MAX: highest attribute number
*/
@@ -8174,6 +8202,18 @@ enum nl80211_peer_measurement_ftm_resp {
NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC,
NL80211_PMSR_FTM_RESP_ATTR_PAD,
NL80211_PMSR_FTM_RESP_ATTR_BURST_PERIOD,
+ NL80211_PMSR_FTM_RESP_ATTR_TX_LTF_REPETITION_COUNT,
+ NL80211_PMSR_FTM_RESP_ATTR_RX_LTF_REPETITION_COUNT,
+ NL80211_PMSR_FTM_RESP_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS,
+ NL80211_PMSR_FTM_RESP_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS,
+ NL80211_PMSR_FTM_RESP_ATTR_NUM_TX_SPATIAL_STREAMS,
+ NL80211_PMSR_FTM_RESP_ATTR_NUM_RX_SPATIAL_STREAMS,
+ NL80211_PMSR_FTM_RESP_ATTR_NOMINAL_TIME,
+ NL80211_PMSR_FTM_RESP_ATTR_AVAILABILITY_WINDOW,
+ NL80211_PMSR_FTM_RESP_ATTR_MEASUREMENTS_PER_AW,
+ NL80211_PMSR_FTM_RESP_ATTR_CHANNEL_WIDTH,
+ NL80211_PMSR_FTM_RESP_ATTR_PREAMBLE,
+ NL80211_PMSR_FTM_RESP_ATTR_IS_DELAYED_LMR,
/* keep last */
NUM_NL80211_PMSR_FTM_RESP_ATTR,
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index 7e90dc29b0e5..a0c07fd841d8 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -527,6 +527,22 @@ static int nl80211_pmsr_send_ftm_res(struct sk_buff *msg,
PUTOPT_U64(DIST_AVG, dist_avg);
PUTOPT_U64(DIST_VARIANCE, dist_variance);
PUTOPT_U64(DIST_SPREAD, dist_spread);
+ PUTOPT(u32, TX_LTF_REPETITION_COUNT, tx_ltf_repetition_count);
+ PUTOPT(u32, RX_LTF_REPETITION_COUNT, rx_ltf_repetition_count);
+ PUTOPT(u32, MAX_TIME_BETWEEN_MEASUREMENTS,
+ max_time_between_measurements);
+ PUTOPT(u32, MIN_TIME_BETWEEN_MEASUREMENTS,
+ min_time_between_measurements);
+ PUTOPT(u32, NUM_TX_SPATIAL_STREAMS, num_tx_spatial_streams);
+ PUTOPT(u32, NUM_RX_SPATIAL_STREAMS, num_rx_spatial_streams);
+ PUTOPT(u32, NOMINAL_TIME, nominal_time);
+ PUTOPT(u32, AVAILABILITY_WINDOW, availability_window);
+ PUTOPT(u32, MEASUREMENTS_PER_AW, measurements_per_aw);
+ PUTOPT(u32, CHANNEL_WIDTH, chan_width);
+ PUTOPT(u32, PREAMBLE, preamble);
+ if (res->ftm.is_delayed_lmr &&
+ nla_put_flag(msg, NL80211_PMSR_FTM_RESP_ATTR_IS_DELAYED_LMR))
+ goto error;
if (res->ftm.lci && res->ftm.lci_len &&
nla_put(msg, NL80211_PMSR_FTM_RESP_ATTR_LCI,
res->ftm.lci_len, res->ftm.lci))
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 07/15] wifi: cfg80211: add continuous ranging and PD request support
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Proximity detection (PD) applications require sustained measurement
sessions without repeated FTM negotiation overhead. Currently, each
ranging session requires separate negotiation.
Enable NTB continuous ranging with configurable timing and
measurement parameters as per the specification "Proximity Ranging
(PR) Implementation Consideration Draft 1.9 Rev 1, section 5.3".
Add PD capability validation to support proximity detection sessions.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 22 ++++++++++++-
include/uapi/linux/nl80211.h | 26 +++++++++++++++
net/wireless/nl80211.c | 10 ++++++
net/wireless/pmsr.c | 64 +++++++++++++++++++++++++++++++-----
4 files changed, 112 insertions(+), 10 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 62a2139b2f37..b66300497312 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4369,6 +4369,19 @@ struct cfg80211_pmsr_result {
* @bss_color: the bss color of the responder. Optional. Set to zero to
* indicate the driver should set the BSS color. Only valid if
* @non_trigger_based or @trigger_based is set.
+ * @min_time_between_measurements: minimum time between two consecutive range
+ * measurements in units of 100 micro seconds, applicable for
+ * non trigger based ranging. Only valid if @non_trigger_based is set.
+ * @max_time_between_measurements: maximum time between two consecutive range
+ * measurements in units of 10 milli seconds, to avoid FTM negotiation
+ * applicable for non trigger based ranging. Only valid
+ * if @non_trigger_based is set.
+ * @availability_window: duration of the availability window (AW) in units of
+ * 1 millisecond (0-255 ms). Only valid if @non_trigger_based is set.
+ * @nominal_time: Nominal duration between adjacent availability windows
+ * in units of milli seconds. Only valid if @non_trigger_based is set.
+ * @measurements_per_aw: number of measurement attempts per availability window
+ * with a maximum value of 4. Only valid if @non_trigger_based is set.
*
* See also nl80211 for the respective attribute documentation.
*/
@@ -4388,6 +4401,11 @@ struct cfg80211_pmsr_ftm_request_peer {
u8 ftms_per_burst;
u8 ftmr_retries;
u8 bss_color;
+ u32 min_time_between_measurements;
+ u32 max_time_between_measurements;
+ u32 availability_window;
+ u32 nominal_time;
+ u32 measurements_per_aw;
};
/**
@@ -4395,12 +4413,14 @@ struct cfg80211_pmsr_ftm_request_peer {
* @addr: MAC address
* @chandef: channel to use
* @report_ap_tsf: report the associated AP's TSF
+ * @pd_request: indicates a peer-to-peer PD request
* @ftm: FTM data, see &struct cfg80211_pmsr_ftm_request_peer
*/
struct cfg80211_pmsr_request_peer {
u8 addr[ETH_ALEN];
struct cfg80211_chan_def chandef;
- u8 report_ap_tsf:1;
+ u8 report_ap_tsf:1,
+ pd_request:1;
struct cfg80211_pmsr_ftm_request_peer ftm;
};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 59e8ba9c37c4..4dafaf25b0f6 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -7792,6 +7792,8 @@ enum nl80211_peer_measurement_resp {
* @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by
* measurement type, with attributes from the
* &enum nl80211_peer_measurement_resp inside.
+ * @NL80211_PMSR_PEER_ATTR_PD_REQUEST: flag attribute indicating this is a
+ * peer-to-peer PD request
*
* @NUM_NL80211_PMSR_PEER_ATTRS: internal
* @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number
@@ -7803,6 +7805,7 @@ enum nl80211_peer_measurement_peer_attrs {
NL80211_PMSR_PEER_ATTR_CHAN,
NL80211_PMSR_PEER_ATTR_REQ,
NL80211_PMSR_PEER_ATTR_RESP,
+ NL80211_PMSR_PEER_ATTR_PD_REQUEST,
/* keep last */
NUM_NL80211_PMSR_PEER_ATTRS,
@@ -8012,6 +8015,24 @@ enum nl80211_peer_measurement_ftm_capa {
* %NL80211_ATTR_TIMEOUT has expired.
* Set %NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK to ensure RSTA will have
* the measurement results to report back in the FTM response.
+ * @NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS: minimum time
+ * between two consecutive range measurements in units of 100 microseconds,
+ * applicable for non-trigger based ranging (u32). Only valid if
+ * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+ * @NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS: maximum time
+ * between two consecutive range measurements in units of 10 milliseconds,
+ * to avoid FTM negotiation, applicable for non-trigger based ranging (u32)
+ * . Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+ * @NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME: the nominal time field shall be set
+ * to the nominal duration between adjacent Availability Windows in units
+ * of milli seconds (u32). Only valid if
+ * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+ * @NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION: The AW duration field shall be set
+ * to the duration of the AW in units of 1ms (0-255 ms) (u32).
+ * Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+ * @NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW: meas per AW field shall indicate the
+ * number of measurements attempts per AW with a maximum value of 4 (u32).
+ * Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -8033,6 +8054,11 @@ enum nl80211_peer_measurement_ftm_req {
NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,
NL80211_PMSR_FTM_REQ_ATTR_RSTA,
+ NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS,
+ NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS,
+ NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME,
+ NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION,
+ NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW,
/* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4fbc2c8ff395..01a70f1898bc 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -372,6 +372,15 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
[NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK] = { .type = NLA_FLAG },
[NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR] = { .type = NLA_U8 },
[NL80211_PMSR_FTM_REQ_ATTR_RSTA] = { .type = NLA_FLAG },
+ [NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS] = {
+ .type = NLA_U32
+ },
+ [NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS] = {
+ .type = NLA_U32
+ },
+ [NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME] = { .type = NLA_U32 },
+ [NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION] = NLA_POLICY_MAX(NLA_U32, 255),
+ [NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW] = NLA_POLICY_MAX(NLA_U32, 4),
};
static const struct nla_policy
@@ -394,6 +403,7 @@ nl80211_pmsr_peer_attr_policy[NL80211_PMSR_PEER_ATTR_MAX + 1] = {
[NL80211_PMSR_PEER_ATTR_REQ] =
NLA_POLICY_NESTED(nl80211_pmsr_req_attr_policy),
[NL80211_PMSR_PEER_ATTR_RESP] = { .type = NLA_REJECT },
+ [NL80211_PMSR_PEER_ATTR_PD_REQUEST] = { .type = NLA_FLAG },
};
static const struct nla_policy
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index 17f0b1c97d58..7e90dc29b0e5 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -90,15 +90,6 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
out->ftm.ftms_per_burst =
nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST]);
- if (capa->ftm.max_ftms_per_burst &&
- (out->ftm.ftms_per_burst > capa->ftm.max_ftms_per_burst ||
- out->ftm.ftms_per_burst == 0)) {
- NL_SET_ERR_MSG_ATTR(info->extack,
- tb[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST],
- "FTM: FTMs per burst must be set lower than the device limit but non-zero");
- return -EINVAL;
- }
-
out->ftm.ftmr_retries = 3;
if (tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES])
out->ftm.ftmr_retries =
@@ -128,6 +119,13 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
return -EINVAL;
}
+ if (out->pd_request && out->ftm.trigger_based) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ ftmreq,
+ "FTM: TB ranging is not supported by Proximity Detection");
+ return -EINVAL;
+ }
+
out->ftm.non_trigger_based =
!!tb[NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED];
if (out->ftm.non_trigger_based && !capa->ftm.non_trigger_based) {
@@ -143,6 +141,16 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
return -EINVAL;
}
+ if (!out->ftm.trigger_based && !out->ftm.non_trigger_based &&
+ capa->ftm.max_ftms_per_burst &&
+ (out->ftm.ftms_per_burst > capa->ftm.max_ftms_per_burst ||
+ out->ftm.ftms_per_burst == 0)) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST],
+ "FTM: FTMs per burst must be set lower than the device limit but non-zero");
+ return -EINVAL;
+ }
+
if (out->ftm.ftms_per_burst > 31 && !out->ftm.non_trigger_based &&
!out->ftm.trigger_based) {
NL_SET_ERR_MSG_ATTR(info->extack,
@@ -196,6 +204,36 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
return -EOPNOTSUPP;
}
+ if (out->ftm.non_trigger_based) {
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS])
+ out->ftm.min_time_between_measurements =
+ nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS]);
+
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS])
+ out->ftm.max_time_between_measurements =
+ nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS]);
+
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION])
+ out->ftm.availability_window =
+ nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION]);
+
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME])
+ out->ftm.nominal_time =
+ nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME]);
+
+ if (tb[NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW])
+ out->ftm.measurements_per_aw =
+ nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_MEAS_PER_AW]);
+ }
+
+ if (out->pd_request && out->ftm.non_trigger_based && !out->ftm.rsta &&
+ out->ftm.measurements_per_aw == 0) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ ftmreq,
+ "FTM: Invalid parameters:measurements per avail window is zero for NTB PD request");
+ return -EINVAL;
+ }
+
return 0;
}
@@ -223,6 +261,14 @@ static int pmsr_parse_peer(struct cfg80211_registered_device *rdev,
memcpy(out->addr, nla_data(tb[NL80211_PMSR_PEER_ATTR_ADDR]), ETH_ALEN);
+ out->pd_request = !!tb[NL80211_PMSR_PEER_ATTR_PD_REQUEST];
+
+ if (out->pd_request && !rdev->wiphy.pmsr_capa->pd_support) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ tb[NL80211_PMSR_PEER_ATTR_PD_REQUEST],
+ "PD request not supported by device");
+ return -EINVAL;
+ }
/* reuse info->attrs */
memset(info->attrs, 0, sizeof(*info->attrs) * (NL80211_ATTR_MAX + 1));
err = nla_parse_nested_deprecated(info->attrs, NL80211_ATTR_MAX,
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 06/15] wifi: cfg80211: add proximity detection capabilities to PMSR
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Introduce Proximity Detection (PD) capabilities in Peer Measurement
Service (PMSR) as defined in the Wi-Fi Alliance specification
"Proximity Ranging (PR) Implementation Consideration Draft 1.9 Rev 1
section 3.3". This enables devices to advertise PD support and
concurrent ISTA/RSTA operation for simultaneous initiator and
responder roles.
Extend FTM capabilities to support PASN negotiation and device timing
constraints. Add antenna configuration for PR Element during PASN
negotiation as per the specification. Add ranging interval limits to
advertise device timing capabilities for EDCA and NTB-based ranging.
Add EDCA-based responder support to indicate if the device can operate
as FTM responder for EDCA-based ranging. These capabilities allow
proper negotiation and validation of PD sessions between peers.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 28 ++++++++++++++++++++++++++--
include/uapi/linux/nl80211.h | 29 +++++++++++++++++++++++++++++
net/wireless/nl80211.c | 29 +++++++++++++++++++++++++++++
net/wireless/pmsr.c | 3 ++-
4 files changed, 86 insertions(+), 3 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 099a2ff9af58..62a2139b2f37 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5692,6 +5692,13 @@ cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
* @max_peers: maximum number of peers in a single measurement
* @report_ap_tsf: can report assoc AP's TSF for radio resource measurement
* @randomize_mac_addr: can randomize MAC address for measurement
+ * @pd_support: supports peer-to-peer ranging as mentioned in the specification
+ * "PR Implementation Consideration Draft 1.9 rev 1" where PD stands for
+ * proximity detection
+ * @pd_concurrent_ista_rsta_support: As the peer measurement request can be a
+ * multi-peer request this will indicate if the device can act
+ * simultaneously as initiator and a responder. Only valid if @pd_support
+ * is set.
* @ftm: FTM measurement data
* @ftm.supported: FTM measurement is supported
* @ftm.asap: ASAP-mode is supported
@@ -5718,12 +5725,24 @@ cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
* (0 means unknown)
* @ftm.max_total_ltf_rx: maximum total number of LTFs that can be received
* (0 means unknown)
+ * @ftm.max_no_of_tx_antennas: maximum number of transmit antennas supported for
+ * ranging
+ * @ftm.max_no_of_rx_antennas: maximum number of receive antennas supported for
+ * ranging
+ * @ftm.min_allowed_ranging_interval_edca: Minimum EDCA ranging
+ * interval supported by the device in milli seconds. (0 means unknown)
+ * @ftm.min_allowed_ranging_interval_ntb: Minimum NTB ranging
+ * interval supported by the device in milli seconds. (0 means unknown)
* @ftm.support_rsta: supports operating as RSTA in PMSR FTM request
+ * @ftm.support_edca_responder: supports operating as FTM responder in PMSR FTM
+ * request for EDCA-based ranging
*/
struct cfg80211_pmsr_capabilities {
unsigned int max_peers;
u8 report_ap_tsf:1,
- randomize_mac_addr:1;
+ randomize_mac_addr:1,
+ pd_support:1,
+ pd_concurrent_ista_rsta_support:1;
struct {
u32 preambles;
@@ -5744,7 +5763,12 @@ struct cfg80211_pmsr_capabilities {
u8 max_rx_sts;
u8 max_total_ltf_tx;
u8 max_total_ltf_rx;
- u8 support_rsta:1;
+ u32 max_no_of_tx_antennas;
+ u32 max_no_of_rx_antennas;
+ u32 min_allowed_ranging_interval_edca;
+ u32 min_allowed_ranging_interval_ntb;
+ u8 support_rsta:1,
+ support_edca_responder:1;
} ftm;
};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 55a882535e2b..59e8ba9c37c4 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -7829,6 +7829,15 @@ enum nl80211_peer_measurement_peer_attrs {
* meaningless, just a list of peers to measure with, with the
* sub-attributes taken from
* &enum nl80211_peer_measurement_peer_attrs.
+ * @NL80211_PMSR_ATTR_PD_SUPPORT: flag attribute in capability indicating
+ * that the device supports peer-to-peer ranging as mentioned in the
+ * specification "PR Implementation Consideration Draft 1.9 rev 1" where
+ * PD stands for proximity detection
+ * @NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT: flag attribute in
+ * capability indicating that as the peer measurement request can be a
+ * multi-peer request, the device can act simultaneously as initiator and
+ * a responder, where the multiple requests are being processed
+ * simultaneously
*
* @NUM_NL80211_PMSR_ATTR: internal
* @NL80211_PMSR_ATTR_MAX: highest attribute number
@@ -7841,6 +7850,8 @@ enum nl80211_peer_measurement_attrs {
NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR,
NL80211_PMSR_ATTR_TYPE_CAPA,
NL80211_PMSR_ATTR_PEERS,
+ NL80211_PMSR_ATTR_PD_SUPPORT,
+ NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT,
/* keep last */
NUM_NL80211_PMSR_ATTR,
@@ -7899,6 +7910,19 @@ enum nl80211_peer_measurement_attrs {
* This limits the allowed combinations of LTF repetitions and STS.
* @NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT: flag attribute indicating the
* device supports operating as the RSTA in PMSR FTM request
+ * @NL80211_PMSR_FTM_CAPA_ATTR_EDCA_BASED_RESPONDER: flag attribute indicating
+ * the device supports operating as the Responder in PMSR FTM request for
+ * EDCA-based ranging.
+ * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS: u32 attribute indicating
+ * the maximum number of transmit antennas supported for ranging
+ * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS: u32 attribute indicating
+ * the maximum number of receive antennas supported for ranging
+ * @NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA: u32 attribute indicating
+ * the minimum EDCA ranging interval supported by the device
+ * in milli seconds. (0 means unknown)
+ * @NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB: u32 attribute indicating
+ * the minimum NTB ranging interval supported by the device
+ * in milli seconds. (0 means unknown)
*
* @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
@@ -7924,6 +7948,11 @@ enum nl80211_peer_measurement_ftm_capa {
NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_TX,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_RX,
NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT,
+ NL80211_PMSR_FTM_CAPA_ATTR_EDCA_BASED_RESPONDER,
+ NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS,
+ NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS,
+ NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA,
+ NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB,
/* keep last */
NUM_NL80211_PMSR_FTM_CAPA_ATTR,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0ae96063c032..4fbc2c8ff395 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -398,6 +398,7 @@ nl80211_pmsr_peer_attr_policy[NL80211_PMSR_PEER_ATTR_MAX + 1] = {
static const struct nla_policy
nl80211_pmsr_attr_policy[NL80211_PMSR_ATTR_MAX + 1] = {
+ [0] = { .strict_start_type = NL80211_PMSR_ATTR_PD_SUPPORT },
[NL80211_PMSR_ATTR_MAX_PEERS] = { .type = NLA_REJECT },
[NL80211_PMSR_ATTR_REPORT_AP_TSF] = { .type = NLA_REJECT },
[NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR] = { .type = NLA_REJECT },
@@ -2375,6 +2376,25 @@ nl80211_send_pmsr_ftm_capa(const struct cfg80211_pmsr_capabilities *cap,
if (cap->ftm.support_rsta &&
nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT))
return -ENOBUFS;
+ if (cap->ftm.support_edca_responder &&
+ nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_EDCA_BASED_RESPONDER))
+ return -ENOBUFS;
+ if (cap->ftm.max_no_of_tx_antennas &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_TX_ANTENNAS,
+ cap->ftm.max_no_of_tx_antennas))
+ return -ENOBUFS;
+ if (cap->ftm.max_no_of_rx_antennas &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MAX_NUM_RX_ANTENNAS,
+ cap->ftm.max_no_of_rx_antennas))
+ return -ENOBUFS;
+ if (cap->ftm.min_allowed_ranging_interval_edca &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_EDCA,
+ cap->ftm.min_allowed_ranging_interval_edca))
+ return -ENOBUFS;
+ if (cap->ftm.min_allowed_ranging_interval_ntb &&
+ nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MIN_INTERVAL_NTB,
+ cap->ftm.min_allowed_ranging_interval_ntb))
+ return -ENOBUFS;
nla_nest_end(msg, ftm);
return 0;
@@ -2409,6 +2429,15 @@ static int nl80211_send_pmsr_capa(struct cfg80211_registered_device *rdev,
nla_put_flag(msg, NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR))
return -ENOBUFS;
+ if (cap->pd_support) {
+ if (nla_put_flag(msg, NL80211_PMSR_ATTR_PD_SUPPORT))
+ return -ENOBUFS;
+
+ if (cap->pd_concurrent_ista_rsta_support &&
+ nla_put_flag(msg,
+ NL80211_PMSR_ATTR_PD_CONCURRENT_ISTA_RSTA_SUPPORT))
+ return -ENOBUFS;
+ }
caps = nla_nest_start_noflag(msg, NL80211_PMSR_ATTR_TYPE_CAPA);
if (!caps)
return -ENOBUFS;
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index c2977a37add2..17f0b1c97d58 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -188,7 +188,8 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
}
out->ftm.rsta = !!tb[NL80211_PMSR_FTM_REQ_ATTR_RSTA];
- if (out->ftm.rsta && !capa->ftm.support_rsta) {
+ if (out->ftm.rsta && !capa->ftm.support_rsta &&
+ !capa->ftm.support_edca_responder) {
NL_SET_ERR_MSG_ATTR(info->extack,
tb[NL80211_PMSR_FTM_REQ_ATTR_RSTA],
"FTM: RSTA not supported by device");
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 05/15] wifi: cfg80211: add start/stop proximity detection commands
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Currently, the proximity detection (PD) interface type has no
start/stop commands defined, preventing user space from
controlling PD operations through the nl80211 interface.
Add NL80211_CMD_START_PD and NL80211_CMD_STOP_PD commands to
allow user space to start and stop a PD interface. Add the
corresponding start_pd and stop_pd operations to cfg80211_ops
and ieee80211_ops, along with nl80211 command handlers, rdev
wrappers, and tracing support. Validate that drivers advertising
PD interface support implement the required operations. Handle
PD interface teardown during device unregistration and when
the interface leaves the network.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 5 ++++
include/uapi/linux/nl80211.h | 9 ++++++
net/wireless/core.c | 32 ++++++++++++++++++++-
net/wireless/core.h | 2 ++
net/wireless/nl80211.c | 54 ++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 19 +++++++++++++
net/wireless/trace.h | 10 +++++++
7 files changed, 130 insertions(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 73cfe1a14c01..099a2ff9af58 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4900,6 +4900,9 @@ struct mgmt_frame_regs {
* links by calling cfg80211_mlo_reconf_add_done(). When calling
* cfg80211_mlo_reconf_add_done() the bss pointer must be given for each
* link for which MLO reconfiguration 'add' operation was requested.
+ *
+ * @start_pd: Start the PD interface.
+ * @stop_pd: Stop the PD interface.
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -5271,6 +5274,8 @@ struct cfg80211_ops {
struct cfg80211_ml_reconf_req *req);
int (*set_epcs)(struct wiphy *wiphy, struct net_device *dev,
bool val);
+ int (*start_pd)(struct wiphy *wiphy, struct wireless_dev *wdev);
+ void (*stop_pd)(struct wiphy *wiphy, struct wireless_dev *wdev);
};
/*
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index b1f0e72ec953..55a882535e2b 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1369,6 +1369,12 @@
* %NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP. The current channel
* definition is also sent.
*
+ * @NL80211_CMD_START_PD: Start PD operation, identified by its
+ * %NL80211_ATTR_WDEV interface. This interface must have been previously
+ * created with %NL80211_CMD_NEW_INTERFACE.
+ * @NL80211_CMD_STOP_PD: Stop the PD operation, identified by
+ * its %NL80211_ATTR_WDEV interface.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1634,6 +1640,9 @@ enum nl80211_commands {
NL80211_CMD_INCUMBENT_SIGNAL_DETECT,
+ NL80211_CMD_START_PD,
+ NL80211_CMD_STOP_PD,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 67a603129c42..7bab8c4fb873 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -270,6 +270,25 @@ void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,
rdev->opencount--;
}
+void cfg80211_stop_pd(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev)
+{
+ lockdep_assert_held(&rdev->wiphy.mtx);
+
+ if (WARN_ON(wdev->iftype != NL80211_IFTYPE_PD))
+ return;
+
+ if (!wdev_running(wdev))
+ return;
+
+ cfg80211_pmsr_wdev_down(wdev);
+
+ rdev_stop_pd(rdev, wdev);
+ wdev->is_running = false;
+
+ rdev->opencount--;
+}
+
void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy)
{
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
@@ -294,6 +313,9 @@ void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy)
case NL80211_IFTYPE_NAN:
cfg80211_stop_nan(rdev, wdev);
break;
+ case NL80211_IFTYPE_PD:
+ cfg80211_stop_pd(rdev, wdev);
+ break;
default:
break;
}
@@ -760,6 +782,9 @@ int wiphy_register(struct wiphy *wiphy)
!rdev->ops->add_nan_func || !rdev->ops->del_nan_func ||
!(wiphy->nan_supported_bands & BIT(NL80211_BAND_2GHZ)))))
return -EINVAL;
+ if (WARN_ON((wiphy->interface_modes & BIT(NL80211_IFTYPE_PD)) &&
+ (!rdev->ops->start_pd || !rdev->ops->stop_pd)))
+ return -EINVAL;
if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)))
return -EINVAL;
@@ -1309,6 +1334,9 @@ static void _cfg80211_unregister_wdev(struct wireless_dev *wdev,
case NL80211_IFTYPE_NAN:
cfg80211_stop_nan(rdev, wdev);
break;
+ case NL80211_IFTYPE_PD:
+ cfg80211_stop_pd(rdev, wdev);
+ break;
default:
break;
}
@@ -1418,9 +1446,11 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
case NL80211_IFTYPE_NAN:
cfg80211_stop_nan(rdev, wdev);
break;
+ case NL80211_IFTYPE_PD:
+ cfg80211_stop_pd(rdev, wdev);
+ break;
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_MONITOR:
- case NL80211_IFTYPE_PD:
/* nothing to do */
break;
case NL80211_IFTYPE_UNSPECIFIED:
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 6cace846d7a3..f631b6997988 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -550,6 +550,8 @@ void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev);
+void cfg80211_stop_pd(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev);
struct cfg80211_internal_bss *
cfg80211_bss_update(struct cfg80211_registered_device *rdev,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 293fdd07ac7a..0ae96063c032 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -16296,6 +16296,46 @@ static int nl80211_nan_change_config(struct sk_buff *skb,
return rdev_nan_change_conf(rdev, wdev, &conf, changed);
}
+static int nl80211_start_pd(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+ int err;
+
+ if (wdev->iftype != NL80211_IFTYPE_PD)
+ return -EOPNOTSUPP;
+
+ if (wdev_running(wdev))
+ return -EEXIST;
+
+ if (rfkill_blocked(rdev->wiphy.rfkill))
+ return -ERFKILL;
+
+ if (!rdev->ops->start_pd)
+ return -EOPNOTSUPP;
+
+ err = rdev_start_pd(rdev, wdev);
+ if (err)
+ return err;
+ wdev->is_running = true;
+ rdev->opencount++;
+
+ return 0;
+}
+
+static int nl80211_stop_pd(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+
+ if (wdev->iftype != NL80211_IFTYPE_PD)
+ return -EOPNOTSUPP;
+
+ cfg80211_stop_pd(rdev, wdev);
+
+ return 0;
+}
+
void cfg80211_nan_match(struct wireless_dev *wdev,
struct cfg80211_nan_match_params *match, gfp_t gfp)
{
@@ -18977,6 +19017,20 @@ static const struct genl_small_ops nl80211_small_ops[] = {
.flags = GENL_ADMIN_PERM,
.internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
},
+ {
+ .cmd = NL80211_CMD_START_PD,
+ .doit = nl80211_start_pd,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV |
+ NL80211_FLAG_NEED_RTNL),
+ },
+ {
+ .cmd = NL80211_CMD_STOP_PD,
+ .doit = nl80211_stop_pd,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP |
+ NL80211_FLAG_NEED_RTNL),
+ },
{
.cmd = NL80211_CMD_SET_MCAST_RATE,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 3c0fff3cb5ac..921566fa802d 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1061,6 +1061,25 @@ rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
return ret;
}
+static inline int rdev_start_pd(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev)
+{
+ int ret;
+
+ trace_rdev_start_pd(&rdev->wiphy, wdev);
+ ret = rdev->ops->start_pd(&rdev->wiphy, wdev);
+ trace_rdev_return_int(&rdev->wiphy, ret);
+ return ret;
+}
+
+static inline void rdev_stop_pd(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev)
+{
+ trace_rdev_stop_pd(&rdev->wiphy, wdev);
+ rdev->ops->stop_pd(&rdev->wiphy, wdev);
+ trace_rdev_return_void(&rdev->wiphy);
+}
+
static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
struct net_device *dev,
struct cfg80211_acl_data *params)
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 56718e250d31..1ebb6e90cf8f 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2375,6 +2375,16 @@ DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_nan,
TP_ARGS(wiphy, wdev)
);
+DEFINE_EVENT(wiphy_wdev_evt, rdev_start_pd,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+ TP_ARGS(wiphy, wdev)
+);
+
+DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_pd,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+ TP_ARGS(wiphy, wdev)
+);
+
TRACE_EVENT(rdev_add_nan_func,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
const struct cfg80211_nan_func *func),
--
2.34.1
^ permalink raw reply related
* [PATCH wireless-next v3 04/15] wifi: cfg80211/mac80211: Add NL80211_IFTYPE_PD for PD PASN and PMSR operations
From: Peddolla Harshavardhan Reddy @ 2026-03-05 16:07 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, kavita.kavita
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
Add a new wdev-only interface type NL80211_IFTYPE_PD to support
Proximity Detection (PD) operations such as PASN, key install and
peer measurement operations. This interface type operates without
a netdev, similar to P2P_DEVICE and NAN interfaces.
Implement support across cfg80211 and mac80211 layers with key
management gated by the NL80211_EXT_FEATURE_SECURE_RTT feature
flag, management frame registration and transmission capabilities,
and proper channel context handling where PD interfaces are
excluded from bandwidth calculations.
The PD interface provides isolated functionality for PD PASN
and PMSR without affecting existing network operations.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/uapi/linux/nl80211.h | 2 ++
net/mac80211/cfg.c | 2 ++
net/mac80211/chan.c | 2 ++
net/mac80211/iface.c | 6 +++++-
net/mac80211/offchannel.c | 1 +
net/mac80211/rx.c | 1 +
net/mac80211/util.c | 1 +
net/wireless/chan.c | 2 ++
net/wireless/core.c | 1 +
net/wireless/mlme.c | 1 +
net/wireless/nl80211.c | 27 +++++++++++++++++++++++++--
net/wireless/reg.c | 3 +++
net/wireless/util.c | 4 +++-
13 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 49f4704ce627..b1f0e72ec953 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3671,6 +3671,7 @@ enum nl80211_attrs {
* @NL80211_IFTYPE_OCB: Outside Context of a BSS
* This mode corresponds to the MIB variable dot11OCBActivated=true
* @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
+ * @NL80211_IFTYPE_PD: PD device interface type (not a netdev)
* @NL80211_IFTYPE_MAX: highest interface type number currently defined
* @NUM_NL80211_IFTYPES: number of defined interface types
*
@@ -3692,6 +3693,7 @@ enum nl80211_iftype {
NL80211_IFTYPE_P2P_DEVICE,
NL80211_IFTYPE_OCB,
NL80211_IFTYPE_NAN,
+ NL80211_IFTYPE_PD,
/* keep last */
NUM_NL80211_IFTYPES,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ee64ac8e0f61..dac211f9a438 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -713,6 +713,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
case NL80211_IFTYPE_UNSPECIFIED:
case NUM_NL80211_IFTYPES:
case NL80211_IFTYPE_P2P_CLIENT:
@@ -3183,6 +3184,7 @@ static int ieee80211_scan(struct wiphy *wiphy,
}
break;
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
default:
return -EOPNOTSUPP;
}
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 4447cf03c41b..00cbb13fb74b 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -473,6 +473,7 @@ ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local,
break;
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
continue;
case NL80211_IFTYPE_MONITOR:
WARN_ON_ONCE(!ieee80211_hw_check(&local->hw,
@@ -1414,6 +1415,7 @@ ieee80211_link_chanctx_reservation_complete(struct ieee80211_link_data *link)
case NL80211_IFTYPE_P2P_GO:
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
case NUM_NL80211_IFTYPES:
WARN_ON(1);
break;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 676b2a43c9f2..b647c6394b28 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1369,6 +1369,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_OCB:
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
/* no special treatment */
break;
case NL80211_IFTYPE_UNSPECIFIED:
@@ -1489,7 +1490,8 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
FIF_PROBE_REQ);
if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
- sdata->vif.type != NL80211_IFTYPE_NAN)
+ sdata->vif.type != NL80211_IFTYPE_NAN &&
+ sdata->vif.type != NL80211_IFTYPE_PD)
changed |= ieee80211_reset_erp_info(sdata);
ieee80211_link_info_change_notify(sdata, &sdata->deflink,
changed);
@@ -1504,6 +1506,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
break;
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
break;
default:
/* not reached */
@@ -1935,6 +1938,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
break;
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_P2P_DEVICE:
+ case NL80211_IFTYPE_PD:
sdata->vif.bss_conf.bssid = sdata->vif.addr;
break;
case NL80211_IFTYPE_UNSPECIFIED:
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 5f398d38d1c9..04c6031dc46b 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -898,6 +898,7 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
need_offchan = true;
break;
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
break;
default:
return -EOPNOTSUPP;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 6c4b549444c6..ed3f7e3094ea 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4621,6 +4621,7 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
(ieee80211_is_public_action(hdr, skb->len) ||
(ieee80211_is_auth(hdr->frame_control) &&
ether_addr_equal(sdata->vif.addr, hdr->addr1)));
+ case NL80211_IFTYPE_PD:
default:
break;
}
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index b2e6c8b98381..2fa81fb57093 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2121,6 +2121,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_P2P_DEVICE:
+ case NL80211_IFTYPE_PD:
/* nothing to do */
break;
case NL80211_IFTYPE_UNSPECIFIED:
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index d9d4e043bb39..31b621de3f9b 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -796,6 +796,7 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_P2P_DEVICE:
+ case NL80211_IFTYPE_PD:
break;
case NL80211_IFTYPE_WDS:
case NL80211_IFTYPE_UNSPECIFIED:
@@ -919,6 +920,7 @@ bool cfg80211_beaconing_iface_active(struct wireless_dev *wdev)
case NL80211_IFTYPE_P2P_DEVICE:
/* Can NAN type be considered as beaconing interface? */
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
break;
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_WDS:
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 23afc250bc10..67a603129c42 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1420,6 +1420,7 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
break;
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_MONITOR:
+ case NL80211_IFTYPE_PD:
/* nothing to do */
break;
case NL80211_IFTYPE_UNSPECIFIED:
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 5cd86253a62e..6d13093ce449 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -939,6 +939,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
* public action frames
*/
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
default:
err = -EOPNOTSUPP;
break;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 2d22fd405c39..293fdd07ac7a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1711,6 +1711,11 @@ static int nl80211_key_allowed(struct wireless_dev *wdev)
NL80211_EXT_FEATURE_SECURE_NAN))
return 0;
return -EINVAL;
+ case NL80211_IFTYPE_PD:
+ if (wiphy_ext_feature_isset(wdev->wiphy,
+ NL80211_EXT_FEATURE_SECURE_RTT))
+ return 0;
+ return -EINVAL;
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_OCB:
case NL80211_IFTYPE_MONITOR:
@@ -4739,6 +4744,7 @@ static int _nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
return -EOPNOTSUPP;
if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN ||
+ type == NL80211_IFTYPE_PD ||
rdev->wiphy.features & NL80211_FEATURE_MAC_ON_CREATE) &&
info->attrs[NL80211_ATTR_MAC]) {
nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC],
@@ -4795,8 +4801,9 @@ static int _nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
break;
case NL80211_IFTYPE_NAN:
case NL80211_IFTYPE_P2P_DEVICE:
+ case NL80211_IFTYPE_PD:
/*
- * P2P Device and NAN do not have a netdev, so don't go
+ * P2P Device, NAN and PD do not have a netdev, so don't go
* through the netdev notifier and must be added here
*/
cfg80211_init_wdev(wdev);
@@ -10537,7 +10544,8 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
wiphy = &rdev->wiphy;
- if (wdev->iftype == NL80211_IFTYPE_NAN)
+ if (wdev->iftype == NL80211_IFTYPE_NAN ||
+ wdev->iftype == NL80211_IFTYPE_PD)
return -EOPNOTSUPP;
if (!rdev->ops->scan)
@@ -13954,6 +13962,11 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
WIPHY_NAN_FLAGS_USERSPACE_DE))
return -EOPNOTSUPP;
break;
+ case NL80211_IFTYPE_PD:
+ if (!wiphy_ext_feature_isset(wdev->wiphy,
+ NL80211_EXT_FEATURE_SECURE_RTT))
+ return -EOPNOTSUPP;
+ break;
default:
return -EOPNOTSUPP;
}
@@ -14017,6 +14030,11 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
WIPHY_NAN_FLAGS_USERSPACE_DE))
return -EOPNOTSUPP;
break;
+ case NL80211_IFTYPE_PD:
+ if (!wiphy_ext_feature_isset(wdev->wiphy,
+ NL80211_EXT_FEATURE_SECURE_RTT))
+ return -EOPNOTSUPP;
+ break;
default:
return -EOPNOTSUPP;
}
@@ -14142,6 +14160,11 @@ static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *in
NL80211_EXT_FEATURE_SECURE_NAN))
return -EOPNOTSUPP;
break;
+ case NL80211_IFTYPE_PD:
+ if (!wiphy_ext_feature_isset(wdev->wiphy,
+ NL80211_EXT_FEATURE_SECURE_RTT))
+ return -EOPNOTSUPP;
+ break;
default:
return -EOPNOTSUPP;
}
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1c5c38d18feb..fb7eaee734b4 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2411,6 +2411,9 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
case NL80211_IFTYPE_NAN:
/* we have no info, but NAN is also pretty universal */
continue;
+ case NL80211_IFTYPE_PD:
+ /* we have no info, but PD is also pretty universal */
+ continue;
default:
/* others not implemented for now */
WARN_ON_ONCE(1);
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 0a0cea018fc5..d558c4bc00f0 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1186,7 +1186,8 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
/* cannot change into P2P device or NAN */
if (ntype == NL80211_IFTYPE_P2P_DEVICE ||
- ntype == NL80211_IFTYPE_NAN)
+ ntype == NL80211_IFTYPE_NAN ||
+ ntype == NL80211_IFTYPE_PD)
return -EOPNOTSUPP;
if (!rdev->ops->change_virtual_intf ||
@@ -1250,6 +1251,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_WDS:
case NL80211_IFTYPE_NAN:
+ case NL80211_IFTYPE_PD:
WARN_ON(1);
break;
}
--
2.34.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox