diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 929b852f6..e53dc20b0 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4037,7 +4037,7 @@ static int wpa_driver_nl80211_set_ap(void *priv, struct wpa_driver_nl80211_data *drv = bss->drv; struct nl_msg *msg; u8 cmd = NL80211_CMD_NEW_BEACON; - int ret; + int ret = -ENOBUFS; int beacon_set; int num_suites; int smps_mode; @@ -4243,6 +4243,29 @@ static int wpa_driver_nl80211_set_ap(void *priv, goto fail; } + if (params->ftm_responder) { + struct nlattr *ftm; + + if (!(drv->capa.flags & WPA_DRIVER_FLAGS_FTM_RESPONDER)) { + ret = -ENOTSUP; + goto fail; + } + + ftm = nla_nest_start(msg, NL80211_ATTR_FTM_RESPONDER); + if (!ftm || + nla_put_flag(msg, NL80211_FTM_RESP_ATTR_ENABLED) || + (params->lci && + nla_put(msg, NL80211_FTM_RESP_ATTR_LCI, + wpabuf_len(params->lci), + wpabuf_head(params->lci))) || + (params->civic && + nla_put(msg, NL80211_FTM_RESP_ATTR_CIVICLOC, + wpabuf_len(params->civic), + wpabuf_head(params->civic)))) + goto fail; + nla_nest_end(msg, ftm); + } + ret = send_and_recv_msgs(drv, msg, NULL, NULL); if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", @@ -4294,7 +4317,7 @@ static int wpa_driver_nl80211_set_ap(void *priv, return ret; fail: nlmsg_free(msg); - return -ENOBUFS; + return ret; } diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 7b360d209..8e2ebd210 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -428,6 +428,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info, NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION)) capa->flags |= WPA_DRIVER_FLAGS_OCE_STA; #endif /* CONFIG_MBO */ + + if (ext_feature_isset(ext_features, len, + NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER)) + capa->flags |= WPA_DRIVER_FLAGS_FTM_RESPONDER; }