diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index e1f133c2d..946e33938 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -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 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 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); } }