wifi: Reduce amount of scheduled operations when switching main PHY

This commit is contained in:
Stefano Avallone
2023-06-29 17:58:09 +02:00
committed by Stefano Avallone
parent 459a5aa46b
commit c7b37d1caa
2 changed files with 9 additions and 8 deletions

View File

@@ -836,9 +836,8 @@ EhtFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
}
NS_ASSERT(m_staMac->GetEmlsrManager());
Simulator::ScheduleNow(&EmlsrManager::NotifyIcfReceived,
m_staMac->GetEmlsrManager(),
m_linkId);
m_staMac->GetEmlsrManager()->NotifyIcfReceived(m_linkId);
// 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)
m_ongoingTxopEnd.Cancel();

View File

@@ -370,13 +370,15 @@ EmlsrManager::NotifyIcfReceived(uint8_t linkId)
return;
}
SwitchMainPhy(linkId, true); // channel switch should occur instantaneously
Simulator::ScheduleNow([=, this]() {
SwitchMainPhy(linkId, true); // channel switch should occur instantaneously
// aux PHY received the ICF but main PHY will send the response
auto uid = auxPhy->GetPreviouslyRxPpduUid();
mainPhy->SetPreviouslyRxPpduUid(uid);
// aux PHY received the ICF but main PHY will send the response
auto uid = auxPhy->GetPreviouslyRxPpduUid();
mainPhy->SetPreviouslyRxPpduUid(uid);
DoNotifyIcfReceived(linkId);
DoNotifyIcfReceived(linkId);
});
}
void