From dd216804e242b24049a0113d043f3fdd38f96aec Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Sat, 22 Jun 2024 17:27:49 +0200 Subject: [PATCH] wifi: Do not start MSD timer on a link if no PHY is operating on it --- src/wifi/model/eht/emlsr-manager.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index f473c0f17..10faac327 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -713,16 +713,21 @@ EmlsrManager::StartMediumSyncDelayTimer(uint8_t linkId) return; } + auto phy = m_staMac->GetWifiPhy(linkId); + + if (!phy) + { + NS_LOG_DEBUG("No PHY operating on link " << +linkId); + // MSD timer will be started when a PHY will be operating on this link + return; + } + const auto [it, inserted] = m_mediumSyncDelayStatus.try_emplace(linkId); // reset the max number of TXOP attempts it->second.msdNTxopsLeft = m_msdMaxNTxops; - // there are cases in which no PHY is operating on a link; e.g., the main PHY starts - // switching to a link on which an aux PHY gained a TXOP and sent an RTS, but the CTS - // is not received and the UL TXOP ends before the main PHY channel switch is - // completed. The MSD timer is started on the link left "uncovered" by the main PHY - if (auto phy = m_staMac->GetWifiPhy(linkId); phy && !it->second.timer.IsPending()) + if (!it->second.timer.IsPending()) { NS_LOG_DEBUG("Setting CCA ED threshold on link " << +linkId << " to " << +m_msdOfdmEdThreshold << " PHY " << phy);