|
|
| 536 |
if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)) |
536 |
if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)) |
| 537 |
{ |
537 |
{ |
| 538 |
bool foundFirstLost = false; |
538 |
bool foundFirstLost = false; |
|
|
539 |
uint32_t nSuccessfulMpdus = 0; |
| 540 |
uint32_t nFailedMpdus = 0; |
| 539 |
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); |
541 |
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); |
| 540 |
PacketQueueI queueEnd = it->second.second.end (); |
542 |
PacketQueueI queueEnd = it->second.second.end (); |
| 541 |
|
543 |
|
|
|
| 558 |
if (blockAck->IsFragmentReceived ((*queueIt).hdr.GetSequenceNumber (), |
560 |
if (blockAck->IsFragmentReceived ((*queueIt).hdr.GetSequenceNumber (), |
| 559 |
(*queueIt).hdr.GetFragmentNumber ())) |
561 |
(*queueIt).hdr.GetFragmentNumber ())) |
| 560 |
{ |
562 |
{ |
|
|
563 |
nSuccessfulMpdus++; |
| 561 |
queueIt = it->second.second.erase (queueIt); |
564 |
queueIt = it->second.second.erase (queueIt); |
| 562 |
} |
565 |
} |
| 563 |
else |
566 |
else |
|
|
| 568 |
sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber (); |
571 |
sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber (); |
| 569 |
(*it).second.first.SetStartingSequence (sequenceFirstLost); |
572 |
(*it).second.first.SetStartingSequence (sequenceFirstLost); |
| 570 |
} |
573 |
} |
| 571 |
|
574 |
nFailedMpdus++; |
| 572 |
if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (),recipient,tid)) |
575 |
if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (),recipient,tid)) |
| 573 |
{ |
576 |
{ |
| 574 |
InsertInRetryQueue (queueIt); |
577 |
InsertInRetryQueue (queueIt); |
| 575 |
} |
578 |
} |
| 576 |
|
|
|
| 577 |
queueIt++; |
579 |
queueIt++; |
| 578 |
} |
580 |
} |
| 579 |
} |
581 |
} |
|
|
| 588 |
while (queueIt != queueEnd |
590 |
while (queueIt != queueEnd |
| 589 |
&& (*queueIt).hdr.GetSequenceNumber () == currentSeq) |
591 |
&& (*queueIt).hdr.GetSequenceNumber () == currentSeq) |
| 590 |
{ |
592 |
{ |
| 591 |
//notify remote station of successful transmission |
593 |
nSuccessfulMpdus++; |
| 592 |
m_stationManager->ReportDataOk ((*queueIt).hdr.GetAddr1 (), &(*queueIt).hdr, 0, txMode, 0); |
|
|
| 593 |
if (!m_txOkCallback.IsNull ()) |
594 |
if (!m_txOkCallback.IsNull ()) |
| 594 |
{ |
595 |
{ |
| 595 |
m_txOkCallback ((*queueIt).hdr); |
596 |
m_txOkCallback ((*queueIt).hdr); |
|
|
| 605 |
sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber (); |
606 |
sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber (); |
| 606 |
(*it).second.first.SetStartingSequence (sequenceFirstLost); |
607 |
(*it).second.first.SetStartingSequence (sequenceFirstLost); |
| 607 |
} |
608 |
} |
| 608 |
//notify remote station of unsuccessful transmission |
609 |
nFailedMpdus++; |
| 609 |
m_stationManager->ReportDataFailed ((*queueIt).hdr.GetAddr1 (), &(*queueIt).hdr); |
|
|
| 610 |
if (!m_txFailedCallback.IsNull ()) |
610 |
if (!m_txFailedCallback.IsNull ()) |
| 611 |
{ |
611 |
{ |
| 612 |
m_txFailedCallback ((*queueIt).hdr); |
612 |
m_txFailedCallback ((*queueIt).hdr); |
|
|
| 619 |
} |
619 |
} |
| 620 |
} |
620 |
} |
| 621 |
} |
621 |
} |
|
|
622 |
m_stationManager->ReportAmpduTxStatus (recipient, tid, nSuccessfulMpdus, nFailedMpdus); |
| 622 |
uint16_t newSeq = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient); |
623 |
uint16_t newSeq = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient); |
| 623 |
if ((foundFirstLost && !SwitchToBlockAckIfNeeded (recipient, tid, sequenceFirstLost)) |
624 |
if ((foundFirstLost && !SwitchToBlockAckIfNeeded (recipient, tid, sequenceFirstLost)) |
| 624 |
|| (!foundFirstLost && !SwitchToBlockAckIfNeeded (recipient, tid, newSeq))) |
625 |
|| (!foundFirstLost && !SwitchToBlockAckIfNeeded (recipient, tid, newSeq))) |