aboutsummaryrefslogtreecommitdiff
path: root/hostapd/aidl/hostapd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'hostapd/aidl/hostapd.cpp')
-rw-r--r--hostapd/aidl/hostapd.cpp62
1 files changed, 44 insertions, 18 deletions
diff --git a/hostapd/aidl/hostapd.cpp b/hostapd/aidl/hostapd.cpp
index 11d1290c..b313e549 100644
--- a/hostapd/aidl/hostapd.cpp
+++ b/hostapd/aidl/hostapd.cpp
@@ -376,12 +376,18 @@ std::string CreateHostapdConfig(
encryption_config_as_string = StringPrintf(
"wpa=2\n"
"rsn_pairwise=%s\n"
- "wpa_key_mgmt=WPA-PSK SAE\n"
+ "wpa_key_mgmt=%s\n"
"ieee80211w=1\n"
"sae_require_mfp=1\n"
"wpa_passphrase=%s\n"
"sae_password=%s",
is_60Ghz_band_only ? "GCMP" : "CCMP",
+#ifdef CONFIG_IEEE80211BE
+ iface_params.hwModeParams.enable80211BE ?
+ "WPA-PSK SAE SAE-EXT-KEY" : "WPA-PSK SAE",
+#else
+ "WPA-PSK SAE",
+#endif
nw_params.passphrase.c_str(),
nw_params.passphrase.c_str());
break;
@@ -392,12 +398,17 @@ std::string CreateHostapdConfig(
encryption_config_as_string = StringPrintf(
"wpa=2\n"
"rsn_pairwise=%s\n"
- "wpa_key_mgmt=SAE\n"
+ "wpa_key_mgmt=%s\n"
"ieee80211w=2\n"
"sae_require_mfp=2\n"
"sae_pwe=%d\n"
"sae_password=%s",
is_60Ghz_band_only ? "GCMP" : "CCMP",
+#ifdef CONFIG_IEEE80211BE
+ iface_params.hwModeParams.enable80211BE ? "SAE SAE-EXT-KEY" : "SAE",
+#else
+ "SAE",
+#endif
is_6Ghz_band_only ? 1 : 2,
nw_params.passphrase.c_str());
break;
@@ -504,6 +515,15 @@ std::string CreateHostapdConfig(
he_params_as_string = "ieee80211ax=0";
}
#endif /* CONFIG_IEEE80211AX */
+ std::string eht_params_as_string;
+#ifdef CONFIG_IEEE80211BE
+ if (iface_params.hwModeParams.enable80211BE && !is_60Ghz_used) {
+ eht_params_as_string = "ieee80211be=1";
+ /* TODO set eht_su_beamformer, eht_su_beamformee, eht_mu_beamformer */
+ } else {
+ eht_params_as_string = "ieee80211be=0";
+ }
+#endif /* CONFIG_IEEE80211BE */
std::string ht_cap_vht_oper_he_oper_chwidth_as_string;
switch (iface_params.hwModeParams.maximumChannelBandwidth) {
@@ -547,17 +567,18 @@ std::string CreateHostapdConfig(
iface_params.hwModeParams.enable80211AC ? 2 : 0);
break;
default:
- if (!is_2Ghz_band_only && !is_60Ghz_used
- && iface_params.hwModeParams.enable80211AC) {
- ht_cap_vht_oper_he_oper_chwidth_as_string =
+ if (!is_2Ghz_band_only && !is_60Ghz_used) {
+ if (iface_params.hwModeParams.enable80211AC) {
+ ht_cap_vht_oper_he_oper_chwidth_as_string =
"ht_capab=[HT40+]\n"
"vht_oper_chwidth=1\n";
- }
+ }
#ifdef CONFIG_IEEE80211AX
- if (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) {
- ht_cap_vht_oper_he_oper_chwidth_as_string += "he_oper_chwidth=1";
- }
+ if (iface_params.hwModeParams.enable80211AX) {
+ ht_cap_vht_oper_he_oper_chwidth_as_string += "he_oper_chwidth=1";
+ }
#endif
+ }
break;
}
@@ -610,6 +631,7 @@ std::string CreateHostapdConfig(
"%s\n"
"%s\n"
"%s\n"
+ "%s\n"
"ignore_broadcast_ssid=%d\n"
"wowlan_triggers=any\n"
#ifdef CONFIG_INTERWORKING
@@ -626,6 +648,7 @@ std::string CreateHostapdConfig(
iface_params.hwModeParams.enable80211N ? 1 : 0,
iface_params.hwModeParams.enable80211AC ? 1 : 0,
he_params_as_string.c_str(),
+ eht_params_as_string.c_str(),
hw_mode_as_string.c_str(), ht_cap_vht_oper_he_oper_chwidth_as_string.c_str(),
nw_params.isHidden ? 1 : 0,
#ifdef CONFIG_INTERWORKING
@@ -670,27 +693,27 @@ ChannelBandwidth getChannelBandwidth(struct hostapd_config *iconf)
iconf->vht_oper_chwidth, iconf->ieee80211n,
iconf->secondary_channel);
switch (iconf->vht_oper_chwidth) {
- case CHANWIDTH_80MHZ:
+ case CONF_OPER_CHWIDTH_80MHZ:
return ChannelBandwidth::BANDWIDTH_80;
- case CHANWIDTH_80P80MHZ:
+ case CONF_OPER_CHWIDTH_80P80MHZ:
return ChannelBandwidth::BANDWIDTH_80P80;
break;
- case CHANWIDTH_160MHZ:
+ case CONF_OPER_CHWIDTH_160MHZ:
return ChannelBandwidth::BANDWIDTH_160;
break;
- case CHANWIDTH_USE_HT:
+ case CONF_OPER_CHWIDTH_USE_HT:
if (iconf->ieee80211n) {
return iconf->secondary_channel != 0 ?
ChannelBandwidth::BANDWIDTH_40 : ChannelBandwidth::BANDWIDTH_20;
}
return ChannelBandwidth::BANDWIDTH_20_NOHT;
- case CHANWIDTH_2160MHZ:
+ case CONF_OPER_CHWIDTH_2160MHZ:
return ChannelBandwidth::BANDWIDTH_2160;
- case CHANWIDTH_4320MHZ:
+ case CONF_OPER_CHWIDTH_4320MHZ:
return ChannelBandwidth::BANDWIDTH_4320;
- case CHANWIDTH_6480MHZ:
+ case CONF_OPER_CHWIDTH_6480MHZ:
return ChannelBandwidth::BANDWIDTH_6480;
- case CHANWIDTH_8640MHZ:
+ case CONF_OPER_CHWIDTH_8640MHZ:
return ChannelBandwidth::BANDWIDTH_8640;
default:
return ChannelBandwidth::BANDWIDTH_INVALID;
@@ -701,6 +724,9 @@ bool forceStaDisconnection(struct hostapd_data* hapd,
const std::vector<uint8_t>& client_address,
const uint16_t reason_code) {
struct sta_info *sta;
+ if (client_address.size() != ETH_ALEN) {
+ return false;
+ }
for (sta = hapd->sta_list; sta; sta = sta->next) {
int res;
res = memcmp(sta->addr, client_address.data(), ETH_ALEN);
@@ -1027,7 +1053,7 @@ std::vector<uint8_t> generateRandomOweSsid()
iface_hapd->setup_complete_cb_ctx = iface_hapd;
iface_hapd->sta_authorized_cb = onAsyncStaAuthorizedCb;
iface_hapd->sta_authorized_cb_ctx = iface_hapd;
- wpa_msg_register_cb(onAsyncWpaEventCb);
+ wpa_msg_register_aidl_cb(onAsyncWpaEventCb);
if (hostapd_enable_iface(iface_hapd->iface) < 0) {
wpa_printf(