diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index 9a027ac8b..5ab4fb9ce 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -403,18 +403,6 @@ ApWifiMac::GetSupportedRates (void) const { NS_LOG_FUNCTION (this); SupportedRates rates; - //If it is an HT-AP or VHT-AP or HE-AP, then add the BSSMembershipSelectorSet - //The standard says that the BSSMembershipSelectorSet - //must have its MSB set to 1 (must be treated as a Basic Rate) - //Also the standard mentioned that at least 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates - if (GetHtSupported () || GetVhtSupported () || GetHeSupported ()) - { - for (uint8_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++) - { - rates.AddBssMembershipSelectorRate (m_phy->GetBssMembershipSelector (i)); - } - } - // //Send the set of supported rates and make sure that we indicate //the Basic Rate set in this set of supported rates. for (uint8_t i = 0; i < m_phy->GetNModes (); i++) @@ -440,7 +428,17 @@ ApWifiMac::GetSupportedRates (void) const NS_LOG_DEBUG ("Setting basic rate " << mode.GetUniqueName ()); rates.SetBasicRate (modeDataRate); } - + //If it is an HT-AP or VHT-AP or HE-AP, then add the BSSMembershipSelectorSet + //The standard says that the BSSMembershipSelectorSet + //must have its MSB set to 1 (must be treated as a Basic Rate) + //Also the standard mentioned that at least 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates + if (GetHtSupported () || GetVhtSupported () || GetHeSupported ()) + { + for (uint8_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++) + { + rates.AddBssMembershipSelectorRate (m_phy->GetBssMembershipSelector (i)); + } + } return rates; } diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index 16675e3f3..3e85f8cbd 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -1087,13 +1087,6 @@ SupportedRates StaWifiMac::GetSupportedRates (void) const { SupportedRates rates; - if (GetHtSupported () || GetVhtSupported () || GetHeSupported ()) - { - for (uint8_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++) - { - rates.AddBssMembershipSelectorRate (m_phy->GetBssMembershipSelector (i)); - } - } for (uint8_t i = 0; i < m_phy->GetNModes (); i++) { WifiMode mode = m_phy->GetMode (i); @@ -1101,6 +1094,13 @@ StaWifiMac::GetSupportedRates (void) const NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate); rates.AddSupportedRate (modeDataRate); } + if (GetHtSupported () || GetVhtSupported () || GetHeSupported ()) + { + for (uint8_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++) + { + rates.AddBssMembershipSelectorRate (m_phy->GetBssMembershipSelector (i)); + } + } return rates; } diff --git a/src/wifi/model/supported-rates.cc b/src/wifi/model/supported-rates.cc index b1b1854d9..8f6d251fb 100644 --- a/src/wifi/model/supported-rates.cc +++ b/src/wifi/model/supported-rates.cc @@ -101,7 +101,7 @@ SupportedRates::AddBssMembershipSelectorRate (uint64_t bs) { NS_ASSERT_MSG (false, "Value " << bs << " not a BSS Membership Selector"); } - uint8_t rate = (static_cast (bs / 500000) | 0x80); + uint8_t rate = static_cast (bs / 500000); for (uint8_t i = 0; i < m_nRates; i++) { if (rate == m_rates[i])