src/wifi/model/minstrel-wifi-manager.cc
changeset 10139 17a71cd49da3
parent 8981 7e1c95c4d1a7
child 10218 97da49da2d6c
--- a/src/wifi/model/minstrel-wifi-manager.cc	Tue Aug 13 10:37:49 2013 -0700
+++ b/src/wifi/model/minstrel-wifi-manager.cc	Tue Aug 13 22:05:25 2013 -0700
@@ -38,6 +38,8 @@
 #include "ns3/assert.h"
 #include <vector>
 
+#define Min(a,b) ((a < b) ? a : b)
+
 NS_LOG_COMPONENT_DEFINE ("MinstrelWifiManager");
 
 
@@ -136,7 +138,9 @@
   for (uint32_t i = 0; i < nModes; i++)
     {
       WifiMode mode = phy->GetMode (i);
-      AddCalcTxTime (mode, phy->CalculateTxDuration (m_pktLen, mode, WIFI_PREAMBLE_LONG));
+      WifiTxVector txVector;
+      txVector.SetMode(mode);
+      AddCalcTxTime (mode, phy->CalculateTxDuration (m_pktLen, txVector, WIFI_PREAMBLE_LONG));
     }
   WifiRemoteStationManager::SetupPhy (phy);
 }
@@ -435,8 +439,8 @@
   station->m_longRetry = 0;
 }
 
-WifiMode
-MinstrelWifiManager::DoGetDataMode (WifiRemoteStation *st,
+WifiTxVector
+MinstrelWifiManager::DoGetDataTxVector (WifiRemoteStation *st,
                                     uint32_t size)
 {
   MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st;
@@ -448,16 +452,16 @@
       station->m_txrate = m_nsupported / 2;
     }
   UpdateStats (station);
-  return GetSupported (station, station->m_txrate);
+  return WifiTxVector (GetSupported (station, station->m_txrate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station));
 }
 
-WifiMode
-MinstrelWifiManager::DoGetRtsMode (WifiRemoteStation *st)
+WifiTxVector
+MinstrelWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
 {
   MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st;
   NS_LOG_DEBUG ("DoGetRtsMode m_txrate=" << station->m_txrate);
 
-  return GetSupported (station, 0);
+  return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station));
 }
 
 bool