aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Avshalom Lazar <ailizaro@codeaurora.org>2019-09-11 09:03:07 (GMT)
committerJouni Malinen <j@w1.fi>2019-10-07 14:20:41 (GMT)
commit241dd76cfdc83158efc3b8af0b254dae8d408022 (patch)
tree111921ef41e1d653c0a6149f02f0fc62e24c7e8b
parentdc3457cc4a958a491fae1bff7c0be28e50877509 (diff)
downloadhostap-241dd76cfdc83158efc3b8af0b254dae8d408022.zip
hostap-241dd76cfdc83158efc3b8af0b254dae8d408022.tar.gz
hostap-241dd76cfdc83158efc3b8af0b254dae8d408022.tar.bz2
hostapd: Check EDMG configuration against capability
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
-rw-r--r--src/ap/hostapd.c3
-rw-r--r--src/ap/hw_features.c26
-rw-r--r--src/ap/hw_features.h6
3 files changed, 35 insertions, 0 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 83e6474..3686438 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1590,6 +1590,9 @@ static int setup_interface2(struct hostapd_iface *iface)
wpa_printf(MSG_DEBUG, "Interface initialization will be completed in a callback (ACS)");
return 0;
}
+ ret = hostapd_check_edmg_capab(iface);
+ if (ret < 0)
+ goto fail;
ret = hostapd_check_ht_capab(iface);
if (ret < 0)
goto fail;
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index a0720ba..2a1fa0a 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -704,6 +704,32 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface)
}
+int hostapd_check_edmg_capab(struct hostapd_iface *iface)
+{
+ struct hostapd_hw_modes *mode = iface->hw_features;
+ struct ieee80211_edmg_config edmg;
+
+ if (!iface->conf->enable_edmg)
+ return 0;
+
+ hostapd_encode_edmg_chan(iface->conf->enable_edmg,
+ iface->conf->edmg_channel,
+ iface->conf->channel,
+ &edmg);
+
+ if (mode->edmg.channels && ieee802_edmg_is_allowed(mode->edmg, edmg))
+ return 0;
+
+ wpa_printf(MSG_WARNING, "Requested EDMG configuration is not valid");
+ wpa_printf(MSG_INFO, "EDMG capab: channels 0x%x, bw_config %d",
+ mode->edmg.channels, mode->edmg.bw_config);
+ wpa_printf(MSG_INFO,
+ "Requested EDMG configuration: channels 0x%x, bw_config %d",
+ edmg.channels, edmg.bw_config);
+ return -1;
+}
+
+
static int hostapd_is_usable_chan(struct hostapd_iface *iface,
int channel, int primary)
{
diff --git a/src/ap/hw_features.h b/src/ap/hw_features.h
index ca7f22b..902a19f 100644
--- a/src/ap/hw_features.h
+++ b/src/ap/hw_features.h
@@ -21,6 +21,7 @@ const char * hostapd_hw_mode_txt(int mode);
int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
int hostapd_check_ht_capab(struct hostapd_iface *iface);
+int hostapd_check_edmg_capab(struct hostapd_iface *iface);
int hostapd_prepare_rates(struct hostapd_iface *iface,
struct hostapd_hw_modes *mode);
void hostapd_stop_setup_timers(struct hostapd_iface *iface);
@@ -61,6 +62,11 @@ static inline int hostapd_check_ht_capab(struct hostapd_iface *iface)
return 0;
}
+static inline int hostapd_check_edmg_capab(struct hostapd_iface *iface)
+{
+ return 0;
+}
+
static inline int hostapd_prepare_rates(struct hostapd_iface *iface,
struct hostapd_hw_modes *mode)
{