|
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); |