From be042d89684ffca5eae07b9d7738d28a09f6ffbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sat, 5 Sep 2015 15:53:37 +0200 Subject: [PATCH] Better visibility in if conditions --- src/wifi/model/aarf-wifi-manager.cc | 4 ++-- src/wifi/model/aarfcd-wifi-manager.cc | 4 ++-- src/wifi/model/amrr-wifi-manager.cc | 4 ++-- src/wifi/model/aparf-wifi-manager.cc | 4 ++-- src/wifi/model/arf-wifi-manager.cc | 4 ++-- src/wifi/model/cara-wifi-manager.cc | 4 ++-- src/wifi/model/ideal-wifi-manager.cc | 4 ++-- src/wifi/model/minstrel-wifi-manager.cc | 4 ++-- src/wifi/model/onoe-wifi-manager.cc | 4 ++-- src/wifi/model/parf-wifi-manager.cc | 4 ++-- src/wifi/model/rraa-wifi-manager.cc | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/wifi/model/aarf-wifi-manager.cc b/src/wifi/model/aarf-wifi-manager.cc index 7cf30d760..784a1c071 100644 --- a/src/wifi/model/aarf-wifi-manager.cc +++ b/src/wifi/model/aarf-wifi-manager.cc @@ -233,7 +233,7 @@ AarfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) NS_LOG_FUNCTION (this << st << size); AarfWifiRemoteStation *station = (AarfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -249,7 +249,7 @@ AarfWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) /// RTS only by picking a single rate within the BasicRateSet. AarfWifiRemoteStation *station = (AarfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/aarfcd-wifi-manager.cc b/src/wifi/model/aarfcd-wifi-manager.cc index 5006fb0de..aa3738499 100644 --- a/src/wifi/model/aarfcd-wifi-manager.cc +++ b/src/wifi/model/aarfcd-wifi-manager.cc @@ -305,7 +305,7 @@ AarfcdWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) NS_LOG_FUNCTION (this << st << size); AarfcdWifiRemoteStation *station = (AarfcdWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -321,7 +321,7 @@ AarfcdWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) /// RTS only by picking a single rate within the BasicRateSet. AarfcdWifiRemoteStation *station = (AarfcdWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/amrr-wifi-manager.cc b/src/wifi/model/amrr-wifi-manager.cc index 3fb5a0612..da63ec8fb 100644 --- a/src/wifi/model/amrr-wifi-manager.cc +++ b/src/wifi/model/amrr-wifi-manager.cc @@ -336,7 +336,7 @@ AmrrWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) } } uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -350,7 +350,7 @@ AmrrWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) NS_LOG_FUNCTION (this << st); AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/aparf-wifi-manager.cc b/src/wifi/model/aparf-wifi-manager.cc index c62929c71..fb4bdf9ab 100644 --- a/src/wifi/model/aparf-wifi-manager.cc +++ b/src/wifi/model/aparf-wifi-manager.cc @@ -323,7 +323,7 @@ AparfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) NS_LOG_FUNCTION (this << st << size); AparfWifiRemoteStation *station = (AparfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -340,7 +340,7 @@ AparfWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) /// RTS only by picking a single rate within the BasicRateSet. AparfWifiRemoteStation *station = (AparfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/arf-wifi-manager.cc b/src/wifi/model/arf-wifi-manager.cc index 6b920c841..fbd6c824d 100644 --- a/src/wifi/model/arf-wifi-manager.cc +++ b/src/wifi/model/arf-wifi-manager.cc @@ -209,7 +209,7 @@ ArfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) NS_LOG_FUNCTION (this << st << size); ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -225,7 +225,7 @@ ArfWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) /// RTS only by picking a single rate within the BasicRateSet. ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/cara-wifi-manager.cc b/src/wifi/model/cara-wifi-manager.cc index 5b9287b03..3dcc18ef7 100644 --- a/src/wifi/model/cara-wifi-manager.cc +++ b/src/wifi/model/cara-wifi-manager.cc @@ -184,7 +184,7 @@ CaraWifiManager::DoGetDataTxVector (WifiRemoteStation *st, NS_LOG_FUNCTION (this << st << size); CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -200,7 +200,7 @@ CaraWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) /// \todo we could/should implement the Arf algorithm for /// RTS only by picking a single rate within the BasicRateSet. uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index 78cf82f26..8384d1b07 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -170,7 +170,7 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) } } uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -199,7 +199,7 @@ IdealWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) } } uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/minstrel-wifi-manager.cc b/src/wifi/model/minstrel-wifi-manager.cc index 624921e47..077e81653 100644 --- a/src/wifi/model/minstrel-wifi-manager.cc +++ b/src/wifi/model/minstrel-wifi-manager.cc @@ -475,7 +475,7 @@ MinstrelWifiManager::DoGetDataTxVector (WifiRemoteStation *st, { MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -497,7 +497,7 @@ MinstrelWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st; NS_LOG_DEBUG ("DoGetRtsMode m_txrate=" << station->m_txrate); uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/onoe-wifi-manager.cc b/src/wifi/model/onoe-wifi-manager.cc index 373b0b2ce..71b2fecd8 100644 --- a/src/wifi/model/onoe-wifi-manager.cc +++ b/src/wifi/model/onoe-wifi-manager.cc @@ -279,7 +279,7 @@ OnoeWifiManager::DoGetDataTxVector (WifiRemoteStation *st, } } uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -292,7 +292,7 @@ OnoeWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) { OnoeWifiRemoteStation *station = (OnoeWifiRemoteStation *)st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/parf-wifi-manager.cc b/src/wifi/model/parf-wifi-manager.cc index 5142edaef..39cda612a 100644 --- a/src/wifi/model/parf-wifi-manager.cc +++ b/src/wifi/model/parf-wifi-manager.cc @@ -295,7 +295,7 @@ ParfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size) NS_LOG_FUNCTION (this << st << size); ParfWifiRemoteStation *station = (ParfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -312,7 +312,7 @@ ParfWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) /// RTS only by picking a single rate within the BasicRateSet. ParfWifiRemoteStation *station = (ParfWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; diff --git a/src/wifi/model/rraa-wifi-manager.cc b/src/wifi/model/rraa-wifi-manager.cc index f9723cf1f..5760a0b7e 100644 --- a/src/wifi/model/rraa-wifi-manager.cc +++ b/src/wifi/model/rraa-wifi-manager.cc @@ -287,7 +287,7 @@ RraaWifiManager::DoGetDataTxVector (WifiRemoteStation *st, { RraaWifiRemoteStation *station = (RraaWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20; @@ -304,7 +304,7 @@ RraaWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) { RraaWifiRemoteStation *station = (RraaWifiRemoteStation *) st; uint32_t channelWidth = GetChannelWidth (station); - if (channelWidth >= 40) + if (channelWidth > 20 && channelWidth != 22) { //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac channelWidth = 20;