wifi: Schedule channel access request upon enqueuing a packet

This allows us to request channel access after that all the packets of a burst
are enqueued, instead of requesting channel access right after the first packet
This commit is contained in:
Stefano Avallone
2023-08-09 15:57:19 +02:00
parent 3f19c111e3
commit df97ca42be
2 changed files with 14 additions and 1 deletions

View File

@@ -545,7 +545,14 @@ Txop::Queue(Ptr<WifiMpdu> mpdu)
m_queue->Enqueue(mpdu);
for (const auto linkId : linkIds)
{
StartAccessIfNeeded(linkId);
// schedule a call to StartAccessIfNeeded() to request channel access after that all the
// packets of a burst have been enqueued, instead of requesting channel access right after
// the first packet. The call to StartAccessIfNeeded() is scheduled only after the first
// packet
if (auto& event = GetLink(linkId).accessRequest.event; !event.IsRunning())
{
event = Simulator::ScheduleNow(&Txop::StartAccessIfNeeded, this, linkId);
}
}
}

View File

@@ -509,6 +509,12 @@ class Txop : public Object
uint8_t aifsn{0}; //!< the AIFSN
Time txopLimit{0}; //!< the TXOP limit time
ChannelAccessStatus access{NOT_REQUESTED}; //!< channel access status
mutable class
{
friend void Txop::Queue(Ptr<WifiMpdu>);
EventId event;
} accessRequest; //!< access request event, to be used by Txop::Queue() only
};
/**