diff --git a/src/wifi/model/wifi-phy-operating-channel.cc b/src/wifi/model/wifi-phy-operating-channel.cc index 9c5f68ee0..30c1c40b2 100644 --- a/src/wifi/model/wifi-phy-operating-channel.cc +++ b/src/wifi/model/wifi-phy-operating-channel.cc @@ -708,12 +708,9 @@ WifiPhyOperatingChannel::GetSecondaryChannelCenterFrequency( // we assume here that all segments have the same width const auto segmentWidth = GetWidth(segmentIndex); const auto segmentOffset = (segmentIndex * (segmentWidth / secondaryChannelWidth)); - const auto primaryChannelIndex = GetPrimaryChannelIndex(secondaryChannelWidth); - const auto primaryCenterFrequency = - GetFrequency(segmentIndex) - segmentWidth / 2. + - (primaryChannelIndex - segmentOffset + 0.5) * secondaryChannelWidth; - return (primaryChannelIndex % 2 == 0) ? (primaryCenterFrequency + secondaryChannelWidth) - : (primaryCenterFrequency - secondaryChannelWidth); + return GetFrequency(segmentIndex) - segmentWidth / 2. + + (GetSecondaryChannelIndex(secondaryChannelWidth) - segmentOffset + 0.5) * + secondaryChannelWidth; } uint8_t