From 45583a35834c7bbf434112c89612607a52ad9845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 13 Aug 2023 17:52:30 +0200 Subject: [PATCH] wifi: Event does not need to store TXVECTOR since it can be retrieved from the PPDU --- src/wifi/model/he/he-phy.cc | 12 ++++---- src/wifi/model/he/he-ppdu.cc | 4 +-- src/wifi/model/ht/ht-phy.cc | 4 +-- src/wifi/model/ht/ht-ppdu.cc | 2 +- src/wifi/model/interference-helper.cc | 40 ++++++++++--------------- src/wifi/model/interference-helper.h | 15 +--------- src/wifi/model/non-ht/dsss-ppdu.cc | 2 +- src/wifi/model/non-ht/ofdm-ppdu.cc | 2 +- src/wifi/model/phy-entity.cc | 43 +++++++++++++-------------- src/wifi/model/spectrum-wifi-phy.cc | 5 ++-- src/wifi/model/vht/vht-phy.cc | 2 +- src/wifi/model/vht/vht-ppdu.cc | 2 +- src/wifi/model/wifi-phy.cc | 2 +- 13 files changed, 55 insertions(+), 80 deletions(-) diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index 218123894..bb9189d8d 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -596,7 +596,7 @@ PhyEntity::PhyFieldRxStatus HePhy::ProcessSig(Ptr event, PhyFieldRxStatus status, WifiPpduField field) { NS_LOG_FUNCTION(this << *event << status << field); - NS_ASSERT(event->GetTxVector().GetPreambleType() >= WIFI_PREAMBLE_HE_SU); + NS_ASSERT(event->GetPpdu()->GetTxVector().GetPreambleType() >= WIFI_PREAMBLE_HE_SU); switch (field) { case WIFI_PPDU_FIELD_SIG_A: @@ -614,7 +614,7 @@ HePhy::ProcessSigA(Ptr event, PhyFieldRxStatus status) { NS_LOG_FUNCTION(this << *event << status); // Notify end of SIG-A (in all cases) - WifiTxVector txVector = event->GetTxVector(); + const auto& txVector = event->GetPpdu()->GetTxVector(); HeSigAParameters params; params.rssiW = GetRxPowerWForPpdu(event); params.bssColor = txVector.GetBssColor(); @@ -728,7 +728,7 @@ PhyEntity::PhyFieldRxStatus HePhy::ProcessSigB(Ptr event, PhyFieldRxStatus status) { NS_LOG_FUNCTION(this << *event << status); - NS_ASSERT(IsDlMu(event->GetTxVector().GetPreambleType())); + NS_ASSERT(IsDlMu(event->GetPpdu()->GetTxVector().GetPreambleType())); if (status.isSuccess) { // Check if PPDU is filtered only if the SIG-B content is supported (not explicitly stated @@ -754,7 +754,7 @@ HePhy::IsConfigSupported(Ptr ppdu) const return true; // evaluated in ProcessSigA } - const WifiTxVector& txVector = ppdu->GetTxVector(); + const auto& txVector = ppdu->GetTxVector(); uint16_t staId = GetStaId(ppdu); WifiMode txMode = txVector.GetMode(staId); uint8_t nss = txVector.GetNssMax(); @@ -789,7 +789,8 @@ Time HePhy::DoStartReceivePayload(Ptr event) { NS_LOG_FUNCTION(this << *event); - const auto& txVector = event->GetTxVector(); + const auto ppdu = event->GetPpdu(); + const auto& txVector = ppdu->GetTxVector(); if (!txVector.IsMu()) { @@ -797,7 +798,6 @@ HePhy::DoStartReceivePayload(Ptr event) } NS_ASSERT(txVector.GetModulationClass() >= WIFI_MOD_CLASS_HE); - Ptr ppdu = event->GetPpdu(); if (txVector.IsDlMu()) { diff --git a/src/wifi/model/he/he-ppdu.cc b/src/wifi/model/he/he-ppdu.cc index 8d2e11840..7449c0ab0 100644 --- a/src/wifi/model/he/he-ppdu.cc +++ b/src/wifi/model/he/he-ppdu.cc @@ -312,7 +312,7 @@ Time HePpdu::GetTxDuration() const { Time ppduDuration = Seconds(0); - const WifiTxVector& txVector = GetTxVector(); + const auto& txVector = GetTxVector(); const auto length = m_lSig.GetLength(); const auto tSymbol = NanoSeconds(12800 + txVector.GetGuardInterval()); const auto preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration(txVector); @@ -415,7 +415,7 @@ HePpdu::GetStaId() const uint16_t HePpdu::GetTransmissionChannelWidth() const { - const WifiTxVector& txVector = GetTxVector(); + const auto& txVector = GetTxVector(); if (txVector.IsUlMu() && GetStaId() != SU_STA_ID) { TxPsdFlag flag = GetTxPsdFlag(); diff --git a/src/wifi/model/ht/ht-phy.cc b/src/wifi/model/ht/ht-phy.cc index 29ceb08dd..8086debec 100644 --- a/src/wifi/model/ht/ht-phy.cc +++ b/src/wifi/model/ht/ht-phy.cc @@ -407,7 +407,7 @@ PhyEntity::PhyFieldRxStatus HtPhy::EndReceiveHtSig(Ptr event) { NS_LOG_FUNCTION(this << *event); - NS_ASSERT(event->GetTxVector().GetPreambleType() == WIFI_PREAMBLE_HT_MF); + NS_ASSERT(event->GetPpdu()->GetTxVector().GetPreambleType() == WIFI_PREAMBLE_HT_MF); SnrPer snrPer = GetPhyHeaderSnrPer(WIFI_PPDU_FIELD_HT_SIG, event); NS_LOG_DEBUG("HT-SIG: SNR(dB)=" << RatioToDb(snrPer.snr) << ", PER=" << snrPer.per); PhyFieldRxStatus status(GetRandomValue() > snrPer.per); @@ -441,7 +441,7 @@ HtPhy::IsAllConfigSupported(WifiPpduField field, Ptr ppdu) const bool HtPhy::IsConfigSupported(Ptr ppdu) const { - const WifiTxVector& txVector = ppdu->GetTxVector(); + const auto& txVector = ppdu->GetTxVector(); if (txVector.GetNss() > m_wifiPhy->GetMaxSupportedRxSpatialStreams()) { NS_LOG_DEBUG("Packet reception could not be started because not enough RX antennas"); diff --git a/src/wifi/model/ht/ht-ppdu.cc b/src/wifi/model/ht/ht-ppdu.cc index d41dcdaa7..5eecc4404 100644 --- a/src/wifi/model/ht/ht-ppdu.cc +++ b/src/wifi/model/ht/ht-ppdu.cc @@ -109,7 +109,7 @@ HtPpdu::SetTxVectorFromPhyHeaders(WifiTxVector& txVector, Time HtPpdu::GetTxDuration() const { - const WifiTxVector& txVector = GetTxVector(); + const auto& txVector = GetTxVector(); const auto htLength = m_htSig.GetHtLength(); NS_ASSERT(m_operatingChannel.IsSet()); return WifiPhy::CalculateTxDuration(htLength, txVector, m_operatingChannel.GetPhyBand()); diff --git a/src/wifi/model/interference-helper.cc b/src/wifi/model/interference-helper.cc index 118ba41fe..89fc2670f 100644 --- a/src/wifi/model/interference-helper.cc +++ b/src/wifi/model/interference-helper.cc @@ -44,12 +44,8 @@ NS_OBJECT_ENSURE_REGISTERED(InterferenceHelper); * PHY event class ****************************************************************/ -Event::Event(Ptr ppdu, - const WifiTxVector& txVector, - Time duration, - RxPowerWattPerChannelBand&& rxPower) +Event::Event(Ptr ppdu, Time duration, RxPowerWattPerChannelBand&& rxPower) : m_ppdu(ppdu), - m_txVector(txVector), m_startTime(Simulator::Now()), m_endTime(m_startTime + duration), m_rxPowerW(std::move(rxPower)) @@ -112,12 +108,6 @@ Event::GetRxPowerWPerBand() const return m_rxPowerW; } -const WifiTxVector& -Event::GetTxVector() const -{ - return m_txVector; -} - void Event::UpdateRxPowerW(const RxPowerWattPerChannelBand& rxPower) { @@ -138,7 +128,7 @@ std::ostream& operator<<(std::ostream& os, const Event& event) { os << "start=" << event.GetStartTime() << ", end=" << event.GetEndTime() - << ", TXVECTOR=" << event.GetTxVector() << ", power=" << event.GetRxPowerW() << "W" + << ", power=" << event.GetRxPowerW() << "W" << ", PPDU=" << event.GetPpdu(); return os; } @@ -219,12 +209,11 @@ InterferenceHelper::DoDispose() Ptr InterferenceHelper::Add(Ptr ppdu, - const WifiTxVector& txVector, Time duration, RxPowerWattPerChannelBand& rxPowerW, bool isStartHePortionRxing) { - Ptr event = Create(ppdu, txVector, duration, std::move(rxPowerW)); + Ptr event = Create(ppdu, duration, std::move(rxPowerW)); AppendEvent(event, isStartHePortionRxing); return event; } @@ -240,7 +229,7 @@ InterferenceHelper::AddForeignSignal(Time duration, RxPowerWattPerChannelBand& r Ptr fakePpdu = Create(Create(Create(0), hdr), WifiTxVector(), WifiPhyOperatingChannel()); - Add(fakePpdu, WifiTxVector(), duration, rxPowerW); + Add(fakePpdu, duration, rxPowerW); } bool @@ -531,14 +520,14 @@ InterferenceHelper::CalculatePayloadPer(Ptr event, const auto& niIt = nis->find(band)->second; auto j = niIt.cbegin(); Time previous = j->first; - WifiMode payloadMode = event->GetTxVector().GetMode(staId); + WifiMode payloadMode = event->GetPpdu()->GetTxVector().GetMode(staId); Time phyPayloadStart = j->first; if (event->GetPpdu()->GetType() != WIFI_PPDU_TYPE_UL_MU && event->GetPpdu()->GetType() != WIFI_PPDU_TYPE_DL_MU) // j->first corresponds to the start of the MU payload { - phyPayloadStart = - j->first + WifiPhy::CalculatePhyPreambleAndHeaderDuration(event->GetTxVector()); + phyPayloadStart = j->first + WifiPhy::CalculatePhyPreambleAndHeaderDuration( + event->GetPpdu()->GetTxVector()); } Time windowStart = phyPayloadStart + window.first; Time windowEnd = phyPayloadStart + window.second; @@ -553,13 +542,13 @@ InterferenceHelper::CalculatePayloadPer(Ptr event, double snr = CalculateSnr(powerW, noiseInterferenceW, channelWidth, - event->GetTxVector().GetNss(staId)); + event->GetPpdu()->GetTxVector().GetNss(staId)); // Case 1: Both previous and current point to the windowed payload if (previous >= windowStart) { psr *= CalculatePayloadChunkSuccessRate(snr, Min(windowEnd, current) - previous, - event->GetTxVector(), + event->GetPpdu()->GetTxVector(), staId); NS_LOG_DEBUG("Both previous and current point to the windowed payload: mode=" << payloadMode << ", psr=" << psr); @@ -569,7 +558,7 @@ InterferenceHelper::CalculatePayloadPer(Ptr event, { psr *= CalculatePayloadChunkSuccessRate(snr, Min(windowEnd, current) - windowStart, - event->GetTxVector(), + event->GetPpdu()->GetTxVector(), staId); NS_LOG_DEBUG( "previous is before windowed payload and current is in the windowed payload: mode=" @@ -631,7 +620,7 @@ InterferenceHelper::CalculatePhyHeaderSectionPsr( psr *= CalculateChunkSuccessRate(snr, duration, section.second.second, - event->GetTxVector(), + event->GetPpdu()->GetTxVector(), section.first); NS_LOG_DEBUG("Current NI change in " << section.first << " [" << start << ", " << stop << "] for " @@ -661,11 +650,12 @@ InterferenceHelper::CalculatePhyHeaderPer(Ptr event, { NS_LOG_FUNCTION(this << band << header); auto niIt = nis->find(band)->second; - auto phyEntity = WifiPhy::GetStaticPhyEntity(event->GetTxVector().GetModulationClass()); + auto phyEntity = + WifiPhy::GetStaticPhyEntity(event->GetPpdu()->GetTxVector().GetModulationClass()); PhyEntity::PhyHeaderSections sections; for (const auto& section : - phyEntity->GetPhyHeaderSections(event->GetTxVector(), niIt.begin()->first)) + phyEntity->GetPhyHeaderSections(event->GetPpdu()->GetTxVector(), niIt.begin()->first)) { if (section.first == header) { @@ -695,7 +685,7 @@ InterferenceHelper::CalculatePayloadSnrPer(Ptr event, double snr = CalculateSnr(event->GetRxPowerW(band), noiseInterferenceW, channelWidth, - event->GetTxVector().GetNss(staId)); + event->GetPpdu()->GetTxVector().GetNss(staId)); /* calculate the SNIR at the start of the MPDU (located through windowing) and accumulate * all SNIR changes in the SNIR vector. diff --git a/src/wifi/model/interference-helper.h b/src/wifi/model/interference-helper.h index 0de719b5f..f1ee01296 100644 --- a/src/wifi/model/interference-helper.h +++ b/src/wifi/model/interference-helper.h @@ -44,14 +44,10 @@ class Event : public SimpleRefCount * be moved into this object. * * \param ppdu the PPDU - * \param txVector the TXVECTOR * \param duration duration of the PPDU * \param rxPower the received power per band (W) */ - Event(Ptr ppdu, - const WifiTxVector& txVector, - Time duration, - RxPowerWattPerChannelBand&& rxPower); + Event(Ptr ppdu, Time duration, RxPowerWattPerChannelBand&& rxPower); ~Event(); /** @@ -97,12 +93,6 @@ class Event : public SimpleRefCount * \return the received power (W) for all bands. */ const RxPowerWattPerChannelBand& GetRxPowerWPerBand() const; - /** - * Return the TXVECTOR of the PPDU. - * - * \return the TXVECTOR of the PPDU - */ - const WifiTxVector& GetTxVector() const; /** * Update the received power (W) for all bands, i.e. add up the received power * to the current received power, for each band. @@ -113,7 +103,6 @@ class Event : public SimpleRefCount private: Ptr m_ppdu; //!< PPDU - WifiTxVector m_txVector; //!< TXVECTOR Time m_startTime; //!< start time Time m_endTime; //!< end time RxPowerWattPerChannelBand m_rxPowerW; //!< received power in watts per band @@ -209,7 +198,6 @@ class InterferenceHelper : public Object * Add the PPDU-related signal to interference helper. * * \param ppdu the PPDU - * \param txVector the TXVECTOR * \param duration the PPDU duration * \param rxPower received power per band (W) * \param isStartHePortionRxing flag whether the event corresponds to the start of the HE @@ -218,7 +206,6 @@ class InterferenceHelper : public Object * \return Event */ Ptr Add(Ptr ppdu, - const WifiTxVector& txVector, Time duration, RxPowerWattPerChannelBand& rxPower, bool isStartHePortionRxing = false); diff --git a/src/wifi/model/non-ht/dsss-ppdu.cc b/src/wifi/model/non-ht/dsss-ppdu.cc index 621d3f64b..dce0244d2 100644 --- a/src/wifi/model/non-ht/dsss-ppdu.cc +++ b/src/wifi/model/non-ht/dsss-ppdu.cc @@ -80,7 +80,7 @@ DsssPpdu::SetTxVectorFromDsssHeader(WifiTxVector& txVector, const DsssSigHeader& Time DsssPpdu::GetTxDuration() const { - const WifiTxVector& txVector = GetTxVector(); + const auto& txVector = GetTxVector(); const auto length = m_dsssSig.GetLength(); return (MicroSeconds(length) + WifiPhy::CalculatePhyPreambleAndHeaderDuration(txVector)); } diff --git a/src/wifi/model/non-ht/ofdm-ppdu.cc b/src/wifi/model/non-ht/ofdm-ppdu.cc index 8d56c858f..0ce0f3d9c 100644 --- a/src/wifi/model/non-ht/ofdm-ppdu.cc +++ b/src/wifi/model/non-ht/ofdm-ppdu.cc @@ -83,7 +83,7 @@ OfdmPpdu::SetTxVectorFromLSigHeader(WifiTxVector& txVector, const LSigHeader& lS Time OfdmPpdu::GetTxDuration() const { - const WifiTxVector& txVector = GetTxVector(); + const auto& txVector = GetTxVector(); const auto length = m_lSig.GetLength(); NS_ASSERT(m_operatingChannel.IsSet()); return WifiPhy::CalculateTxDuration(length, txVector, m_operatingChannel.GetPhyBand()); diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index f63780227..f24ab1db7 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -295,7 +295,7 @@ PhyEntity::StartReceiveField(WifiPpduField field, Ptr event) NS_ABORT_MSG_IF(!supported, "Unknown field " << field << " for this PHY entity"); // TODO see what to do if not supported - Time duration = GetDuration(field, event->GetTxVector()); + Time duration = GetDuration(field, event->GetPpdu()->GetTxVector()); m_wifiPhy->m_endPhyRxEvent = Simulator::Schedule(duration, &PhyEntity::EndReceiveField, this, field, event); m_wifiPhy->NotifyCcaBusy( @@ -310,7 +310,7 @@ PhyEntity::EndReceiveField(WifiPpduField field, Ptr event) NS_ASSERT(m_wifiPhy); // no sense if no owner WifiPhy instance NS_ASSERT(m_wifiPhy->m_endPhyRxEvent.IsExpired()); PhyFieldRxStatus status = DoEndReceiveField(field, event); - WifiTxVector txVector = event->GetTxVector(); + const auto& txVector = event->GetPpdu()->GetTxVector(); if (status.isSuccess) // move to next field if reception succeeded { StartReceiveField(GetNextField(field, txVector.GetPreambleType()), event); @@ -358,7 +358,7 @@ PhyEntity::EndReceiveField(WifiPpduField field, Ptr event) Time PhyEntity::GetRemainingDurationAfterField(Ptr ppdu, WifiPpduField field) const { - const WifiTxVector& txVector = ppdu->GetTxVector(); + const auto& txVector = ppdu->GetTxVector(); return ppdu->GetTxDuration() - (GetDurationUpToField(field, txVector) + GetDuration(field, txVector)); } @@ -586,7 +586,7 @@ PhyEntity::DoStartReceivePayload(Ptr event) m_signalNoiseMap.insert({std::make_pair(ppdu->GetUid(), staId), SignalNoiseDbm()}); m_statusPerMpduMap.insert({std::make_pair(ppdu->GetUid(), staId), std::vector()}); ScheduleEndOfMpdus(event); - const WifiTxVector& txVector = event->GetTxVector(); + const auto& txVector = event->GetPpdu()->GetTxVector(); Time payloadDuration = ppdu->GetTxDuration() - CalculatePhyPreambleAndHeaderDuration(txVector); m_wifiPhy->m_phyRxPayloadBeginTrace( txVector, @@ -604,7 +604,7 @@ PhyEntity::ScheduleEndOfMpdus(Ptr event) NS_LOG_FUNCTION(this << *event); Ptr ppdu = event->GetPpdu(); Ptr psdu = GetAddressedPsduInPpdu(ppdu); - const WifiTxVector& txVector = event->GetTxVector(); + const auto& txVector = event->GetPpdu()->GetTxVector(); uint16_t staId = GetStaId(ppdu); Time endOfMpduDuration = NanoSeconds(0); Time relativeStart = NanoSeconds(0); @@ -668,8 +668,8 @@ PhyEntity::EndOfMpdu(Ptr event, Time mpduDuration) { NS_LOG_FUNCTION(this << *event << mpduIndex << relativeStart << mpduDuration); - Ptr ppdu = event->GetPpdu(); - WifiTxVector txVector = event->GetTxVector(); + const auto ppdu = event->GetPpdu(); + const auto& txVector = ppdu->GetTxVector(); uint16_t staId = GetStaId(ppdu); std::pair rxInfo = @@ -700,13 +700,14 @@ PhyEntity::EndOfMpdu(Ptr event, void PhyEntity::EndReceivePayload(Ptr event) { - Ptr ppdu = event->GetPpdu(); - WifiTxVector txVector = event->GetTxVector(); - Time psduDuration = ppdu->GetTxDuration() - CalculatePhyPreambleAndHeaderDuration(txVector); + const auto ppdu = event->GetPpdu(); + const auto& txVector = ppdu->GetTxVector(); + const auto psduDuration = + ppdu->GetTxDuration() - CalculatePhyPreambleAndHeaderDuration(txVector); NS_LOG_FUNCTION(this << *event << psduDuration); NS_ASSERT(event->GetEndTime() == Simulator::Now()); - uint16_t staId = GetStaId(ppdu); - const auto& channelWidthAndBand = GetChannelWidthAndBand(event->GetTxVector(), staId); + const auto staId = GetStaId(ppdu); + const auto channelWidthAndBand = GetChannelWidthAndBand(txVector, staId); double snr = m_wifiPhy->m_interference->CalculateSnr(event, channelWidthAndBand.first, txVector.GetNss(staId), @@ -786,7 +787,8 @@ PhyEntity::GetReceptionStatus(Ptr psdu, Time mpduDuration) { NS_LOG_FUNCTION(this << *psdu << *event << staId << relativeMpduStart << mpduDuration); - const auto& channelWidthAndBand = GetChannelWidthAndBand(event->GetTxVector(), staId); + const auto& channelWidthAndBand = + GetChannelWidthAndBand(event->GetPpdu()->GetTxVector(), staId); SnrPer snrPer = m_wifiPhy->m_interference->CalculatePayloadSnrPer( event, channelWidthAndBand.first, @@ -794,8 +796,8 @@ PhyEntity::GetReceptionStatus(Ptr psdu, staId, std::make_pair(relativeMpduStart, relativeMpduStart + mpduDuration)); - WifiMode mode = event->GetTxVector().GetMode(staId); - NS_LOG_DEBUG("rate=" << (mode.GetDataRate(event->GetTxVector(), staId)) + WifiMode mode = event->GetPpdu()->GetTxVector().GetMode(staId); + NS_LOG_DEBUG("rate=" << (mode.GetDataRate(event->GetPpdu()->GetTxVector(), staId)) << ", SNR(dB)=" << RatioToDb(snrPer.snr) << ", PER=" << snrPer.per << ", size=" << psdu->GetSize() << ", relativeStart = " << relativeMpduStart.As(Time::NS) @@ -886,11 +888,7 @@ PhyEntity::CreateInterferenceEvent(Ptr ppdu, RxPowerWattPerChannelBand& rxPower, bool isStartHePortionRxing /* = false */) { - return m_wifiPhy->m_interference->Add(ppdu, - ppdu->GetTxVector(), - duration, - rxPower, - isStartHePortionRxing); + return m_wifiPhy->m_interference->Add(ppdu, duration, rxPower, isStartHePortionRxing); } void @@ -1045,8 +1043,9 @@ PhyEntity::EndPreambleDetectionPeriod(Ptr event) m_wifiPhy->m_timeLastPreambleDetected = Simulator::Now(); // Continue receiving preamble - Time durationTillEnd = GetDuration(WIFI_PPDU_FIELD_PREAMBLE, event->GetTxVector()) - - m_wifiPhy->GetPreambleDetectionDuration(); + Time durationTillEnd = + GetDuration(WIFI_PPDU_FIELD_PREAMBLE, event->GetPpdu()->GetTxVector()) - + m_wifiPhy->GetPreambleDetectionDuration(); m_wifiPhy->NotifyCcaBusy(event->GetPpdu(), durationTillEnd); // will be prolonged by next field m_wifiPhy->m_endPhyRxEvent = Simulator::Schedule(durationTillEnd, diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index 71f4243e0..ebed6f75a 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -407,11 +407,10 @@ SpectrumWifiPhy::StartRx(Ptr rxParams, // Compare received TX power per MHz to normalized RX sensitivity const auto txWidth = wifiRxParams->txWidth; const auto& ppdu = GetRxPpduFromTxPpdu(wifiRxParams->ppdu); - const auto& txVector = ppdu->GetTxVector(); if (totalRxPowerW < DbmToW(GetRxSensitivity()) * (txWidth / 20.0)) { NS_LOG_INFO("Received signal too weak to process: " << WToDbm(totalRxPowerW) << " dBm"); - m_interference->Add(ppdu, txVector, rxDuration, rxPowerW); + m_interference->Add(ppdu, rxDuration, rxPowerW); SwitchMaybeToCcaBusy(nullptr); return; } @@ -421,7 +420,7 @@ SpectrumWifiPhy::StartRx(Ptr rxParams, if (!CanStartRx(ppdu, txWidth)) { NS_LOG_INFO("Cannot start reception of the PPDU, consider it as interference"); - m_interference->Add(ppdu, txVector, rxDuration, rxPowerW); + m_interference->Add(ppdu, rxDuration, rxPowerW); SwitchMaybeToCcaBusy(ppdu); return; } diff --git a/src/wifi/model/vht/vht-phy.cc b/src/wifi/model/vht/vht-phy.cc index 4edba093b..5ca0d4445 100644 --- a/src/wifi/model/vht/vht-phy.cc +++ b/src/wifi/model/vht/vht-phy.cc @@ -314,7 +314,7 @@ PhyEntity::PhyFieldRxStatus VhtPhy::ProcessSig(Ptr event, PhyFieldRxStatus status, WifiPpduField field) { NS_LOG_FUNCTION(this << *event << status << field); - NS_ASSERT(event->GetTxVector().GetPreambleType() >= WIFI_PREAMBLE_VHT_SU); + NS_ASSERT(event->GetPpdu()->GetTxVector().GetPreambleType() >= WIFI_PREAMBLE_VHT_SU); // TODO see if something should be done here once MU-MIMO is supported return status; // nothing special for VHT } diff --git a/src/wifi/model/vht/vht-ppdu.cc b/src/wifi/model/vht/vht-ppdu.cc index 50c5952b2..29c9a5a33 100644 --- a/src/wifi/model/vht/vht-ppdu.cc +++ b/src/wifi/model/vht/vht-ppdu.cc @@ -111,7 +111,7 @@ VhtPpdu::SetTxVectorFromPhyHeaders(WifiTxVector& txVector, Time VhtPpdu::GetTxDuration() const { - const WifiTxVector& txVector = GetTxVector(); + const auto& txVector = GetTxVector(); const auto length = m_lSig.GetLength(); const auto sgi = m_vhtSig.GetShortGuardInterval(); const auto sgiDisambiguation = m_vhtSig.GetShortGuardIntervalDisambiguation(); diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 07cba0bad..51e340b36 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -1874,7 +1874,7 @@ WifiPhy::StartReceivePreamble(Ptr ppdu, // TODO find a fallback PHY for receiving the PPDU (e.g. 11a for 11ax due to preamble // structure) NS_LOG_DEBUG("Unsupported modulation received (" << modulation << "), consider as noise"); - m_interference->Add(ppdu, ppdu->GetTxVector(), rxDuration, rxPowersW); + m_interference->Add(ppdu, rxDuration, rxPowersW); SwitchMaybeToCcaBusy(nullptr); } }