From de42170ff2c14c21b68be8fb73ad16fbade0ce78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 1 Apr 2018 10:53:05 +0200 Subject: [PATCH] wifi: Cleanup SupportedRates --- src/wifi/model/supported-rates.cc | 34 +++++-------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/src/wifi/model/supported-rates.cc b/src/wifi/model/supported-rates.cc index 61d1efa17..5d00e43cb 100644 --- a/src/wifi/model/supported-rates.cc +++ b/src/wifi/model/supported-rates.cc @@ -61,37 +61,13 @@ SupportedRates::AddSupportedRate (uint32_t bs) NS_LOG_FUNCTION (this << bs); NS_ASSERT_MSG (IsBssMembershipSelectorRate (bs) == false, "Invalid rate"); NS_ASSERT (m_nRates < MAX_SUPPORTED_RATES); - if (bs == BSS_MEMBERSHIP_SELECTOR_HT_PHY) + if (IsSupportedRate (bs)) { - // Encoding defined in Sec. 8.4.2.3, IEEE 802.11-2012 - m_rates[m_nRates] = (BSS_MEMBERSHIP_SELECTOR_HT_PHY | 0x80); - m_nRates++; - NS_LOG_DEBUG ("add HT_PHY membership selector"); - } - else if (bs == BSS_MEMBERSHIP_SELECTOR_VHT_PHY) - { - // Encoding defined in Sec. 8.4.2.3, IEEE 802.11-2012 - m_rates[m_nRates] = (BSS_MEMBERSHIP_SELECTOR_VHT_PHY | 0x80); - m_nRates++; - NS_LOG_DEBUG ("add VHT_PHY membership selector"); - } - else if (bs == BSS_MEMBERSHIP_SELECTOR_HE_PHY) - { - // Encoding defined in Sec. 8.4.2.3, IEEE 802.11-2012 - m_rates[m_nRates] = (BSS_MEMBERSHIP_SELECTOR_HE_PHY | 0x80); - m_nRates++; - NS_LOG_DEBUG ("add HE_PHY membership selector"); - } - else - { - if (IsSupportedRate (bs)) - { - return; - } - m_rates[m_nRates] = bs / 500000; - m_nRates++; - NS_LOG_DEBUG ("add rate=" << bs << ", n rates=" << +m_nRates); + return; } + m_rates[m_nRates] = bs / 500000; + m_nRates++; + NS_LOG_DEBUG ("add rate=" << bs << ", n rates=" << +m_nRates); } void