diff --git a/src/wifi/model/ht/ht-phy.cc b/src/wifi/model/ht/ht-phy.cc index dfa742544..3c8737694 100644 --- a/src/wifi/model/ht/ht-phy.cc +++ b/src/wifi/model/ht/ht-phy.cc @@ -60,7 +60,7 @@ HtPhy::HtPhy(uint8_t maxNss /* = 1 */, bool buildModeList /* = true */) m_maxSupportedMcsIndexPerSs = m_maxMcsIndexPerSs; if (buildModeList) { - NS_ABORT_MSG_IF(maxNss == 0 || maxNss > 4, + NS_ABORT_MSG_IF(maxNss == 0 || maxNss > HT_MAX_NSS, "Unsupported max Nss " << +maxNss << " for HT PHY"); BuildModeList(); } @@ -196,7 +196,7 @@ HtPhy::SetMaxSupportedNss(uint8_t maxNss) { NS_LOG_FUNCTION(this << +maxNss); NS_ASSERT(m_bssMembershipSelector == HT_PHY); - NS_ABORT_MSG_IF(maxNss == 0 || maxNss > 4, "Unsupported max Nss " << +maxNss << " for HT PHY"); + maxNss = std::min(HT_MAX_NSS, maxNss); if (maxNss != m_maxSupportedNss) { NS_LOG_LOGIC("Rebuild mode list since max number of spatial streams has changed"); diff --git a/src/wifi/model/ht/ht-phy.h b/src/wifi/model/ht/ht-phy.h index 948b6df9c..d9eb2c91b 100644 --- a/src/wifi/model/ht/ht-phy.h +++ b/src/wifi/model/ht/ht-phy.h @@ -37,6 +37,9 @@ namespace ns3 */ #define HT_PHY 127 +/// Maximum number of supported NSS by HT PHY +constexpr uint8_t HT_MAX_NSS = 4; + /** * \brief PHY entity for HT (11n) * \ingroup wifi diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index a0b42ab40..a881bc511 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -1249,7 +1249,7 @@ void WifiPhy::SetNumberOfAntennas(uint8_t antennas) { NS_LOG_FUNCTION(this << +antennas); - NS_ASSERT_MSG(antennas > 0 && antennas <= 4, "unsupported number of antennas"); + NS_ASSERT_MSG(antennas > 0 && antennas <= 8, "unsupported number of antennas"); m_numberOfAntennas = antennas; if (m_interference) {