From b627396ee5d6f0497096fcdfff6c00a5c7917a33 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 26 May 2022 19:48:53 +0200 Subject: [PATCH] wifi: HE FEM can receive TB PPDUs containing a single QoS Null --- .../model/he/he-frame-exchange-manager.cc | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 5ea476629..aa66bb7f2 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1530,6 +1530,44 @@ HeFrameExchangeManager::ReceiveMpdu (Ptr mpdu, RxSignalInfo rx return; } + if (txVector.IsUlMu () && m_txTimer.IsRunning () + && m_txTimer.GetReason () == WifiTxTimer::WAIT_QOS_NULL_AFTER_BSRP_TF + && !inAmpdu) // if in A-MPDU, processing is done at the end of A-MPDU reception + { + Mac48Address sender = hdr.GetAddr2 (); + + if (m_staExpectTbPpduFrom.find (sender) == m_staExpectTbPpduFrom.end ()) + { + NS_LOG_WARN ("Received a TB PPDU from an unexpected station: " << sender); + return; + } + if (!(hdr.IsQosData () && !hdr.HasData ())) + { + NS_LOG_WARN ("No QoS Null frame in the received MPDU"); + return; + } + + NS_LOG_DEBUG ("Received a QoS Null frame in a TB PPDU from " << sender); + + // remove the sender from the set of stations that are expected to send a TB PPDU + m_staExpectTbPpduFrom.erase (sender); + + if (m_staExpectTbPpduFrom.empty ()) + { + // we do not expect any other response + m_txTimer.Cancel (); + m_channelAccessManager->NotifyAckTimeoutResetNow (); + + NS_ASSERT (m_edca != 0); + m_psduMap.clear (); + m_edca->ResetCw (); + TransmissionSucceeded (); + } + + // the received TB PPDU has been processed + return; + } + if (hdr.IsCtl ()) { if (hdr.IsCts () && m_txTimer.IsRunning () && m_txTimer.GetReason () == WifiTxTimer::WAIT_CTS