diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index c95352f65..444923020 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -363,24 +363,24 @@ QosTxop::IsQosOldPacket(Ptr mpdu) } Ptr -QosTxop::PeekNextMpdu(uint8_t linkId, uint8_t tid, Mac48Address recipient, Ptr item) +QosTxop::PeekNextMpdu(uint8_t linkId, uint8_t tid, Mac48Address recipient, Ptr mpdu) { - NS_LOG_FUNCTION(this << +linkId << +tid << recipient << item); + NS_LOG_FUNCTION(this << +linkId << +tid << recipient << mpdu); // lambda to peek the next frame - auto peek = [this, &linkId, &tid, &recipient, &item]() -> Ptr { + auto peek = [this, &linkId, &tid, &recipient, &mpdu]() -> Ptr { if (tid == 8 && recipient.IsBroadcast()) // undefined TID and recipient { - return m_queue->PeekFirstAvailable(linkId, m_qosBlockedDestinations, item); + return m_queue->PeekFirstAvailable(linkId, m_qosBlockedDestinations, mpdu); } if (m_qosBlockedDestinations->IsBlocked(recipient, tid)) { return nullptr; } - return m_queue->PeekByTidAndAddress(tid, recipient, item); + return m_queue->PeekByTidAndAddress(tid, recipient, mpdu); }; - item = peek(); + auto item = peek(); // remove old packets (must be retransmissions or in flight, otherwise they did // not get a sequence number assigned) while (item && !item->IsFragment()) @@ -392,9 +392,9 @@ QosTxop::PeekNextMpdu(uint8_t linkId, uint8_t tid, Mac48Address recipient, PtrRemove(oldItem); + m_queue->Remove(mpdu); continue; } @@ -418,6 +418,7 @@ QosTxop::PeekNextMpdu(uint8_t linkId, uint8_t tid, Mac48Address recipient, PtrCanForwardPacketsTo(item->GetHeader().GetAddr1())) { NS_LOG_DEBUG("Skipping frame that cannot be forwarded: " << *item); + mpdu = item; item = peek(); continue; } diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 2f5a686af..c4f258025 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -271,8 +271,8 @@ class QosTxop : public Txop /** * Peek the next frame to transmit on the given link to the given receiver and of the given TID * from the EDCA queue. If tid is equal to 8 (invalid value) and recipient - * is the broadcast address, the first available frame is returned. If item - * is not a null pointer, the search starts from the packet following item + * is the broadcast address, the first available frame is returned. If mpdu + * is not a null pointer, the search starts from the MPDU following mpdu * in the queue; otherwise, the search starts from the head of the queue. * Note that A-MSDU aggregation is never attempted. If the frame has never been * transmitted, it is assigned a sequence number peeked from MacTxMiddle. @@ -281,13 +281,13 @@ class QosTxop : public Txop * \param linkId the ID of the given link * \param tid traffic ID. * \param recipient the receiver station address. - * \param item the item after which the search starts from + * \param mpdu the MPDU after which the search starts from * \returns the peeked frame. */ Ptr PeekNextMpdu(uint8_t linkId, uint8_t tid = 8, Mac48Address recipient = Mac48Address::GetBroadcast(), - Ptr item = nullptr); + Ptr mpdu = nullptr); /** * Prepare the frame to transmit on the given link starting from the MPDU that has been * previously peeked by calling PeekNextMpdu. A frame is only returned if it meets the