wifi: Complete post-processing of the ICF before notifying the EMLSR manager

Allows to switch the aux PHY at the end of ICF reception without the
need of scheduling an event
This commit is contained in:
Stefano Avallone
2024-07-02 17:46:17 +02:00
parent 5c08352b34
commit 28030d39b0
3 changed files with 25 additions and 15 deletions

View File

@@ -130,10 +130,18 @@ DefaultEmlsrManager::NotifyMainPhySwitch(std::optional<uint8_t> currLinkId,
<< " will switch to link " << +currLinkId.value() << " in "
<< duration.As(Time::US));
m_auxPhySwitchEvent =
Simulator::Schedule(duration, [=, this, prevLinkId = m_mainPhySwitchInfo.from]() {
SwitchAuxPhy(auxPhy, nextLinkId, prevLinkId);
});
if (duration.IsStrictlyPositive())
{
m_auxPhySwitchEvent =
Simulator::Schedule(duration, [=, this, prevLinkId = m_mainPhySwitchInfo.from]() {
SwitchAuxPhy(auxPhy, nextLinkId, prevLinkId);
});
}
else
{
SwitchAuxPhy(auxPhy, nextLinkId, m_mainPhySwitchInfo.from);
}
return;
}

View File

@@ -1279,6 +1279,13 @@ EhtFrameExchangeManager::PostProcessFrame(Ptr<const WifiPsdu> psdu, const WifiTx
UpdateTxopEndOnRxEnd(psdu->GetDuration());
}
}
if (m_staMac && m_icfReceived)
{
// notify the EMLSR manager
m_staMac->GetEmlsrManager()->NotifyIcfReceived(m_linkId);
m_icfReceived = false;
}
}
bool
@@ -1391,8 +1398,6 @@ EhtFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
CheckEmlsrClientStartingTxop(hdr, txVector);
}
bool icfReceived = false;
if (hdr.IsTrigger())
{
if (!m_staMac)
@@ -1423,7 +1428,7 @@ EhtFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
auto emlsrManager = m_staMac->GetEmlsrManager();
NS_ASSERT(emlsrManager);
icfReceived = true;
m_icfReceived = true;
// we just got involved in a DL TXOP. Check if we are still involved in the TXOP in a
// SIFS (we are expected to reply by sending a CTS frame)
@@ -1436,17 +1441,12 @@ EhtFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
}
}
if (!icfReceived && ShallDropReceivedMpdu(mpdu))
if (!m_icfReceived && ShallDropReceivedMpdu(mpdu))
{
return;
}
HeFrameExchangeManager::ReceiveMpdu(mpdu, rxSignalInfo, txVector, inAmpdu);
if (icfReceived)
{
m_staMac->GetEmlsrManager()->NotifyIcfReceived(m_linkId);
}
}
void

View File

@@ -299,8 +299,10 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager
*/
void TxopEnd(const std::optional<Mac48Address>& txopHolder);
EventId m_ongoingTxopEnd; //!< event indicating the possible end of the current TXOP (of which
//!< we are not the holder)
bool m_icfReceived{false}; //!< whether an ICF has been received and needs to be notified to
//!< the EMLSR manager after post-processing the frame
EventId m_ongoingTxopEnd; //!< event indicating the possible end of the current TXOP (of which
//!< we are not the holder)
std::unordered_map<Mac48Address, EventId, WifiAddressHash>
m_transDelayTimer; //!< MLD address-indexed map of transition delay timers
};