From c2d13ef565e1bfe0c4b253ab657006f31f3048ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Wed, 29 Jan 2025 15:59:16 +0100 Subject: [PATCH] wifi: Do not loop over unallowed RUs --- src/wifi/model/spectrum-wifi-phy.cc | 4 +++- src/wifi/model/wifi-ru.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index 813fee108..3c7581830 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -152,7 +152,9 @@ SpectrumWifiPhy::GetRuBands(Ptr spectrumPhyInterface, { for (uint32_t i = 0; i < (channelWidth / bw); ++i) { - for (uint32_t type = 0; type < static_cast(RuType::RU_TYPE_MAX); ++type) + for (uint32_t type = 0; + type <= static_cast(WifiRu::GetMaxRuType(WIFI_MOD_CLASS_HE)); + ++type) { auto ruType = static_cast(type); std::size_t nRus = WifiRu::GetNRus(bw, ruType, WIFI_MOD_CLASS_HE); diff --git a/src/wifi/model/wifi-ru.h b/src/wifi/model/wifi-ru.h index 3590dfc72..8cc0ef9e0 100644 --- a/src/wifi/model/wifi-ru.h +++ b/src/wifi/model/wifi-ru.h @@ -228,7 +228,6 @@ class WifiRu */ static bool IsEht(RuSpec ru); - private: /** * Get the maximum RU type supported by a given modulation class. *