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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user