src/wifi/model/wifi-phy.cc
changeset 11196 9d8c60f0db81
parent 11174 780a43e4980c
child 11245 5c781d7e5a25
--- a/src/wifi/model/wifi-phy.cc	Sat Jan 31 15:45:36 2015 -0800
+++ b/src/wifi/model/wifi-phy.cc	Sat Jan 31 17:30:30 2015 -0800
@@ -261,6 +261,10 @@
 Time
 WifiPhy::GetPlcpHeaderDuration (WifiMode payloadMode, WifiPreamble preamble)
 {
+  if (preamble == WIFI_PREAMBLE_NONE)
+  {
+      return MicroSeconds(0);
+  }
   switch (payloadMode.GetModulationClass ())
     {
     case WIFI_MOD_CLASS_OFDM:
@@ -292,7 +296,6 @@
              case WIFI_PREAMBLE_HT_MF:
                // L-SIG
                return MicroSeconds(4);
-             case WIFI_PREAMBLE_NONE:
              case WIFI_PREAMBLE_HT_GF:
                //L-SIG
                return MicroSeconds(0);
@@ -325,6 +328,10 @@
 Time
 WifiPhy::GetPlcpPreambleDuration (WifiMode payloadMode, WifiPreamble preamble)
 {
+  if (preamble == WIFI_PREAMBLE_NONE)
+  {
+      return MicroSeconds(0);
+  }
   switch (payloadMode.GetModulationClass ())
     {
     case WIFI_MOD_CLASS_OFDM:
@@ -347,16 +354,9 @@
           }
       }
     case WIFI_MOD_CLASS_HT:
-      {  
-          switch (preamble)
-            {
-             case WIFI_PREAMBLE_NONE:
-               //A-MPDU support since MPDUs inside an A-MPDU are sent without a preamble
-               return MicroSeconds(0);
-             default:
-               //IEEE 802.11n Figure 20.1 the training symbols before L_SIG or HT_SIG
-               return MicroSeconds(16);
-            }
+      {
+        //IEEE 802.11n Figure 20.1 the training symbols before L_SIG or HT_SIG
+        return MicroSeconds(16);
       }
     case WIFI_MOD_CLASS_ERP_OFDM:
       return MicroSeconds(16);