From cb6afcaacd3f0de23882fdd5e341a986a860bb3e Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 10 Sep 2021 14:47:55 -0700 Subject: [PATCH 01/15] mbssid: add configuration options Add configuration options to enable multiple BSSID (MBSSID) and enhanced multiple BSSID advertisements (EMA). MBSSID enablement is mandatory to enable EMA. Signed-off-by: John Crispin Signed-off-by: Aloka Dixit --- hostapd/config_file.c | 4 ++++ hostapd/hostapd.conf | 10 ++++++++++ src/ap/ap_config.c | 5 +++++ src/ap/ap_config.h | 2 ++ 4 files changed, 21 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index a6334b1..00af762 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -4735,6 +4735,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, return 1; } else if (os_strcmp(buf, "rnr") == 0) { bss->rnr = atoi(pos); + } else if (os_strcmp(buf, "mbssid") == 0) { + conf->mbssid = atoi(pos); + } else if (os_strcmp(buf, "ema") == 0) { + conf->ema = atoi(pos); #ifdef CONFIG_IEEE80211BE } else if (os_strcmp(buf, "ieee80211be") == 0) { conf->ieee80211be = atoi(pos); diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 84b9a93..a3a7dab 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -1055,6 +1055,16 @@ wmm_ac_vo_acm=0 # MLD ID - Affiliated MLD ID #mld_id=1 +# Multiple BSSID element support in beacon and probe response frames. +# 0 = Disabled +# 1 = Enabled +#mbssid=0 + +# Enhanced multiple BSSID advertisements support in beacons. +# 0 = Disabled +# 1 = Enabled +#ema=0 + ##### IEEE 802.1X-2004 related configuration ################################## # Require IEEE 802.1X authorization diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 5deca40..afc1dd7 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -1567,6 +1567,11 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config) return -1; } + if (!conf->mbssid && conf->ema) { + wpa_printf(MSG_ERROR, "mbssid must be enabled to enable ema"); + return -1; + } + for (i = 0; i < conf->num_bss; i++) { if (hostapd_config_check_bss(conf->bss[i], conf, full_config)) return -1; diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 4e7108a..679435c 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -1196,6 +1196,7 @@ struct hostapd_config { #define CH_SWITCH_EHT_ENABLED BIT(0) #define CH_SWITCH_EHT_DISABLED BIT(1) unsigned int ch_switch_eht_config; + u8 ema; enum mbssid { MBSSID_DISABLED = 0,