wifi: (fixes #2337) Replace channel width value units in MHz in WifiPhy (reported by Ali Rostami)
authorSébastien Deronne <sebastien.deronne@gmail.com>
Tue, 15 Mar 2016 23:51:42 +0100
changeset 12050 589b138eb7f6
parent 12049 8d1dd0a2672e
child 12051 9bcd3ffec807
wifi: (fixes #2337) Replace channel width value units in MHz in WifiPhy (reported by Ali Rostami)
RELEASE_NOTES
src/wifi/model/wifi-phy.cc
--- a/RELEASE_NOTES	Tue Mar 15 23:47:58 2016 +0100
+++ b/RELEASE_NOTES	Tue Mar 15 23:51:42 2016 +0100
@@ -191,6 +191,7 @@
 - Bug 2328 - changes to antenna configuration should update HT MCS set
 - Bug 2331 - Wrong mobility model in vanet-routing-compare example
 - Bug 2332 - Assert failed when using aggregation and two pairs of AP-STA
+- Bug 2337 - WifiPhy uses channel width in Hz iso MHz
 
 Known issues
 ------------
--- a/src/wifi/model/wifi-phy.cc	Tue Mar 15 23:47:58 2016 +0100
+++ b/src/wifi/model/wifi-phy.cc	Tue Mar 15 23:51:42 2016 +0100
@@ -243,14 +243,14 @@
     case WIFI_MOD_CLASS_VHT:
       switch (txVector.GetChannelWidth ())
         {
-        case 5000000:
+        case 5:
           return WifiPhy::GetOfdmRate1_5MbpsBW5MHz ();
-        case 10000000:
+        case 10:
           return WifiPhy::GetOfdmRate3MbpsBW10MHz ();
-        case 20000000:
-        case 40000000:
-        case 80000000:
-        case 160000000:
+        case 20:
+        case 40:
+        case 80:
+        case 160:
         default:
           //(Section 18.3.2 "PLCP frame format"; IEEE Std 802.11-2012)
           //actually this is only the first part of the PlcpHeader,
@@ -291,7 +291,7 @@
       {
         switch (txVector.GetChannelWidth ())
           {
-          case 20000000:
+          case 20:
           default:
             //(Section 18.3.3 "PLCP preamble (SYNC))" and Figure 18-4 "OFDM training structure"; IEEE Std 802.11-2012)
             //also (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
@@ -300,10 +300,10 @@
             //header, see Section 18.3.2 and Figure 18-1) is sent using the
             //payload mode.
             return MicroSeconds (4);
-          case 10000000:
+          case 10:
             //(Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
             return MicroSeconds (8);
-          case 5000000:
+          case 5:
             //(Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
             return MicroSeconds (16);
           }
@@ -355,16 +355,16 @@
       {
         switch (txVector.GetChannelWidth ())
           {
-          case 20000000:
+          case 20:
           default:
             //(Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
             //also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
             return MicroSeconds (16);
-          case 10000000:
+          case 10:
             //(Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
             //also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
             return MicroSeconds (32);
-          case 5000000:
+          case 5:
             //(Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
             //also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
             return MicroSeconds (64);
@@ -417,14 +417,14 @@
 
         switch (txVector.GetChannelWidth ())
           {
-          case 20000000:
+          case 20:
           default:
             symbolDuration = MicroSeconds (4);
             break;
-          case 10000000:
+          case 10:
             symbolDuration = MicroSeconds (8);
             break;
-          case 5000000:
+          case 5:
             symbolDuration = MicroSeconds (16);
             break;
           }