wifi: WifiMac creates FEM based on the configured standard

This commit is contained in:
Stefano Avallone
2021-11-18 12:15:18 +01:00
parent 7c3c3f4980
commit 58f00a3677
2 changed files with 10 additions and 7 deletions

View File

@@ -114,23 +114,24 @@ RegularWifiMac::DoDispose ()
}
void
RegularWifiMac::SetupFrameExchangeManager (void)
RegularWifiMac::SetupFrameExchangeManager (WifiStandard standard)
{
NS_LOG_FUNCTION (this);
NS_ABORT_MSG_IF (standard == WIFI_STANDARD_UNSPECIFIED, "Wifi standard not set");
if (GetHeSupported ())
if (standard >= WIFI_STANDARD_80211ax_2_4GHZ)
{
m_feManager = CreateObject<HeFrameExchangeManager> ();
}
else if (GetVhtSupported ())
else if (standard >= WIFI_STANDARD_80211ac)
{
m_feManager = CreateObject<VhtFrameExchangeManager> ();
}
else if (GetHtSupported ())
else if (standard >= WIFI_STANDARD_80211n_2_4GHZ)
{
m_feManager = CreateObject<HtFrameExchangeManager> ();
}
else if (GetQosSupported ())
else if (m_qosSupported)
{
m_feManager = CreateObject<QosFrameExchangeManager> ();
}
@@ -1177,7 +1178,7 @@ RegularWifiMac::ConfigureStandard (WifiStandard standard)
NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
}
SetupFrameExchangeManager ();
SetupFrameExchangeManager (standard);
ConfigureContentionWindow (cwmin, cwmax);
}

View File

@@ -318,8 +318,10 @@ protected:
/**
* Create a Frame Exchange Manager depending on the supported version
* of the standard.
*
* \param standard the supported version of the standard
*/
void SetupFrameExchangeManager (void);
void SetupFrameExchangeManager (WifiStandard standard);
/**
* Enable or disable ERP support for the device.