From d403ff4c7e8426ebaf81bf3e289ddecd443306e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Thu, 22 Aug 2019 21:06:19 +0200 Subject: [PATCH] wifi: Use length field from TXVECTOR to compute the TX duration of a HE TB PPDU --- src/wifi/model/wifi-phy.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 434f2888d..089794e41 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -2630,6 +2630,11 @@ WifiPhy::CalculateTxDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand Time WifiPhy::CalculateTxDuration (WifiConstPsduMap psduMap, WifiTxVector txVector, WifiPhyBand band) { + if (txVector.GetPreambleType () == WIFI_PREAMBLE_HE_TB) + { + return ConvertLSigLengthToHeTbPpduDuration (txVector.GetLength (), txVector, band); + } + Time maxDuration = Seconds (0); for (auto & staIdPsdu : psduMap) { @@ -2815,8 +2820,17 @@ WifiPhy::Send (WifiConstPsduMap psdus, WifiTxVector txVector) } return; } - - Time txDuration = CalculateTxDuration (psdus, txVector, GetPhyBand ()); + + Time txDuration; + if (txVector.GetPreambleType () == WIFI_PREAMBLE_HE_TB) + { + NS_ASSERT (txVector.GetLength () > 0); + txDuration = ConvertLSigLengthToHeTbPpduDuration (txVector.GetLength (), txVector, GetPhyBand ()); + } + else + { + txDuration = CalculateTxDuration (psdus, txVector, GetPhyBand ()); + } if ((m_currentEvent != 0) && (m_currentEvent->GetEndTime () > (Simulator::Now () + m_state->GetDelayUntilIdle ()))) {