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

(-)a/src/wifi/model/dca-txop.cc (+4 lines)
 Lines 49-54    Link Here 
49
    : m_txop (txop)
49
    : m_txop (txop)
50
  {
50
  {
51
  }
51
  }
52
  virtual bool IsEDCA (void) const
53
  {
54
    return false;
55
  }
52
private:
56
private:
53
  virtual void DoNotifyAccessGranted (void)
57
  virtual void DoNotifyAccessGranted (void)
54
  {
58
  {
(-)a/src/wifi/model/dcf-manager.cc (+17 lines)
 Lines 540-545    Link Here 
540
        {
540
        {
541
          uint32_t nus = (Simulator::Now () - backoffStart).GetMicroSeconds ();
541
          uint32_t nus = (Simulator::Now () - backoffStart).GetMicroSeconds ();
542
          uint32_t nIntSlots = nus / m_slotTimeUs;
542
          uint32_t nIntSlots = nus / m_slotTimeUs;
543
544
          /*
545
           * EDCA behaves slightly different to DCA. For EDCA we
546
           * decrement once at the slot boundary at the end of AIFS as
547
           * well as once at the end of each clear slot
548
           * thereafter. For DCA we only decrement at the end of each
549
           * clear slot after DIFS. We account for the extra backoff
550
           * by incrementing the slot count here in the case of
551
           * EDCA. The if statement whose body we are in has confirmed
552
           * that a minimum of AIFS has elapsed since last busy
553
           * medium.
554
           */
555
          if (state->IsEDCA ())
556
            {
557
              nIntSlots++;
558
            }
559
543
          uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
560
          uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
544
          MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
561
          MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
545
          Time backoffUpdateBound = backoffStart + MicroSeconds (n * m_slotTimeUs);
562
          Time backoffUpdateBound = backoffStart + MicroSeconds (n * m_slotTimeUs);
(-)a/src/wifi/model/dcf-manager.h (+6 lines)
 Lines 50-55    Link Here 
50
50
51
  virtual ~DcfState ();
51
  virtual ~DcfState ();
52
52
53
  /* This method, which must be overridden in derived classes,
54
   * indicates whether DCF or EDCAF rules should be used for this
55
   * channel access function. This affects the behavior of DcfManager
56
   * when dealing with this instance. */
57
  virtual bool IsEDCA (void) const = 0;
58
53
  /**
59
  /**
54
   * \param aifsn the number of slots which make up an AIFS for a specific DCF.
60
   * \param aifsn the number of slots which make up an AIFS for a specific DCF.
55
   *        a DIFS corresponds to an AIFSN = 2.
61
   *        a DIFS corresponds to an AIFSN = 2.
(-)a/src/wifi/model/edca-txop-n.cc (+4 lines)
 Lines 49-54    Link Here 
49
    : m_txop (txop)
49
    : m_txop (txop)
50
  {
50
  {
51
  }
51
  }
52
  virtual bool IsEDCA (void) const
53
  {
54
    return true;
55
  }
52
private:
56
private:
53
  virtual void DoNotifyAccessGranted (void)
57
  virtual void DoNotifyAccessGranted (void)
54
  {
58
  {
(-)a/src/wifi/test/dcf-manager-test.cc (+6 lines)
 Lines 31-36    Link Here 
31
public:
31
public:
32
  DcfStateTest (DcfManagerTest *test, uint32_t i);
32
  DcfStateTest (DcfManagerTest *test, uint32_t i);
33
  void QueueTx (uint64_t txTime, uint64_t expectedGrantTime);
33
  void QueueTx (uint64_t txTime, uint64_t expectedGrantTime);
34
  bool IsEDCA (void) const;
34
private:
35
private:
35
  friend class DcfManagerTest;
36
  friend class DcfManagerTest;
36
  virtual void DoNotifyAccessGranted (void);
37
  virtual void DoNotifyAccessGranted (void);
 Lines 107-112    Link Here 
107
    m_i (i)
108
    m_i (i)
108
{
109
{
109
}
110
}
111
bool
112
DcfStateTest::IsEDCA (void) const
113
{
114
  return false;
115
}
110
void
116
void
111
DcfStateTest::QueueTx (uint64_t txTime, uint64_t expectedGrantTime)
117
DcfStateTest::QueueTx (uint64_t txTime, uint64_t expectedGrantTime)
112
{
118
{

Return to bug 1205