src/wifi/model/parf-wifi-manager.cc
changeset 11450 9f4ae69f12b7
parent 11245 5c781d7e5a25
child 11479 a3dcf66928f3
--- a/src/wifi/model/parf-wifi-manager.cc	Tue Jun 16 13:13:06 2015 -0700
+++ b/src/wifi/model/parf-wifi-manager.cc	Sun Jun 21 00:23:45 2015 +0200
@@ -29,7 +29,6 @@
 
 NS_LOG_COMPONENT_DEFINE ("ns3::ParfWifiManager");
 
-
 namespace ns3 {
 
 /**
@@ -40,19 +39,16 @@
  */
 struct ParfWifiRemoteStation : public WifiRemoteStation
 {
-  uint32_t m_nAttempt; //!< Number of transmission attempts.
-  uint32_t m_nSuccess; //!< Number of successful transmission attempts.
-  uint32_t m_nFail; //!< Number of failed transmission attempts.
-  bool m_usingRecoveryRate; //!< If using recovery rate.
+  uint32_t m_nAttempt;       //!< Number of transmission attempts.
+  uint32_t m_nSuccess;       //!< Number of successful transmission attempts.
+  uint32_t m_nFail;          //!< Number of failed transmission attempts.
+  bool m_usingRecoveryRate;  //!< If using recovery rate.
   bool m_usingRecoveryPower; //!< If using recovery power.
-  uint32_t m_nRetry; //!< Number of transmission retries.
-
-  uint32_t m_currentRate; //!< Current rate used by the remote station.
-
-  uint8_t m_currentPower; //!< Current power used by the remote station.
-
-  uint32_t m_nSupported; //!< Number of supported rates by the remote station.
-  bool m_initialized; //!< For initializing variables.
+  uint32_t m_nRetry;         //!< Number of transmission retries.
+  uint32_t m_currentRate;    //!< Current rate used by the remote station.
+  uint8_t m_currentPower;    //!< Current power used by the remote station.
+  uint32_t m_nSupported;     //!< Number of supported rates by the remote station.
+  bool m_initialized;        //!< For initializing variables.
 };
 
 NS_OBJECT_ENSURE_REGISTERED (ParfWifiManager);
@@ -90,6 +86,7 @@
 {
   NS_LOG_FUNCTION (this);
 }
+
 ParfWifiManager::~ParfWifiManager ()
 {
   NS_LOG_FUNCTION (this);
@@ -141,6 +138,7 @@
 {
   NS_LOG_FUNCTION (this << station);
 }
+
 /**
  * \internal
  * It is important to realize that "recovery" mode starts after failure of
@@ -169,7 +167,7 @@
       NS_ASSERT (station->m_nRetry >= 1);
       if (station->m_nRetry == 1)
         {
-          // need recovery fallback
+          //need recovery fallback
           if (station->m_currentRate != 0)
             {
               NS_LOG_DEBUG ("station=" << station << " dec rate");
@@ -185,7 +183,7 @@
       NS_ASSERT (station->m_nRetry >= 1);
       if (station->m_nRetry == 1)
         {
-          // need recovery fallback
+          //need recovery fallback
           if (station->m_currentPower < m_nPower - 1)
             {
               NS_LOG_DEBUG ("station=" << station << " inc power");
@@ -201,7 +199,7 @@
       NS_ASSERT (station->m_nRetry >= 1);
       if (((station->m_nRetry - 1) % 2) == 1)
         {
-          // need normal fallback
+          //need normal fallback
           if (station->m_currentPower == m_nPower - 1)
             {
               if (station->m_currentRate != 0)
@@ -224,18 +222,21 @@
         }
     }
 }
+
 void
 ParfWifiManager::DoReportRxOk (WifiRemoteStation *station,
                                double rxSnr, WifiMode txMode)
 {
   NS_LOG_FUNCTION (this << station << rxSnr << txMode);
 }
+
 void ParfWifiManager::DoReportRtsOk (WifiRemoteStation *station,
                                      double ctsSnr, WifiMode ctsMode, double rtsSnr)
 {
   NS_LOG_FUNCTION (this << station << ctsSnr << ctsMode << rtsSnr);
   NS_LOG_DEBUG ("station=" << station << " rts ok");
 }
+
 void ParfWifiManager::DoReportDataOk (WifiRemoteStation *st,
                                       double ackSnr, WifiMode ackMode, double dataSnr)
 {
@@ -274,11 +275,13 @@
       station->m_usingRecoveryPower = true;
     }
 }
+
 void
 ParfWifiManager::DoReportFinalRtsFailed (WifiRemoteStation *station)
 {
   NS_LOG_FUNCTION (this << station);
 }
+
 void
 ParfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station)
 {
@@ -291,8 +294,9 @@
   NS_LOG_FUNCTION (this << st << size);
   ParfWifiRemoteStation *station = (ParfWifiRemoteStation *) st;
   CheckInit (station);
-  return WifiTxVector (GetSupported (station, station->m_currentRate), station->m_currentPower, GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas ()), GetNumberOfTransmitAntennas (station), GetStbc (station));
+  return WifiTxVector (GetSupported (station, station->m_currentRate), station->m_currentPower, GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station), GetNumberOfTransmitAntennas ()), GetNumberOfTransmitAntennas (station), GetStbc (station));
 }
+
 WifiTxVector
 ParfWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
 {
@@ -300,7 +304,7 @@
   /// \todo we could/should implement the Arf algorithm for
   /// RTS only by picking a single rate within the BasicRateSet.
   ParfWifiRemoteStation *station = (ParfWifiRemoteStation *) st;
-  return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas ()), GetNumberOfTransmitAntennas (station), GetStbc (station));
+  return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station), GetNumberOfTransmitAntennas ()), GetNumberOfTransmitAntennas (station), GetStbc (station));
 }
 
 bool
@@ -309,4 +313,5 @@
   NS_LOG_FUNCTION (this);
   return true;
 }
-} // namespace ns3
+
+} //namespace ns3