From 7eae5c8387a5018262a2c0209816956fb4fd0e24 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 28 Aug 2019 11:46:27 +0200 Subject: [PATCH] wifi: Schedule a BAR (if needed) when requesting channel access --- src/wifi/model/qos-txop.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 9cec4fb39..6a0aac807 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -941,7 +941,10 @@ QosTxop::RestartAccessIfNeeded (void) { NS_LOG_FUNCTION (this); if ((m_currentPacket != 0 - || !m_queue->IsEmpty () || m_baManager->HasPackets ()) + // check first if the BA manager retransmit queue is empty, so that expired + // frames (if any) are removed and a Block Ack Request is scheduled to advance + // the starting sequence number of the transmit (and receiver) window + || m_baManager->HasPackets () || !m_queue->IsEmpty ()) && !IsAccessRequested ()) { Ptr packet; @@ -978,7 +981,10 @@ QosTxop::StartAccessIfNeeded (void) { NS_LOG_FUNCTION (this); if (m_currentPacket == 0 - && (!m_queue->IsEmpty () || m_baManager->HasPackets ()) + // check first if the BA manager retransmit queue is empty, so that expired + // frames (if any) are removed and a Block Ack Request is scheduled to advance + // the starting sequence number of the transmit (and receiver) window + && (m_baManager->HasPackets () || !m_queue->IsEmpty ()) && !IsAccessRequested ()) { Ptr packet;