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

(-)a/src/devices/wifi/dcf-manager.cc (-1 / +3 lines)
 Lines 244-249    Link Here 
244
    m_lastSwitchingDuration (MicroSeconds (0)), 
244
    m_lastSwitchingDuration (MicroSeconds (0)), 
245
    m_rxing (false),
245
    m_rxing (false),
246
    m_slotTime (Seconds (0.0)),
246
    m_slotTime (Seconds (0.0)),
247
    m_slotTimeInvert (Scalar (1) / Seconds (10.0)),
247
    m_sifs (Seconds (0.0)),
248
    m_sifs (Seconds (0.0)),
248
    m_phyListener (0),
249
    m_phyListener (0),
249
    m_lowListener (0)
250
    m_lowListener (0)
 Lines 274-279    Link Here 
274
DcfManager::SetSlot (Time slotTime)
275
DcfManager::SetSlot (Time slotTime)
275
{
276
{
276
  m_slotTime = slotTime;
277
  m_slotTime = slotTime;
278
  m_slotTimeInvert = Scalar (1) / slotTime;
277
}
279
}
278
void 
280
void 
279
DcfManager::SetSifs (Time sifs)
281
DcfManager::SetSifs (Time sifs)
 Lines 519-525    Link Here 
519
      Time backoffStart = GetBackoffStartFor (state);
521
      Time backoffStart = GetBackoffStartFor (state);
520
      if (backoffStart <= Simulator::Now ())
522
      if (backoffStart <= Simulator::Now ())
521
        {
523
        {
522
          Scalar nSlots = (Simulator::Now () - backoffStart) / m_slotTime;
524
          Scalar nSlots = (Simulator::Now () - backoffStart) * m_slotTimeInvert;
523
          uint32_t nIntSlots = lrint (nSlots.GetDouble ());          
525
          uint32_t nIntSlots = lrint (nSlots.GetDouble ());          
524
          uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
526
          uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
525
          MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
527
          MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
(-)a/src/devices/wifi/dcf-manager.h (+1 lines)
 Lines 324-329    Link Here 
324
  Time m_eifsNoDifs;
324
  Time m_eifsNoDifs;
325
  EventId m_accessTimeout;
325
  EventId m_accessTimeout;
326
  Time m_slotTime;
326
  Time m_slotTime;
327
  TimeInvert m_slotTimeInvert;
327
  Time m_sifs;
328
  Time m_sifs;
328
  class PhyListener *m_phyListener;
329
  class PhyListener *m_phyListener;
329
  class LowDcfListener *m_lowListener;
330
  class LowDcfListener *m_lowListener;

Return to bug 695