Add checks when setting the HT and VHT capabilities; fix issue when a 20MHz channel width is selected in 802.11ac

This commit is contained in:
Sébastien Deronne
2015-11-07 21:32:56 +01:00
parent c0e874e0d3
commit a73970b783
2 changed files with 8 additions and 4 deletions

View File

@@ -362,7 +362,8 @@ ApWifiMac::GetHtCapabilities (void) const
{
WifiMode mcs = m_phy->GetMcs (i);
capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1) > maxSupportedRate)
if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_HT)
&& (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1) > maxSupportedRate))
{
maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1);
}
@@ -398,7 +399,8 @@ ApWifiMac::GetVhtCapabilities (void) const
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetMcsValue () > maxMcs)
if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT)
&& (mcs.GetMcsValue () > maxMcs))
{
maxMcs = mcs.GetMcsValue ();
}

View File

@@ -686,7 +686,8 @@ StaWifiMac::GetHtCapabilities (void) const
{
WifiMode mcs = m_phy->GetMcs (i);
capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1) > maxSupportedRate)
if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_HT)
&& (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1) > maxSupportedRate))
{
maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1);
}
@@ -722,7 +723,8 @@ StaWifiMac::GetVhtCapabilities (void) const
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetMcsValue () > maxMcs)
if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT)
&& (mcs.GetMcsValue () > maxMcs))
{
maxMcs = mcs.GetMcsValue ();
}