From e3e3568ac6461a0bcaac2e9b086203454ec82e75 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Sat, 28 Sep 2024 19:15:55 +0200 Subject: [PATCH] wifi: If a PPDU is not a non-HT PPDU, it cannot be an ICF --- src/wifi/model/eht/advanced-emlsr-manager.cc | 30 ++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/wifi/model/eht/advanced-emlsr-manager.cc b/src/wifi/model/eht/advanced-emlsr-manager.cc index 1fd7dc76f..2cb1ae107 100644 --- a/src/wifi/model/eht/advanced-emlsr-manager.cc +++ b/src/wifi/model/eht/advanced-emlsr-manager.cc @@ -231,14 +231,12 @@ AdvancedEmlsrManager::DoGetDelayUntilAccessRequest(uint8_t linkId) // prevent or allow an UL TXOP depending on whether another PHY is receiving a PPDU for (const auto id : GetStaMac()->GetLinkIds()) { - if (id != linkId && GetStaMac()->IsEmlsrLink(id)) + if (auto phy = GetStaMac()->GetWifiPhy(id); + phy && id != linkId && GetStaMac()->IsEmlsrLink(id)) { - auto phy = GetStaMac()->GetWifiPhy(id); - if (auto macHdr = GetEhtFem(id)->GetReceivedMacHdr(); macHdr && m_useNotifiedMacHdr) { - NS_ASSERT(phy && - phy->GetState()->GetLastTime({WifiPhyState::RX}) == Simulator::Now()); + NS_ASSERT(phy->GetState()->GetLastTime({WifiPhyState::RX}) == Simulator::Now()); // we are receiving the MAC payload of a PSDU; if the PSDU being received on // another link is an ICF, give up the TXOP and restart channel access at the // end of PSDU reception. Note that we cannot be sure that the PSDU being received @@ -252,8 +250,15 @@ AdvancedEmlsrManager::DoGetDelayUntilAccessRequest(uint8_t linkId) continue; } - if (phy && phy->GetInfoIfRxingPhyHeader()) + if (auto txVector = phy->GetInfoIfRxingPhyHeader()) { + if (txVector->get().GetModulationClass() >= WIFI_MOD_CLASS_HT) + { + // The initial Control frame of frame exchanges shall be sent in the non-HT PPDU + // or non-HT duplicate PPDU format (Sec. 35.3.17 of 802.11be D7.0), so this is + // not an ICF, we can ignore it + continue; + } // we don't know yet the type of the frame being received; prevent or allow // the UL TXOP based on user configuration if (!m_allowUlTxopInRx) @@ -264,7 +269,7 @@ AdvancedEmlsrManager::DoGetDelayUntilAccessRequest(uint8_t linkId) continue; } - if (phy && phy->IsStateRx()) + if (phy->IsStateRx()) { // we don't know yet the type of the frame being received; prevent or allow // the UL TXOP based on user configuration @@ -299,7 +304,7 @@ AdvancedEmlsrManager::DoGetDelayUntilAccessRequest(uint8_t linkId) continue; } const auto& txVector = ongoingRxInfo->get().txVector; - if (txVector.IsMu()) + if (txVector.GetModulationClass() >= WIFI_MOD_CLASS_HT) { // this is not an ICF, ignore it continue; @@ -577,6 +582,15 @@ AdvancedEmlsrManager::SwitchMainPhyBackDelayExpired(uint8_t linkId) delay = Max(delay, phy->GetDelayUntilIdle()); } } + else if (auto txVector = phy->GetInfoIfRxingPhyHeader()) + { + if (txVector->get().GetModulationClass() < WIFI_MOD_CLASS_HT) + { + // the PHY header of a non-HT PPDU, which may be an ICF, is being received; check + // again after the TX duration of a non-HT PHY header + delay = Max(delay, EMLSR_RX_PHY_START_DELAY); + } + } else if (phy->IsStateRx()) { if (auto ongoingRxInfo = GetEhtFem(id)->GetOngoingRxInfo();