wifi: Directly call WifiPhy::GetPrimaryChannelNumber

This commit is contained in:
Sébastien Deronne
2023-05-09 21:15:57 +02:00
parent 6289cd92c3
commit 00842cdd42
2 changed files with 2 additions and 4 deletions

View File

@@ -1005,9 +1005,7 @@ ApWifiMac::GetVhtOperation(uint8_t linkId) const
// indicates the channel center frequency index of the 80 MHz channel
// segment that contains the primary channel.
operation.SetChannelCenterFrequencySegment0(
(bssBandwidth == 160)
? phy->GetOperatingChannel().GetPrimaryChannelNumber(80, phy->GetStandard())
: phy->GetChannelNumber());
(bssBandwidth == 160) ? phy->GetPrimaryChannelNumber(80) : 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,
// indicates the channel center frequency index of the 160 MHz channel on

View File

@@ -312,7 +312,7 @@ StaWifiMac::GetCurrentChannel(uint8_t linkId) const
{
auto phy = GetWifiPhy(linkId);
uint16_t width = phy->GetOperatingChannel().IsOfdm() ? 20 : phy->GetChannelWidth();
uint8_t ch = phy->GetOperatingChannel().GetPrimaryChannelNumber(width, phy->GetStandard());
uint8_t ch = phy->GetPrimaryChannelNumber(width);
return {ch, phy->GetPhyBand()};
}