]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Move beacon transmit rate configuration from radio level to BSS level main pending
authorHaribabu Krishnasamy <hkr@qti.qualcomm.com>
Fri, 19 Dec 2025 11:48:40 +0000 (17:18 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 19 Dec 2025 20:15:33 +0000 (22:15 +0200)
This enables control of the beacon transmission rate on a per-BSS basis.
Refactor beacon rate handling by moving the beacon_rate and rate_type
fields from struct hostapd_config to the per-BSS struct
hostapd_bss_config structure. This change ensures that beacon rate
settings are applied at BSS level, allowing multiple BSS instances to
have independent configurations. This updates the configuration parsing
logic to set these values in BSS context and adjusts beacon parameter
building to reference the BSS-level fields.

Signed-off-by: Haribabu Krishnasamy <hkr@qti.qualcomm.com>
hostapd/config_file.c
src/ap/ap_config.h
src/ap/beacon.c

index fec51bd4ab8afcf367cb3e1d8969eda030d8f7d7..8d5c1433ab3fa0d83d0459265243b3e0250fdbb8 100644 (file)
@@ -3338,6 +3338,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                        return 1;
                }
        } else if (os_strcmp(buf, "beacon_rate") == 0) {
+               enum beacon_rate_type rate_type;
                int val;
 
                if (os_strncmp(pos, "ht:", 3) == 0) {
@@ -3348,8 +3349,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                           line, val);
                                return 1;
                        }
-                       conf->rate_type = BEACON_RATE_HT;
-                       conf->beacon_rate = val;
+                       rate_type = BEACON_RATE_HT;
                } else if (os_strncmp(pos, "vht:", 4) == 0) {
                        val = atoi(pos + 4);
                        if (val < 0 || val > 9) {
@@ -3358,8 +3358,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                           line, val);
                                return 1;
                        }
-                       conf->rate_type = BEACON_RATE_VHT;
-                       conf->beacon_rate = val;
+                       rate_type = BEACON_RATE_VHT;
                } else if (os_strncmp(pos, "he:", 3) == 0) {
                        val = atoi(pos + 3);
                        if (val < 0 || val > 11) {
@@ -3368,8 +3367,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                           line, val);
                                return 1;
                        }
-                       conf->rate_type = BEACON_RATE_HE;
-                       conf->beacon_rate = val;
+                       rate_type = BEACON_RATE_HE;
                } else {
                        val = atoi(pos);
                        if (val < 10 || val > 10000) {
@@ -3378,9 +3376,11 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                           line, val);
                                return 1;
                        }
-                       conf->rate_type = BEACON_RATE_LEGACY;
-                       conf->beacon_rate = val;
+                       rate_type = BEACON_RATE_LEGACY;
                }
+
+               bss->rate_type = rate_type;
+               bss->beacon_rate = val;
        } else if (os_strcmp(buf, "preamble") == 0) {
                if (atoi(pos))
                        conf->preamble = SHORT_PREAMBLE;
index ae6972f48512246dd41a4a4e3645e4dab80e51cc..b427a972e92ecd50bb7ae84d5807a1ec5a808547 100644 (file)
@@ -295,6 +295,9 @@ struct hostapd_bss_config {
 
        int max_num_sta; /* maximum number of STAs in station table */
 
+       enum beacon_rate_type rate_type;
+       unsigned int beacon_rate;
+
        int dtim_period;
        unsigned int bss_load_update_period;
        unsigned int chan_util_avg_period;
@@ -1063,9 +1066,6 @@ struct hostapd_config {
                SHORT_PREAMBLE = 1
        } preamble;
 
-       unsigned int beacon_rate;
-       enum beacon_rate_type rate_type;
-
        const struct wpa_driver_ops *driver;
        char *driver_params;
 
index 6eb4ff20ba1d63acd1279548625bda42f229ef1f..90224211b31278ffcfb1e58abd50884eaec9f833 100644 (file)
@@ -2583,8 +2583,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
        params->dtim_period = hapd->conf->dtim_period;
        params->beacon_int = hapd->iconf->beacon_int;
        params->basic_rates = hapd->basic_rates;
-       params->beacon_rate = hapd->iconf->beacon_rate;
-       params->rate_type = hapd->iconf->rate_type;
+       params->beacon_rate = hapd->conf->beacon_rate;
+       params->rate_type = hapd->conf->rate_type;
        params->ssid = hapd->conf->ssid.ssid;
        params->ssid_len = hapd->conf->ssid.ssid_len;
        if ((hapd->conf->wpa & (WPA_PROTO_WPA | WPA_PROTO_RSN)) ==