diff --git a/src/wifi/model/he/multi-user-scheduler.cc b/src/wifi/model/he/multi-user-scheduler.cc index 847110da5..d74018e38 100644 --- a/src/wifi/model/he/multi-user-scheduler.cc +++ b/src/wifi/model/he/multi-user-scheduler.cc @@ -146,9 +146,9 @@ MultiUserScheduler::SetWifiMac(Ptr mac) } Ptr -MultiUserScheduler::GetWifiRemoteStationManager() const +MultiUserScheduler::GetWifiRemoteStationManager(uint8_t linkId) const { - return m_apMac->GetWifiRemoteStationManager(); + return m_apMac->GetWifiRemoteStationManager(linkId); } void @@ -227,7 +227,10 @@ MultiUserScheduler::GetDlMuInfo() // check that all the addressed stations support HE for (auto& psdu : m_dlInfo.psduMap) { - NS_ABORT_MSG_IF(!GetWifiRemoteStationManager()->GetHeSupported(psdu.second->GetAddr1()), + auto receiver = psdu.second->GetAddr1(); + auto linkId = m_apMac->IsAssociated(receiver); + NS_ABORT_MSG_IF(!linkId, "Station " << receiver << " should be associated"); + NS_ABORT_MSG_IF(!GetWifiRemoteStationManager(*linkId)->GetHeSupported(receiver), "Station " << psdu.second->GetAddr1() << " does not support HE"); } #endif diff --git a/src/wifi/model/he/multi-user-scheduler.h b/src/wifi/model/he/multi-user-scheduler.h index b98400840..36e8be985 100644 --- a/src/wifi/model/he/multi-user-scheduler.h +++ b/src/wifi/model/he/multi-user-scheduler.h @@ -121,11 +121,12 @@ class MultiUserScheduler : public Object protected: /** - * Get the station manager attached to the AP. + * Get the station manager attached to the AP on the given link. * - * \return the station manager attached to the AP + * \param linkId the ID of the given link + * \return the station manager attached to the AP on the given link */ - Ptr GetWifiRemoteStationManager() const; + Ptr GetWifiRemoteStationManager(uint8_t linkId) const; /** * Get an MPDU containing the given Trigger Frame. diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index 463b38117..9fa5444a7 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -150,7 +150,8 @@ RrMultiUserScheduler::SelectTxFormat() Ptr mpdu = m_edca->PeekNextMpdu(m_linkId); - if (mpdu && !GetWifiRemoteStationManager()->GetHeSupported(mpdu->GetHeader().GetAddr1())) + if (mpdu && !GetWifiRemoteStationManager(SINGLE_LINK_OP_ID) + ->GetHeSupported(mpdu->GetHeader().GetAddr1())) { return SU_TX; } @@ -265,7 +266,7 @@ RrMultiUserScheduler::GetTxVectorForUlMu(Func canbeSolicited) hdr.SetAddr1(staIt->address); hdr.SetAddr2(m_apMac->GetAddress()); WifiTxVector suTxVector = - GetWifiRemoteStationManager()->GetDataTxVector(hdr, m_allowedWidth); + GetWifiRemoteStationManager(SINGLE_LINK_OP_ID)->GetDataTxVector(hdr, m_allowedWidth); txVector.SetHeMuUserInfo(staIt->aid, {HeRu::RuSpec(), // assigned later by FinalizeTxVector suTxVector.GetMode().GetMcsValue(), @@ -313,8 +314,8 @@ RrMultiUserScheduler::TrySendingBsrpTf() m_txParams.Clear(); // set the TXVECTOR used to send the Trigger Frame - m_txParams.m_txVector = - m_apMac->GetWifiRemoteStationManager()->GetRtsTxVector(m_triggerMacHdr.GetAddr1()); + m_txParams.m_txVector = m_apMac->GetWifiRemoteStationManager(SINGLE_LINK_OP_ID) + ->GetRtsTxVector(m_triggerMacHdr.GetAddr1()); if (!m_heFem->TryAddMpdu(item, m_txParams, m_availableTime)) { @@ -430,8 +431,8 @@ RrMultiUserScheduler::TrySendingBasicTf() m_txParams.Clear(); // set the TXVECTOR used to send the Trigger Frame - m_txParams.m_txVector = - m_apMac->GetWifiRemoteStationManager()->GetRtsTxVector(m_triggerMacHdr.GetAddr1()); + m_txParams.m_txVector = m_apMac->GetWifiRemoteStationManager(SINGLE_LINK_OP_ID) + ->GetRtsTxVector(m_triggerMacHdr.GetAddr1()); if (!m_heFem->TryAddMpdu(item, m_txParams, m_availableTime)) { @@ -693,8 +694,8 @@ RrMultiUserScheduler::TrySendingDlMuPpdu() // An RU of the computed size is tentatively assigned to the candidate // station, so that the TX duration can be correctly computed. WifiTxVector suTxVector = - GetWifiRemoteStationManager()->GetDataTxVector(mpdu->GetHeader(), - m_allowedWidth); + GetWifiRemoteStationManager(SINGLE_LINK_OP_ID) + ->GetDataTxVector(mpdu->GetHeader(), m_allowedWidth); WifiTxVector txVectorCopy = m_txParams.m_txVector; m_txParams.m_txVector.SetHeMuUserInfo(staIt->aid, diff --git a/src/wifi/test/wifi-mac-ofdma-test.cc b/src/wifi/test/wifi-mac-ofdma-test.cc index 1d77c2490..2de423e10 100644 --- a/src/wifi/test/wifi-mac-ofdma-test.cc +++ b/src/wifi/test/wifi-mac-ofdma-test.cc @@ -285,7 +285,8 @@ TestMultiUserScheduler::ComputeWifiTxVector() } m_txVector.SetChannelWidth(bw); m_txVector.SetGuardInterval(m_apMac->GetHeConfiguration()->GetGuardInterval().GetNanoSeconds()); - m_txVector.SetTxPowerLevel(GetWifiRemoteStationManager()->GetDefaultTxPowerLevel()); + m_txVector.SetTxPowerLevel( + GetWifiRemoteStationManager(SINGLE_LINK_OP_ID)->GetDefaultTxPowerLevel()); const std::map& staList = m_apMac->GetStaList(); NS_ABORT_MSG_IF(staList.size() != 4, "There must be 4 associated stations");