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

(-)a/src/wifi/model/dca-txop.cc (-1 / +4 lines)
 Lines 48-54    Link Here 
48
    : m_txop (txop)
48
    : m_txop (txop)
49
  {
49
  {
50
  }
50
  }
51
51
  virtual bool IsEdca (void) const
52
  {
53
    return false;
54
  }
52
private:
55
private:
53
  virtual void DoNotifyAccessGranted (void)
56
  virtual void DoNotifyAccessGranted (void)
54
  {
57
  {
(-)a/src/wifi/model/dcf-manager.cc (+15 lines)
 Lines 645-650    Link Here 
645
        {
645
        {
646
          uint32_t nus = (Simulator::Now () - backoffStart).GetMicroSeconds ();
646
          uint32_t nus = (Simulator::Now () - backoffStart).GetMicroSeconds ();
647
          uint32_t nIntSlots = nus / m_slotTimeUs;
647
          uint32_t nIntSlots = nus / m_slotTimeUs;
648
          /*
649
           * EDCA behaves slightly different to DCA. For EDCA we
650
           * decrement once at the slot boundary at the end of AIFS as
651
           * well as once at the end of each clear slot
652
           * thereafter. For DCA we only decrement at the end of each
653
           * clear slot after DIFS. We account for the extra backoff
654
           * by incrementing the slot count here in the case of
655
           * EDCA. The if statement whose body we are in has confirmed
656
           * that a minimum of AIFS has elapsed since last busy
657
           * medium.
658
           */
659
          if (state->IsEdca ())
660
            {
661
              nIntSlots++;
662
            }
648
          uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
663
          uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ());
649
          MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
664
          MY_DEBUG ("dcf " << k << " dec backoff slots=" << n);
650
          Time backoffUpdateBound = backoffStart + MicroSeconds (n * m_slotTimeUs);
665
          Time backoffUpdateBound = backoffStart + MicroSeconds (n * m_slotTimeUs);
(-)a/src/wifi/model/dcf-manager.h (+10 lines)
 Lines 50-55    Link Here 
50
  virtual ~DcfState ();
50
  virtual ~DcfState ();
51
51
52
  /**
52
  /**
53
   * \return whether this DCF state is an EDCA state
54
   *
55
   * This method, which must be overridden in derived classes,
56
   * indicates whether DCF or EDCAF rules should be used for this
57
   * channel access function. This affects the behavior of DcfManager
58
   * when dealing with this instance. 
59
   */
60
  virtual bool IsEdca (void) const = 0;
61
62
  /**
53
   * \param aifsn the number of slots which make up an AIFS for a specific DCF.
63
   * \param aifsn the number of slots which make up an AIFS for a specific DCF.
54
   *        a DIFS corresponds to an AIFSN = 2.
64
   *        a DIFS corresponds to an AIFSN = 2.
55
   *
65
   *
(-)a/src/wifi/model/edca-txop-n.cc (+5 lines)
 Lines 51-56    Link Here 
51
  {
51
  {
52
  }
52
  }
53
53
54
  virtual bool IsEdca (void) const
55
  {
56
    return true;
57
  }
58
54
private:
59
private:
55
  virtual void DoNotifyAccessGranted (void)
60
  virtual void DoNotifyAccessGranted (void)
56
  {
61
  {
(-)a/src/wifi/test/dcf-manager-test.cc (+7 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
35
35
36
36
private:
37
private:
 Lines 113-118    Link Here 
113
{
114
{
114
}
115
}
115
116
117
bool
118
DcfStateTest::IsEdca (void) const
119
{
120
  return false;
121
}
122
116
void
123
void
117
DcfStateTest::QueueTx (uint64_t txTime, uint64_t expectedGrantTime)
124
DcfStateTest::QueueTx (uint64_t txTime, uint64_t expectedGrantTime)
118
{
125
{

Return to bug 1205