diff --git a/src/wifi/model/ctrl-headers.cc b/src/wifi/model/ctrl-headers.cc index 88e7c6c70..e36ce48dc 100644 --- a/src/wifi/model/ctrl-headers.cc +++ b/src/wifi/model/ctrl-headers.cc @@ -1547,17 +1547,22 @@ CtrlTriggerUserInfoField::SetMuRtsRuAllocation(uint8_t value) NS_ABORT_MSG_IF(m_triggerType != TriggerFrameType::MU_RTS_TRIGGER, "SetMuRtsRuAllocation() can only be used for MU-RTS"); NS_ABORT_MSG_IF( - value < 61 || value > 68, + value < 61 || value > 69, "Value " << +value << " is not admitted for B7-B1 of the RU Allocation subfield of MU-RTS Trigger Frames"); m_ruAllocation = (value << 1); - if (value == 68) + if (value >= 68) { - // set B0 for 160 MHz and 80+80 MHz indication + // set B0 for 160 MHz, 80+80 MHz and 320 MHz indication m_ruAllocation++; } + if (value == 69) + { + // set 160 for 320 MHz indication + m_ps160 = true; + } } uint8_t @@ -1567,7 +1572,7 @@ CtrlTriggerUserInfoField::GetMuRtsRuAllocation() const "GetMuRtsRuAllocation() can only be used for MU-RTS"); uint8_t value = (m_ruAllocation >> 1); NS_ABORT_MSG_IF( - value < 61 || value > 68, + value < 61 || value > 69, "Value " << +value << " is not admitted for B7-B1 of the RU Allocation subfield of MU-RTS Trigger Frames"); diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 52791ae26..90eb13e4a 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1241,10 +1241,14 @@ HeFrameExchangeManager::GetCtsTxVectorAfterMuRts(const CtrlTriggerHeader& trigge { bw = MHz_u{80}; } + else if (ru == 68) + { + bw = MHz_u{160}; + } else { - NS_ASSERT(ru == 68); - bw = MHz_u{160}; + NS_ASSERT(ru == 69); + bw = MHz_u{320}; } auto txVector = GetWifiRemoteStationManager()->GetCtsTxVector(m_bssid, GetCtsModeAfterMuRts()); diff --git a/src/wifi/model/wifi-protection-manager.cc b/src/wifi/model/wifi-protection-manager.cc index cf5939c99..7f1a5f3b6 100644 --- a/src/wifi/model/wifi-protection-manager.cc +++ b/src/wifi/model/wifi-protection-manager.cc @@ -85,11 +85,11 @@ WifiProtectionManager::AddUserInfoToMuRts(CtrlTriggerHeader& muRts, auto phy = m_mac->GetWifiPhy(m_linkId); std::size_t primaryIdx = phy->GetOperatingChannel().GetPrimaryChannelIndex(ctsTxWidth); std::size_t idx80MHz = MHz_u{80} / ctsTxWidth; - if ((phy->GetChannelWidth() == MHz_u{160}) && (ctsTxWidth <= MHz_u{40}) && + if ((phy->GetChannelWidth() > MHz_u{80}) && (ctsTxWidth <= MHz_u{40}) && (primaryIdx >= idx80MHz)) { - // the primary80 is in the higher part of the 160 MHz channel - primaryIdx -= idx80MHz; + // get the index of the primary within the primary80 + primaryIdx %= idx80MHz; } switch (static_cast(ctsTxWidth)) { @@ -105,6 +105,9 @@ WifiProtectionManager::AddUserInfoToMuRts(CtrlTriggerHeader& muRts, case 160: ui.SetMuRtsRuAllocation(68); break; + case 320: + ui.SetMuRtsRuAllocation(69); + break; default: NS_ABORT_MSG("Unhandled TX width: " << ctsTxWidth << " MHz"); }