From f38712dc3cfef3d2c63cfc1639862e558fcdbf9f Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 14 Jun 2023 17:57:51 +0200 Subject: [PATCH] wifi: Re-enable short slot time (if needed) after EMLSR link switch --- src/wifi/model/eht/emlsr-manager.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index e543b7121..2a8b533b0 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -409,6 +409,11 @@ EmlsrManager::SwitchMainPhy(uint8_t linkId, bool noSwitchDelay) { mainPhy->SetAttribute("ChannelSwitchDelay", TimeValue(delay)); } + // re-enable short time slot, if needed + if (m_staMac->GetWifiRemoteStationManager(linkId)->GetShortSlotTimeEnabled()) + { + mainPhy->SetSlot(MicroSeconds(9)); + } }); NotifyMainPhySwitch(*currMainPhyLinkId, linkId); @@ -430,8 +435,14 @@ EmlsrManager::SwitchAuxPhy(uint8_t currLinkId, uint8_t nextLinkId) ->GetChannelAccessManager(currLinkId) ->NotifySwitchingEmlsrLink(auxPhy, newAuxPhyChannel, nextLinkId); - void (WifiPhy::*fp)(const WifiPhyOperatingChannel&) = &WifiPhy::SetOperatingChannel; - Simulator::ScheduleNow(fp, auxPhy, newAuxPhyChannel); + Simulator::ScheduleNow([=]() { + auxPhy->SetOperatingChannel(newAuxPhyChannel); + // re-enable short time slot, if needed + if (m_staMac->GetWifiRemoteStationManager(nextLinkId)->GetShortSlotTimeEnabled()) + { + auxPhy->SetSlot(MicroSeconds(9)); + } + }); } MgtEmlOmn