From da289b170bdc35d28b3e8a391096deaec78ffff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sat, 4 Apr 2020 12:38:56 +0200 Subject: [PATCH] wifi: Notify RX packet is dropped if its transmission is aborted due to a TX event --- src/wifi/model/wifi-phy.cc | 16 ++-------------- src/wifi/model/wifi-phy.h | 3 +++ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 20cdeae50..a33a587d9 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -2571,21 +2571,9 @@ WifiPhy::Send (Ptr psdu, WifiTxVector txVector) MaybeCcaBusyDuration (); } - if (m_endPreambleDetectionEvent.IsRunning ()) + if (m_currentEvent != 0) { - m_endPreambleDetectionEvent.Cancel (); - } - if (m_endPhyRxEvent.IsRunning ()) - { - m_endPhyRxEvent.Cancel (); - } - if (m_endRxEvent.IsRunning ()) - { - m_endRxEvent.Cancel (); - } - if (m_state->IsStateRx ()) - { - m_interference.NotifyRxEnd (); + AbortCurrentReception (RECEPTION_ABORTED_BY_TX); } if (m_powerRestricted) diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index aa90ed539..bb0984949 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -60,6 +60,7 @@ enum WifiPhyRxfailureReason SLEEPING, BUSY_DECODING_PREAMBLE, PREAMBLE_DETECT_FAILURE, + RECEPTION_ABORTED_BY_TX, L_SIG_FAILURE, SIG_A_FAILURE, PREAMBLE_DETECTION_PACKET_SWITCH, @@ -92,6 +93,8 @@ inline std::ostream& operator<< (std::ostream& os, WifiPhyRxfailureReason reason return (os << "BUSY_DECODING_PREAMBLE"); case PREAMBLE_DETECT_FAILURE: return (os << "PREAMBLE_DETECT_FAILURE"); + case RECEPTION_ABORTED_BY_TX: + return (os << "RECEPTION_ABORTED_BY_TX"); case L_SIG_FAILURE: return (os << "L_SIG_FAILURE"); case SIG_A_FAILURE: