From d7713b5ca78966dd7ea6a3bdd35511503dc59537 Mon Sep 17 00:00:00 2001 From: Ramya Gnanasekar Date: Thu, 14 Apr 2022 12:14:03 +0530 Subject: [PATCH] mesh: add EHT support Add mesh_eht_enabled and eht ssid config to include EHT capability and EHT operation IEs in mesh PLINK action frames. Update mesh_eht_enabled from EHT capability advertised for mesh mode. Support for mesh channelization in 320MHz. Signed-off-by: Ramya Gnanasekar Signed-off-by: Sathishkumar Muruganandam --- diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 339cb7f..166ce67 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -4319,6 +4319,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, } else if (os_strcmp(buf, "wowlan_triggers") == 0) { os_free(bss->wowlan_triggers); bss->wowlan_triggers = os_strdup(pos); + } else if (os_strcmp(buf, "enable_320mhz_bw") == 0) { + conf->enable_320mhz_bw = atoi(pos); } else if (os_strcmp(buf, "enable_160mhz_bw") == 0) { conf->enable_160mhz_bw = atoi(pos); } else if (os_strcmp(buf, "disable_40mhz_scan") == 0) { diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index c8d219b..bfc08fa 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -1204,6 +1204,7 @@ struct hostapd_config { u16 ru_punct_bitmap; u8 ru_punct_ofdma; u8 ru_punct_acs_threshold; + int enable_320mhz_bw; enum mbssid { MBSSID_DISABLED = 0, diff --git a/src/drivers/driver.h b/src/drivers/driver.h index a2093e0..0e9fcaf 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1366,6 +1366,11 @@ struct wpa_driver_associate_params { int beacon_tx_mode; /** + * Enable 320MHz BW - set it 1 to enable mesh 320MHz 6G + */ + int enable_320mhz_bw; + + /** * Enable 160MHz BW - set it 1 to enable mesh 160MHz 6G */ int enable_160mhz_bw; diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 97836e7..83476dd 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -425,6 +425,11 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, ssid->he) conf->ieee80211ax = 1; + if (mode->eht_capab[wpas_mode_to_ieee80211_mode( + ssid->mode)].eht_supported && + ssid->eht) + conf->ieee80211be = 1; + if (mode->vht_capab && ssid->vht) { conf->ieee80211ac = 1; conf->vht_capab |= mode->vht_capab; diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 9ab4e03..6d4273c 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2884,6 +2884,7 @@ static const struct parse_data ssid_fields[] = { { INT_RANGE(disable_40mhz_scan, 0, 1)}, { INT_RANGE(beacon_tx_mode, 1, 2)}, { INT_RANGE(enable_160mhz_bw, 0, 1)}, + { INT_RANGE(enable_320mhz_bw, 0, 1)}, { INT_RANGE(disable_eht, 0, 1)}, { INT_RANGE(enable_4addr_mode, 0, 1)}, }; diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h index 86a05db..e073028 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -1288,6 +1288,11 @@ struct wpa_ssid { */ int enable_160mhz_bw; + /** + * Enable 320MHz BW - set it 1 to enable mesh 320MHz 6G + */ + int enable_320mhz_bw; + /** * disable_eht - Disable EHT (IEEE 802.11be) for this network * diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index 91b1cb2..499b157 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -468,6 +468,9 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, case 160: conf->op_class = 134; break; + case 320: + conf->op_class = 137; + break; default: conf->op_class = 131; break; @@ -685,6 +688,9 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, case 160: ssid->max_oper_chwidth = CONF_OPER_CHWIDTH_160MHZ; break; + case 320: + ssid->max_oper_chwidth = CONF_OPER_CHWIDTH_320MHZ; + break; default: ssid->max_oper_chwidth = CONF_OPER_CHWIDTH_USE_HT; break; diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c index 656dda8..67415a3 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c @@ -257,6 +257,16 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, 3 + sizeof(struct ieee80211_he_6ghz_band_cap); } #endif /* CONFIG_IEEE80211AX */ +#ifdef CONFIG_IEEE80211BE + if (type != PLINK_CLOSE && wpa_s->mesh_eht_enabled) { + buf_len += 3 + + 2 + + EHT_PHY_CAPAB_LEN + + EHT_MCS_NSS_CAPAB_LEN + + EHT_PPE_THRESH_CAPAB_LEN; + buf_len += 3 + sizeof(struct ieee80211_eht_operation); + } +#endif /* CONFIG_IEEE80211BE */ if (type != PLINK_CLOSE) buf_len += conf->rsn_ie_len; /* RSN IE */ #ifdef CONFIG_OCV @@ -398,6 +408,20 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, wpabuf_put_data(buf, he_capa_oper, pos - he_capa_oper); } #endif /* CONFIG_IEEE80211AX */ +#ifdef CONFIG_IEEE80211BE + if (type != PLINK_CLOSE && wpa_s->mesh_eht_enabled) { + u8 eht_capa_oper[3 + + 2 + + EHT_PHY_CAPAB_LEN + + EHT_MCS_NSS_CAPAB_LEN + + EHT_PPE_THRESH_CAPAB_LEN + + 3 + sizeof(struct ieee80211_eht_operation)]; + pos = hostapd_eid_eht_capab(bss, eht_capa_oper, + IEEE80211_MODE_MESH); + pos = hostapd_eid_eht_operation(bss, pos, IEEE80211_MODE_MESH); + wpabuf_put_data(buf, eht_capa_oper, pos - eht_capa_oper); + } +#endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_OCV if (type != PLINK_CLOSE && conf->ocv) { struct wpa_channel_info ci; @@ -788,6 +812,11 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s, elems->eht_capabilities_len); #endif /*CONFIG_IEEE80211BE */ +#ifdef CONFIG_IEEE80211BE + copy_sta_eht_capab(data, sta, IEEE80211_MODE_MESH, elems->he_capabilities, + elems->he_capabilities_len, elems->eht_capabilities, elems->eht_capabilities_len); +#endif /* CONFIG_IEEE80211BE */ + if (hostapd_get_aid(data, sta) < 0) { wpa_msg(wpa_s, MSG_ERROR, "No AIDs available"); ap_free_sta(data, sta);