aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2022-04-17 09:26:48 -0700
committerSunil Ravi <sunilravi@google.com>2022-04-18 21:53:06 -0700
commit4fc918fad83b0d324ca128dbbec60fd243ea66ba (patch)
treec671fc3e04d885810e9dfd27da46ec765d8f9c81
parent621ef2db6261d5ab9fb830d2d8c98d02a66de0e0 (diff)
downloadwpa_supplicant_8-4fc918fad83b0d324ca128dbbec60fd243ea66ba.tar.gz
set the hostapd channel bandwidth
This change takes care of setting the channel bandwidth when framework doesn't provide the bandwidth. Changes are, 1. 40MHz bandwidth in 2.4GHz band is not common and is prone to inter-op issues. So disable setting 40MHz in 2.4GHz band only configuration and cases where 60GHz is used. 2. Set 40MHz & vht operational channel width only in 5GHz and 6GHz when 11AC is enabled and 60GHz is not used cases. 3. set he operational channel width when 11ax is enabled and 60GHz is not used cases. Bug: 213122226 Test: atest android.net.wifi.cts.WifiManagerTest Test: adb shell cmd wifi force-softap-channel enabled 2412 Change-Id: I4e707d709f885daa5dcc7fdcafbfad751e3a62e1
-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;
}