From ec0fb36d6a86a42e0929a59224a70b76d490368f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 26 Sep 2023 21:18:42 +0200 Subject: [PATCH] wifi: Pass reference instead of pointer to RecipientBlockAckAgreement::FillBlockAckBitmap --- src/wifi/model/he/he-frame-exchange-manager.cc | 2 +- src/wifi/model/ht/ht-frame-exchange-manager.cc | 2 +- src/wifi/model/recipient-block-ack-agreement.cc | 16 ++++++++-------- src/wifi/model/recipient-block-ack-agreement.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index b4841ffd2..2f66a259b 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1740,7 +1740,7 @@ HeFrameExchangeManager::SendMultiStaBlockAck(const WifiTxParameters& txParams, T auto agreement = m_mac->GetBaAgreementEstablishedAsRecipient(receiver, tid); NS_ASSERT(agreement); - agreement->get().FillBlockAckBitmap(&blockAck, index); + agreement->get().FillBlockAckBitmap(blockAck, index); NS_LOG_DEBUG("Multi-STA Block Ack: Sending Block Ack with seq=" << blockAck.GetStartingSequence(index) << " to=" << receiver << " tid=" << +tid); diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 854805d85..523c8f0c0 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -1485,7 +1485,7 @@ HtFrameExchangeManager::SendBlockAck(const RecipientBlockAckAgreement& agreement CtrlBAckResponseHeader blockAck; blockAck.SetType(agreement.GetBlockAckType()); blockAck.SetTidInfo(agreement.GetTid()); - agreement.FillBlockAckBitmap(&blockAck); + agreement.FillBlockAckBitmap(blockAck); Ptr packet = Create(); packet->AddHeader(blockAck); diff --git a/src/wifi/model/recipient-block-ack-agreement.cc b/src/wifi/model/recipient-block-ack-agreement.cc index 94673d8ee..95e8d05a6 100644 --- a/src/wifi/model/recipient-block-ack-agreement.cc +++ b/src/wifi/model/recipient-block-ack-agreement.cc @@ -218,20 +218,20 @@ RecipientBlockAckAgreement::NotifyReceivedBar(uint16_t startingSequenceNumber) } void -RecipientBlockAckAgreement::FillBlockAckBitmap(CtrlBAckResponseHeader* blockAckHeader, +RecipientBlockAckAgreement::FillBlockAckBitmap(CtrlBAckResponseHeader& blockAckHeader, std::size_t index) const { NS_LOG_FUNCTION(this << blockAckHeader << index); - if (blockAckHeader->IsBasic()) + if (blockAckHeader.IsBasic()) { NS_FATAL_ERROR("Basic block ack is not supported."); } - else if (blockAckHeader->IsMultiTid()) + else if (blockAckHeader.IsMultiTid()) { NS_FATAL_ERROR("Multi-tid block ack is not supported."); } - else if (blockAckHeader->IsCompressed() || blockAckHeader->IsExtendedCompressed() || - blockAckHeader->IsMultiSta()) + else if (blockAckHeader.IsCompressed() || blockAckHeader.IsExtendedCompressed() || + blockAckHeader.IsMultiSta()) { // The Starting Sequence Number subfield of the Block Ack Starting Sequence // Control subfield of the BlockAck frame shall be set to any value in the @@ -239,14 +239,14 @@ RecipientBlockAckAgreement::FillBlockAckBitmap(CtrlBAckResponseHeader* blockAckH // We set it to WinStartR uint16_t ssn = m_scoreboard.GetWinStart(); NS_LOG_DEBUG("SSN=" << ssn); - blockAckHeader->SetStartingSequence(ssn, index); - blockAckHeader->ResetBitmap(index); + blockAckHeader.SetStartingSequence(ssn, index); + blockAckHeader.ResetBitmap(index); for (std::size_t i = 0; i < m_scoreboard.GetWinSize(); i++) { if (m_scoreboard.At(i)) { - blockAckHeader->SetReceivedPacket((ssn + i) % SEQNO_SPACE_SIZE, index); + blockAckHeader.SetReceivedPacket((ssn + i) % SEQNO_SPACE_SIZE, index); } } } diff --git a/src/wifi/model/recipient-block-ack-agreement.h b/src/wifi/model/recipient-block-ack-agreement.h index 196c8d5d9..77e2ff09e 100644 --- a/src/wifi/model/recipient-block-ack-agreement.h +++ b/src/wifi/model/recipient-block-ack-agreement.h @@ -79,7 +79,7 @@ class RecipientBlockAckAgreement : public BlockAckAgreement * @param blockAckHeader the block ack header * @param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only) */ - void FillBlockAckBitmap(CtrlBAckResponseHeader* blockAckHeader, std::size_t index = 0) const; + void FillBlockAckBitmap(CtrlBAckResponseHeader& blockAckHeader, std::size_t index = 0) const; /** * This is called when a Block Ack agreement is destroyed to flush the * received packets.