diff --git a/src/wifi/model/frame-exchange-manager.cc b/src/wifi/model/frame-exchange-manager.cc index 492b766f9..b1dfc62a4 100644 --- a/src/wifi/model/frame-exchange-manager.cc +++ b/src/wifi/model/frame-exchange-manager.cc @@ -907,8 +907,8 @@ FrameExchangeManager::NotifyInternalCollision (Ptr txop) // sent. As an approximation, we consider the frame peeked from the queues of the AC. Ptr qosTxop = (txop->IsQosTxop () ? StaticCast (txop) : nullptr); - Ptr mpdu = (qosTxop ? qosTxop->PeekNextMpdu () - : txop->GetWifiMacQueue ()->Peek ()); + auto mpdu = (qosTxop ? StaticCast (qosTxop->PeekNextMpdu ()) + : txop->GetWifiMacQueue ()->Peek ()); if (mpdu) { diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 151d24e15..57daf77a4 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1281,7 +1281,6 @@ HeFrameExchangeManager::ReceiveBasicTrigger (const CtrlTriggerHeader& trigger, c } } - Ptr mpdu; Ptr psdu; WifiTxParameters txParams; WifiTxVector tbTxVector = GetHeTbTxVector (trigger, hdr.GetAddr2 ()); @@ -1303,7 +1302,8 @@ HeFrameExchangeManager::ReceiveBasicTrigger (const CtrlTriggerHeader& trigger, c txParams.m_txVector = tbTxVector; // first, check if there is a pending BlockAckReq frame - if ((mpdu = edca->GetBaManager ()->GetBar (false, tid, hdr.GetAddr2 ())) + if (Ptr mpdu; + (mpdu = edca->GetBaManager ()->GetBar (false, tid, hdr.GetAddr2 ())) && TryAddMpdu (mpdu, txParams, ppduDuration)) { NS_LOG_DEBUG ("Sending a BAR within a TB PPDU"); @@ -1312,7 +1312,8 @@ HeFrameExchangeManager::ReceiveBasicTrigger (const CtrlTriggerHeader& trigger, c } // otherwise, check if a suitable data frame is available - if ((mpdu = edca->PeekNextMpdu (tid, hdr.GetAddr2 ()))) + if (Ptr mpdu; + (mpdu = edca->PeekNextMpdu (tid, hdr.GetAddr2 ()))) { Ptr item = edca->GetNextMpdu (mpdu, txParams, ppduDuration, false); diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 409718093..d0c4520bf 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -374,7 +374,7 @@ HtFrameExchangeManager::StartFrameExchange (Ptr edca, Time availableTim return true; } - Ptr peekedItem = edca->PeekNextMpdu (); + Ptr peekedItem = edca->PeekNextMpdu (); // Even though channel access is requested when the queue is not empty, at // the time channel access is granted the lifetime of the packet might be @@ -469,7 +469,7 @@ HtFrameExchangeManager::SendMpduFromBaManager (Ptr edca, Time available } bool -HtFrameExchangeManager::SendDataFrame (Ptr peekedItem, +HtFrameExchangeManager::SendDataFrame (Ptr peekedItem, Time availableTime, bool initialFrame) { NS_ASSERT (peekedItem && peekedItem->GetHeader ().IsQosData () diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.h b/src/wifi/model/ht/ht-frame-exchange-manager.h index 72d368aaa..73b59d544 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.h +++ b/src/wifi/model/ht/ht-frame-exchange-manager.h @@ -314,7 +314,7 @@ protected: * limit can be exceeded * \return true if frame is transmitted, false otherwise */ - virtual bool SendDataFrame (Ptr peekedItem, + virtual bool SendDataFrame (Ptr peekedItem, Time availableTime, bool initialFrame); /** diff --git a/src/wifi/model/mpdu-aggregator.cc b/src/wifi/model/mpdu-aggregator.cc index bc6ca2042..138926936 100644 --- a/src/wifi/model/mpdu-aggregator.cc +++ b/src/wifi/model/mpdu-aggregator.cc @@ -223,7 +223,7 @@ MpduAggregator::GetNextAmpdu (Ptr mpdu, WifiTxParameters& txPa mpduList.push_back (nextMpdu); // If allowed by the BA agreement, get the next MPDU - Ptr peekedMpdu; + Ptr peekedMpdu; peekedMpdu = qosTxop->PeekNextMpdu (tid, recipient, nextMpdu); nextMpdu = 0; diff --git a/src/wifi/model/qos-frame-exchange-manager.cc b/src/wifi/model/qos-frame-exchange-manager.cc index f87dcfdca..69bd306b7 100644 --- a/src/wifi/model/qos-frame-exchange-manager.cc +++ b/src/wifi/model/qos-frame-exchange-manager.cc @@ -264,7 +264,7 @@ QosFrameExchangeManager::StartFrameExchange (Ptr edca, Time availableTi { NS_LOG_FUNCTION (this << edca << availableTime << initialFrame); - Ptr mpdu = edca->PeekNextMpdu (); + Ptr mpdu = edca->PeekNextMpdu (); // Even though channel access is requested when the queue is not empty, at // the time channel access is granted the lifetime of the packet might be diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 611531893..c064043b3 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -352,13 +352,13 @@ QosTxop::IsQosOldPacket (Ptr mpdu) return false; } -Ptr -QosTxop::PeekNextMpdu (uint8_t tid, Mac48Address recipient, Ptr item) +Ptr +QosTxop::PeekNextMpdu (uint8_t tid, Mac48Address recipient, Ptr item) { NS_LOG_FUNCTION (this << +tid << recipient << item); // lambda to peek the next frame - auto peek = [this, &tid, &recipient, &item] () -> Ptr + auto peek = [this, &tid, &recipient, &item] () -> Ptr { if (tid == 8 && recipient.IsBroadcast ()) // undefined TID and recipient { @@ -439,7 +439,7 @@ QosTxop::PeekNextMpdu (uint8_t tid, Mac48Address recipient, Ptr -QosTxop::GetNextMpdu (Ptr peekedItem, WifiTxParameters& txParams, +QosTxop::GetNextMpdu (Ptr peekedItem, WifiTxParameters& txParams, Time availableTime, bool initialFrame) { NS_ASSERT (peekedItem); diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 4d197cd23..2366a12a6 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -308,9 +308,9 @@ public: * \param item the item after which the search starts from * \returns the peeked frame. */ - Ptr PeekNextMpdu (uint8_t tid = 8, - Mac48Address recipient = Mac48Address::GetBroadcast (), - Ptr item = nullptr); + Ptr PeekNextMpdu (uint8_t tid = 8, + Mac48Address recipient = Mac48Address::GetBroadcast (), + Ptr item = nullptr); /** * Prepare the frame to transmit starting from the MPDU that has been previously * peeked by calling PeekNextMpdu. A frame is only returned if it meets the @@ -329,7 +329,7 @@ public: * \param initialFrame true if the frame is the initial PPDU of a TXOP * \return the frame to transmit or a null pointer if no frame meets the time constraints */ - Ptr GetNextMpdu (Ptr peekedItem, WifiTxParameters& txParams, + Ptr GetNextMpdu (Ptr peekedItem, WifiTxParameters& txParams, Time availableTime, bool initialFrame); /** diff --git a/src/wifi/model/wifi-mac-queue.cc b/src/wifi/model/wifi-mac-queue.cc index e658b12bc..b2ecde7e9 100644 --- a/src/wifi/model/wifi-mac-queue.cc +++ b/src/wifi/model/wifi-mac-queue.cc @@ -222,7 +222,7 @@ WifiMacQueue::Peek (void) const return 0; } -Ptr +Ptr WifiMacQueue::PeekByAddress (Mac48Address dest, Ptr item) const { NS_LOG_FUNCTION (this << dest << item); @@ -248,7 +248,7 @@ WifiMacQueue::PeekByAddress (Mac48Address dest, Ptr item return nullptr; } -Ptr +Ptr WifiMacQueue::PeekByTid (uint8_t tid, Ptr item) const { NS_LOG_FUNCTION (this << +tid << item); @@ -273,7 +273,7 @@ WifiMacQueue::PeekByTid (uint8_t tid, Ptr item) const return nullptr; } -Ptr +Ptr WifiMacQueue::PeekByTidAndAddress (uint8_t tid, Mac48Address dest, Ptr item) const { NS_LOG_FUNCTION (this << +tid << dest << item); @@ -299,7 +299,7 @@ WifiMacQueue::PeekByTidAndAddress (uint8_t tid, Mac48Address dest, Ptr +Ptr WifiMacQueue::PeekFirstAvailable (const Ptr blockedPackets, Ptr item) const { diff --git a/src/wifi/model/wifi-mac-queue.h b/src/wifi/model/wifi-mac-queue.h index c86b5d107..3e62866b0 100644 --- a/src/wifi/model/wifi-mac-queue.h +++ b/src/wifi/model/wifi-mac-queue.h @@ -144,8 +144,8 @@ public: * * \return the peeked packet or nullptr if no packet was found */ - Ptr PeekByAddress (Mac48Address dest, - Ptr item = nullptr) const; + Ptr PeekByAddress (Mac48Address dest, + Ptr item = nullptr) const; /** * Search and return, if present in the queue, the first packet having the * TID equal to tid. If item is not a null pointer, the search @@ -158,8 +158,8 @@ public: * * \return the peeked packet or nullptr if no packet was found */ - Ptr PeekByTid (uint8_t tid, - Ptr item = nullptr) const; + Ptr PeekByTid (uint8_t tid, + Ptr item = nullptr) const; /** * Search and return, if present in the queue, the first packet having the * receiver address equal to dest, and TID equal to tid. @@ -175,8 +175,8 @@ public: * * \return the peeked packet or nullptr if no packet was found */ - Ptr PeekByTidAndAddress (uint8_t tid, Mac48Address dest, - Ptr item = nullptr) const; + Ptr PeekByTidAndAddress (uint8_t tid, Mac48Address dest, + Ptr item = nullptr) const; /** * Return first available packet for transmission. If item is not a null * pointer, the search starts from the packet following item in the queue; @@ -188,8 +188,8 @@ public: * * \return the peeked packet or nullptr if no packet was found */ - Ptr PeekFirstAvailable (const Ptr blockedPackets = nullptr, - Ptr item = nullptr) const; + Ptr PeekFirstAvailable (const Ptr blockedPackets = nullptr, + Ptr item = nullptr) const; /** * Remove the packet in the front of the queue. * diff --git a/src/wifi/test/wifi-aggregation-test.cc b/src/wifi/test/wifi-aggregation-test.cc index fb99a5e2f..a029f7aca 100644 --- a/src/wifi/test/wifi-aggregation-test.cc +++ b/src/wifi/test/wifi-aggregation-test.cc @@ -194,7 +194,7 @@ AmpduAggregationTest::DoRun (void) m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create (pkt, hdr)); - Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); + Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); WifiTxParameters txParams; txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); Ptr item = m_mac->GetBEQueue ()->GetNextMpdu (peeked, txParams, Time::Min (), true); @@ -425,7 +425,7 @@ TwoLevelAggregationTest::DoRun (void) m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create (Create (1500), hdr)); m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create (Create (1500), hdr)); - Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); + Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); WifiTxParameters txParams; txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); htFem->TryAddMpdu (peeked, txParams, Time::Min ()); @@ -689,7 +689,7 @@ HeAggregationTest::DoRunSubTest (uint16_t bufferSize) m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create (pkt, hdr)); } - Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); + Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); WifiTxParameters txParams; txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); Ptr item = m_mac->GetBEQueue ()->GetNextMpdu (peeked, txParams, Time::Min (), true); diff --git a/src/wifi/test/wifi-mac-ofdma-test.cc b/src/wifi/test/wifi-mac-ofdma-test.cc index 1521cd63b..13cfe9c1b 100644 --- a/src/wifi/test/wifi-mac-ofdma-test.cc +++ b/src/wifi/test/wifi-mac-ofdma-test.cc @@ -199,7 +199,7 @@ TestMultiUserScheduler::SelectTxFormat (void) for (auto& sta : staList) { - Ptr peeked = m_apMac->GetQosTxop (AC_BE)->PeekNextMpdu (0, sta.second); + Ptr peeked = m_apMac->GetQosTxop (AC_BE)->PeekNextMpdu (0, sta.second); if (!peeked) {