From feff08fd3fc8b68c1fb0afab4deebedc522b193b Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 30 Jan 2024 16:26:09 +0100 Subject: [PATCH] wifi: Prevent issues when no PHY is connected to CAM --- src/wifi/model/channel-access-manager.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/channel-access-manager.cc b/src/wifi/model/channel-access-manager.cc index 1f3daae23..b833327b4 100644 --- a/src/wifi/model/channel-access-manager.cc +++ b/src/wifi/model/channel-access-manager.cc @@ -419,8 +419,9 @@ ChannelAccessManager::NeedBackoffUponAccess(Ptr txop, { NS_LOG_FUNCTION(this << txop << hadFramesToTransmit << checkMediumBusy); - // No backoff needed if in sleep mode or off - if (m_sleeping || m_off) + // 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) { return false; } @@ -479,8 +480,9 @@ ChannelAccessManager::RequestAccess(Ptr txop) { m_phy->NotifyChannelAccessRequested(); } - // Deny access if in sleep mode or off - if (m_sleeping || m_off) + // 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) { return; }