From: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, kavita.kavita@oss.qualcomm.com,
peddolla.reddy@oss.qualcomm.com
Subject: [PATCH wireless-next v5 09/13] wifi: cfg80211: add ingress/egress distance thresholds for FTM
Date: Mon, 20 Apr 2026 14:38:52 +0530 [thread overview]
Message-ID: <20260420090856.2152905-10-peddolla.reddy@oss.qualcomm.com> (raw)
In-Reply-To: <20260420090856.2152905-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.
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.
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
include/net/cfg80211.h | 14 ++++++++++++++
include/uapi/linux/nl80211.h | 15 +++++++++++++++
net/wireless/nl80211.c | 2 ++
net/wireless/pmsr.c | 8 ++++++++
4 files changed, 39 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8c82f33bfc40..b16f36473b2f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4619,6 +4619,18 @@ struct cfg80211_pmsr_result {
* exchanges as configured by @ftms_per_burst. Only valid if
* @non_trigger_based is set. If set to 0, the firmware or driver
* can automatically select an appropriate value.
+ * @ingress_distancemm: optional ingress threshold in units of mm. When set,
+ * the measurement result of the peer needs to be indicated if the device
+ * moves into this range. Measurement results need to be sent on a burst
+ * index basis in this case.
+ * @egress_distancemm: optional egress threshold in units of mm. When set,
+ * the measurement result of the peer needs to be indicated if the device
+ * moves out of this range. Measurement results need to be sent on a burst
+ * index basis in this case.
+ * If neither or only one of @ingress_distancemm and @egress_distancemm
+ * is set, only the specified threshold is used. If both are set, both
+ * thresholds are applied. If neither is set, results are reported without
+ * threshold filtering.
*
* See also nl80211 for the respective attribute documentation.
*/
@@ -4645,6 +4657,8 @@ struct cfg80211_pmsr_ftm_request_peer {
u8 availability_window;
u32 nominal_time;
u32 num_measurements;
+ u64 ingress_distancemm;
+ u64 egress_distancemm;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index a42bae666d02..1400adfee10b 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -8330,6 +8330,18 @@ enum nl80211_peer_measurement_ftm_type_capa {
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
* If the attribute is absent ("no preference"), the driver or firmware
* can choose a suitable value.
+ * @NL80211_PMSR_FTM_REQ_ATTR_PAD: ignore, for u64/s64 padding only.
+ * @NL80211_PMSR_FTM_REQ_ATTR_INGRESS: optional u64 attribute in units of mm.
+ * When specified, the measurement result of the peer needs to be
+ * indicated if the device moves into this range.
+ * @NL80211_PMSR_FTM_REQ_ATTR_EGRESS: optional u64 attribute in units of mm.
+ * When specified, the measurement result of the peer needs to be
+ * indicated if the device moves out of this range.
+ * If neither or only one of @NL80211_PMSR_FTM_REQ_ATTR_INGRESS and
+ * @NL80211_PMSR_FTM_REQ_ATTR_EGRESS is specified, only the specified
+ * threshold is used. If both are specified, both thresholds are applied.
+ * If neither is specified, results are reported without threshold
+ * filtering.
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -8356,6 +8368,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_NUM_MEASUREMENTS,
+ 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 4f6612311de3..0e0c66fe39db 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -485,6 +485,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_NUM_MEASUREMENTS] = { .type = NLA_U32 },
+ [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 432d34be7945..46c444d0327b 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -264,6 +264,14 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
nla_get_u32(tb[NL80211_PMSR_FTM_REQ_ATTR_NUM_MEASUREMENTS]);
}
+ 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
next prev parent reply other threads:[~2026-04-20 9:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 9:08 [PATCH wireless-next v5 00/13] wifi: Ranging support enhancements Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 01/13] wifi: cfg80211: restrict LMR feedback check to TB and non-TB ranging Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 02/13] wifi: cfg80211: Add MAC address filter to remain_on_channel Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 03/13] wifi: cfg80211/mac80211: Add NL80211_IFTYPE_PD for PD PASN and PMSR operations Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 04/13] wifi: cfg80211: add start/stop proximity detection commands Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 05/13] wifi: cfg80211: add proximity detection capabilities to PMSR Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 06/13] wifi: cfg80211: add NTB continuous ranging and FTM request type support Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 07/13] wifi: cfg80211: extend PMSR FTM response for proximity ranging Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 08/13] wifi: cfg80211: add role-based peer limits to FTM capabilities Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` Peddolla Harshavardhan Reddy [this message]
2026-04-20 9:08 ` [PATCH wireless-next v5 10/13] wifi: cfg80211: add PD-specific preamble and bandwidth capabilities Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 11/13] wifi: cfg80211: allow suppressing FTM result reporting for PD requests Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 12/13] wifi: cfg80211: add LTF keyseed support for secure ranging Peddolla Harshavardhan Reddy
2026-04-20 9:08 ` [PATCH wireless-next v5 13/13] wifi: mac80211_hwsim: Add support for extended FTM ranging Peddolla Harshavardhan Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260420090856.2152905-10-peddolla.reddy@oss.qualcomm.com \
--to=peddolla.reddy@oss.qualcomm.com \
--cc=johannes@sipsolutions.net \
--cc=kavita.kavita@oss.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox