From 4e1524855e57c2623bdab3a8be1ca860446e9b47 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 3 Feb 2022 15:38:05 +0100 Subject: [PATCH] wifi: QosTxop does not need to store a pointer to FEM --- src/wave/model/ocb-wifi-mac.cc | 7 ------- src/wifi/model/qos-txop.cc | 14 +++----------- src/wifi/model/qos-txop.h | 8 -------- src/wifi/model/wifi-mac.cc | 7 ------- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/wave/model/ocb-wifi-mac.cc b/src/wave/model/ocb-wifi-mac.cc index b7dcf4573..379a90aa0 100644 --- a/src/wave/model/ocb-wifi-mac.cc +++ b/src/wave/model/ocb-wifi-mac.cc @@ -413,13 +413,6 @@ OcbWifiMac::ConfigureStandard (enum WifiStandard standard) m_feManager->SetMacRxMiddle (m_rxMiddle); m_feManager->SetAddress (GetAddress ()); m_channelAccessManager->SetupFrameExchangeManager (m_feManager); - if (GetQosSupported ()) - { - for (auto& ac : {AC_BE, AC_BK, AC_VI, AC_VO}) - { - GetQosTxop (ac)->SetQosFrameExchangeManager (DynamicCast (m_feManager)); - } - } } diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 254b3dc1f..8a16bdda3 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -125,7 +125,6 @@ QosTxop::DoDispose (void) } m_baManager = 0; m_qosBlockedDestinations = 0; - m_qosFem = 0; Txop::DoDispose (); } @@ -139,13 +138,6 @@ QosTxop::GetQosQueueSize (uint8_t tid, Mac48Address receiver) const return queueSize; } -void -QosTxop::SetQosFrameExchangeManager (const Ptr qosFem) -{ - NS_LOG_FUNCTION (this << qosFem); - m_qosFem = qosFem; -} - void QosTxop::SetDroppedMpduCallback (DroppedMpdu callback) { @@ -444,7 +436,6 @@ QosTxop::GetNextMpdu (Ptr peekedItem, WifiTxParameters& Time availableTime, bool initialFrame) { NS_ASSERT (peekedItem != 0); - NS_ASSERT (m_qosFem != 0); NS_LOG_FUNCTION (this << *peekedItem << &txParams << availableTime << initialFrame); Mac48Address recipient = peekedItem->GetHeader ().GetAddr1 (); @@ -455,7 +446,8 @@ QosTxop::GetNextMpdu (Ptr peekedItem, WifiTxParameters& Time actualAvailableTime = (initialFrame && txParams.GetSize (recipient) == 0 ? Time::Min () : availableTime); - if (!m_qosFem->TryAddMpdu (peekedItem, txParams, actualAvailableTime)) + auto qosFem = StaticCast (m_mac->GetFrameExchangeManager ()); + if (!qosFem->TryAddMpdu (peekedItem, txParams, actualAvailableTime)) { return nullptr; } @@ -482,7 +474,7 @@ QosTxop::GetNextMpdu (Ptr peekedItem, WifiTxParameters& && !peekedItem->GetHeader ().IsRetry () && !peekedItem->IsFragment () && !peekedItem->IsInFlight ()) { - Ptr htFem = StaticCast (m_qosFem); + auto htFem = StaticCast (qosFem); mpdu = htFem->GetMsduAggregator ()->GetNextAmsdu (peekedItem, txParams, availableTime); } diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 958f7f095..24f0e7cd9 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -92,13 +92,6 @@ public: void NotifyChannelReleased (void) override; void SetDroppedMpduCallback (DroppedMpdu callback) override; - /** - * Set the Frame Exchange Manager associated with this QoS STA. - * - * \param qosFem the associated QoS Frame Exchange Manager. - */ - void SetQosFrameExchangeManager (const Ptr qosFem); - /** * Get the access category of this object. * @@ -460,7 +453,6 @@ private: bool IsQosOldPacket (Ptr mpdu); AcIndex m_ac; //!< the access category - Ptr m_qosFem; //!< the QoS Frame Exchange Manager Ptr m_qosBlockedDestinations; //!< the QoS blocked destinations Ptr m_baManager; //!< the block ack manager uint8_t m_blockAckThreshold; /**< the block ack threshold (use BA mechanism if number of packets in queue reaches diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index b9aae0b3c..acc12b50b 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -736,13 +736,6 @@ WifiMac::SetupFrameExchangeManager (WifiStandard standard) m_feManager->SetAckedMpduCallback (MakeCallback (&MpduTracedCallback::operator(), &m_ackedMpduCallback)); m_channelAccessManager->SetupFrameExchangeManager (m_feManager); - if (GetQosSupported ()) - { - for (const auto& pair : m_edca) - { - pair.second->SetQosFrameExchangeManager (DynamicCast (m_feManager)); - } - } } Ptr