]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HE: Send the AP's OBSS PD settings to the kernel
authorJohn Crispin <john@phrozen.org>
Tue, 13 Aug 2019 14:16:25 +0000 (16:16 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 10 Sep 2019 11:00:14 +0000 (14:00 +0300)
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@phrozen.org>
src/ap/beacon.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index f3bdf30aa6bdd73834c5ff94526f9d7e08bf1971..6c94f9521942cad39324832150b3bc7fb7a87137 100644 (file)
@@ -1423,6 +1423,13 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
        params.proberesp_ies = proberesp;
        params.assocresp_ies = assocresp;
        params.reenable = hapd->reenable_beacon;
+#ifdef CONFIG_IEEE80211AX
+       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 /* CONFIG_IEEE80211AX */
        hapd->reenable_beacon = 0;
 
        if (cmode &&
index 2a8459ae3f2d7251193b9235be2c008ffadd4e81..e9d0e47282306070822d4f560d6bceb5b4a3b08c 100644 (file)
@@ -1442,6 +1442,21 @@ struct wpa_driver_ap_params {
         * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
         */
        const struct wpabuf *civic;
+
+       /**
+        * 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 {
index 4133aa6af48f35569ba622a8a82a56eb2534c757..c7dad201b220f8ecd60cac19cbf617afae6b82c6 100644 (file)
@@ -4282,6 +4282,23 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                nla_nest_end(msg, ftm);
        }
 
+#ifdef CONFIG_IEEE80211AX
+       if (params->he_spr) {
+               struct nlattr *spr;
+
+               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) ||
+                   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 /* CONFIG_IEEE80211AX */
+
        ret = send_and_recv_msgs(drv, msg, NULL, NULL);
        if (ret) {
                wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",