From 99cb2319cc940ca3a5ee75989e18720c98ca1e9a Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 28 Jun 2023 14:04:03 +0200 Subject: [PATCH] wifi: AP MLD unblocks transmissions on other links if no response to MU-RTS Transmissions are blocked by the AP MLD when sending the MU-RTS --- .../model/eht/eht-frame-exchange-manager.cc | 39 +++++++++++++++++++ .../model/eht/eht-frame-exchange-manager.h | 1 + 2 files changed, 40 insertions(+) diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index 0a28a2dae..0a9454635 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -469,6 +469,45 @@ EhtFrameExchangeManager::SendMuRts(const WifiTxParameters& txParams) HeFrameExchangeManager::SendMuRts(txParams); } +void +EhtFrameExchangeManager::CtsAfterMuRtsTimeout(Ptr muRts, const WifiTxVector& txVector) +{ + NS_LOG_FUNCTION(this << *muRts << txVector); + + // we blocked transmissions on the other EMLSR links for the EMLSR clients we sent the ICF to. + // Given that no client responded, we can unblock transmissions for a client if there is no + // ongoing UL TXOP held by that client + for (const auto& address : m_sentRtsTo) + { + if (!GetWifiRemoteStationManager()->GetEmlsrEnabled(address)) + { + continue; + } + + auto mldAddress = GetWifiRemoteStationManager()->GetMldAddress(address); + NS_ASSERT(mldAddress); + + if (m_ongoingTxopEnd.IsRunning() && m_txopHolder && + m_mac->GetMldAddress(*m_txopHolder) == mldAddress) + { + continue; + } + + for (uint8_t linkId = 0; linkId < m_apMac->GetNLinks(); linkId++) + { + if (linkId != m_linkId && + m_mac->GetWifiRemoteStationManager(linkId)->GetEmlsrEnabled(*mldAddress)) + { + m_mac->UnblockUnicastTxOnLinks(WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK, + *mldAddress, + {linkId}); + } + } + } + + HeFrameExchangeManager::CtsAfterMuRtsTimeout(muRts, txVector); +} + bool EhtFrameExchangeManager::GetEmlsrSwitchToListening(Ptr psdu, uint16_t aid, diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.h b/src/wifi/model/eht/eht-frame-exchange-manager.h index 4e5874789..218db820a 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.h +++ b/src/wifi/model/eht/eht-frame-exchange-manager.h @@ -93,6 +93,7 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager void ForwardPsduDown(Ptr psdu, WifiTxVector& txVector) override; void ForwardPsduMapDown(WifiConstPsduMap psduMap, WifiTxVector& txVector) override; void SendMuRts(const WifiTxParameters& txParams) override; + void CtsAfterMuRtsTimeout(Ptr muRts, const WifiTxVector& txVector) override; void TransmissionSucceeded() override; void TransmissionFailed() override; void NotifyChannelReleased(Ptr txop) override;