diff --git a/src/wifi/model/channel-access-manager.cc b/src/wifi/model/channel-access-manager.cc index f011d7a36..0b3e42a13 100644 --- a/src/wifi/model/channel-access-manager.cc +++ b/src/wifi/model/channel-access-manager.cc @@ -219,8 +219,6 @@ ChannelAccessManager::ChannelAccessManager() m_lastRxReceivedOk(true), m_lastTxEnd(0), m_lastSwitchingEnd(0), - m_sleeping(false), - m_off(false), m_linkId(0) { NS_LOG_FUNCTION(this); @@ -485,7 +483,7 @@ ChannelAccessManager::NeedBackoffUponAccess(Ptr txop, // No backoff needed if in sleep mode or off. Checking if m_phy is nullptr is a workaround // needed for EMLSR and may be removed in the future - if (m_sleeping || m_off || !m_phy) + if (!m_phy || m_phy->IsStateSleep() || m_phy->IsStateOff()) { return false; } @@ -546,7 +544,7 @@ ChannelAccessManager::RequestAccess(Ptr txop) } // Deny access if in sleep mode or off. Checking if m_phy is nullptr is a workaround // needed for EMLSR and may be removed in the future - if (m_sleeping || m_off || !m_phy) + if (!m_phy || m_phy->IsStateSleep() || m_phy->IsStateOff()) { return; } @@ -1118,7 +1116,6 @@ void ChannelAccessManager::NotifySleepNow() { NS_LOG_FUNCTION(this); - m_sleeping = true; // Reset backoffs ResetAllBackoffs(); m_feManager->NotifySleepNow(); @@ -1132,7 +1129,6 @@ void ChannelAccessManager::NotifyOffNow() { NS_LOG_FUNCTION(this); - m_off = true; // Cancel timeout if (m_accessTimeout.IsPending()) { @@ -1150,7 +1146,6 @@ void ChannelAccessManager::NotifyWakeupNow() { NS_LOG_FUNCTION(this); - m_sleeping = false; for (auto txop : m_txops) { ResetBackoff(txop); @@ -1162,7 +1157,6 @@ void ChannelAccessManager::NotifyOnNow() { NS_LOG_FUNCTION(this); - m_off = false; for (auto txop : m_txops) { ResetBackoff(txop); diff --git a/src/wifi/model/channel-access-manager.h b/src/wifi/model/channel-access-manager.h index 50c8ea869..31d478ebd 100644 --- a/src/wifi/model/channel-access-manager.h +++ b/src/wifi/model/channel-access-manager.h @@ -480,8 +480,6 @@ class ChannelAccessManager : public Object std::map m_lastIdle; //!< the last idle start and end time for each channel type Time m_lastSwitchingEnd; //!< the last switching end time - bool m_sleeping; //!< flag whether it is in sleeping state - bool m_off; //!< flag whether it is in off state Time m_eifsNoDifs; //!< EIFS no DIFS time EventId m_accessTimeout; //!< the access timeout ID bool m_generateBackoffOnNoTx; //!< whether the backoff should be invoked when the AC gains the