aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2022-04-20 12:21:59 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-04-20 12:21:59 +0000
commit70a2d206f174091ec24199a51234c7c7925d3319 (patch)
tree3905d4b63398da21e03a2b08301416e8b7974a78
parent083fd59340c105e3c3d4c71b6a366b6353cf5537 (diff)
parent4fc918fad83b0d324ca128dbbec60fd243ea66ba (diff)
downloadwpa_supplicant_8-70a2d206f174091ec24199a51234c7c7925d3319.tar.gz
Merge "set the hostapd channel bandwidth" into tm-dev
-rw-r--r--hostapd/aidl/hostapd.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/hostapd/aidl/hostapd.cpp b/hostapd/aidl/hostapd.cpp
index d973dae8..f0fa687a 100644
--- a/hostapd/aidl/hostapd.cpp
+++ b/hostapd/aidl/hostapd.cpp
@@ -321,6 +321,7 @@ std::string CreateHostapdConfig(
// Encryption config string
uint32_t band = 0;
band |= static_cast<uint32_t>(channelParams.bandMask);
+ bool is_2Ghz_band_only = band == static_cast<uint32_t>(band2Ghz);
bool is_6Ghz_band_only = band == static_cast<uint32_t>(band6Ghz);
bool is_60Ghz_band_only = band == static_cast<uint32_t>(band60Ghz);
std::string encryption_config_as_string;
@@ -460,9 +461,7 @@ std::string CreateHostapdConfig(
std::string hw_mode_as_string;
std::string enable_edmg_as_string;
std::string edmg_channel_as_string;
-#ifdef CONFIG_IEEE80211AX
bool is_60Ghz_used = false;
-#endif /* CONFIG_IEEE80211AX */
if (((band & band60Ghz) != 0)) {
hw_mode_as_string = "hw_mode=ad";
@@ -472,9 +471,7 @@ std::string CreateHostapdConfig(
"edmg_channel=%d",
channelParams.channel);
}
-#ifdef CONFIG_IEEE80211AX
is_60Ghz_used = true;
-#endif /* CONFIG_IEEE80211AX */
} else if ((band & band2Ghz) != 0) {
if (((band & band5Ghz) != 0)
|| ((band & band6Ghz) != 0)) {
@@ -550,17 +547,17 @@ std::string CreateHostapdConfig(
iface_params.hwModeParams.enable80211AC ? 2 : 0);
break;
default:
- ht_cap_vht_oper_he_oper_chwidth_as_string = StringPrintf(
- "ht_capab=[HT40+]\n"
-#ifdef CONFIG_IEEE80211AX
- "he_oper_chwidth=%d\n"
-#endif
- "vht_oper_chwidth=%d",
+ if (!is_2Ghz_band_only && !is_60Ghz_used
+ && 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
- (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) ? 1 : 0,
+ if (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) {
+ ht_cap_vht_oper_he_oper_chwidth_as_string += "he_oper_chwidth=1";
+ }
#endif
- ((((band & band5Ghz) != 0) || ((band & band6Ghz) != 0))
- && iface_params.hwModeParams.enable80211AC) ? 1 : 0);
break;
}