diff --git a/RELEASE_NOTES b/RELEASE_NOTES index e4e62d9773a..d32fd788520 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -29,6 +29,7 @@ New user-visible features Bugs fixed ---------- - Bug 2505 - network: Avoid asserts in Header/Trailer deserialization +- Bug 2764 - wifi: WifiSpectrumModelId doesn't distinguish 11ax from legacy Known issues ------------ diff --git a/src/spectrum/model/wifi-spectrum-value-helper.cc b/src/spectrum/model/wifi-spectrum-value-helper.cc index a8686558ceb..5e2d603b697 100644 --- a/src/spectrum/model/wifi-spectrum-value-helper.cc +++ b/src/spectrum/model/wifi-spectrum-value-helper.cc @@ -38,17 +38,20 @@ struct WifiSpectrumModelId * Constructor * \param f the frequency in Mhz * \param w the channel width in Mhz + * \param b the width of each band (Hz) */ - WifiSpectrumModelId (uint32_t f, uint8_t w); + WifiSpectrumModelId (uint32_t f, uint8_t w, double b); uint32_t m_centerFrequency; ///< center frequency uint8_t m_channelWidth; ///< channel width + double m_bandBandwidth; ///< width of each band (Hz) }; -WifiSpectrumModelId::WifiSpectrumModelId (uint32_t f, uint8_t w) +WifiSpectrumModelId::WifiSpectrumModelId (uint32_t f, uint8_t w, double b) : m_centerFrequency (f), - m_channelWidth (w) + m_channelWidth (w), + m_bandBandwidth (b) { - NS_LOG_FUNCTION (this << f << (uint16_t)w); + NS_LOG_FUNCTION (this << f << (uint16_t)w << b); } /** @@ -60,7 +63,12 @@ WifiSpectrumModelId::WifiSpectrumModelId (uint32_t f, uint8_t w) bool operator < (const WifiSpectrumModelId& a, const WifiSpectrumModelId& b) { - return ( (a.m_centerFrequency < b.m_centerFrequency) || ( (a.m_centerFrequency == b.m_centerFrequency) && (a.m_channelWidth < b.m_channelWidth))); + return ( (a.m_centerFrequency < b.m_centerFrequency) + || ((a.m_centerFrequency == b.m_centerFrequency) && + (a.m_channelWidth < b.m_channelWidth)) + || ((a.m_centerFrequency == b.m_centerFrequency) && //to cover coexistence of 11ax with legacy case + (a.m_channelWidth == b.m_channelWidth) && + (a.m_bandBandwidth < b.m_bandBandwidth))); } static std::map > g_wifiSpectrumModelMap; ///< static initializer for the class @@ -70,7 +78,7 @@ WifiSpectrumValueHelper::GetSpectrumModel (uint32_t centerFrequency, uint8_t cha { NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandBandwidth << (uint16_t)guardBandwidth); Ptr ret; - WifiSpectrumModelId key (centerFrequency, channelWidth); + WifiSpectrumModelId key (centerFrequency, channelWidth, bandBandwidth); std::map >::iterator it = g_wifiSpectrumModelMap.find (key); if (it != g_wifiSpectrumModelMap.end ()) {