From 00842cdd42356476dcba0e4983666f66379ccfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 9 May 2023 21:15:57 +0200 Subject: [PATCH] wifi: Directly call WifiPhy::GetPrimaryChannelNumber --- src/wifi/model/ap-wifi-mac.cc | 4 +--- src/wifi/model/sta-wifi-mac.cc | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index bf453acff..77dbb3e13 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -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 diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index ffc054e40..4550bdb85 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -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()}; }