From 942e0baca3c3ab9a34bef9741713f0fd8b9eae1a Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 17 Nov 2023 17:25:43 +0100 Subject: [PATCH] wifi: Reset backoff and request access if needed when switching EMLSR links --- src/wifi/model/eht/default-emlsr-manager.cc | 8 +++- src/wifi/model/eht/emlsr-manager.cc | 53 +++++++++++++++++++-- src/wifi/model/eht/emlsr-manager.h | 12 ++++- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/wifi/model/eht/default-emlsr-manager.cc b/src/wifi/model/eht/default-emlsr-manager.cc index 7befd67be..f7e750df6 100644 --- a/src/wifi/model/eht/default-emlsr-manager.cc +++ b/src/wifi/model/eht/default-emlsr-manager.cc @@ -153,9 +153,11 @@ DefaultEmlsrManager::DoNotifyTxopEnd(uint8_t linkId) // is not received and the UL TXOP ends before the main PHY channel switch is completed. // In such cases, wait until the main PHY channel switch is completed before requesting // a new channel switch. + // Backoff shall not be reset on the link left by the main PHY because a TXOP ended and + // a new backoff value must be generated. if (!mainPhy->IsStateSwitching()) { - SwitchMainPhy(GetMainPhyId(), false); + SwitchMainPhy(GetMainPhyId(), false, DONT_RESET_BACKOFF, REQUEST_ACCESS); } else { @@ -163,7 +165,9 @@ DefaultEmlsrManager::DoNotifyTxopEnd(uint8_t linkId) &DefaultEmlsrManager::SwitchMainPhy, this, GetMainPhyId(), - false); + false, + DONT_RESET_BACKOFF, + REQUEST_ACCESS); } return; } diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index 0e3387d25..12e1dd4d3 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -372,7 +372,10 @@ EmlsrManager::NotifyIcfReceived(uint8_t linkId) } Simulator::ScheduleNow([=, this]() { - SwitchMainPhy(linkId, true); // channel switch should occur instantaneously + SwitchMainPhy(linkId, + true, // channel switch should occur instantaneously + RESET_BACKOFF, + DONT_REQUEST_ACCESS); // aux PHY received the ICF but main PHY will send the response auto uid = auxPhy->GetPreviouslyRxPpduUid(); @@ -423,7 +426,13 @@ EmlsrManager::NotifyUlTxopStart(uint8_t linkId, std::optional