diff options
author | Purushottam Kushwaha <quic_pkushwah@quicinc.com> | 2022-02-04 19:00:34 +0530 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2022-03-16 09:52:08 -0700 |
commit | 90c710b733492cba3bcb6ec69a931d103c3ddd10 (patch) | |
tree | ed2d2b66c9e70658abdf3b455e3e14b0f88b79e2 | |
parent | 84e230b06c49a15abeedd1812fdda4c1388cfb94 (diff) | |
download | wpa_supplicant_8-90c710b733492cba3bcb6ec69a931d103c3ddd10.tar.gz |
Hostapd[AIDL]: Configure HwModeParams.maximumChannelBandwidth.
This CL is to add the HwModeParams.maximumChannelBandwidthsupport.
Based on different values, ht_capab, he_oper_chwidth and
vht_oper_chwidth params are set.
Bug: 215120219
Test: Manual - Hotspot turn on/off multiple times
Change-Id: Ibcb656b2a2cb477c42673185d08b9f87674cc29e
Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
-rw-r--r-- | hostapd/aidl/hostapd.cpp | 70 |
1 files changed, 57 insertions, 13 deletions
diff --git a/hostapd/aidl/hostapd.cpp b/hostapd/aidl/hostapd.cpp index 61539a07..f67aaa3d 100644 --- a/hostapd/aidl/hostapd.cpp +++ b/hostapd/aidl/hostapd.cpp @@ -458,7 +458,6 @@ std::string CreateHostapdConfig( } std::string hw_mode_as_string; - std::string ht_cap_vht_oper_chwidth_as_string; std::string enable_edmg_as_string; std::string edmg_channel_as_string; bool is_60Ghz_used = false; @@ -476,22 +475,12 @@ std::string CreateHostapdConfig( if (((band & band5Ghz) != 0) || ((band & band6Ghz) != 0)) { hw_mode_as_string = "hw_mode=any"; - if (iface_params.hwModeParams.enable80211AC) { - ht_cap_vht_oper_chwidth_as_string = - "ht_capab=[HT40+]\n" - "vht_oper_chwidth=1"; - } } else { hw_mode_as_string = "hw_mode=g"; } } else if (((band & band5Ghz) != 0) || ((band & band6Ghz) != 0)) { hw_mode_as_string = "hw_mode=a"; - if (iface_params.hwModeParams.enable80211AC) { - ht_cap_vht_oper_chwidth_as_string = - "ht_capab=[HT40+]\n" - "vht_oper_chwidth=1"; - } } else { wpa_printf(MSG_ERROR, "Invalid band"); return ""; @@ -502,7 +491,6 @@ std::string CreateHostapdConfig( if (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) { he_params_as_string = StringPrintf( "ieee80211ax=1\n" - "he_oper_chwidth=1\n" "he_su_beamformer=%d\n" "he_su_beamformee=%d\n" "he_mu_beamformer=%d\n" @@ -516,6 +504,62 @@ std::string CreateHostapdConfig( } #endif /* CONFIG_IEEE80211AX */ + std::string ht_cap_vht_oper_he_oper_chwidth_as_string; + switch (iface_params.hwModeParams.maximumChannelBandwidth) { + case ChannelBandwidth::BANDWIDTH_20: + ht_cap_vht_oper_he_oper_chwidth_as_string = StringPrintf( +#ifdef CONFIG_IEEE80211AX + "he_oper_chwidth=0\n" +#endif + "vht_oper_chwidth=0"); + break; + case ChannelBandwidth::BANDWIDTH_40: + ht_cap_vht_oper_he_oper_chwidth_as_string = StringPrintf( + "ht_capab=[HT40+]\n" +#ifdef CONFIG_IEEE80211AX + "he_oper_chwidth=0\n" +#endif + "vht_oper_chwidth=0"); + break; + case ChannelBandwidth::BANDWIDTH_80: + 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", +#ifdef CONFIG_IEEE80211AX + (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) ? 1 : 0, +#endif + iface_params.hwModeParams.enable80211AC ? 1 : 0); + break; + case ChannelBandwidth::BANDWIDTH_160: + 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", +#ifdef CONFIG_IEEE80211AX + (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) ? 2 : 0, +#endif + 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", +#ifdef CONFIG_IEEE80211AX + (iface_params.hwModeParams.enable80211AX && !is_60Ghz_used) ? 1 : 0, +#endif + ((((band & band5Ghz) != 0) || ((band & band6Ghz) != 0)) + && iface_params.hwModeParams.enable80211AC) ? 1 : 0); + break; + } + #ifdef CONFIG_INTERWORKING std::string access_network_params_as_string; if (nw_params.isMetered) { @@ -581,7 +625,7 @@ std::string CreateHostapdConfig( iface_params.hwModeParams.enable80211N ? 1 : 0, iface_params.hwModeParams.enable80211AC ? 1 : 0, he_params_as_string.c_str(), - hw_mode_as_string.c_str(), ht_cap_vht_oper_chwidth_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 access_network_params_as_string.c_str(), |