wifi: Enable setting the max modulation class supported by PHY

This commit is contained in:
Stefano Avallone
2023-06-07 17:29:08 +02:00
committed by Stefano Avallone
parent 1b1654536d
commit 8558da228b
2 changed files with 39 additions and 4 deletions

View File

@@ -349,6 +349,7 @@ WifiPhy::WifiPhy()
m_currentEvent(nullptr),
m_previouslyRxPpduUid(UINT64_MAX),
m_standard(WIFI_STANDARD_UNSPECIFIED),
m_maxModClassSupported(WIFI_MOD_CLASS_UNKNOWN),
m_band(WIFI_PHY_BAND_UNSPECIFIED),
m_sifs(Seconds(0)),
m_slot(Seconds(0)),
@@ -946,6 +947,19 @@ WifiPhy::Configure80211be()
AddPhyEntity(WIFI_MOD_CLASS_EHT, Create<EhtPhy>());
}
void
WifiPhy::SetMaxModulationClassSupported(WifiModulationClass modClass)
{
NS_LOG_FUNCTION(this << modClass);
m_maxModClassSupported = modClass;
}
WifiModulationClass
WifiPhy::GetMaxModulationClassSupported() const
{
return m_maxModClassSupported;
}
void
WifiPhy::ConfigureStandard(WifiStandard standard)
{
@@ -956,6 +970,11 @@ WifiPhy::ConfigureStandard(WifiStandard standard)
m_standard = standard;
if (m_maxModClassSupported == WIFI_MOD_CLASS_UNKNOWN)
{
m_maxModClassSupported = GetModulationClassForStandard(m_standard);
}
if (!m_operatingChannel.IsSet())
{
NS_LOG_DEBUG("Setting the operating channel first");
@@ -1864,8 +1883,9 @@ WifiPhy::StartReceivePreamble(Ptr<const WifiPpdu> ppdu,
{
NS_LOG_FUNCTION(this << ppdu << rxDuration);
WifiModulationClass modulation = ppdu->GetModulation();
auto it = m_phyEntities.find(modulation);
if (it != m_phyEntities.end())
NS_ASSERT(m_maxModClassSupported != WIFI_MOD_CLASS_UNKNOWN);
if (auto it = m_phyEntities.find(modulation);
it != m_phyEntities.end() && modulation <= m_maxModClassSupported)
{
it->second->StartReceivePreamble(ppdu, rxPowersW, rxDuration);
}

View File

@@ -508,6 +508,20 @@ class WifiPhy : public Object
*/
virtual void ConfigureStandard(WifiStandard standard);
/**
* Set the maximum modulation class that has to be supported by this PHY object.
* The maximum modulation class supported will be the minimum between the given modulation
* class and the maximum modulation class supported based on the configured standard.
*
* \param modClass the given modulation class
*/
void SetMaxModulationClassSupported(WifiModulationClass modClass);
/**
* \return the maximum modulation class that has to be supported by this PHY object.
*/
WifiModulationClass GetMaxModulationClassSupported() const;
/**
* Get the configured Wi-Fi standard
*
@@ -1470,8 +1484,9 @@ class WifiPhy : public Object
*/
static std::map<WifiModulationClass, Ptr<PhyEntity>>& GetStaticPhyEntities();
WifiStandard m_standard; //!< WifiStandard
WifiPhyBand m_band; //!< WifiPhyBand
WifiStandard m_standard; //!< WifiStandard
WifiModulationClass m_maxModClassSupported; //!< max modulation class supported
WifiPhyBand m_band; //!< WifiPhyBand
ChannelTuple m_channelSettings; //!< Store operating channel settings until initialization
WifiPhyOperatingChannel m_operatingChannel; //!< Operating channel
bool m_fixedPhyBand; //!< True to prohibit changing PHY band after initialization