]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: nl80211/cfg80211: clarify periodic FTM parameters for non-EDCA based ranging
authorAvraham Stern <avraham.stern@intel.com>
Sun, 11 Jan 2026 17:03:49 +0000 (19:03 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Jan 2026 12:40:30 +0000 (13:40 +0100)
Periodic FTM request attributes are defined based on the periodic
parameters used in EDCA-based ranging negotiation. However, non-EDCA
based ranging (trigger-based/non-trigger-based) does not include
periodic parameters in the negotiation protocol, even though upper
layers may still request periodic measurements.

Clarify the semantics of periodic ranging attributes when used with
non-EDCA based ranging.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260111190221.b89cb3f68e1a.I7a9d8c6d1c66c77f1b43120a841101c96c3f19ad@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/pmsr.c

index 8153b6aaa998cc8eb11c5957c729f1b0a298c076..8a81adbf37235a8d14104686d60f8d426e889430 100644 (file)
@@ -4295,7 +4295,9 @@ struct cfg80211_pmsr_result {
  * @burst_period: burst period to use
  * @asap: indicates to use ASAP mode
  * @num_bursts_exp: number of bursts exponent
- * @burst_duration: burst duration
+ * @burst_duration: burst duration. If @trigger_based or @non_trigger_based is
+ *     set, this is the burst duration in milliseconds, and zero means the
+ *     device should pick an appropriate value based on @ftms_per_burst.
  * @ftms_per_burst: number of FTMs per burst
  * @ftmr_retries: number of retries for FTM request
  * @request_lci: request LCI information
index 200703c8b2c169d5b5a3735ab975e6998065ad53..71219445f5c71e757570a3c93e40dd7a73618524 100644 (file)
@@ -7851,12 +7851,15 @@ enum nl80211_peer_measurement_ftm_capa {
  *     &enum nl80211_preamble), optional for DMG (u32)
  * @NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP: number of bursts exponent as in
  *     802.11-2016 9.4.2.168 "Fine Timing Measurement Parameters element"
- *     (u8, 0-15, optional with default 15 i.e. "no preference")
+ *     (u8, 0-15, optional with default 15 i.e. "no preference". No limit for
+ *      non-EDCA ranging)
  * @NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD: interval between bursts in units
  *     of 100ms (u16, optional with default 0)
  * @NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION: burst duration, as in 802.11-2016
  *     Table 9-257 "Burst Duration field encoding" (u8, 0-15, optional with
- *     default 15 i.e. "no preference")
+ *     default 15 i.e. "no preference"). For non-EDCA ranging, this is the
+ *     burst duration in milliseconds (optional with default 0, i.e. let the
+ *     device decide).
  * @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames
  *     requested per burst
  *     (u8, 0-31, optional with default 0 i.e. "no preference")
index a117f5093ca29fcb45f7b7c26ba1a65ba948684d..795683a8130391eb3327be2f6182932e2cf50184 100644 (file)
@@ -85,11 +85,6 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
                return -EINVAL;
        }
 
-       out->ftm.burst_duration = 15;
-       if (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION])
-               out->ftm.burst_duration =
-                       nla_get_u8(tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION]);
-
        out->ftm.ftms_per_burst = 0;
        if (tb[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST])
                out->ftm.ftms_per_burst =
@@ -164,6 +159,12 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
                return -EINVAL;
        }
 
+       if (tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION])
+               out->ftm.burst_duration =
+                       nla_get_u8(tb[NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION]);
+       else if (!out->ftm.non_trigger_based && !out->ftm.trigger_based)
+               out->ftm.burst_duration = 15;
+
        out->ftm.lmr_feedback =
                !!tb[NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK];
        if (!out->ftm.trigger_based && !out->ftm.non_trigger_based &&