wifi: Generate backoff if needed when unblocking links after BA agreement

This commit is contained in:
Stefano Avallone
2023-09-19 17:28:18 +02:00
committed by Stefano Avallone
parent 3cea322710
commit 2bb301a8db

View File

@@ -618,6 +618,15 @@ QosTxop::GotAddBaResponse(const MgtAddBaResponseHeader& respHdr, Mac48Address re
{
NS_LOG_FUNCTION(this << respHdr << recipient);
uint8_t tid = respHdr.GetTid();
// save the status of the AC queues before unblocking the transmissions to the recipient
// (performed by the calls to the BlockAckManager below)
std::map<uint8_t, bool> hasFramesToTransmit;
for (const auto& [id, link] : GetLinks())
{
hasFramesToTransmit[id] = HasFramesToTransmit(id);
}
if (respHdr.GetStatusCode().IsSuccess())
{
NS_LOG_DEBUG("block ack agreement established with " << recipient << " tid " << +tid);
@@ -644,7 +653,7 @@ QosTxop::GotAddBaResponse(const MgtAddBaResponseHeader& respHdr, Mac48Address re
for (const auto& [id, link] : GetLinks())
{
StartAccessIfNeeded(id);
StartAccessAfterEvent(id, hasFramesToTransmit.at(id), true);
}
}
@@ -661,12 +670,20 @@ QosTxop::NotifyOriginatorAgreementNoReply(const Mac48Address& recipient, uint8_t
{
NS_LOG_FUNCTION(this << recipient << tid);
// save the status of the AC queues before unblocking the transmissions to the recipient
// (performed by the call to the BlockAckManager below)
std::map<uint8_t, bool> hasFramesToTransmit;
for (const auto& [id, link] : GetLinks())
{
hasFramesToTransmit[id] = HasFramesToTransmit(id);
}
m_baManager->NotifyOriginatorAgreementNoReply(recipient, tid);
// the recipient has been "unblocked" and transmissions can resume using normal
// acknowledgment, hence start access (if needed) on all the links
for (const auto& [id, link] : GetLinks())
{
StartAccessIfNeeded(id);
StartAccessAfterEvent(id, hasFramesToTransmit.at(id), true);
}
}