wifi: Clear PSDU map of HE FEM when needed

This commit is contained in:
Stefano Avallone
2022-04-25 00:22:35 +02:00
parent 0fd04a774b
commit 14af5af4db
3 changed files with 65 additions and 1 deletions

View File

@@ -522,7 +522,7 @@ protected:
* \param mpdu the MPDU that solicited a Normal Ack response
* \param txVector the TXVECTOR used to transmit the frame soliciting the Normal Ack
*/
void NormalAckTimeout (Ptr<WifiMacQueueItem> mpdu, const WifiTxVector& txVector);
virtual void NormalAckTimeout (Ptr<WifiMacQueueItem> mpdu, const WifiTxVector& txVector);
/**
* Called when the CTS timeout expires.

View File

@@ -621,6 +621,12 @@ HeFrameExchangeManager::SendPsduMap (void)
auto hePhy = StaticCast<HePhy> (m_phy->GetPhyEntity (WIFI_MOD_CLASS_HE));
hePhy->SetTrigVector (m_trigVector, m_txTimer.GetDelayLeft ());
}
else if (timerType == WifiTxTimer::NOT_RUNNING
&& m_txParams.m_txVector.IsUlMu ())
{
// clear m_psduMap after sending QoS Null frames following a BSRP Trigger Frame
Simulator::Schedule (txDuration, &WifiPsduMap::clear, &m_psduMap);
}
}
void
@@ -999,6 +1005,52 @@ HeFrameExchangeManager::BlockAckAfterTbPpduTimeout (Ptr<WifiPsdu> psdu, const Wi
m_psduMap.clear ();
}
void
HeFrameExchangeManager::NormalAckTimeout (Ptr<WifiMacQueueItem> mpdu, const WifiTxVector& txVector)
{
NS_LOG_FUNCTION (this << *mpdu << txVector);
VhtFrameExchangeManager::NormalAckTimeout (mpdu, txVector);
// If a Normal Ack is missed in response to a DL MU PPDU requiring acknowledgment
// in SU format, we have to set the Retry flag for all transmitted MPDUs that have
// not been acknowledged nor discarded and clear m_psduMap since the transmission failed.
for (auto& psdu : m_psduMap)
{
for (auto& mpdu : *PeekPointer (psdu.second))
{
if (mpdu->IsQueued ())
{
mpdu->GetHeader ().SetRetry ();
}
}
}
m_psduMap.clear ();
}
void
HeFrameExchangeManager::BlockAckTimeout (Ptr<WifiPsdu> psdu, const WifiTxVector& txVector)
{
NS_LOG_FUNCTION (this << *psdu << txVector);
VhtFrameExchangeManager::BlockAckTimeout (psdu, txVector);
// If a Block Ack is missed in response to a DL MU PPDU requiring acknowledgment
// in SU format, we have to set the Retry flag for all transmitted MPDUs that have
// not been acknowledged nor discarded and clear m_psduMap since the transmission failed.
for (auto& psdu : m_psduMap)
{
for (auto& mpdu : *PeekPointer (psdu.second))
{
if (mpdu->IsQueued ())
{
mpdu->GetHeader ().SetRetry ();
}
}
}
m_psduMap.clear ();
}
WifiTxVector
HeFrameExchangeManager::GetTrigVector (const CtrlTriggerHeader& trigger) const
{
@@ -1509,6 +1561,7 @@ HeFrameExchangeManager::ReceiveMpdu (Ptr<WifiMacQueueItem> mpdu, RxSignalInfo rx
SnrTag tag;
mpdu->GetPacket ()->PeekPacketTag (tag);
ReceivedNormalAck (*it->second->begin (), m_txParams.m_txVector, txVector, rxSignalInfo, tag.Get ());
m_psduMap.clear ();
}
// TODO the PHY should not pass us a non-TB PPDU if we are waiting for a
// TB PPDU. However, processing the PHY header is done by the PHY entity
@@ -1635,6 +1688,15 @@ HeFrameExchangeManager::ReceiveMpdu (Ptr<WifiMacQueueItem> mpdu, RxSignalInfo rx
m_channelAccessManager->NotifyAckTimeoutResetNow ();
m_psduMap.clear ();
}
else if (hdr.IsBlockAck () && m_txTimer.IsRunning ()
&& m_txTimer.GetReason () == WifiTxTimer::WAIT_BLOCK_ACK)
{
// this BlockAck frame may have been sent in response to a DL MU PPDU with
// acknowledgment in SU format or one of the consequent BlockAckReq frames.
// We clear the PSDU map and let parent classes continue processing this frame.
m_psduMap.clear ();
VhtFrameExchangeManager::ReceiveMpdu (mpdu, rxSignalInfo, txVector, inAmpdu);
}
else if (hdr.IsTrigger ())
{
// Trigger Frames are only processed by STAs

View File

@@ -101,6 +101,8 @@ protected:
Time GetTxDuration (uint32_t ppduPayloadSize, Mac48Address receiver,
const WifiTxParameters& txParams) const override;
bool SendMpduFromBaManager (Ptr<QosTxop> edca, Time availableTime, bool initialFrame) override;
void NormalAckTimeout (Ptr<WifiMacQueueItem> mpdu, const WifiTxVector& txVector) override;
void BlockAckTimeout (Ptr<WifiPsdu> psdu, const WifiTxVector& txVector) override;
void CtsTimeout (Ptr<WifiMacQueueItem> rts, const WifiTxVector& txVector) override;
/**