]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: nl80211: remove the FTMs per burst limit for NDP ranging
authorAvraham Stern <avraham.stern@intel.com>
Wed, 5 Jun 2024 10:57:16 +0000 (13:57 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 12 Jun 2024 11:04:25 +0000 (13:04 +0200)
In NDP ranging, the number of NDP exchanges is not negotiated
and thus is not limited by the protocol. Remove the limit on
FTMs per burst for trigger based and non trigger based ranging.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240605135233.916e228537d9.I5fe4c1cefa1c1328726e7615dd5a0d861c694381@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c
net/wireless/pmsr.c

index a94e73c133f76f8434731a0da1bffc66239e76c5..fcac7dedcd61e75debf0f9cb2f05901ca38e654e 100644 (file)
@@ -315,8 +315,7 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = {
        [NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD] = { .type = NLA_U16 },
        [NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION] =
                NLA_POLICY_MAX(NLA_U8, 15),
-       [NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST] =
-               NLA_POLICY_MAX(NLA_U8, 31),
+       [NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST] = { .type = NLA_U8 },
        [NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES] = { .type = NLA_U8 },
        [NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI] = { .type = NLA_FLAG },
        [NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC] = { .type = NLA_FLAG },
index c569c37da31758a1b7f4051541537588140ef45d..0396fa19bdf19d84a01e9918dbad6d1b0d634fa7 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Copyright (C) 2018 - 2021, 2023 Intel Corporation
+ * Copyright (C) 2018 - 2021, 2023 - 2024 Intel Corporation
  */
 #include <net/cfg80211.h>
 #include "core.h"
@@ -148,6 +148,14 @@ static int pmsr_parse_ftm(struct cfg80211_registered_device *rdev,
                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,
+                                   tb[NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST],
+                                   "FTM: FTMs per burst must be set lower than 31");
+               return -ERANGE;
+       }
+
        if ((out->ftm.trigger_based || out->ftm.non_trigger_based) &&
            out->ftm.preamble != NL80211_PREAMBLE_HE) {
                NL_SET_ERR_MSG_ATTR(info->extack,