wifi: Do not start access on a link on which no PHY is operating

This commit is contained in:
Stefano Avallone
2023-11-30 18:01:59 +01:00
committed by Stefano Avallone
parent 2652be78ca
commit 47ebdfbbf0

View File

@@ -25,6 +25,7 @@
#include "wifi-mac-queue.h"
#include "wifi-mac-trailer.h"
#include "wifi-mac.h"
#include "wifi-phy.h"
#include "ns3/attribute-container.h"
#include "ns3/log.h"
@@ -602,6 +603,12 @@ Txop::StartAccessAfterEvent(uint8_t linkId, bool hadFramesToTransmit, bool check
{
NS_LOG_FUNCTION(this << linkId << hadFramesToTransmit << checkMediumBusy);
if (!m_mac->GetWifiPhy(linkId))
{
NS_LOG_DEBUG("No PHY operating on link " << +linkId);
return;
}
if (GetLink(linkId).access != NOT_REQUESTED)
{
NS_LOG_DEBUG("Channel access already requested or granted on link " << +linkId);