diff --git a/src/wifi/model/channel-access-manager.cc b/src/wifi/model/channel-access-manager.cc index 7bb089601..1f3daae23 100644 --- a/src/wifi/model/channel-access-manager.cc +++ b/src/wifi/model/channel-access-manager.cc @@ -995,6 +995,18 @@ ChannelAccessManager::ResetBackoff(Ptr txop) txop->GetLink(m_linkId).access = Txop::NOT_REQUESTED; } +void +ChannelAccessManager::ResetAllBackoffs() +{ + NS_LOG_FUNCTION(this); + + for (const auto& txop : m_txops) + { + ResetBackoff(txop); + } + m_accessTimeout.Cancel(); +} + void ChannelAccessManager::NotifySleepNow() { diff --git a/src/wifi/model/channel-access-manager.h b/src/wifi/model/channel-access-manager.h index ba10e3dd8..b199bcc9f 100644 --- a/src/wifi/model/channel-access-manager.h +++ b/src/wifi/model/channel-access-manager.h @@ -329,6 +329,11 @@ class ChannelAccessManager : public Object */ void ResetBackoff(Ptr txop); + /** + * Reset the backoff for all the DCF/EDCAF. Additionally, cancel the access timeout event. + */ + void ResetAllBackoffs(); + /** * Notify that the given PHY is about to switch to the given operating channel, which is * used by the given link. This notification is sent by the EMLSR Manager when a PHY object