View | Details | Raw Unified | Return to bug 2153
Collapse All | Expand All

(-)a/src/wifi/model/aparf-wifi-manager.cc (-6 / +7 lines)
 Lines 127-133    Link Here 
127
void
127
void
128
AparfWifiManager::SetupPhy (Ptr<WifiPhy> phy)
128
AparfWifiManager::SetupPhy (Ptr<WifiPhy> phy)
129
{
129
{
130
  m_nPower = phy->GetNTxPower ();
130
  m_minPower = phy->GetTxPowerStart();
131
  m_maxPower = phy->GetTxPowerEnd();
131
  WifiRemoteStationManager::SetupPhy (phy);
132
  WifiRemoteStationManager::SetupPhy (phy);
132
}
133
}
133
134
 Lines 158-164    Link Here 
158
    {
159
    {
159
      station->m_nSupported = GetNSupported (station);
160
      station->m_nSupported = GetNSupported (station);
160
      station->m_rate = station->m_nSupported - 1;
161
      station->m_rate = station->m_nSupported - 1;
161
      station->m_power = m_nPower - 1;
162
      station->m_power = m_maxPower;
162
      station->m_rateCrit = 0;
163
      station->m_rateCrit = 0;
163
      m_powerChange (station->m_power, station->m_state->m_address);
164
      m_powerChange (station->m_power, station->m_state->m_address);
164
      m_rateChange (station->m_rate, station->m_state->m_address);
165
      m_rateChange (station->m_rate, station->m_state->m_address);
 Lines 197-203    Link Here 
197
      station->m_nFailed = 0;
198
      station->m_nFailed = 0;
198
      station->m_nSuccess = 0;
199
      station->m_nSuccess = 0;
199
      station->m_pCount = 0;
200
      station->m_pCount = 0;
200
      if (station->m_power == (m_nPower - 1))
201
      if (station->m_power == m_maxPower)
201
        {
202
        {
202
          station->m_rateCrit = station->m_rate;
203
          station->m_rateCrit = station->m_rate;
203
          if (station->m_rate != 0)
204
          if (station->m_rate != 0)
 Lines 261-267    Link Here 
261
      station->m_nFailed = 0;
262
      station->m_nFailed = 0;
262
      if (station->m_rate == (station->m_state->m_operationalRateSet.size () - 1))
263
      if (station->m_rate == (station->m_state->m_operationalRateSet.size () - 1))
263
        {
264
        {
264
          if (station->m_power != 0)
265
          if (station->m_power != m_minPower)
265
            {
266
            {
266
              NS_LOG_DEBUG ("station=" << station << " dec power");
267
              NS_LOG_DEBUG ("station=" << station << " dec power");
267
              station->m_power -= m_powerDec;
268
              station->m_power -= m_powerDec;
 Lines 283-289    Link Here 
283
            {
284
            {
284
              if (station->m_pCount == m_powerMax)
285
              if (station->m_pCount == m_powerMax)
285
                {
286
                {
286
                  station->m_power = (m_nPower - 1);
287
                  station->m_power = m_maxPower;
287
                  m_powerChange (station->m_power, station->m_state->m_address);
288
                  m_powerChange (station->m_power, station->m_state->m_address);
288
                  station->m_rate = station->m_rateCrit;
289
                  station->m_rate = station->m_rateCrit;
289
                  m_rateChange (station->m_rate, station->m_state->m_address);
290
                  m_rateChange (station->m_rate, station->m_state->m_address);
 Lines 292-298    Link Here 
292
                }
293
                }
293
              else
294
              else
294
                {
295
                {
295
                  if (station->m_power != 0)
296
                  if (station->m_power != m_minPower)
296
                    {
297
                    {
297
                      station->m_power -= m_powerDec;
298
                      station->m_power -= m_powerDec;
298
                      m_powerChange (station->m_power, station->m_state->m_address);
299
                      m_powerChange (station->m_power, station->m_state->m_address);
(-)a/src/wifi/model/aparf-wifi-manager.h (-2 / +8 lines)
 Lines 110-121    Link Here 
110
  uint32_t m_powerDec;   //!< Step size for decrement the power.
110
  uint32_t m_powerDec;   //!< Step size for decrement the power.
111
  uint32_t m_rateInc;    //!< Step size for increment the rate.
111
  uint32_t m_rateInc;    //!< Step size for increment the rate.
112
  uint32_t m_rateDec;    //!< Step size for decrement the rate.
112
  uint32_t m_rateDec;    //!< Step size for decrement the rate.
113
113
  /**
114
  /**
114
   * Number of power levels.
115
   * Minimal power level.
115
   * Differently form rate, power levels do not depend on the remote station.
116
   * Differently form rate, power levels do not depend on the remote station.
116
   * The levels depend only on the physical layer of the device.
117
   * The levels depend only on the physical layer of the device.
117
   */
118
   */
118
  uint32_t m_nPower;
119
  uint32_t m_minPower;  
120
121
  /**
122
   * Maximal power level.
123
   */
124
  uint32_t m_maxPower;
119
125
120
  /**
126
  /**
121
   * The trace source fired when the transmission power change
127
   * The trace source fired when the transmission power change
(-)a/src/wifi/model/parf-wifi-manager.cc (-5 / +6 lines)
 Lines 95-101    Link Here 
95
void
95
void
96
ParfWifiManager::SetupPhy (Ptr<WifiPhy> phy)
96
ParfWifiManager::SetupPhy (Ptr<WifiPhy> phy)
97
{
97
{
98
  m_nPower = phy->GetNTxPower ();
98
  m_minPower = phy->GetTxPowerStart ();
99
  m_maxPower = phy->GetTxPowerEnd ();
99
  WifiRemoteStationManager::SetupPhy (phy);
100
  WifiRemoteStationManager::SetupPhy (phy);
100
}
101
}
101
102
 Lines 126-132    Link Here 
126
    {
127
    {
127
      station->m_nSupported = GetNSupported (station);
128
      station->m_nSupported = GetNSupported (station);
128
      station->m_currentRate = station->m_nSupported - 1;
129
      station->m_currentRate = station->m_nSupported - 1;
129
      station->m_currentPower = m_nPower - 1;
130
      station->m_currentPower = m_maxPower;
130
      m_powerChange (station->m_currentPower, station->m_state->m_address);
131
      m_powerChange (station->m_currentPower, station->m_state->m_address);
131
      m_rateChange (station->m_currentRate, station->m_state->m_address);
132
      m_rateChange (station->m_currentRate, station->m_state->m_address);
132
      station->m_initialized = true;
133
      station->m_initialized = true;
 Lines 184-190    Link Here 
184
      if (station->m_nRetry == 1)
185
      if (station->m_nRetry == 1)
185
        {
186
        {
186
          //need recovery fallback
187
          //need recovery fallback
187
          if (station->m_currentPower < m_nPower - 1)
188
          if (station->m_currentPower < m_maxPower)
188
            {
189
            {
189
              NS_LOG_DEBUG ("station=" << station << " inc power");
190
              NS_LOG_DEBUG ("station=" << station << " inc power");
190
              station->m_currentPower++;
191
              station->m_currentPower++;
 Lines 200-206    Link Here 
200
      if (((station->m_nRetry - 1) % 2) == 1)
201
      if (((station->m_nRetry - 1) % 2) == 1)
201
        {
202
        {
202
          //need normal fallback
203
          //need normal fallback
203
          if (station->m_currentPower == m_nPower - 1)
204
          if (station->m_currentPower == m_maxPower)
204
            {
205
            {
205
              if (station->m_currentRate != 0)
206
              if (station->m_currentRate != 0)
206
                {
207
                {
 Lines 264-270    Link Here 
264
  else if (station->m_nSuccess == m_successThreshold || station->m_nAttempt == m_attemptThreshold)
265
  else if (station->m_nSuccess == m_successThreshold || station->m_nAttempt == m_attemptThreshold)
265
    {
266
    {
266
      //we are at the maximum rate, we decrease power
267
      //we are at the maximum rate, we decrease power
267
      if (station->m_currentPower != 0)
268
      if (station->m_currentPower != m_minPower)
268
        {
269
        {
269
          NS_LOG_DEBUG ("station=" << station << " dec power");
270
          NS_LOG_DEBUG ("station=" << station << " dec power");
270
          station->m_currentPower--;
271
          station->m_currentPower--;
(-)a/src/wifi/model/parf-wifi-manager.h (-2 / +8 lines)
 Lines 91-102    Link Here 
91
91
92
  uint32_t m_attemptThreshold; //!< The minimum number of transmission attempts to try a new power or rate. The 'timer' threshold in the ARF algorithm.
92
  uint32_t m_attemptThreshold; //!< The minimum number of transmission attempts to try a new power or rate. The 'timer' threshold in the ARF algorithm.
93
  uint32_t m_successThreshold; //!< The minimum number of successful transmissions to try a new power or rate.
93
  uint32_t m_successThreshold; //!< The minimum number of successful transmissions to try a new power or rate.
94
  
94
  /**
95
  /**
95
   * Number of power levels.
96
   * Minimal power level.
96
   * In contrast to rate, power levels do not depend on the remote station.
97
   * In contrast to rate, power levels do not depend on the remote station.
97
   * The levels depend only on the physical layer of the device.
98
   * The levels depend only on the physical layer of the device.
98
   */
99
   */
99
  uint32_t m_nPower;
100
  uint32_t m_minPower;
101
102
  /**
103
   * Maximal power level.
104
   */
105
  uint32_t m_maxPower;
100
106
101
  /**
107
  /**
102
   * The trace source fired when the transmission power changes....
108
   * The trace source fired when the transmission power changes....

Return to bug 2153