wifi: Pass BlockAck header as const reference rather than pointer

This commit is contained in:
Stefano Avallone
2021-04-21 20:05:02 +02:00
parent c28e2fdb48
commit c975eb6425
4 changed files with 12 additions and 12 deletions

View File

@@ -456,19 +456,19 @@ BlockAckManager::NotifyMissedAck (Ptr<WifiMacQueueItem> mpdu)
}
void
BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient,
BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader& blockAck, Mac48Address recipient,
const std::set<uint8_t>& tids, double rxSnr, double dataSnr,
const WifiTxVector& dataTxVector, size_t index)
{
NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataTxVector << index);
if (!blockAck->IsMultiTid ())
if (!blockAck.IsMultiTid ())
{
uint8_t tid = blockAck->GetTidInfo (index);
uint8_t tid = blockAck.GetTidInfo (index);
// If this is a Multi-STA Block Ack with All-ack context (TID equal to 14),
// use the TID passed by the caller.
if (tid == 14)
{
NS_ASSERT (blockAck->GetAckType (index) && tids.size () == 1);
NS_ASSERT (blockAck.GetAckType (index) && tids.size () == 1);
tid = *tids.begin ();
}
if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED))
@@ -495,12 +495,12 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4
uint16_t currentStartingSeq = it->second.first.GetStartingSequence ();
uint16_t currentSeq = SEQNO_SPACE_SIZE; // invalid value
if (blockAck->IsBasic ())
if (blockAck.IsBasic ())
{
for (PacketQueueI queueIt = it->second.second.begin (); queueIt != queueEnd; )
{
currentSeq = (*queueIt)->GetHeader ().GetSequenceNumber ();
if (blockAck->IsFragmentReceived (currentSeq,
if (blockAck.IsFragmentReceived (currentSeq,
(*queueIt)->GetHeader ().GetFragmentNumber ()))
{
nSuccessfulMpdus++;
@@ -524,12 +524,12 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4
RemoveOldPackets (recipient, tid, (currentSeq + 1) % SEQNO_SPACE_SIZE);
}
}
else if (blockAck->IsCompressed () || blockAck->IsExtendedCompressed () || blockAck->IsMultiSta ())
else if (blockAck.IsCompressed () || blockAck.IsExtendedCompressed () || blockAck.IsMultiSta ())
{
for (PacketQueueI queueIt = it->second.second.begin (); queueIt != queueEnd; )
{
currentSeq = (*queueIt)->GetHeader ().GetSequenceNumber ();
if (blockAck->IsPacketReceived (currentSeq, index))
if (blockAck.IsPacketReceived (currentSeq, index))
{
it->second.first.NotifyAckedMpdu (*queueIt);
nSuccessfulMpdus++;

View File

@@ -208,7 +208,7 @@ public:
* Note that <i>tids</i> is only used if <i>blockAck</i> is a Multi-STA Block Ack
* using All-ack context.
*/
void NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient,
void NotifyGotBlockAck (const CtrlBAckResponseHeader& blockAck, Mac48Address recipient,
const std::set<uint8_t>& tids, double rxSnr, double dataSnr,
const WifiTxVector& dataTxVector, size_t index = 0);
/**

View File

@@ -1431,7 +1431,7 @@ HeFrameExchangeManager::ReceiveMpdu (Ptr<WifiMacQueueItem> mpdu, RxSignalInfo rx
CtrlBAckResponseHeader blockAck;
mpdu->GetPacket ()->PeekHeader (blockAck);
uint8_t tid = blockAck.GetTidInfo ();
GetBaManager (tid)->NotifyGotBlockAck (&blockAck, hdr.GetAddr2 (), {tid}, rxSignalInfo.snr,
GetBaManager (tid)->NotifyGotBlockAck (blockAck, hdr.GetAddr2 (), {tid}, rxSignalInfo.snr,
tag.Get (), m_txParams.m_txVector);
// remove the sender from the set of stations that are expected to send a BlockAck
@@ -1500,7 +1500,7 @@ HeFrameExchangeManager::ReceiveMpdu (Ptr<WifiMacQueueItem> mpdu, RxSignalInfo rx
tid = *tids.begin ();
}
GetBaManager (tid)->NotifyGotBlockAck (&blockAck, hdr.GetAddr2 (), {tid},
GetBaManager (tid)->NotifyGotBlockAck (blockAck, hdr.GetAddr2 (), {tid},
rxSignalInfo.snr, tag.Get (staId),
m_txParams.m_txVector, index);
}

View File

@@ -1338,7 +1338,7 @@ HtFrameExchangeManager::ReceiveMpdu (Ptr<WifiMacQueueItem> mpdu, RxSignalInfo rx
CtrlBAckResponseHeader blockAck;
mpdu->GetPacket ()->PeekHeader (blockAck);
uint8_t tid = blockAck.GetTidInfo ();
GetBaManager (tid)->NotifyGotBlockAck (&blockAck, hdr.GetAddr2 (), {tid}, rxSnr,
GetBaManager (tid)->NotifyGotBlockAck (blockAck, hdr.GetAddr2 (), {tid}, rxSnr,
tag.Get (), m_txParams.m_txVector);
// cancel the timer