From f84e07276e5310839bd89fe2bc5aa46968f4c337 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 13 May 2024 11:46:17 +0200 Subject: [PATCH] wifi: Handle Basic/BSRP TFs when checking if EMLSR client switches to listening --- src/wifi/model/eht/eht-frame-exchange-manager.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index 1c8a4c4d7..d116e1dd2 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -392,11 +392,13 @@ EhtFrameExchangeManager::ForwardPsduMapDown(WifiConstPsduMap psduMap, WifiTxVect for (auto clientIt = m_protectedStas.begin(); clientIt != m_protectedStas.end();) { auto aid = GetWifiRemoteStationManager()->GetAssociationId(*clientIt); + const auto psduMapIt = psduMap.find(aid); + const auto aidNotFoundAndNotTf = (psduMapIt == psduMap.cend()) && !IsTrigger(psduMap); + // the PSDU to process: the one addressed to the given AID (if any) or the unique one + const auto psdu = (psduMapIt != psduMap.cend() ? psduMapIt : psduMap.cbegin())->second; - if (auto psduMapIt = psduMap.find(aid); - GetWifiRemoteStationManager()->GetEmlsrEnabled(*clientIt) && - (psduMapIt == psduMap.cend() || - GetEmlsrSwitchToListening(psduMapIt->second, aid, *clientIt))) + if (GetWifiRemoteStationManager()->GetEmlsrEnabled(*clientIt) && + (aidNotFoundAndNotTf || GetEmlsrSwitchToListening(psdu, aid, *clientIt))) { EmlsrSwitchToListening(*clientIt, txDuration); // this client is no longer involved in the current TXOP