src/wifi/model/parf-wifi-manager.cc
changeset 11524 f0c39728e884
parent 11479 a3dcf66928f3
child 11606 98fa74311b21
--- a/src/wifi/model/parf-wifi-manager.cc	Wed Jul 22 08:53:01 2015 -0700
+++ b/src/wifi/model/parf-wifi-manager.cc	Wed Jul 22 23:14:47 2015 +0200
@@ -95,7 +95,8 @@
 void
 ParfWifiManager::SetupPhy (Ptr<WifiPhy> phy)
 {
-  m_nPower = phy->GetNTxPower ();
+  m_minPower = phy->GetTxPowerStart ();
+  m_maxPower = phy->GetTxPowerEnd ();
   WifiRemoteStationManager::SetupPhy (phy);
 }
 
@@ -126,7 +127,7 @@
     {
       station->m_nSupported = GetNSupported (station);
       station->m_currentRate = station->m_nSupported - 1;
-      station->m_currentPower = m_nPower - 1;
+      station->m_currentPower = m_maxPower;
       m_powerChange (station->m_currentPower, station->m_state->m_address);
       m_rateChange (station->m_currentRate, station->m_state->m_address);
       station->m_initialized = true;
@@ -184,7 +185,7 @@
       if (station->m_nRetry == 1)
         {
           //need recovery fallback
-          if (station->m_currentPower < m_nPower - 1)
+          if (station->m_currentPower < m_maxPower)
             {
               NS_LOG_DEBUG ("station=" << station << " inc power");
               station->m_currentPower++;
@@ -200,7 +201,7 @@
       if (((station->m_nRetry - 1) % 2) == 1)
         {
           //need normal fallback
-          if (station->m_currentPower == m_nPower - 1)
+          if (station->m_currentPower == m_maxPower)
             {
               if (station->m_currentRate != 0)
                 {
@@ -264,7 +265,7 @@
   else if (station->m_nSuccess == m_successThreshold || station->m_nAttempt == m_attemptThreshold)
     {
       //we are at the maximum rate, we decrease power
-      if (station->m_currentPower != 0)
+      if (station->m_currentPower != m_minPower)
         {
           NS_LOG_DEBUG ("station=" << station << " dec power");
           station->m_currentPower--;