wifi: Add a RegularWifiMac method to return a specified MAC queue

This commit is contained in:
Stefano Avallone
2021-09-19 18:49:41 +02:00
committed by Stefano Avallone
parent 39947f3cac
commit 97c888cd55
4 changed files with 31 additions and 0 deletions

View File

@@ -143,6 +143,16 @@ ApWifiMac::SetAddress (Mac48Address address)
RegularWifiMac::SetBssid (address);
}
Ptr<WifiMacQueue>
ApWifiMac::GetTxopQueue (AcIndex ac) const
{
if (ac == AC_BEACON)
{
return m_beaconTxop->GetWifiMacQueue ();
}
return RegularWifiMac::GetTxopQueue (ac);
}
void
ApWifiMac::SetBeaconGeneration (bool enable)
{

View File

@@ -63,6 +63,7 @@ public:
void Enqueue (Ptr<Packet> packet, Mac48Address to, Mac48Address from) override;
bool SupportsSendFrom (void) const override;
void SetAddress (Mac48Address address) override;
Ptr<WifiMacQueue> GetTxopQueue (AcIndex ac) const override;
/**
* \param interval the interval between two beacon transmissions.

View File

@@ -37,6 +37,7 @@
#include <cmath>
#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<WifiMacQueue>
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<WifiPhy> phy)
{

View File

@@ -35,6 +35,7 @@ class ChannelAccessManager;
class ExtendedCapabilities;
class FrameExchangeManager;
class WifiPsdu;
class WifiMacQueue;
enum WifiTxTimerReason : uint8_t;
typedef std::unordered_map <uint16_t /* staId */, Ptr<WifiPsdu> /* PSDU */> WifiPsduMap;
@@ -123,6 +124,13 @@ public:
* \return a smart pointer to a QosTxop
*/
Ptr<QosTxop> 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<WifiMacQueue> GetTxopQueue (AcIndex ac) const;
/**
* Return whether the device supports QoS.