wifi: MAC configures PHY dependent parameters when setting the PHY
This is in preparation for the removal of the band from the wifi standard.
This commit is contained in:
@@ -544,7 +544,12 @@ MeshWifiInterfaceMac::ConfigureStandard (enum WifiStandard standard)
|
||||
NS_ABORT_IF (!GetQosSupported ());
|
||||
RegularWifiMac::ConfigureStandard (standard);
|
||||
m_standard = standard;
|
||||
}
|
||||
|
||||
void
|
||||
MeshWifiInterfaceMac::ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax)
|
||||
{
|
||||
RegularWifiMac::ConfigureContentionWindow (cwMin, cwMax);
|
||||
// We use the single DCF provided by WifiMac for the purpose of
|
||||
// Beacon transmission. For this we need to reconfigure the channel
|
||||
// access parameters slightly, and do so here.
|
||||
|
||||
@@ -192,6 +192,15 @@ public:
|
||||
* \param standard the WifiStandard being configured
|
||||
*/
|
||||
virtual void ConfigureStandard (enum WifiStandard standard);
|
||||
/**
|
||||
* \param cwMin the minimum contention window size
|
||||
* \param cwMax the maximum contention window size
|
||||
*
|
||||
* This method is called to set the minimum and the maximum
|
||||
* contention window size.
|
||||
*/
|
||||
virtual void ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax);
|
||||
|
||||
/**
|
||||
* Assign a fixed random variable stream number to the random variables
|
||||
* used by this model. Return the number of streams (possibly zero) that
|
||||
|
||||
@@ -563,6 +563,9 @@ RegularWifiMac::SetWifiPhy (const Ptr<WifiPhy> phy)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << phy);
|
||||
m_phy = phy;
|
||||
NS_ABORT_MSG_IF (!m_phy->GetOperatingChannel ().IsSet (),
|
||||
"PHY operating channel must have been set");
|
||||
ConfigurePhyDependentParameters ();
|
||||
m_channelAccessManager->SetupPhyListener (phy);
|
||||
NS_ASSERT (m_feManager != 0);
|
||||
m_feManager->SetWifiPhy (phy);
|
||||
@@ -1143,25 +1146,45 @@ void
|
||||
RegularWifiMac::ConfigureStandard (WifiStandard standard)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << standard);
|
||||
|
||||
NS_ABORT_IF (standard >= WIFI_STANDARD_80211n_2_4GHZ && !m_qosSupported);
|
||||
SetDsssSupported (standard == WIFI_STANDARD_80211b);
|
||||
|
||||
SetupFrameExchangeManager (standard);
|
||||
}
|
||||
|
||||
void
|
||||
RegularWifiMac::ConfigurePhyDependentParameters (void)
|
||||
{
|
||||
WifiPhyBand band = m_phy->GetPhyBand ();
|
||||
NS_LOG_FUNCTION (this << band);
|
||||
|
||||
uint32_t cwmin = 0;
|
||||
uint32_t cwmax = 0;
|
||||
switch (standard)
|
||||
// NOTE the distinction between wifi standard and wifi PHY standard will be removed soon...
|
||||
NS_ASSERT (m_phy != 0);
|
||||
WifiPhyStandard phyStandard = m_phy->GetPhyStandard ();
|
||||
|
||||
auto standardIt = std::find_if (wifiStandards.cbegin (), wifiStandards.cend (),
|
||||
[&phyStandard, &band](auto& pair)
|
||||
{
|
||||
return (pair.second.phyStandard == phyStandard
|
||||
&& pair.second.phyBand == band);
|
||||
});
|
||||
NS_ASSERT (standardIt != wifiStandards.cend ());
|
||||
switch (standardIt->first)
|
||||
{
|
||||
case WIFI_STANDARD_80211n_5GHZ:
|
||||
case WIFI_STANDARD_80211ac:
|
||||
case WIFI_STANDARD_80211ax_5GHZ:
|
||||
case WIFI_STANDARD_80211ax_6GHZ:
|
||||
{
|
||||
NS_ABORT_IF (!m_qosSupported);
|
||||
cwmin = 15;
|
||||
cwmax = 1023;
|
||||
break;
|
||||
}
|
||||
case WIFI_STANDARD_80211ax_2_4GHZ:
|
||||
case WIFI_STANDARD_80211n_2_4GHZ:
|
||||
{
|
||||
NS_ABORT_IF (!m_qosSupported);
|
||||
}
|
||||
case WIFI_STANDARD_80211g:
|
||||
SetErpSupported (true);
|
||||
case WIFI_STANDARD_80211a:
|
||||
@@ -1170,7 +1193,6 @@ RegularWifiMac::ConfigureStandard (WifiStandard standard)
|
||||
cwmax = 1023;
|
||||
break;
|
||||
case WIFI_STANDARD_80211b:
|
||||
SetDsssSupported (true);
|
||||
cwmin = 31;
|
||||
cwmax = 1023;
|
||||
break;
|
||||
@@ -1178,7 +1200,6 @@ RegularWifiMac::ConfigureStandard (WifiStandard standard)
|
||||
NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
|
||||
}
|
||||
|
||||
SetupFrameExchangeManager (standard);
|
||||
ConfigureContentionWindow (cwmin, cwmax);
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ protected:
|
||||
* This method is called to set the minimum and the maximum
|
||||
* contention window size.
|
||||
*/
|
||||
void ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax);
|
||||
virtual void ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax);
|
||||
|
||||
/**
|
||||
* This method acts as the MacRxMiddle receive callback and is
|
||||
@@ -406,6 +406,11 @@ private:
|
||||
*/
|
||||
void SetBkBlockAckInactivityTimeout (uint16_t timeout);
|
||||
|
||||
/**
|
||||
* Configure PHY dependent parameters such as CWmin and CWmax.
|
||||
*/
|
||||
void ConfigurePhyDependentParameters (void);
|
||||
|
||||
TypeOfStation m_typeOfStation; //!< the type of station
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,7 +126,7 @@ WifiMac::NotifyRxDrop (Ptr<const Packet> packet)
|
||||
void
|
||||
WifiMac::ConfigureDcf (Ptr<Txop> dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << dcf << cwmin << cwmax << isDsss << ac);
|
||||
NS_LOG_FUNCTION (this << dcf << cwmin << cwmax << isDsss << +ac);
|
||||
/* see IEEE 802.11 section 7.3.2.29 */
|
||||
switch (ac)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user