From cbae2cf004e6c5e5bd055e37191c4cb031df9783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Mon, 30 Sep 2024 07:52:26 +0200 Subject: [PATCH] wifi: Extend CCA tests for 320 MHz --- src/wifi/test/wifi-phy-cca-test.cc | 1941 +++++++++++++++++----------- 1 file changed, 1195 insertions(+), 746 deletions(-) diff --git a/src/wifi/test/wifi-phy-cca-test.cc b/src/wifi/test/wifi-phy-cca-test.cc index a5023525f..9a13047e4 100644 --- a/src/wifi/test/wifi-phy-cca-test.cc +++ b/src/wifi/test/wifi-phy-cca-test.cc @@ -35,6 +35,7 @@ #include "ns3/wifi-standards.h" #include "ns3/wifi-utils.h" +#include #include #include @@ -42,17 +43,20 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE("WifiPhyCcaTest"); -constexpr MHz_u P20_CENTER_FREQUENCY{5180}; +constexpr MHz_u P20_CENTER_FREQUENCY{5955}; constexpr MHz_u S20_CENTER_FREQUENCY = P20_CENTER_FREQUENCY + MHz_u{20}; constexpr MHz_u P40_CENTER_FREQUENCY = P20_CENTER_FREQUENCY + MHz_u{10}; constexpr MHz_u S40_CENTER_FREQUENCY = P40_CENTER_FREQUENCY + MHz_u{40}; constexpr MHz_u P80_CENTER_FREQUENCY = P40_CENTER_FREQUENCY + MHz_u{20}; constexpr MHz_u S80_CENTER_FREQUENCY = P80_CENTER_FREQUENCY + MHz_u{80}; constexpr MHz_u P160_CENTER_FREQUENCY = P80_CENTER_FREQUENCY + MHz_u{40}; +constexpr MHz_u S160_CENTER_FREQUENCY = P160_CENTER_FREQUENCY + MHz_u{160}; +constexpr MHz_u P320_CENTER_FREQUENCY = P160_CENTER_FREQUENCY + MHz_u{80}; const Time smallDelta = NanoSeconds(1); const Time aCcaTime = MicroSeconds(4); const Time phyHeaderDuration = MicroSeconds(32); -// add small delta to be right after aCcaTime, since test checks are scheduled before wifi events +// add small delta to be right after aCcaTime, since test checks are scheduled before wifi +// events const Time aCcaTimeWithDelta = aCcaTime + smallDelta; const std::map hePpduDurations = { {20, NanoSeconds(1009600)}, @@ -63,6 +67,7 @@ const std::map ehtPpduDurations = { {20, NanoSeconds(1017600)}, {40, NanoSeconds(541600)}, {80, NanoSeconds(287200)}, + {160, NanoSeconds(178400)}, }; /** @@ -147,12 +152,13 @@ class WifiPhyCcaThresholdsTest : public TestCase Ptr m_ehtConfiguration; ///< The EHT configuration dBm_u m_CcaEdThreshold; ///< The current CCA-ED threshold for a 20 MHz subchannel - dBm_u m_CcaSensitivity; ///< The current CCA sensitivity threshold for signals that occupy the - ///< primary 20 MHz channel + dBm_u m_CcaSensitivity; ///< The current CCA sensitivity threshold for signals that occupy + ///< the primary 20 MHz channel VhtConfiguration::SecondaryCcaSensitivityThresholds - m_secondaryCcaSensitivityThresholds; ///< The current CCA sensitivity thresholds for signals - ///< that do not occupy the primary 20 MHz channel + m_secondaryCcaSensitivityThresholds; ///< The current CCA sensitivity thresholds for + ///< signals that do not occupy the primary 20 MHz + ///< channel dBm_u m_obssPdLevel; ///< The current OBSS-PD level dBm_u m_per20CcaSensitivity; ///< The current CCA sensitivity threshold for Per 20MHz check @@ -307,11 +313,11 @@ WifiPhyCcaThresholdsTest::DoSetup() auto channelNum = WifiPhyOperatingChannel::FindFirst(0, MHz_u{0}, - MHz_u{160}, + MHz_u{320}, WIFI_STANDARD_80211be, - WIFI_PHY_BAND_5GHZ) + WIFI_PHY_BAND_6GHZ) ->number; - m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{channelNum, 160, WIFI_PHY_BAND_5GHZ, 0}); + m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{channelNum, 320, WIFI_PHY_BAND_6GHZ, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211be); m_obssPdAlgorithm = CreateObject(); @@ -366,15 +372,15 @@ WifiPhyCcaThresholdsTest::RunOne() //----------------------------------------------------------------------------------------------------------------------------------- - // HT PHY: 20 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity - // threshold + // HT PHY: 20 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HT), CreateDummyHtPpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivity); - // HT PHY: 40 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity - // threshold + // HT PHY: 40 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HT), CreateDummyHtPpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, @@ -445,36 +451,41 @@ WifiPhyCcaThresholdsTest::RunOne() WIFI_CHANLIST_SECONDARY, std::get<0>(m_secondaryCcaSensitivityThresholds)); - // VHT PHY: 20 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity - // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz + // VHT PHY: 20 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA + // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 + // MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), CreateDummyVhtPpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::get<0>(m_secondaryCcaSensitivityThresholds)); - // VHT PHY: 40 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity - // threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz + // VHT PHY: 40 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA + // sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 + // MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), CreateDummyVhtPpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::get<1>(m_secondaryCcaSensitivityThresholds)); - // VHT PHY: 20 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity - // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz + // VHT PHY: 20 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA + // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 + // MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), CreateDummyVhtPpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::get<0>(m_secondaryCcaSensitivityThresholds)); - // VHT PHY: 40 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity - // threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz + // VHT PHY: 40 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA + // sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 + // MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), CreateDummyVhtPpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::get<1>(m_secondaryCcaSensitivityThresholds)); - // VHT PHY: 80 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity - // threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz + // VHT PHY: 80 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA + // sensitivity threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 + // MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), CreateDummyVhtPpdu(MHz_u{80}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, @@ -508,29 +519,29 @@ WifiPhyCcaThresholdsTest::RunOne() //----------------------------------------------------------------------------------------------------------------------------------- - // HE PHY: 20 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity - // threshold + // HE PHY: 20 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivity); - // HE PHY: 40 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity - // threshold + // HE PHY: 40 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivity); - // HE PHY: 80 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity - // threshold + // HE PHY: 80 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{80}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivity); - // HE PHY: 160 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity - // threshold + // HE PHY: 160 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{160}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, @@ -538,51 +549,51 @@ WifiPhyCcaThresholdsTest::RunOne() //----------------------------------------------------------------------------------------------------------------------------------- - // HE PHY: 20 MHz HE PPDU in secondary channel (20 MHz) if power above the max between the CCA - // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz - // and the OBSS-PD level + // HE PHY: 20 MHz HE PPDU in secondary channel (20 MHz) if power above the max between the + // CCA sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary + // 20 MHz and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY, std::max(m_obssPdLevel, std::get<0>(m_secondaryCcaSensitivityThresholds))); - // HE PHY: 20 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the CCA - // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz - // and the OBSS-PD level + // HE PHY: 20 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the + // CCA sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary + // 20 MHz and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::max(m_obssPdLevel, std::get<0>(m_secondaryCcaSensitivityThresholds))); - // HE PHY: 40 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the CCA - // sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz - // and the OBSS-PD level plus 3 dB + // HE PHY: 40 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the + // CCA sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary + // 20 MHz and the OBSS-PD level plus 3 dB VerifyCcaThreshold( m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::max(m_obssPdLevel + dB_u{3.0}, std::get<1>(m_secondaryCcaSensitivityThresholds))); - // HE PHY: 20 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA - // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz - // and the OBSS-PD level + // HE PHY: 20 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the + // CCA sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary + // 20 MHz and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel, std::get<0>(m_secondaryCcaSensitivityThresholds))); - // HE PHY: 40 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA - // sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz - // and the OBSS-PD level plus 3 dB + // HE PHY: 40 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the + // CCA sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary + // 20 MHz and the OBSS-PD level plus 3 dB VerifyCcaThreshold( m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel + dB_u{3.0}, std::get<1>(m_secondaryCcaSensitivityThresholds))); - // HE PHY: 80 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA - // sensitivity threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz - // and the OBSS-PD level plus 6 dB + // HE PHY: 80 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the + // CCA sensitivity threshold corresponding to a 80 MHz PPDU that does not occupy the primary + // 20 MHz and the OBSS-PD level plus 6 dB VerifyCcaThreshold( m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), CreateDummyHePpdu(MHz_u{80}, m_phy->GetOperatingChannel()), @@ -603,20 +614,27 @@ WifiPhyCcaThresholdsTest::RunOne() WIFI_CHANLIST_SECONDARY, m_CcaEdThreshold); - // EHT PHY: any signal in secondary40 channel (40 MHz) if power in any 20 MHz subchannel above - // CCA-ED threshold + // EHT PHY: any signal in secondary40 channel (40 MHz) if power in any 20 MHz subchannel + // above CCA-ED threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), nullptr, WIFI_CHANLIST_SECONDARY40, m_CcaEdThreshold); - // EHT PHY: any signal in secondary80 channel (80 MHz) if power in any 20 MHz subchannel above - // CCA-ED threshold + // EHT PHY: any signal in secondary80 channel (80 MHz) if power in any 20 MHz subchannel + // above CCA-ED threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), nullptr, WIFI_CHANLIST_SECONDARY80, m_CcaEdThreshold); + // EHT PHY: any signal in secondary160 channel (160 MHz) if power in any 20 MHz subchannel + // above CCA-ED threshold + VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), + nullptr, + WIFI_CHANLIST_SECONDARY160, + m_CcaEdThreshold); + //----------------------------------------------------------------------------------------------------------------------------------- // EHT PHY: 20 MHz EHT PPDU in primary channel (20 MHz) if power in primary above CCA // sensitivity threshold @@ -645,49 +663,63 @@ WifiPhyCcaThresholdsTest::RunOne() WIFI_CHANLIST_PRIMARY, m_CcaSensitivity); + // EHT PHY: 320 MHz EHT PPDU in primary channel (20 MHz) if power in primary above CCA + // sensitivity threshold + VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), + CreateDummyEhtPpdu(320, m_phy->GetOperatingChannel()), + WIFI_CHANLIST_PRIMARY, + m_CcaSensitivity); + //----------------------------------------------------------------------------------------------------------------------------------- - // EHT PHY: 20 MHz EHT PPDU in secondary channel (20 MHz) if power above the max between the CCA - // sensitivity threshold for Per 20MHz check and the OBSS-PD level + // EHT PHY: 20 MHz EHT PPDU in secondary channel (20 MHz) if power above the max between the + // CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), CreateDummyEhtPpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY, std::max(m_obssPdLevel, m_per20CcaSensitivity)); - // EHT PHY: 20 MHz EHT PPDU in secondary40 channel (40 MHz) if power above the max between the - // CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level + // EHT PHY: 20 MHz EHT PPDU in secondary40 channel (40 MHz) if power above the max between + // the CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), CreateDummyEhtPpdu(MHz_u{20}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::max(m_obssPdLevel, m_per20CcaSensitivity)); - // EHT PHY: 40 MHz EHT PPDU in secondary40 channel (40 MHz) if power above the max between the - // CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level + // EHT PHY: 40 MHz EHT PPDU in secondary40 channel (40 MHz) if power above the max between + // the CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), CreateDummyEhtPpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::max(m_obssPdLevel, m_per20CcaSensitivity)); - // EHT PHY: 20 MHz EHT PPDU in secondary80 channel (80 MHz) if power above the max between the - // CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level + // EHT PHY: 20 MHz EHT PPDU in secondary80 channel (80 MHz) if power above the max between + // the CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), CreateDummyEhtPpdu(MHz_u{80}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel, m_per20CcaSensitivity)); - // EHT PHY: 40 MHz EHT PPDU in secondary80 channel (80 MHz) if power above the max between the - // CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level + // EHT PHY: 40 MHz EHT PPDU in secondary80 channel (80 MHz) if power above the max between + // the CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), CreateDummyEhtPpdu(MHz_u{40}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel, m_per20CcaSensitivity)); - // EHT PHY: 80 MHz EHT PPDU in secondary80 channel (80 MHz) if power above the max between the - // CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level + // EHT PHY: 80 MHz EHT PPDU in secondary80 channel (80 MHz) if power above the max between + // the CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), CreateDummyEhtPpdu(MHz_u{80}, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel, m_per20CcaSensitivity)); + + // EHT PHY: 160 MHz EHT PPDU in secondary160 channel (160 MHz) if power above the max + // between the CCA sensitivity threshold for Per 20MHz check and the OBSS-PD level + VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_EHT), + CreateDummyEhtPpdu(160, m_phy->GetOperatingChannel()), + WIFI_CHANLIST_SECONDARY160, + std::max(m_obssPdLevel, m_per20CcaSensitivity)); } void @@ -977,6 +1009,11 @@ class WifiPhyCcaIndicationTest : public TestCase */ void Reset(); + /** + * Reset the expected Per 20 MHz CCA durations + */ + void ResetExpectedPer20MhzCcaBusyDurations(); + /** * Run one function */ @@ -988,14 +1025,17 @@ class WifiPhyCcaIndicationTest : public TestCase Ptr m_txPhy; ///< PHY object of the transmitter std::vector> m_signalGenerators; ///< Generators of non-wifi signals - std::size_t - m_numSignalGenerators; ///< The number of non-wifi signals generators needed for the test + std::size_t m_numSignalGenerators; ///< The number of non-wifi signals generators needed for + ///< the test std::shared_ptr m_rxPhyStateListener; ///< Listener for PHY state transitions MHz_u m_frequency; ///< Operating frequency MHz_u m_channelWidth; ///< Operating channel width + + std::vector> + m_expectedPer20MhzCcaBusyDurations{}; ///< expected Per 20Mhz CCA durations per check }; WifiPhyCcaIndicationTest::WifiPhyCcaIndicationTest(WifiStandard standard) @@ -1048,10 +1088,10 @@ WifiPhyCcaIndicationTest::SendSuPpdu(dBm_u txPower, MHz_u frequency, MHz_u bandw NS_LOG_FUNCTION(this << txPower); auto channelNum = - WifiPhyOperatingChannel::FindFirst(0, frequency, bandwidth, m_standard, WIFI_PHY_BAND_5GHZ) + WifiPhyOperatingChannel::FindFirst(0, frequency, bandwidth, m_standard, WIFI_PHY_BAND_6GHZ) ->number; m_txPhy->SetOperatingChannel( - WifiPhy::ChannelTuple{channelNum, bandwidth, WIFI_PHY_BAND_5GHZ, 0}); + WifiPhy::ChannelTuple{channelNum, bandwidth, WIFI_PHY_BAND_6GHZ, 0}); const auto mcs = (m_standard == WIFI_STANDARD_80211ax) ? HePhy::GetHeMcs0() : EhtPhy::GetEhtMcs0(); @@ -1185,6 +1225,99 @@ WifiPhyCcaIndicationTest::Reset() m_rxPhyStateListener->Reset(); } +void +WifiPhyCcaIndicationTest::ResetExpectedPer20MhzCcaBusyDurations() +{ + m_expectedPer20MhzCcaBusyDurations.clear(); + switch (static_cast(m_channelWidth)) + { + case 20: + default: + // no Per-20 MHz CCA + m_expectedPer20MhzCcaBusyDurations.emplace_back(); + m_expectedPer20MhzCcaBusyDurations.emplace_back(); + break; + case 40: + m_expectedPer20MhzCcaBusyDurations.push_back({MicroSeconds(0), MicroSeconds(0)}); + m_expectedPer20MhzCcaBusyDurations.push_back({MicroSeconds(0), MicroSeconds(0)}); + break; + case 80: + m_expectedPer20MhzCcaBusyDurations.push_back({ + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + }); + m_expectedPer20MhzCcaBusyDurations.push_back({ + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + }); + break; + case 160: + m_expectedPer20MhzCcaBusyDurations.push_back({ + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + }); + m_expectedPer20MhzCcaBusyDurations.push_back({ + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + }); + break; + case 320: + m_expectedPer20MhzCcaBusyDurations.push_back({ + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + }); + m_expectedPer20MhzCcaBusyDurations.push_back({ + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + MicroSeconds(0), + }); + break; + } +} + void WifiPhyCcaIndicationTest::DoSetup() { @@ -1260,25 +1393,26 @@ WifiPhyCcaIndicationTest::RunOne() m_frequency, m_channelWidth, m_standard, - WIFI_PHY_BAND_5GHZ) + WIFI_PHY_BAND_6GHZ) ->number; m_rxPhy->SetOperatingChannel( - WifiPhy::ChannelTuple{channelNum, m_channelWidth, WIFI_PHY_BAND_5GHZ, 0}); + WifiPhy::ChannelTuple{channelNum, m_channelWidth, WIFI_PHY_BAND_6GHZ, 0}); m_txPhy->SetOperatingChannel( - WifiPhy::ChannelTuple{channelNum, m_channelWidth, WIFI_PHY_BAND_5GHZ, 0}); + WifiPhy::ChannelTuple{channelNum, m_channelWidth, WIFI_PHY_BAND_6GHZ, 0}); const auto& ppduDurations = (m_standard == WIFI_STANDARD_80211ax) ? hePpduDurations : ehtPpduDurations; - std::vector