From aa1bd1005e796cd9b08af25fb90e724bb75cca2c Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 18 Oct 2024 13:35:28 +0200 Subject: [PATCH] wifi: Remove unneeded calls to ScheduleNow in EMLSR manager --- src/wifi/model/eht/emlsr-manager.cc | 34 +++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index 6de004e7f..b27a97f3c 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -732,18 +732,16 @@ EmlsrManager::NotifyTxopEnd(uint8_t linkId, bool ulTxopNotStarted, bool ongoingD DoNotifyTxopEnd(linkId); - Simulator::ScheduleNow([=, this]() { - // unblock transmissions and resume medium access on other EMLSR links - std::set linkIds; - for (auto id : m_staMac->GetLinkIds()) + // unblock transmissions and resume medium access on other EMLSR links + std::set linkIds; + for (auto id : m_staMac->GetLinkIds()) + { + if ((id != linkId) && m_staMac->IsEmlsrLink(id)) { - if ((id != linkId) && m_staMac->IsEmlsrLink(id)) - { - linkIds.insert(id); - } + linkIds.insert(id); } - m_staMac->UnblockTxOnLink(linkIds, WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK); - }); + } + m_staMac->UnblockTxOnLink(linkIds, WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK); } void @@ -1282,15 +1280,13 @@ EmlsrManager::ApplyMaxChannelWidthAndModClassOnAuxPhys() // reset all backoffs (so that access timeout is also cancelled) when the channel switch // starts and request channel access (if needed) when the channel switch ends. cam->ResetAllBackoffs(); - Simulator::ScheduleNow([=, this]() { - for (const auto& [acIndex, ac] : wifiAcList) - { - m_staMac->GetQosTxop(acIndex)->StartAccessAfterEvent( - linkId, - Txop::DIDNT_HAVE_FRAMES_TO_TRANSMIT, - Txop::CHECK_MEDIUM_BUSY); - } - }); + for (const auto& [acIndex, ac] : wifiAcList) + { + m_staMac->GetQosTxop(acIndex)->StartAccessAfterEvent( + linkId, + Txop::DIDNT_HAVE_FRAMES_TO_TRANSMIT, + Txop::CHECK_MEDIUM_BUSY); + } } }