wifi: Fix getting p80 channel number in 6 GHz band
This commit is contained in:
@@ -823,7 +823,7 @@ ApWifiMac::GetVhtOperation(uint8_t linkId) const
|
||||
// segment that contains the primary channel.
|
||||
operation.SetChannelCenterFrequencySegment0(
|
||||
(bssBandwidth == 160)
|
||||
? phy->GetOperatingChannel().GetPrimaryChannelNumber(80, WIFI_STANDARD_80211ac)
|
||||
? phy->GetOperatingChannel().GetPrimaryChannelNumber(80, phy->GetStandard())
|
||||
: phy->GetChannelNumber());
|
||||
// For a 20, 40, or 80 MHz BSS bandwidth, this subfield is set to 0.
|
||||
// For a 160 MHz BSS bandwidth and the Channel Width subfield equal to 1,
|
||||
|
||||
@@ -512,8 +512,10 @@ WifiPhyOperatingChannel::GetPrimaryChannelNumber(uint16_t primaryChannelWidth,
|
||||
WifiStandard standard) const
|
||||
{
|
||||
auto frequency = GetPrimaryChannelCenterFrequency(primaryChannelWidth);
|
||||
NS_ASSERT_MSG(IsSet(), "No channel set");
|
||||
auto& [chanNumber, centerFreq, channelWidth, channelType, band] = *m_channelIt;
|
||||
auto primaryChanIt = FindFirst(0, frequency, primaryChannelWidth, standard, band);
|
||||
NS_ASSERT_MSG(primaryChanIt != m_frequencyChannels.end(), "Primary channel number not found");
|
||||
return std::get<0>(*primaryChanIt);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user