diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index 77a0220fc..7260903a2 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -627,44 +627,25 @@ ApWifiMac::GetMuEdcaParameterSet() const MuEdcaParameterSet muEdcaParameters; muEdcaParameters.SetQosInfo(0); - UintegerValue uintegerValue; - TimeValue timeValue; + muEdcaParameters.SetMuAifsn(AC_BE, heConfiguration->m_muBeAifsn); + muEdcaParameters.SetMuCwMin(AC_BE, heConfiguration->m_muBeCwMin); + muEdcaParameters.SetMuCwMax(AC_BE, heConfiguration->m_muBeCwMax); + muEdcaParameters.SetMuEdcaTimer(AC_BE, heConfiguration->m_beMuEdcaTimer); - heConfiguration->GetAttribute("MuBeAifsn", uintegerValue); - muEdcaParameters.SetMuAifsn(AC_BE, uintegerValue.Get()); - heConfiguration->GetAttribute("MuBeCwMin", uintegerValue); - muEdcaParameters.SetMuCwMin(AC_BE, uintegerValue.Get()); - heConfiguration->GetAttribute("MuBeCwMax", uintegerValue); - muEdcaParameters.SetMuCwMax(AC_BE, uintegerValue.Get()); - heConfiguration->GetAttribute("BeMuEdcaTimer", timeValue); - muEdcaParameters.SetMuEdcaTimer(AC_BE, timeValue.Get()); + muEdcaParameters.SetMuAifsn(AC_BK, heConfiguration->m_muBkAifsn); + muEdcaParameters.SetMuCwMin(AC_BK, heConfiguration->m_muBkCwMin); + muEdcaParameters.SetMuCwMax(AC_BK, heConfiguration->m_muBkCwMax); + muEdcaParameters.SetMuEdcaTimer(AC_BK, heConfiguration->m_bkMuEdcaTimer); - heConfiguration->GetAttribute("MuBkAifsn", uintegerValue); - muEdcaParameters.SetMuAifsn(AC_BK, uintegerValue.Get()); - heConfiguration->GetAttribute("MuBkCwMin", uintegerValue); - muEdcaParameters.SetMuCwMin(AC_BK, uintegerValue.Get()); - heConfiguration->GetAttribute("MuBkCwMax", uintegerValue); - muEdcaParameters.SetMuCwMax(AC_BK, uintegerValue.Get()); - heConfiguration->GetAttribute("BkMuEdcaTimer", timeValue); - muEdcaParameters.SetMuEdcaTimer(AC_BK, timeValue.Get()); + muEdcaParameters.SetMuAifsn(AC_VI, heConfiguration->m_muViAifsn); + muEdcaParameters.SetMuCwMin(AC_VI, heConfiguration->m_muViCwMin); + muEdcaParameters.SetMuCwMax(AC_VI, heConfiguration->m_muViCwMax); + muEdcaParameters.SetMuEdcaTimer(AC_VI, heConfiguration->m_viMuEdcaTimer); - heConfiguration->GetAttribute("MuViAifsn", uintegerValue); - muEdcaParameters.SetMuAifsn(AC_VI, uintegerValue.Get()); - heConfiguration->GetAttribute("MuViCwMin", uintegerValue); - muEdcaParameters.SetMuCwMin(AC_VI, uintegerValue.Get()); - heConfiguration->GetAttribute("MuViCwMax", uintegerValue); - muEdcaParameters.SetMuCwMax(AC_VI, uintegerValue.Get()); - heConfiguration->GetAttribute("ViMuEdcaTimer", timeValue); - muEdcaParameters.SetMuEdcaTimer(AC_VI, timeValue.Get()); - - heConfiguration->GetAttribute("MuVoAifsn", uintegerValue); - muEdcaParameters.SetMuAifsn(AC_VO, uintegerValue.Get()); - heConfiguration->GetAttribute("MuVoCwMin", uintegerValue); - muEdcaParameters.SetMuCwMin(AC_VO, uintegerValue.Get()); - heConfiguration->GetAttribute("MuVoCwMax", uintegerValue); - muEdcaParameters.SetMuCwMax(AC_VO, uintegerValue.Get()); - heConfiguration->GetAttribute("VoMuEdcaTimer", timeValue); - muEdcaParameters.SetMuEdcaTimer(AC_VO, timeValue.Get()); + muEdcaParameters.SetMuAifsn(AC_VO, heConfiguration->m_muVoAifsn); + muEdcaParameters.SetMuCwMin(AC_VO, heConfiguration->m_muVoCwMin); + muEdcaParameters.SetMuCwMax(AC_VO, heConfiguration->m_muVoCwMax); + muEdcaParameters.SetMuEdcaTimer(AC_VO, heConfiguration->m_voMuEdcaTimer); // The timers of the MU EDCA Parameter Set must be either all zero or all // non-zero. The information element is advertised if all timers are non-zero @@ -989,7 +970,7 @@ ApWifiMac::GetHeOperation(uint8_t linkId) const nss, 11); // TBD: hardcode to 11 for now since we assume all MCS values are supported } - operation.m_bssColorInfo.m_bssColor = GetHeConfiguration()->GetBssColor(); + operation.m_bssColorInfo.m_bssColor = GetHeConfiguration()->m_bssColor; if (auto phy = GetWifiPhy(linkId); phy && phy->GetPhyBand() == WIFI_PHY_BAND_6GHZ) { diff --git a/src/wifi/model/he/constant-obss-pd-algorithm.cc b/src/wifi/model/he/constant-obss-pd-algorithm.cc index 2f296dd5e..f97a896d3 100644 --- a/src/wifi/model/he/constant-obss-pd-algorithm.cc +++ b/src/wifi/model/he/constant-obss-pd-algorithm.cc @@ -72,7 +72,7 @@ ConstantObssPdAlgorithm::ReceiveHeSigA(HeSigAParameters params) Ptr heConfiguration = m_device->GetHeConfiguration(); NS_ASSERT(heConfiguration); - uint8_t bssColor = heConfiguration->GetBssColor(); + uint8_t bssColor = heConfiguration->m_bssColor; if (bssColor == 0) { diff --git a/src/wifi/model/he/he-configuration.cc b/src/wifi/model/he/he-configuration.cc index 6fec093b3..0fc9b0fcd 100644 --- a/src/wifi/model/he/he-configuration.cc +++ b/src/wifi/model/he/he-configuration.cc @@ -38,12 +38,11 @@ HeConfiguration::GetTypeId() MakeTimeAccessor(&HeConfiguration::GetGuardInterval, &HeConfiguration::SetGuardInterval), MakeTimeChecker(NanoSeconds(800), NanoSeconds(3200))) - .AddAttribute( - "BssColor", - "The BSS color", - UintegerValue(0), - MakeUintegerAccessor(&HeConfiguration::GetBssColor, &HeConfiguration::SetBssColor), - MakeUintegerChecker()) + .AddAttribute("BssColor", + "The BSS color", + UintegerValue(0), + MakeUintegerAccessor(&HeConfiguration::m_bssColor), + MakeUintegerChecker()) .AddAttribute("MaxTbPpduDelay", "If positive, the value of this attribute specifies the maximum " "delay with which a TB PPDU can be received after the reception of " @@ -52,8 +51,7 @@ HeConfiguration::GetTypeId() "is anyway capped at the duration of the training fields in the PPDU. " "This attribute is only valid for APs.", TimeValue(Seconds(0)), - MakeTimeAccessor(&HeConfiguration::GetMaxTbPpduDelay, - &HeConfiguration::SetMaxTbPpduDelay), + MakeTimeAccessor(&HeConfiguration::m_maxTbPpduDelay), MakeTimeChecker(Seconds(0))) .AddAttribute("MuBeAifsn", "AIFSN used by BE EDCA when the MU EDCA Timer is running. " diff --git a/src/wifi/model/he/he-configuration.h b/src/wifi/model/he/he-configuration.h index 72ea918d7..ea8ca9a8f 100644 --- a/src/wifi/model/he/he-configuration.h +++ b/src/wifi/model/he/he-configuration.h @@ -8,6 +8,7 @@ #ifndef HE_CONFIGURATION_H #define HE_CONFIGURATION_H +#include "ns3/deprecated.h" #include "ns3/nstime.h" #include "ns3/object.h" @@ -37,29 +38,36 @@ class HeConfiguration : public Object * \param guardInterval the supported HE guard interval */ void SetGuardInterval(Time guardInterval); + /** * \return the supported HE guard interval */ Time GetGuardInterval() const; + /** * \param bssColor the BSS color */ + NS_DEPRECATED_3_44("Set the m_bssColor member variable instead") void SetBssColor(uint8_t bssColor); + /** * \return the BSS color */ + NS_DEPRECATED_3_44("Get the m_bssColor member variable instead") uint8_t GetBssColor() const; + /** * \param maxTbPpduDelay the maximum TB PPDU delay */ + NS_DEPRECATED_3_44("Set the m_maxTbPpduDelay member variable instead") void SetMaxTbPpduDelay(Time maxTbPpduDelay); + /** * \return the maximum TB PPDU delay */ + NS_DEPRECATED_3_44("Get the m_maxTbPpduDelay member variable instead") Time GetMaxTbPpduDelay() const; - private: - Time m_guardInterval; //!< Supported HE guard interval uint8_t m_bssColor; //!< BSS color Time m_maxTbPpduDelay; //!< Max TB PPDU delay uint8_t m_muBeAifsn; //!< AIFSN for BE in MU EDCA Parameter Set @@ -78,6 +86,9 @@ class HeConfiguration : public Object Time m_bkMuEdcaTimer; //!< Timer for BK in MU EDCA Parameter Set Time m_viMuEdcaTimer; //!< Timer for VI in MU EDCA Parameter Set Time m_voMuEdcaTimer; //!< Timer for VO in MU EDCA Parameter Set + + private: + Time m_guardInterval; //!< Supported HE guard interval }; } // namespace ns3 diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 306a99735..07a664057 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1582,7 +1582,7 @@ HeFrameExchangeManager::GetHeTbTxVector(CtrlTriggerHeader trigger, Mac48Address Ptr heConfiguration = m_mac->GetHeConfiguration(); NS_ASSERT_MSG(heConfiguration, "This STA has to be an HE station to send an HE TB PPDU"); - v.SetBssColor(heConfiguration->GetBssColor()); + v.SetBssColor(heConfiguration->m_bssColor); if (userInfoIt->IsUlTargetRssiMaxTxPower()) { @@ -2113,7 +2113,7 @@ HeFrameExchangeManager::IsIntraBssPpdu(Ptr psdu, const WifiTxVec // This condition is used if the BSS is not disabled ("If a STA determines that the BSS color // is disabled (see 26.17.3.3), then the RXVECTOR parameter BSS_COLOR of a PPDU shall not be // used to classify the PPDU") - const auto bssColor = m_mac->GetHeConfiguration()->GetBssColor(); + const auto bssColor = m_mac->GetHeConfiguration()->m_bssColor; // the other two conditions using the RXVECTOR parameter PARTIAL_AID are not implemented return bssColor != 0 && bssColor == txVector.GetBssColor(); diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index f366508de..63f731498 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -555,7 +555,7 @@ HePhy::GetBssColor() const Ptr heConfiguration = m_wifiPhy->GetDevice()->GetHeConfiguration(); if (heConfiguration) { - bssColor = heConfiguration->GetBssColor(); + bssColor = heConfiguration->m_bssColor; } } return bssColor; @@ -1317,9 +1317,9 @@ HePhy::GetMaxDelayPpduSameUid(const WifiTxVector& txVector) // training fields that are between the start of the HE portion and the start // of the Data field. auto maxDelay = GetDuration(WIFI_PPDU_FIELD_TRAINING, txVector); - if (heConfiguration->GetMaxTbPpduDelay().IsStrictlyPositive()) + if (heConfiguration->m_maxTbPpduDelay.IsStrictlyPositive()) { - maxDelay = Min(maxDelay, heConfiguration->GetMaxTbPpduDelay()); + maxDelay = Min(maxDelay, heConfiguration->m_maxTbPpduDelay); } return maxDelay; } diff --git a/src/wifi/model/he/obss-pd-algorithm.cc b/src/wifi/model/he/obss-pd-algorithm.cc index 3b58e3347..dc1ac90a0 100644 --- a/src/wifi/model/he/obss-pd-algorithm.cc +++ b/src/wifi/model/he/obss-pd-algorithm.cc @@ -94,7 +94,7 @@ ObssPdAlgorithm::ResetPhy(HeSigAParameters params) // Fetch my BSS color Ptr heConfiguration = m_device->GetHeConfiguration(); NS_ASSERT(heConfiguration); - uint8_t bssColor = heConfiguration->GetBssColor(); + uint8_t bssColor = heConfiguration->m_bssColor; NS_LOG_DEBUG("My BSS color " << (uint16_t)bssColor << " received frame " << (uint16_t)params.bssColor); diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index 2bed27b13..e708124af 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -192,7 +192,7 @@ RrMultiUserScheduler::GetTxVectorForUlMu(std::function txVector.SetPreambleType(WIFI_PREAMBLE_HE_TB); txVector.SetChannelWidth(m_allowedWidth); txVector.SetGuardInterval(heConfiguration->GetGuardInterval()); - txVector.SetBssColor(heConfiguration->GetBssColor()); + txVector.SetBssColor(heConfiguration->m_bssColor); // iterate over the associated stations until an enough number of stations is identified auto staIt = m_staListUl.begin(); @@ -792,7 +792,7 @@ RrMultiUserScheduler::TrySendingDlMuPpdu() m_txParams.m_txVector.SetPreambleType(WIFI_PREAMBLE_HE_MU); m_txParams.m_txVector.SetChannelWidth(m_allowedWidth); m_txParams.m_txVector.SetGuardInterval(heConfiguration->GetGuardInterval()); - m_txParams.m_txVector.SetBssColor(heConfiguration->GetBssColor()); + m_txParams.m_txVector.SetBssColor(heConfiguration->m_bssColor); // The TXOP limit can be exceeded by the TXOP holder if it does not transmit more // than one Data or Management frame in the TXOP and the frame is not in an A-MPDU diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index 730b96808..f30588e5a 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -1716,9 +1716,7 @@ StaWifiMac::UpdateApInfo(const MgtFrameType& frame, if (const auto& heOperation = frame.template Get(); heOperation.has_value()) { - GetHeConfiguration()->SetAttribute( - "BssColor", - UintegerValue(heOperation->m_bssColorInfo.m_bssColor)); + GetHeConfiguration()->m_bssColor = heOperation->m_bssColorInfo.m_bssColor; } } diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 8e5d53370..b1cd58e9c 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -636,7 +636,7 @@ WifiRemoteStationManager::GetDataTxVector(const WifiMacHeader& header, MHz_u all Ptr heConfiguration = m_wifiPhy->GetDevice()->GetHeConfiguration(); if (heConfiguration) { - txVector.SetBssColor(heConfiguration->GetBssColor()); + txVector.SetBssColor(heConfiguration->m_bssColor); } // If both the allowed width and the TXVECTOR channel width are integer multiple // of 20 MHz, then the TXVECTOR channel width must not exceed the allowed width diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index 8f649eca2..c0550f3f2 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -2518,7 +2518,7 @@ TestMultipleHeTbPreambles::DoSetup() preambleDetectionModel->SetAttribute("MinimumRssi", DoubleValue(-82)); m_phy->SetPreambleDetectionModel(preambleDetectionModel); Ptr heConfiguration = CreateObject(); - heConfiguration->SetMaxTbPpduDelay(NanoSeconds(400)); + heConfiguration->m_maxTbPpduDelay = NanoSeconds(400); dev->SetHeConfiguration(heConfiguration); dev->SetPhy(m_phy); node->AddDevice(dev); diff --git a/src/wifi/test/wifi-primary-channels-test.cc b/src/wifi/test/wifi-primary-channels-test.cc index 135de57b9..3514ddc74 100644 --- a/src/wifi/test/wifi-primary-channels-test.cc +++ b/src/wifi/test/wifi-primary-channels-test.cc @@ -422,7 +422,7 @@ WifiPrimaryChannelsTest::DoSetup() for (uint8_t bss = 0; bss < m_nBss; bss++) { auto dev = DynamicCast(m_apDevices.Get(bss)); - dev->GetHeConfiguration()->SetBssColor(bss + 1); + dev->GetHeConfiguration()->m_bssColor = bss + 1; } } @@ -759,7 +759,7 @@ WifiPrimaryChannelsTest::SendDlSuPpdu(uint8_t bss, MHz_u txChannelWidth) auto apDev = DynamicCast(m_apDevices.Get(bss)); auto staDev = DynamicCast(m_staDevices[bss].Get(0)); - uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor(); + uint8_t bssColor = apDev->GetHeConfiguration()->m_bssColor; WifiTxVector txVector = WifiTxVector(HePhy::GetHeMcs8(), 0, WIFI_PREAMBLE_HE_SU, @@ -794,7 +794,7 @@ WifiPrimaryChannelsTest::SendDlMuPpdu(uint8_t bss, << "addressed to " << nRus << " stations (RU type: " << ruType << ")"); auto apDev = DynamicCast(m_apDevices.Get(bss)); - uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor(); + uint8_t bssColor = apDev->GetHeConfiguration()->m_bssColor; WifiTxVector txVector = WifiTxVector(HePhy::GetHeMcs8(), 0, @@ -871,7 +871,7 @@ WifiPrimaryChannelsTest::DoSendHeTbPpdu(uint8_t bss, std::size_t nRus) { auto apDev = DynamicCast(m_apDevices.Get(bss)); - uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor(); + uint8_t bssColor = apDev->GetHeConfiguration()->m_bssColor; WifiMacHeader hdr; hdr.SetType(WIFI_MAC_QOSDATA);