[PATCH 3/3] HE: send the APs OBSS PD settings to the kernel

John Crispin john at phrozen.org
Tue Aug 13 07:16:25 PDT 2019


This allows us to send the OBSS PD settings to the kernel, such that the
driver can propagate them to the hardware/firmware.

Signed-off-by: John Crispin <john at phrozen.org>
---
 src/ap/beacon.c              |  3 +++
 src/drivers/driver.h         | 16 ++++++++++++++++
 src/drivers/driver_nl80211.c | 13 +++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 756dde926..7376ce976 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -1423,6 +1423,9 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
 	params.reenable = hapd->reenable_beacon;
 #ifdef CONFIG_IEEE80211AX
 	params.twt_responder = hostapd_get_he_twt_responder(hapd);
+	params.he_spr = !!hapd->iface->conf->spr.sr_control;
+	params.he_spr_srg_obss_pd_min_offset = hapd->iface->conf->spr.srg_obss_pd_min_offset;
+	params.he_spr_srg_obss_pd_max_offset = hapd->iface->conf->spr.srg_obss_pd_max_offset;
 #endif
 	hapd->reenable_beacon = 0;
 
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 198745ca6..00fbe4faf 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1447,6 +1447,22 @@ struct wpa_driver_ap_params {
 	 * twt_responder - Whether Target Wait Time responder is enabled
 	 */
 	int twt_responder;
+
+	/**
+	 * he_spr - Whether Spatial Reuse is enabled
+	 */
+	 int he_spr;
+
+	/**
+	 * he_spr_srg_obss_pd_min_offset - minimum tx power offset
+	 */
+	 int he_spr_srg_obss_pd_min_offset;
+
+	/**
+	 * he_spr_srg_obss_pd_max_offset - maximum tx power offset
+	 */
+	 int he_spr_srg_obss_pd_max_offset;
+
 };
 
 struct wpa_driver_mesh_bss_params {
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index e0f69c967..1fcb38a4a 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4293,6 +4293,19 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 		if (nla_put_flag(msg, NL80211_ATTR_TWT_RESPONDER))
 			goto fail;
 	}
+
+	if (params->he_spr) {
+		struct nlattr *spr = nla_nest_start(msg, NL80211_ATTR_HE_OBSS_PD);
+		wpa_printf(MSG_DEBUG, "nl80211: he_spr=%d",
+			   params->he_spr);
+
+		if (nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, params->he_spr_srg_obss_pd_min_offset))
+			goto fail;
+		if (nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, params->he_spr_srg_obss_pd_max_offset))
+			goto fail;
+
+		nla_nest_end(msg, spr);
+	}
 #endif
 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
 	if (ret) {
-- 
2.20.1




More information about the Hostap mailing list