]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Multi-AP: Allow supported profile to be configured
authorManoj Sekar <quic_sekar@quicinc.com>
Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 19 Mar 2024 16:57:35 +0000 (18:57 +0200)
Allow both hostapd and wpa_supplicant to be configured with the
supported Multi-AP profile. The configured value will be advertised in
the Multi-AP element.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.c
src/ap/ap_config.h
src/ap/ieee802_11.c
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant.conf

index d30f2fe9f2729e3a689bf8eacc39968e8a53b4bc..668317300d71af6523c6e4e4cfbd1bc876f6e5b1 100644 (file)
@@ -4802,6 +4802,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                }
 
                bss->multi_ap = val;
+       } else if (os_strcmp(buf, "multi_ap_profile") == 0) {
+               int val = atoi(pos);
+
+               if (val < MULTI_AP_PROFILE_1 || val > MULTI_AP_PROFILE_MAX) {
+                       wpa_printf(MSG_ERROR,
+                                  "Line %d: Invalid multi_ap_profile '%s'",
+                                  line, buf);
+                       return -1;
+               }
+               bss->multi_ap_profile = val;
        } else if (os_strcmp(buf, "rssi_reject_assoc_rssi") == 0) {
                conf->rssi_reject_assoc_rssi = atoi(pos);
        } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) {
index f8b4f9c65957e2fbdc897fb377b46d5d9068811e..8d3d32838a42030845eb035625e2eef9250aa874 100644 (file)
@@ -2565,6 +2565,12 @@ own_ip_addr=127.0.0.1
 #multi_ap_backhaul_wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
 #multi_ap_backhaul_wpa_passphrase=secret passphrase
 
+# Multi-AP Profile
+# Indicate the supported Multi-AP profile (default: 2)
+# 1 = Supports Multi-AP profile 1 as defined in Wi-Fi EasyMesh specification
+# 2 = Supports Multi-AP profile 2 as defined in Wi-Fi EasyMesh specification
+#multi_ap_profile=2
+
 # WPS UPnP interface
 # If set, support for external Registrars is enabled.
 #upnp_iface=br0
index a28ebbb5d82037e86dbdb9f0c78a931273271ddb..1a18df61771d12791c262fdf1ee0d8f123a486b3 100644 (file)
@@ -163,6 +163,8 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
        /* Default to strict CRL checking. */
        bss->check_crl_strict = 1;
 
+       bss->multi_ap_profile = MULTI_AP_PROFILE_2;
+
 #ifdef CONFIG_TESTING_OPTIONS
        bss->sae_commit_status = -1;
        bss->test_assoc_comeback_type = -1;
index de02ddafda777c05de10035dddbcdc88282547be..bbc63dc3f0c2a42f04443bab5375e3c5bfd309a9 100644 (file)
@@ -800,6 +800,7 @@ struct hostapd_bss_config {
 #define BACKHAUL_BSS 1
 #define FRONTHAUL_BSS 2
        int multi_ap; /* bitmap of BACKHAUL_BSS, FRONTHAUL_BSS */
+       int multi_ap_profile;
 
 #ifdef CONFIG_AIRTIME_POLICY
        unsigned int airtime_weight;
index 463d904e384957c6be341990f32448167948125f..f5de27446302a8e7cf4d59099e428c5861e66d0a 100644 (file)
@@ -100,6 +100,8 @@ static u8 * hostapd_eid_multi_ap(struct hostapd_data *hapd, u8 *eid, size_t len)
        if (hapd->conf->multi_ap & FRONTHAUL_BSS)
                multi_ap.capability |= MULTI_AP_FRONTHAUL_BSS;
 
+       multi_ap.profile = hapd->conf->multi_ap_profile;
+
        return eid + add_multi_ap_ie(eid, len, &multi_ap);
 }
 
index b4d4830825415244ed8544f4be315aed9425c3b3..2c756136c358b0dd586a257777971c9fa8cd081c 100644 (file)
@@ -2747,6 +2747,8 @@ static const struct parse_data ssid_fields[] = {
        { INT_RANGE(owe_ptk_workaround, 0, 1) },
        { INT_RANGE(multi_ap_backhaul_sta, 0, 1) },
        { INT_RANGE(ft_eap_pmksa_caching, 0, 1) },
+       { INT_RANGE(multi_ap_profile, MULTI_AP_PROFILE_1,
+                   MULTI_AP_PROFILE_MAX) },
        { INT_RANGE(beacon_prot, 0, 1) },
        { INT_RANGE(transition_disable, 0, 255) },
        { INT_RANGE(sae_pk, 0, 2) },
index ac1414ae2957290c52f3478d3e6cde884ed36b84..1a2c0c9bef8a67f0b7c73f7d401e086d6b5a274a 100644 (file)
@@ -850,6 +850,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
        INT(owe_ptk_workaround);
        INT(multi_ap_backhaul_sta);
        INT(ft_eap_pmksa_caching);
+       INT(multi_ap_profile);
        INT(beacon_prot);
        INT(transition_disable);
        INT(sae_pk);
index ff045380ec960fd8ffbd2ee5a974949c11b795c7..e40650c273ebff36d1220ff37e5c4e87150f5de6 100644 (file)
@@ -1187,6 +1187,11 @@ struct wpa_ssid {
         */
        int ft_eap_pmksa_caching;
 
+       /**
+        * multi_ap_profile - Supported Multi-AP profile
+        */
+       int multi_ap_profile;
+
        /**
         * beacon_prot - Whether Beacon protection is enabled
         *
index b67eb341883d08dd765beba5f6bd6f3ccc007390..887dde5c76bc4be8f89a747f14302dd72e1cf25a 100644 (file)
@@ -2411,6 +2411,7 @@ mscs_fail:
                struct multi_ap_params multi_ap = { 0 };
 
                multi_ap.capability = MULTI_AP_BACKHAUL_STA;
+               multi_ap.profile = ssid->multi_ap_profile;
 
                multi_ap_ie_len = add_multi_ap_ie(
                        wpa_s->sme.assoc_req_ie + wpa_s->sme.assoc_req_ie_len,
index e9fea83e4414bd1717368c7ae022277ece3ee769..d52ce1efd3edbf665059cfe63179a2679a380ce9 100644 (file)
@@ -3812,6 +3812,7 @@ mscs_end:
                struct multi_ap_params multi_ap = { 0 };
 
                multi_ap.capability = MULTI_AP_BACKHAUL_STA;
+               multi_ap.profile = ssid->multi_ap_profile;
 
                multi_ap_ie_len = add_multi_ap_ie(wpa_ie + wpa_ie_len,
                                                  max_wpa_ie_len - wpa_ie_len,
index 743f2a323e0e8054be5d0cdfa6ef13f2c37e28b8..2e36845f13d614fb2f06b6b643de05ebc919978e 100644 (file)
@@ -1709,6 +1709,12 @@ fast_reauth=1
 # support Multi-AP, and sets 4-address mode if it does. Thus, the netdev can be
 # added to a bridge to allow forwarding frames over this backhaul link.
 
+# Multi-AP Profile
+# Indicate the supported Multi-AP profile
+# 1 = Supports Multi-AP profile 1 as defined in Wi-Fi EasyMesh specification
+# 2 = Supports Multi-AP profile 2 as defined in Wi-Fi EasyMesh specification
+#multi_ap_profile=2
+
 ##### Fast Session Transfer (FST) support #####################################
 #
 # The options in this section are only available when the build configuration