From 86433f06c719f8364f3533ffd80ffd771def392c Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 9 Oct 2023 18:41:44 +0200 Subject: [PATCH] wifi: Prevent transmissions on aux PHY links in EMLSR test by blocking links ...instead of setting AuxPhyTxCapable to false. This change is in preparation of next commit, where the main PHY may switch to the aux PHY link if an aux PHY gains a TXOP but is not capable of transmitting. --- src/wifi/test/wifi-emlsr-test.cc | 40 +++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/wifi/test/wifi-emlsr-test.cc b/src/wifi/test/wifi-emlsr-test.cc index ba40489e6..c78ca9f13 100644 --- a/src/wifi/test/wifi-emlsr-test.cc +++ b/src/wifi/test/wifi-emlsr-test.cc @@ -2426,8 +2426,16 @@ EmlsrUlTxopTest::Transmit(Ptr mac, void EmlsrUlTxopTest::StartTraffic() { - // initially, aux PHYs are not capable to transmit frames - m_staMacs[0]->GetEmlsrManager()->SetAttribute("AuxPhyTxCapable", BooleanValue(false)); + // initially, we prevent transmissions on aux PHY links + auto auxPhyLinks = m_staMacs[0]->GetSetupLinkIds(); + auxPhyLinks.erase(m_mainPhyId); + if (m_nonEmlsrLink) + { + auxPhyLinks.erase(*m_nonEmlsrLink); + } + m_staMacs[0]->BlockUnicastTxOnLinks(WifiQueueBlockedReason::TID_NOT_MAPPED, + m_apMac->GetAddress(), + auxPhyLinks); // Association, Block Ack agreement establishment and enabling EMLSR mode have been done. // After 50ms, schedule: @@ -2505,7 +2513,8 @@ EmlsrUlTxopTest::CheckQosFrames(const WifiConstPsduMap& psduMap, id, WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK, id != m_staMacs[0]->GetLinkForPhy(m_mainPhyId) && m_staMacs[0]->IsEmlsrLink(id), - "Checking EMLSR links on EMLSR client while sending the first data frame"); + "Checking EMLSR links on EMLSR client while sending the first data frame", + false); Simulator::Schedule( txDuration + MicroSeconds(1) /* propagation delay */, @@ -2533,7 +2542,15 @@ EmlsrUlTxopTest::CheckQosFrames(const WifiConstPsduMap& psduMap, // after this QoS data frame is received Simulator::ScheduleNow([=, this]() { // make aux PHYs capable of transmitting frames - m_staMacs[0]->GetEmlsrManager()->SetAttribute("AuxPhyTxCapable", BooleanValue(true)); + auto auxPhyLinks = m_staMacs[0]->GetSetupLinkIds(); + auxPhyLinks.erase(m_mainPhyId); + if (m_nonEmlsrLink) + { + auxPhyLinks.erase(*m_nonEmlsrLink); + } + m_staMacs[0]->UnblockUnicastTxOnLinks(WifiQueueBlockedReason::TID_NOT_MAPPED, + m_apMac->GetAddress(), + auxPhyLinks); // block transmissions on the link where the main PHY is operating m_staMacs[0]->BlockUnicastTxOnLinks(WifiQueueBlockedReason::TID_NOT_MAPPED, @@ -2592,6 +2609,13 @@ EmlsrUlTxopTest::CheckBlockAck(const WifiConstPsduMap& psduMap, { m_countBlockAck++; + auto auxPhyLinks = m_staMacs[0]->GetSetupLinkIds(); + auxPhyLinks.erase(m_mainPhyId); + if (m_nonEmlsrLink) + { + auxPhyLinks.erase(*m_nonEmlsrLink); + } + // lambda to check that the MediumSyncDelay timer is correctly running/not running and // the CCA ED threshold is set to the correct value on all the links auto checkMediumSyncDelayTimerActive = [=, this]() { @@ -2688,7 +2712,9 @@ EmlsrUlTxopTest::CheckBlockAck(const WifiConstPsduMap& psduMap, }); // make aux PHYs not capable of transmitting frames - m_staMacs[0]->GetEmlsrManager()->SetAttribute("AuxPhyTxCapable", BooleanValue(false)); + m_staMacs[0]->BlockUnicastTxOnLinks(WifiQueueBlockedReason::TID_NOT_MAPPED, + m_apMac->GetAddress(), + auxPhyLinks); // generate data packets for another UL data frame, which will be sent on the link where // the main PHY is operating @@ -2711,7 +2737,9 @@ EmlsrUlTxopTest::CheckBlockAck(const WifiConstPsduMap& psduMap, {0}, linkIds); // make sure aux PHYs are capable of transmitting frames - m_staMacs[0]->GetEmlsrManager()->SetAttribute("AuxPhyTxCapable", BooleanValue(true)); + m_staMacs[0]->UnblockUnicastTxOnLinks(WifiQueueBlockedReason::TID_NOT_MAPPED, + m_apMac->GetAddress(), + auxPhyLinks); // generate data packets for another UL data frame NS_LOG_INFO("Enqueuing two packets at the EMLSR client\n");