From 74c9b84e3ed2fc7a19154cd948ae3785cb6dd795 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 4 Jul 2023 20:12:43 +0200 Subject: [PATCH] wifi: Make sure that we do not start a transmission on a blocked EMLSR link --- src/wifi/model/eht/eht-frame-exchange-manager.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index 60193ea4b..9d5e3565b 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -143,6 +143,19 @@ EhtFrameExchangeManager::StartTransmission(Ptr edca, uint16_t allowedWidth { NS_LOG_FUNCTION(this << edca << allowedWidth); + if (m_staMac && m_staMac->IsEmlsrLink(m_linkId)) + { + auto apAddress = GetWifiRemoteStationManager()->GetMldAddress(m_bssid); + NS_ASSERT_MSG(apAddress, "MLD address not found for BSSID " << m_bssid); + // when EMLSR links are blocked, all TIDs are blocked (we test TID 0 here) + WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WIFI_UNICAST, *apAddress, 0); + auto mask = m_staMac->GetMacQueueScheduler()->GetQueueLinkMask(AC_BE, queueId, m_linkId); + // Cannot start a transmission on a link blocked because another EMLSR link is being used + NS_ASSERT_MSG(mask && !mask->test(static_cast( + WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK)), + "StartTransmission called while EMLSR link is being used"); + } + auto started = HeFrameExchangeManager::StartTransmission(edca, allowedWidth); if (started && m_staMac && m_staMac->IsEmlsrLink(m_linkId))