]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HE: Propagate BSS color settings to nl80211
authorJohn Crispin <john@phrozen.org>
Tue, 4 Feb 2020 08:04:55 +0000 (09:04 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 17 Feb 2020 17:28:39 +0000 (19:28 +0200)
Add the code required to send the BSS color settings to the kernel.

Signed-off-by: John Crispin <john@phrozen.org>
src/ap/beacon.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index 0bab464c2dc3b6778f8d30ac9815d9a58de46b37..e5e81e78c0d51bacf0df09eb7e305dce2ea37905 100644 (file)
@@ -1421,6 +1421,11 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
                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;
+       params.he_bss_color_disabled =
+               hapd->iface->conf->he_op.he_bss_color_disabled;
+       params.he_bss_color_partial =
+               hapd->iface->conf->he_op.he_bss_color_partial;
+       params.he_bss_color = hapd->iface->conf->he_op.he_bss_color;
        params.twt_responder = hostapd_get_he_twt_responder(hapd,
                                                            IEEE80211_MODE_AP);
 #endif /* CONFIG_IEEE80211AX */
index 148e4999d3e4a8657d901e1925186bd3c77ec4b3..e0cf8d122a2bae4fea8fbf6b94c02d56ec6e84bd 100644 (file)
@@ -1481,6 +1481,21 @@ struct wpa_driver_ap_params {
         */
         int he_spr_srg_obss_pd_max_offset;
 
+       /**
+        * he_bss_color - Whether the BSS Color is disabled
+        */
+       int he_bss_color_disabled;
+
+       /**
+        * he_bss_color_partial - The BSS Color AID equation
+        */
+       int he_bss_color_partial;
+
+       /**
+        * he_bss_color - The BSS Color of the AP
+        */
+       int he_bss_color;
+
        /**
         * twt_responder - Whether Target Wait Time responder is enabled
         */
index d55d8e8f5559ace19fcba919f79ae2dcf7b2c96c..1421aff45354c18b27830175c83a234938d5f7f7 100644 (file)
@@ -4362,6 +4362,21 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                nla_nest_end(msg, spr);
        }
 
+       if (params->freq && params->freq->he_enabled) {
+               struct nlattr *bss_color;
+
+               bss_color = nla_nest_start(msg, NL80211_ATTR_HE_BSS_COLOR);
+               if (!bss_color ||
+                   (params->he_bss_color_disabled &&
+                    nla_put_flag(msg, NL80211_HE_BSS_COLOR_ATTR_DISABLED)) ||
+                   (params->he_bss_color_partial &&
+                    nla_put_flag(msg, NL80211_HE_BSS_COLOR_ATTR_PARTIAL)) ||
+                   nla_put_u8(msg, NL80211_HE_BSS_COLOR_ATTR_COLOR,
+                              params->he_bss_color))
+                       goto fail;
+               nla_nest_end(msg, bss_color);
+       }
+
        if (params->twt_responder) {
                wpa_printf(MSG_DEBUG, "nl80211: twt_responder=%d",
                           params->twt_responder);