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