From: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, kavita.kavita@oss.qualcomm.com
Subject: [PATCH wireless-next v3 10/15] wifi: cfg80211: add ingress/egress distance thresholds for FTM
Date: Thu, 5 Mar 2026 21:37:07 +0530 [thread overview]
Message-ID: <20260305160712.1263829-11-peddolla.reddy@oss.qualcomm.com> (raw)
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
next prev parent reply other threads:[~2026-03-05 16:08 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 16:06 [PATCH wireless-next v3 00/15] wifi: Ranging support enhancements Peddolla Harshavardhan Reddy
2026-03-05 16:06 ` [PATCH wireless-next v3 01/15] wifi: cfg80211: Allow RSTA role without LMR request Peddolla Harshavardhan Reddy
2026-03-12 21:03 ` Stern, Avraham
2026-03-20 18:07 ` Peddolla Harshavardhan Reddy
2026-03-05 16:06 ` [PATCH wireless-next v3 02/15] wifi: cfg80211: cancel pmsr_free_wk in cfg80211_pmsr_wdev_down Peddolla Harshavardhan Reddy
2026-03-12 21:04 ` Stern, Avraham
2026-03-20 18:20 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 03/15] wifi: cfg80211: Add MAC address filter to remain_on_channel Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 04/15] wifi: cfg80211/mac80211: Add NL80211_IFTYPE_PD for PD PASN and PMSR operations Peddolla Harshavardhan Reddy
2026-03-12 21:06 ` Stern, Avraham
2026-03-20 18:25 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 05/15] wifi: cfg80211: add start/stop proximity detection commands Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 06/15] wifi: cfg80211: add proximity detection capabilities to PMSR Peddolla Harshavardhan Reddy
2026-03-12 21:08 ` Stern, Avraham
2026-03-20 18:33 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 07/15] wifi: cfg80211: add continuous ranging and PD request support Peddolla Harshavardhan Reddy
2026-03-12 21:11 ` Stern, Avraham
2026-03-20 18:53 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 08/15] wifi: cfg80211: extend PMSR FTM response for proximity ranging Peddolla Harshavardhan Reddy
2026-03-12 21:13 ` Stern, Avraham
2026-03-05 16:07 ` [PATCH wireless-next v3 09/15] wifi: cfg80211: add role-based PD peer limits Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` Peddolla Harshavardhan Reddy [this message]
2026-03-12 21:14 ` [PATCH wireless-next v3 10/15] wifi: cfg80211: add ingress/egress distance thresholds for FTM Stern, Avraham
2026-03-20 19:18 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 11/15] wifi: cfg80211: add PD-specific preamble and bandwidth capabilities Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 12/15] wifi: cfg80211: add FTM range report negotiation support Peddolla Harshavardhan Reddy
2026-03-12 21:15 ` Stern, Avraham
2026-03-20 19:00 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 13/15] wifi: cfg80211: add result reporting control for PD requests Peddolla Harshavardhan Reddy
2026-03-12 21:16 ` Stern, Avraham
2026-03-20 19:04 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 14/15] wifi: cfg80211: add LTF keyseed support for secure ranging Peddolla Harshavardhan Reddy
2026-03-15 8:22 ` Stern, Avraham
2026-03-20 19:10 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 15/15] 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=20260305160712.1263829-11-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