From e844dfd1d73e1f03216683e6028c714da4d855c5 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 21 Oct 2021 14:18:15 -0700 Subject: [PATCH] wifi: (fixes #473) Discard preamble state for truncated TX or device in OFF --- src/wifi/model/phy-entity.cc | 2 ++ src/wifi/model/wifi-phy-common.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index e0f8bee45..d266a1e72 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -385,6 +385,7 @@ PhyEntity::StartReceivePreamble (Ptr ppdu, RxPowerWattPerChannelBand& { m_wifiPhy->SwitchMaybeToCcaBusy (m_wifiPhy->GetMeasurementChannelWidth (nullptr)); } + DropPreambleEvent (ppdu, WifiPhyRxfailureReason::POWERED_OFF, endRx, m_wifiPhy->GetMeasurementChannelWidth (ppdu)); return; } @@ -395,6 +396,7 @@ PhyEntity::StartReceivePreamble (Ptr ppdu, RxPowerWattPerChannelBand& { m_wifiPhy->SwitchMaybeToCcaBusy (GetMeasurementChannelWidth (ppdu)); } + DropPreambleEvent (ppdu, WifiPhyRxfailureReason::TRUNCATED_TX, endRx, m_wifiPhy->GetMeasurementChannelWidth (ppdu)); return; } diff --git a/src/wifi/model/wifi-phy-common.h b/src/wifi/model/wifi-phy-common.h index 556dc1360..24ee9bdc2 100644 --- a/src/wifi/model/wifi-phy-common.h +++ b/src/wifi/model/wifi-phy-common.h @@ -267,6 +267,8 @@ enum WifiPhyRxfailureReason RXING, TXING, SLEEPING, + POWERED_OFF, + TRUNCATED_TX, BUSY_DECODING_PREAMBLE, PREAMBLE_DETECT_FAILURE, RECEPTION_ABORTED_BY_TX, @@ -302,6 +304,10 @@ inline std::ostream& operator<< (std::ostream &os, const WifiPhyRxfailureReason return (os << "TXING"); case SLEEPING: return (os << "SLEEPING"); + case POWERED_OFF: + return (os << "OFF"); + case TRUNCATED_TX: + return (os << "TRUNCATED_TX"); case BUSY_DECODING_PREAMBLE: return (os << "BUSY_DECODING_PREAMBLE"); case PREAMBLE_DETECT_FAILURE: