src/wifi/model/wifi-remote-station-manager.cc
changeset 11384 935dc1cc08a4
parent 11245 5c781d7e5a25
child 11388 e367c5bde0fa
--- a/src/wifi/model/wifi-remote-station-manager.cc	Wed May 06 15:12:29 2015 +0200
+++ b/src/wifi/model/wifi-remote-station-manager.cc	Wed May 06 21:59:49 2015 +0200
@@ -935,8 +935,9 @@
        i != m_bssBasicRateSet.end (); i++)
     {
       if ((!found || i->GetPhyRate () > mode.GetPhyRate ())
-          && i->GetPhyRate () <= reqMode.GetPhyRate ()
-          && i->GetModulationClass () == reqMode.GetModulationClass ())
+          && (i->GetPhyRate () <= reqMode.GetPhyRate ())
+          && ((i->GetModulationClass () == reqMode.GetModulationClass ())
+              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)))
         {
           mode = *i;
           // We've found a potentially-suitable transmit rate, but we
@@ -946,13 +947,13 @@
         }
     }
   if(HasHtSupported())
-      {
-        if (!found)
-          {
-            uint8_t mcs = GetDefaultMcs (); 
-            mode=  m_wifiPhy->McsToWifiMode (mcs); 
-          }
-        for (WifiMcsListIterator i = m_bssBasicMcsSet.begin ();
+    {
+      if (!found)
+        {
+          uint8_t mcs = GetDefaultMcs ();
+          mode = m_wifiPhy->McsToWifiMode (mcs);
+            
+          for (WifiMcsListIterator i = m_bssBasicMcsSet.begin ();
              i != m_bssBasicMcsSet.end (); i++)
           {
             WifiMode thismode=  m_wifiPhy->McsToWifiMode (*i); 
@@ -967,11 +968,13 @@
                 found = true;
               }
           }
+        }
       }
   // If we found a suitable rate in the BSSBasicRateSet, then we are
   // done and can return that mode.
   if (found)
     {
+      NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
       return mode;
     }
 
@@ -1007,8 +1010,9 @@
        */
       if (thismode.IsMandatory ()
           && (!found || thismode.GetPhyRate () > mode.GetPhyRate ())
-          && thismode.GetPhyRate () <= reqMode.GetPhyRate ()
-          && thismode.GetModulationClass () == reqMode.GetModulationClass ())
+          && (thismode.GetPhyRate () <= reqMode.GetPhyRate ())
+          && ((thismode.GetModulationClass () == reqMode.GetModulationClass ()) ||
+             (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)))
         {
           mode = thismode;
           // As above; we've found a potentially-suitable transmit