From 9b8f232b2804d0b5d56d85ed9a09fd523a983b13 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 22 Oct 2021 12:58:56 +0200 Subject: [PATCH] wifi: PHY notifies MAC every time the payload of an HE TB PPDU starts --- src/wifi/model/he/he-phy.cc | 2 ++ src/wifi/model/phy-entity.cc | 6 ++++++ src/wifi/model/phy-entity.h | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index 0a9913e2a..8bc2d291d 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -714,6 +714,8 @@ HePhy::StartReceiveOfdmaPayload (Ptr event) m_endRxPayloadEvents.push_back (Simulator::Schedule (payloadDuration, &PhyEntity::EndReceivePayload, this, event)); m_signalNoiseMap.insert ({std::make_pair (ppdu->GetUid (), ppdu->GetStaId ()), SignalNoiseDbm ()}); m_statusPerMpduMap.insert ({std::make_pair (ppdu->GetUid (), ppdu->GetStaId ()), std::vector ()}); + // Notify the MAC about the start of a new HE TB PPDU, so that it can reschedule the timeout + NotifyPayloadBegin (ppdu->GetTxVector (), payloadDuration); } std::pair diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index d266a1e72..4ea7fab59 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -1032,6 +1032,12 @@ PhyEntity::GetCenterFrequencyForChannelWidth (const WifiTxVector& txVector) cons return m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelCenterFrequency (txVector.GetChannelWidth ()); } +void +PhyEntity::NotifyPayloadBegin (const WifiTxVector& txVector, const Time& payloadDuration) +{ + m_wifiPhy->m_phyRxPayloadBeginTrace (txVector, payloadDuration); +} + void PhyEntity::StartTx (Ptr ppdu) { diff --git a/src/wifi/model/phy-entity.h b/src/wifi/model/phy-entity.h index 7260149eb..0a771ae24 100644 --- a/src/wifi/model/phy-entity.h +++ b/src/wifi/model/phy-entity.h @@ -762,6 +762,14 @@ protected: */ uint16_t GetCenterFrequencyForChannelWidth (const WifiTxVector& txVector) const; + /** + * Fire the trace indicating that the PHY is starting to receive the payload of a PPDU. + * + * \param txVector the TXVECTOR used to transmit the PPDU + * \param payloadDuration the TX duration of the PPDU payload + */ + void NotifyPayloadBegin (const WifiTxVector& txVector, const Time& payloadDuration); + /** * \param currentChannelWidth channel width of the current transmission (MHz) * \return the width of the guard band (MHz)