From 4dd21b151c465ff46d011e069782ee8ba518a96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Fri, 13 Jan 2017 20:10:40 +0100 Subject: [PATCH] wifi: (fixes #2601) HT stations use 40 MHz channel width if the configured channel width is set to 80 or 160 MHz --- RELEASE_NOTES | 1 + src/wifi/model/regular-wifi-mac.cc | 4 +-- src/wifi/model/wifi-mode.cc | 46 +++++++++++++++++++++--------- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 5f0dac292..ed9c41df6 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -61,6 +61,7 @@ Bugs fixed - Bug 2590 - Minor enhancements in red-queue-disc{.h, .cc} - Bug 2591 - 802.11e Block Ack mechanism cannot be enabled on HT/VHT stations - Bug 2594 - vht-wifi-network provides very low throughtput at MCS 6, 160 MHz, SGI +- Bug 2601 - HT stations should use 40 MHz channel width if the configured channel width is set to 80 or 160 MHz - Bug 2605 - A HT/VHT station transmitting to a legacy access point results in a null throughput - Bug 2607 - Minstrel HT manager results in an endless loop when a 802.11ac station is transmitting to a 802.11a access point - Bug 2614 - RIP header version should be set to 2 diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index 1dc35ffe4..d28e60008 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -146,9 +146,9 @@ RegularWifiMac::GetHtCapabilities (void) const capabilities.SetHtSupported (1); capabilities.SetHtSupported (1); capabilities.SetLdpc (m_phy->GetLdpc ()); - capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40); + capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40); capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval ()); - capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () == 40 && m_phy->GetGuardInterval ()); + capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetGuardInterval ()); capabilities.SetGreenfield (m_phy->GetGreenfield ()); capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD) capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ()); diff --git a/src/wifi/model/wifi-mode.cc b/src/wifi/model/wifi-mode.cc index b7642d8c1..71d369a25 100644 --- a/src/wifi/model/wifi-mode.cc +++ b/src/wifi/model/wifi-mode.cc @@ -210,21 +210,39 @@ WifiMode::GetDataRate (uint8_t channelWidth, bool isShortGuardInterval, uint8_t symbolRate = (1 / 3.6) * 1e6; } - switch (channelWidth) + if (item->modClass == WIFI_MOD_CLASS_HT) { - case 20: - default: - usableSubCarriers = 52; - break; - case 40: - usableSubCarriers = 108; - break; - case 80: - usableSubCarriers = 234; - break; - case 160: - usableSubCarriers = 468; - break; + switch (channelWidth) + { + case 20: + default: + usableSubCarriers = 52; + break; + case 40: + case 80: + case 160: + usableSubCarriers = 108; + break; + } + } + else //WIFI_MOD_CLASS_VHT + { + switch (channelWidth) + { + case 20: + default: + usableSubCarriers = 52; + break; + case 40: + usableSubCarriers = 108; + break; + case 80: + usableSubCarriers = 234; + break; + case 160: + usableSubCarriers = 468; + break; + } } switch (GetCodeRate ())