wifi: Stop transition delay timer when receiving an MPDU from an EMLSR client

This commit is contained in:
Stefano Avallone
2023-06-29 16:05:40 +02:00
committed by Stefano Avallone
parent e97cab8ab8
commit 459a5aa46b
2 changed files with 14 additions and 1 deletions

View File

@@ -331,7 +331,8 @@ EhtFrameExchangeManager::EmlsrSwitchToListening(const Mac48Address& address, con
emlCapabilities->get().emlsrTransitionDelay);
endDelay.IsZero() ? unblockLinks()
: static_cast<void>(Simulator::Schedule(endDelay, unblockLinks));
: static_cast<void>(m_transDelayTimer[*mldAddress] =
Simulator::Schedule(endDelay, unblockLinks));
}
void
@@ -746,6 +747,14 @@ EhtFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
m_mac->UnblockUnicastTxOnLinks(WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK,
*mldAddress,
{m_linkId});
// Stop the transition delay timer for this EMLSR client, if any is running
if (auto it = m_transDelayTimer.find(*mldAddress);
it != m_transDelayTimer.end() && it->second.IsRunning())
{
it->second.PeekEventImpl()->Invoke();
it->second.Cancel();
}
}
if (hdr.IsTrigger())

View File

@@ -23,6 +23,8 @@
#include "ns3/he-frame-exchange-manager.h"
#include "ns3/mgt-headers.h"
#include <unordered_map>
namespace ns3
{
@@ -146,6 +148,8 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager
EventId m_ongoingTxopEnd; //!< event indicating the possible end of the current TXOP (of which
//!< we are not the holder)
std::unordered_map<Mac48Address, EventId, WifiAddressHash>
m_transDelayTimer; //!< MLD address-indexed map of transition delay timers
};
} // namespace ns3