diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index ab02754a8..ed4cd2d1a 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -143,6 +143,16 @@ ApWifiMac::SetAddress (Mac48Address address) RegularWifiMac::SetBssid (address); } +Ptr +ApWifiMac::GetTxopQueue (AcIndex ac) const +{ + if (ac == AC_BEACON) + { + return m_beaconTxop->GetWifiMacQueue (); + } + return RegularWifiMac::GetTxopQueue (ac); +} + void ApWifiMac::SetBeaconGeneration (bool enable) { diff --git a/src/wifi/model/ap-wifi-mac.h b/src/wifi/model/ap-wifi-mac.h index 7f0766cbd..27e720bf6 100644 --- a/src/wifi/model/ap-wifi-mac.h +++ b/src/wifi/model/ap-wifi-mac.h @@ -63,6 +63,7 @@ public: void Enqueue (Ptr packet, Mac48Address to, Mac48Address from) override; bool SupportsSendFrom (void) const override; void SetAddress (Mac48Address address) override; + Ptr GetTxopQueue (AcIndex ac) const override; /** * \param interval the interval between two beacon transmissions. diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index 96d89a38c..58375f5d3 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -37,6 +37,7 @@ #include #include "ns3/he-frame-exchange-manager.h" #include "channel-access-manager.h" +#include "wifi-mac-queue.h" namespace ns3 { @@ -532,6 +533,17 @@ RegularWifiMac::GetBKQueue () const return m_edca.find (AC_BK)->second; } +Ptr +RegularWifiMac::GetTxopQueue (AcIndex ac) const +{ + if (ac == AC_BE_NQOS) + { + return m_txop->GetWifiMacQueue (); + } + NS_ASSERT (ac == AC_BE || ac == AC_BK || ac == AC_VI || ac == AC_VO); + return m_edca.find (ac)->second->GetWifiMacQueue (); +} + void RegularWifiMac::SetWifiPhy (const Ptr phy) { diff --git a/src/wifi/model/regular-wifi-mac.h b/src/wifi/model/regular-wifi-mac.h index 2eb842f85..4419296b1 100644 --- a/src/wifi/model/regular-wifi-mac.h +++ b/src/wifi/model/regular-wifi-mac.h @@ -35,6 +35,7 @@ class ChannelAccessManager; class ExtendedCapabilities; class FrameExchangeManager; class WifiPsdu; +class WifiMacQueue; enum WifiTxTimerReason : uint8_t; typedef std::unordered_map /* PSDU */> WifiPsduMap; @@ -123,6 +124,13 @@ public: * \return a smart pointer to a QosTxop */ Ptr GetQosTxop (uint8_t tid) const; + /** + * Get the wifi MAC queue of the (Qos)Txop associated with the given AC. + * + * \param ac the given Access Category + * \return the wifi MAC queue of the (Qos)Txop associated with the given AC + */ + virtual Ptr GetTxopQueue (AcIndex ac) const; /** * Return whether the device supports QoS.