From 30331ec671929741af94bb425b4b3a0a8bdb56a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sat, 21 Sep 2024 09:46:25 +0200 Subject: [PATCH] wifi: Indicate 320 MHz support in EHT capabilities --- src/wifi/model/eht/eht-capabilities.h | 13 ++++++++----- src/wifi/model/wifi-mac.cc | 17 +++++++++++++++-- src/wifi/model/wifi-remote-station-manager.cc | 6 ++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/wifi/model/eht/eht-capabilities.h b/src/wifi/model/eht/eht-capabilities.h index db66db15d..263e751df 100644 --- a/src/wifi/model/eht/eht-capabilities.h +++ b/src/wifi/model/eht/eht-capabilities.h @@ -177,11 +177,14 @@ struct EhtMcsAndNssSet * Deserialize the Supported EHT-MCS And NSS Set subfield * * @param start iterator pointing to where the Supported EHT-MCS And NSS Set subfield should be - * read from \param is2_4Ghz indicating whether PHY is operating in 2.4 GHz based on previously - * serialized IEs \param heSupportedChannelWidthSet supported channel width set based on - * previously deserialized HE capabilities IE \param support320MhzIn6Ghz flag whether 320 MHz is - * supported in 6 GHz band based on EHT PHY capabilities subfield \return the number of bytes - * read + * read from + * @param is2_4Ghz indicating whether PHY is operating in 2.4 GHz based on previously serialized + * IEs + * @param heSupportedChannelWidthSet supported channel width set based on previously + * deserialized HE capabilities IE + * @param support320MhzIn6Ghz flag whether 320 MHz is supported in 6 GHz band based on EHT PHY + * capabilities subfield + * @return the number of bytes read */ uint16_t Deserialize(Buffer::Iterator start, bool is2_4Ghz, diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index 62712bb73..d8c3164e4 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -2520,8 +2520,21 @@ WifiMac::GetEhtCapabilities(uint8_t linkId) const phy->IsMcsSupported(WIFI_MOD_CLASS_EHT, maxMcs) ? maxTxNss : 0); } } - // 320 MHz not supported yet - + if (width >= MHz_u{320}) + { + capabilities.m_phyCapabilities.support320MhzIn6Ghz = true; + for (auto maxMcs : {9, 11, 13}) + { + capabilities.SetSupportedRxEhtMcsAndNss( + EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_320_MHZ, + maxMcs, + phy->IsMcsSupported(WIFI_MOD_CLASS_EHT, maxMcs) ? maxRxNss : 0); + capabilities.SetSupportedTxEhtMcsAndNss( + EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_320_MHZ, + maxMcs, + phy->IsMcsSupported(WIFI_MOD_CLASS_EHT, maxMcs) ? maxTxNss : 0); + } + } return capabilities; } diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 951cf24cc..a9ca2c932 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -1768,6 +1768,12 @@ WifiRemoteStationManager::AddStationEhtCapabilities(Mac48Address from, // Used by all stations to record EHT capabilities of remote stations NS_LOG_FUNCTION(this << from << ehtCapabilities); auto state = LookupState(from); + if (ehtCapabilities.m_phyCapabilities.support320MhzIn6Ghz && + (m_wifiPhy->GetPhyBand() == WIFI_PHY_BAND_6GHZ)) + { + state->m_channelWidth = 320; + } + // For other cases, the supported channel width is set by the HT/VHT capabilities for (const auto& mcs : m_wifiPhy->GetMcsList(WIFI_MOD_CLASS_EHT)) { for (uint8_t mapType = 0; mapType < EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_MAX; ++mapType)