From cb94997553a90f50488d0d2d277a871e8c641a2f Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 30 May 2023 16:21:01 +0200 Subject: [PATCH] wifi: Main PHY takes over UL TXOP after aux PHY has transmitted RTS --- src/wifi/model/eht/emlsr-manager.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index ebf4a2401..dd227b45b 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -28,6 +28,7 @@ #include "ns3/log.h" #include "ns3/wifi-mpdu.h" #include "ns3/wifi-net-device.h" +#include "ns3/wifi-phy-state-helper.h" namespace ns3 { @@ -289,6 +290,20 @@ EmlsrManager::NotifyUlTxopStart(uint8_t linkId) m_staMac->BlockTxOnLink(id, WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK); } } + + // if this TXOP is being started by an aux PHY, wait until the end of RTS transmission + // and then have the main PHY take over the TXOP on this link + if (m_staMac->GetLinkForPhy(m_mainPhyId) != linkId) + { + auto stateHelper = m_staMac->GetWifiPhy(linkId)->GetState(); + NS_ASSERT(stateHelper); + NS_ASSERT_MSG(stateHelper->GetState() == TX, + "Expecting the aux PHY to be transmitting (an RTS frame)"); + Simulator::Schedule(stateHelper->GetDelayUntilIdle(), + &EmlsrManager::SwitchMainPhy, + this, + linkId); + } } void