History

wifi: cfg80211: add NTB continuous ranging and FTM request type support

Enable NTB continuous ranging with configurable timing and measurement parameters as per the Wi-Fi Alliance specification "Proximity Ranging (PR) Implementation Consideration Draft 1.9 Rev 1, section 5.3". Add new FTM request attributes for min/max time between measurements, nominal time (mandatory for NTB), AW duration, and total measurement count. Add NL80211_PMSR_PEER_ATTR_REQ_TYPE attribute using the new nl80211_peer_measurement_ftm_req_type enum to allow userspace to specify the ranging request type per peer: - NL80211_PMSR_FTM_REQ_TYPE_INFRA: STA-to-AP or AP-to-STA ranging (default if attribute is absent) - NL80211_PMSR_FTM_REQ_TYPE_PD: peer-to-peer ranging Validate the request type against the device TYPE_CAPS capabilities advertised via NL80211_PMSR_FTM_CAPA_ATTR_TYPE_CAPS. Reject PD requests if the device does not advertise PD support. Reject PD requests that set trigger-based ranging, as TB ranging is not compatible with peer-to-peer proximity detection. Add ftms_per_burst limit of 4 for PD NTB ranging requests.

Peddolla Harshavardhan Reddy committed 6 months ago

Commit 8823a9b1 parent 18709c64 files · +163 −6Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+60−2
@@ -7991,6 +7991,26 @@ enum nl80211_peer_measurement_resp { · 7990 unmodified lines
7991 NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 17991 NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 1
7992};7992};
7993 7993
7994/**
7995 * enum nl80211_peer_measurement_ftm_req_type - FTM ranging request type,
7996 * used with %NL80211_PMSR_PEER_ATTR_REQ_TYPE
7997 *
7998 * @NL80211_PMSR_FTM_REQ_TYPE_INFRA: infrastructure ranging, i.e. STA-to-AP
7999 * @NL80211_PMSR_FTM_REQ_TYPE_PD: peer-to-peer ranging as defined in the
8000 * Wi-Fi Alliance specification "Proximity Ranging (PR) Implementation
8001 * Consideration Draft 1.9 Rev 1"
8002 * @NUM_NL80211_PMSR_FTM_REQ_TYPE: internal
8003 * @NL80211_PMSR_FTM_REQ_TYPE_MAX: highest request type value
8004 */
8005enum nl80211_peer_measurement_ftm_req_type {
8006 NL80211_PMSR_FTM_REQ_TYPE_INFRA,
8007 NL80211_PMSR_FTM_REQ_TYPE_PD,
8008
8009 /* keep last */
8010 NUM_NL80211_PMSR_FTM_REQ_TYPE,
8011 NL80211_PMSR_FTM_REQ_TYPE_MAX = NUM_NL80211_PMSR_FTM_REQ_TYPE - 1
8012};
8013
7994/**8014/**
7995 * enum nl80211_peer_measurement_peer_attrs - peer attributes for measurement8015 * enum nl80211_peer_measurement_peer_attrs - peer attributes for measurement
7996 * @__NL80211_PMSR_PEER_ATTR_INVALID: invalid8016 * @__NL80211_PMSR_PEER_ATTR_INVALID: invalid
@@ -8004,6 +8024,9 @@ enum nl80211_peer_measurement_resp { · 7 unmodified lines
8004 * @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by8024 * @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by
8005 * measurement type, with attributes from the8025 * measurement type, with attributes from the
8006 * &enum nl80211_peer_measurement_resp inside.8026 * &enum nl80211_peer_measurement_resp inside.
8027 * @NL80211_PMSR_PEER_ATTR_REQ_TYPE: u32 attribute specifying the ranging
8028 * request type, using values from &enum nl80211_peer_measurement_ftm_req_type.
8029 * If absent, defaults to %NL80211_PMSR_FTM_REQ_TYPE_INFRA.
8007 *8030 *
8008 * @NUM_NL80211_PMSR_PEER_ATTRS: internal8031 * @NUM_NL80211_PMSR_PEER_ATTRS: internal
8009 * @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number8032 * @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number
@@ -8015,6 +8038,7 @@ enum nl80211_peer_measurement_peer_attrs { · 5 unmodified lines
8015 NL80211_PMSR_PEER_ATTR_CHAN,8038 NL80211_PMSR_PEER_ATTR_CHAN,
8016 NL80211_PMSR_PEER_ATTR_REQ,8039 NL80211_PMSR_PEER_ATTR_REQ,
8017 NL80211_PMSR_PEER_ATTR_RESP,8040 NL80211_PMSR_PEER_ATTR_RESP,
8041 NL80211_PMSR_PEER_ATTR_REQ_TYPE,
8018 8042
8019 /* keep last */8043 /* keep last */
8020 NUM_NL80211_PMSR_PEER_ATTRS,8044 NUM_NL80211_PMSR_PEER_ATTRS,
@@ -8238,9 +8262,11 @@ enum nl80211_peer_measurement_ftm_type_capa { · 217 unmodified lines
8238 * default 15 i.e. "no preference"). For non-EDCA ranging, this is the8262 * default 15 i.e. "no preference"). For non-EDCA ranging, this is the
8239 * burst duration in milliseconds (optional with default 0, i.e. let the8263 * burst duration in milliseconds (optional with default 0, i.e. let the
8240 * device decide).8264 * device decide).
8241 * @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames8265 * @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: (Optional) number of successful
8242 * requested per burst8266 * FTM frames requested per burst
8243 * (u8, 0-31, optional with default 0 i.e. "no preference")8267 * (u8, 0-31, optional with default 0 i.e. "no preference")
8268 * If the attribute is absent ("no preference"), the driver or firmware can
8269 * choose a suitable value.
8244 * @NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES: number of FTMR frame retries8270 * @NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES: number of FTMR frame retries
8245 * (u8, default 3)8271 * (u8, default 3)
8246 * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag)8272 * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag)
@@ -8274,6 +8300,33 @@ enum nl80211_peer_measurement_ftm_type_capa { · 27 unmodified lines
8274 * Only valid if %NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK is set (so the8300 * Only valid if %NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK is set (so the
8275 * RSTA will have the measurement results to report back in the FTM8301 * RSTA will have the measurement results to report back in the FTM
8276 * response).8302 * response).
8303 * @NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS: minimum time
8304 * between two consecutive range measurements in units of 100 microseconds,
8305 * for non-trigger based ranging (u32). Should be set as short as possible
8306 * to minimize turnaround time, since two-way ranging with delayed LMR
8307 * requires two measurements. Only valid if
8308 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
8309 * @NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS: maximum time
8310 * between two consecutive range measurements in units of 10 milliseconds,
8311 * for non-trigger based ranging (u32). Acts as a session timeout; if
8312 * exceeded, the ranging session should be terminated. Only valid if
8313 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
8314 * @NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME: The nominal time field shall be
8315 * set to the nominal duration between adjacent Availability Windows in
8316 * units of milli seconds (u32). Mandatory if
8317 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
8318 * @NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION: (Optional) The AW duration field
8319 * shall be set to the duration of the AW in units of 1ms (0-255 ms) (u32).
8320 * Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
8321 * If the attribute is absent ("no preference"), the driver or firmware
8322 * can choose a suitable value.
8323 * @NL80211_PMSR_FTM_REQ_ATTR_NUM_MEASUREMENTS: (Optional) number of
8324 * Availability Windows (AWs) to schedule for non-trigger-based ranging.
8325 * Each AW may contain multiple FTM exchanges as configured by
8326 * %NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST. Only valid if
8327 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
8328 * If the attribute is absent ("no preference"), the driver or firmware
8329 * can choose a suitable value.
8277 *8330 *
8278 * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal8331 * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
8279 * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number8332 * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -8295,6 +8348,11 @@ enum nl80211_peer_measurement_ftm_req { · 15 unmodified lines
8295 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,8348 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
8296 NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,8349 NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,
8297 NL80211_PMSR_FTM_REQ_ATTR_RSTA,8350 NL80211_PMSR_FTM_REQ_ATTR_RSTA,
8351 NL80211_PMSR_FTM_REQ_ATTR_MIN_TIME_BETWEEN_MEASUREMENTS,
8352 NL80211_PMSR_FTM_REQ_ATTR_MAX_TIME_BETWEEN_MEASUREMENTS,
8353 NL80211_PMSR_FTM_REQ_ATTR_NOMINAL_TIME,
8354 NL80211_PMSR_FTM_REQ_ATTR_AW_DURATION,
8355 NL80211_PMSR_FTM_REQ_ATTR_NUM_MEASUREMENTS,
8298 8356
8299 /* keep last */8357 /* keep last */
8300 NUM_NL80211_PMSR_FTM_REQ_ATTR,8358 NUM_NL80211_PMSR_FTM_REQ_ATTR,