From 5c2da745c32139cf4e32dc4d5b56f703be9481ef Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 20 Sep 2023 17:56:20 +0200 Subject: [PATCH] wifi: Notify EMLSR Manager of TXOP end only if TXOP actually started --- src/wifi/model/eht/eht-frame-exchange-manager.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index da2576f62..87fe58641 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -681,9 +681,16 @@ EhtFrameExchangeManager::NotifyChannelReleased(Ptr txop) } else if (m_staMac && m_staMac->IsEmlsrLink(m_linkId)) { - // notify the EMLSR Manager of the UL TXOP end + // notify the EMLSR Manager of the UL TXOP end, if the TXOP included the transmission of + // at least a frame NS_ASSERT(m_staMac->GetEmlsrManager()); - m_staMac->GetEmlsrManager()->NotifyTxopEnd(m_linkId); + auto edca = DynamicCast(txop); + NS_ASSERT(edca); + if (auto txopStart = edca->GetTxopStartTime(m_linkId); + txopStart && Simulator::Now() > *txopStart) + { + m_staMac->GetEmlsrManager()->NotifyTxopEnd(m_linkId); + } } HeFrameExchangeManager::NotifyChannelReleased(txop);