Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: nl80211/cfg80211: support operating as RSTA in PMSR FTM request

Add an option to operate as the RSTA in an FTM measurement request.
When requested, the device will dwell on the requested channel until
the peer starts the FTM negotiation. This option is only valid for
trigger-based/non trigger-based measurement with LMR feedback which
will allow the RSTA to receive the results of the measurement.

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.1f95fc0afab4.Iae2d32783b8e7c4a29089fec0f4c6bce94d303cc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Avraham Stern and committed by
Johannes Berg
853800c7 cfd46d1c

+37 -1
+6 -1
include/net/cfg80211.h
··· 4312 4312 * EDCA based ranging will be used. 4313 4313 * @lmr_feedback: negotiate for I2R LMR feedback. Only valid if either 4314 4314 * @trigger_based or @non_trigger_based is set. 4315 + * @rsta: Operate as the RSTA in the measurement. Only valid if @lmr_feedback 4316 + * and either @trigger_based or @non_trigger_based is set. 4315 4317 * @bss_color: the bss color of the responder. Optional. Set to zero to 4316 4318 * indicate the driver should set the BSS color. Only valid if 4317 4319 * @non_trigger_based or @trigger_based is set. ··· 4329 4327 request_civicloc:1, 4330 4328 trigger_based:1, 4331 4329 non_trigger_based:1, 4332 - lmr_feedback:1; 4330 + lmr_feedback:1, 4331 + rsta:1; 4333 4332 u8 num_bursts_exp; 4334 4333 u8 burst_duration; 4335 4334 u8 ftms_per_burst; ··· 5661 5658 * (0 means unknown) 5662 5659 * @ftm.max_total_ltf_rx: maximum total number of LTFs that can be received 5663 5660 * (0 means unknown) 5661 + * @ftm.support_rsta: supports operating as RSTA in PMSR FTM request 5664 5662 */ 5665 5663 struct cfg80211_pmsr_capabilities { 5666 5664 unsigned int max_peers; ··· 5687 5683 u8 max_rx_sts; 5688 5684 u8 max_total_ltf_tx; 5689 5685 u8 max_total_ltf_rx; 5686 + u8 support_rsta:1; 5690 5687 } ftm; 5691 5688 }; 5692 5689
+12
include/uapi/linux/nl80211.h
··· 7812 7812 * maximum total number of LTFs the device can receive. The total number 7813 7813 * of LTFs is (number of LTF repetitions) * (number of space-time streams). 7814 7814 * This limits the allowed combinations of LTF repetitions and STS. 7815 + * @NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT: flag attribute indicating the 7816 + * device supports operating as the RSTA in PMSR FTM request 7815 7817 * 7816 7818 * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal 7817 7819 * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number ··· 7838 7836 NL80211_PMSR_FTM_CAPA_ATTR_MAX_RX_STS, 7839 7837 NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_TX, 7840 7838 NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_RX, 7839 + NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT, 7841 7840 7842 7841 /* keep last */ 7843 7842 NUM_NL80211_PMSR_FTM_CAPA_ATTR, ··· 7891 7888 * @NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR: optional. The BSS color of the 7892 7889 * responder. Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED 7893 7890 * or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED is set. 7891 + * @NL80211_PMSR_FTM_REQ_ATTR_RSTA: optional. Request to perform the measurement 7892 + * as the RSTA (flag). When set, the device is expected to dwell on the 7893 + * channel specified in %NL80211_PMSR_PEER_ATTR_CHAN until it receives the 7894 + * FTM request from the peer or the timeout specified by 7895 + * %NL80211_ATTR_TIMEOUT has expired. 7896 + * Only valid if %NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK is set (so the 7897 + * RSTA will have the measurement results to report back in the FTM 7898 + * response). 7894 7899 * 7895 7900 * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal 7896 7901 * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number ··· 7919 7908 NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, 7920 7909 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK, 7921 7910 NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR, 7911 + NL80211_PMSR_FTM_REQ_ATTR_RSTA, 7922 7912 7923 7913 /* keep last */ 7924 7914 NUM_NL80211_PMSR_FTM_REQ_ATTR,
+4
net/wireless/nl80211.c
··· 361 361 [NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED] = { .type = NLA_FLAG }, 362 362 [NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK] = { .type = NLA_FLAG }, 363 363 [NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR] = { .type = NLA_U8 }, 364 + [NL80211_PMSR_FTM_REQ_ATTR_RSTA] = { .type = NLA_FLAG }, 364 365 }; 365 366 366 367 static const struct nla_policy ··· 2336 2335 if (cap->ftm.max_total_ltf_rx > 0 && 2337 2336 nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MAX_TOTAL_LTF_RX, 2338 2337 cap->ftm.max_total_ltf_rx)) 2338 + return -ENOBUFS; 2339 + if (cap->ftm.support_rsta && 2340 + nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_RSTA_SUPPORT)) 2339 2341 return -ENOBUFS; 2340 2342 2341 2343 nla_nest_end(msg, ftm);
+15
net/wireless/pmsr.c
··· 187 187 nla_get_u8(tb[NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR]); 188 188 } 189 189 190 + out->ftm.rsta = !!tb[NL80211_PMSR_FTM_REQ_ATTR_RSTA]; 191 + if (out->ftm.rsta && !capa->ftm.support_rsta) { 192 + NL_SET_ERR_MSG_ATTR(info->extack, 193 + tb[NL80211_PMSR_FTM_REQ_ATTR_RSTA], 194 + "FTM: RSTA not supported by device"); 195 + return -EOPNOTSUPP; 196 + } 197 + 198 + if (out->ftm.rsta && !out->ftm.lmr_feedback) { 199 + NL_SET_ERR_MSG_ATTR(info->extack, 200 + tb[NL80211_PMSR_FTM_REQ_ATTR_RSTA], 201 + "FTM: RSTA set without LMR feedback"); 202 + return -EINVAL; 203 + } 204 + 190 205 return 0; 191 206 } 192 207