wifi: Reset PHY internals at the end of the detected packet if PHY header reception failed

This commit is contained in:
Sébastien Deronne
2020-03-24 09:31:28 +01:00
committed by Sebastien Deronne
parent 4b97988a68
commit 39800ef31d
2 changed files with 20 additions and 4 deletions

View File

@@ -2852,6 +2852,7 @@ WifiPhy::StartReceivePayload (Ptr<Event> event)
//If we are here, this means non-HT PHY header was already successfully received
canReceivePayload = true;
}
Time payloadDuration = event->GetEndTime () - event->GetStartTime () - CalculatePhyPreambleAndHeaderDuration (txVector);
if (canReceivePayload) //PHY reception succeeded
{
if (txVector.GetNss () > GetMaxSupportedRxSpatialStreams ())
@@ -2871,7 +2872,6 @@ WifiPhy::StartReceivePayload (Ptr<Event> event)
}
else
{
Time payloadDuration = event->GetEndTime () - event->GetStartTime () - CalculatePhyPreambleAndHeaderDuration (txVector);
m_state->SwitchToRx (payloadDuration);
m_endRxEvent = Simulator::Schedule (payloadDuration, &WifiPhy::EndReceive, this, event);
NS_LOG_DEBUG ("Receiving payload");
@@ -2890,9 +2890,7 @@ WifiPhy::StartReceivePayload (Ptr<Event> event)
NS_LOG_DEBUG ("Drop packet because HT PHY header reception failed");
NotifyRxDrop (event->GetPsdu (), SIG_A_FAILURE);
}
m_interference.NotifyRxEnd ();
m_currentEvent = 0;
MaybeCcaBusyDuration ();
m_endRxEvent = Simulator::Schedule (payloadDuration, &WifiPhy::ResetReceive, this, event);
}
void
@@ -3010,6 +3008,17 @@ WifiPhy::EndReceiveInterBss (void)
}
}
void
WifiPhy::ResetReceive (Ptr<Event> event)
{
NS_LOG_FUNCTION (this << *event);
NS_ASSERT (event->GetEndTime () == Simulator::Now ());
NS_ASSERT (!IsStateRx ());
m_interference.NotifyRxEnd ();
m_currentEvent = 0;
MaybeCcaBusyDuration ();
}
void
WifiPhy::NotifyChannelAccessRequested (void)
{

View File

@@ -177,6 +177,13 @@ public:
*/
void EndReceive (Ptr<Event> event);
/**
* Reset PHY at the end of the packet under reception after it has failed the PHY header.
*
* \param event the corresponding event of the first time the packet arrives (also storing packet and TxVector information)
*/
void ResetReceive (Ptr<Event> event);
/**
* For HE receptions only, check and possibly modify the transmit power restriction state at
* the end of PPDU reception.