diff --git a/src/wifi/model/channel-access-manager.cc b/src/wifi/model/channel-access-manager.cc index 7f24f719c..ce25de54e 100644 --- a/src/wifi/model/channel-access-manager.cc +++ b/src/wifi/model/channel-access-manager.cc @@ -199,7 +199,6 @@ ChannelAccessManager::ChannelAccessManager() m_lastTxEnd(0), m_lastSwitchingEnd(0), m_usingOtherEmlsrLink(false), - m_lastUsingOtherEmlsrLinkEnd(0), m_sleeping(false), m_off(false), m_linkId(0) @@ -419,8 +418,8 @@ ChannelAccessManager::NeedBackoffUponAccess(Ptr txop, { NS_LOG_FUNCTION(this << txop << hadFramesToTransmit << checkMediumBusy); - // No backoff needed if in sleep mode, off or when using another EMLSR link - if (m_sleeping || m_off || m_usingOtherEmlsrLink) + // No backoff needed if in sleep mode or off + if (m_sleeping || m_off) { return false; } @@ -479,11 +478,6 @@ ChannelAccessManager::RequestAccess(Ptr txop) { m_phy->NotifyChannelAccessRequested(); } - if (m_usingOtherEmlsrLink) - { - NS_LOG_DEBUG("Channel access cannot be requested while using another EMLSR link"); - return; - } // Deny access if in sleep mode or off if (m_sleeping || m_off) { @@ -620,8 +614,6 @@ ChannelAccessManager::GetAccessGrantStart(bool ignoreNav) const Time ackTimeoutAccessStart = m_lastAckTimeoutEnd + sifs; Time ctsTimeoutAccessStart = m_lastCtsTimeoutEnd + sifs; Time switchingAccessStart = m_lastSwitchingEnd + sifs; - Time usingOtherEmlsrLinkAccessStart = - (m_usingOtherEmlsrLink ? Simulator::Now() : m_lastUsingOtherEmlsrLinkEnd) + sifs; Time accessGrantedStart; if (ignoreNav) { @@ -630,7 +622,6 @@ ChannelAccessManager::GetAccessGrantStart(bool ignoreNav) const txAccessStart, ackTimeoutAccessStart, ctsTimeoutAccessStart, - usingOtherEmlsrLinkAccessStart, switchingAccessStart}); } else @@ -641,14 +632,9 @@ ChannelAccessManager::GetAccessGrantStart(bool ignoreNav) const navAccessStart, ackTimeoutAccessStart, ctsTimeoutAccessStart, - usingOtherEmlsrLinkAccessStart, switchingAccessStart}); } std::stringstream ss; - if (m_usingOtherEmlsrLink) - { - ss << ", using other EMLSR link access start=" << usingOtherEmlsrLinkAccessStart; - } NS_LOG_INFO("access grant start=" << accessGrantedStart << ", rx access start=" << rxAccessStart << ", busy access start=" << busyAccessStart << ", tx access start=" << txAccessStart @@ -1132,18 +1118,7 @@ void ChannelAccessManager::NotifyStartUsingOtherEmlsrLink() { NS_LOG_FUNCTION(this); - // update backoff if a PHY is operating on this link - if (m_phy) - { - UpdateBackoff(); - } - // Cancel timeout - if (m_accessTimeout.IsRunning()) - { - m_accessTimeout.Cancel(); - } m_usingOtherEmlsrLink = true; - UpdateLastIdlePeriod(); } void @@ -1151,16 +1126,13 @@ ChannelAccessManager::NotifyStopUsingOtherEmlsrLink() { NS_LOG_FUNCTION(this); m_usingOtherEmlsrLink = false; - m_lastUsingOtherEmlsrLinkEnd = Simulator::Now(); - DoRestartAccessTimeoutIfNeeded(); } void ChannelAccessManager::UpdateLastIdlePeriod() { NS_LOG_FUNCTION(this); - Time idleStart = - std::max({m_lastTxEnd, m_lastRx.end, m_lastSwitchingEnd, m_lastUsingOtherEmlsrLinkEnd}); + Time idleStart = std::max({m_lastTxEnd, m_lastRx.end, m_lastSwitchingEnd}); Time now = Simulator::Now(); if (idleStart >= now) diff --git a/src/wifi/model/channel-access-manager.h b/src/wifi/model/channel-access-manager.h index e3ff7c552..ba10e3dd8 100644 --- a/src/wifi/model/channel-access-manager.h +++ b/src/wifi/model/channel-access-manager.h @@ -33,6 +33,8 @@ #include #include +class EmlsrUlTxopTest; + namespace ns3 { @@ -58,6 +60,9 @@ class FrameExchangeManager; */ class ChannelAccessManager : public Object { + /// Allow test cases to access private members + friend class ::EmlsrUlTxopTest; + public: ChannelAccessManager(); ~ChannelAccessManager() override; @@ -444,15 +449,13 @@ class ChannelAccessManager : public Object std::vector