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

(-)a/src/wifi/model/block-ack-manager.cc (-6 / +7 lines)
 Lines 538-543    Link Here 
538
      if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED))
538
      if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED))
539
        {
539
        {
540
          bool foundFirstLost = false;
540
          bool foundFirstLost = false;
541
          uint32_t nSuccessfulMpdus = 0;
542
          uint32_t nFailedMpdus = 0;
541
          AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
543
          AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
542
          PacketQueueI queueEnd = it->second.second.end ();
544
          PacketQueueI queueEnd = it->second.second.end ();
543
545
 Lines 560-565    Link Here 
560
                  if (blockAck->IsFragmentReceived ((*queueIt).hdr.GetSequenceNumber (),
562
                  if (blockAck->IsFragmentReceived ((*queueIt).hdr.GetSequenceNumber (),
561
                                                    (*queueIt).hdr.GetFragmentNumber ()))
563
                                                    (*queueIt).hdr.GetFragmentNumber ()))
562
                    {
564
                    {
565
                      nSuccessfulMpdus++;
563
                      queueIt = it->second.second.erase (queueIt);
566
                      queueIt = it->second.second.erase (queueIt);
564
                    }
567
                    }
565
                  else
568
                  else
 Lines 570-581    Link Here 
570
                          sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber ();
573
                          sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber ();
571
                          (*it).second.first.SetStartingSequence (sequenceFirstLost);
574
                          (*it).second.first.SetStartingSequence (sequenceFirstLost);
572
                        }
575
                        }
573
576
                      nFailedMpdus++;
574
                      if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (), recipient, tid))
577
                      if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (), recipient, tid))
575
                        {
578
                        {
576
                          InsertInRetryQueue (queueIt);
579
                          InsertInRetryQueue (queueIt);
577
                        }
580
                        }
578
579
                      queueIt++;
581
                      queueIt++;
580
                    }
582
                    }
581
                }
583
                }
 Lines 590-597    Link Here 
590
                      while (queueIt != queueEnd
592
                      while (queueIt != queueEnd
591
                             && (*queueIt).hdr.GetSequenceNumber () == currentSeq)
593
                             && (*queueIt).hdr.GetSequenceNumber () == currentSeq)
592
                        {
594
                        {
593
                          //notify remote station of successful transmission
595
                          nSuccessfulMpdus++;
594
                          m_stationManager->ReportDataOk ((*queueIt).hdr.GetAddr1 (), &(*queueIt).hdr, 0, txMode, 0);
595
                          if (!m_txOkCallback.IsNull ())
596
                          if (!m_txOkCallback.IsNull ())
596
                            {
597
                            {
597
                              m_txOkCallback ((*queueIt).hdr);
598
                              m_txOkCallback ((*queueIt).hdr);
 Lines 607-614    Link Here 
607
                          sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber ();
608
                          sequenceFirstLost = (*queueIt).hdr.GetSequenceNumber ();
608
                          (*it).second.first.SetStartingSequence (sequenceFirstLost);
609
                          (*it).second.first.SetStartingSequence (sequenceFirstLost);
609
                        }
610
                        }
610
                      //notify remote station of unsuccessful transmission
611
                      nFailedMpdus++;
611
                      m_stationManager->ReportDataFailed ((*queueIt).hdr.GetAddr1 (), &(*queueIt).hdr);
612
                      if (!m_txFailedCallback.IsNull ())
612
                      if (!m_txFailedCallback.IsNull ())
613
                        {
613
                        {
614
                          m_txFailedCallback ((*queueIt).hdr);
614
                          m_txFailedCallback ((*queueIt).hdr);
 Lines 628-633    Link Here 
628
                            }
628
                            }
629
                        }
629
                        }
630
                    }
630
                    }
631
                  m_stationManager->ReportAmpduTxStatus ((*queueIt).hdr.GetAddr1 (), &(*queueIt).hdr, nSuccessfulMpdus, nFailedMpdus);
631
                }
632
                }
632
            }
633
            }
633
          uint16_t newSeq = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
634
          uint16_t newSeq = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
(-)a/src/wifi/model/edca-txop-n.cc (+4 lines)
 Lines 870-875    Link Here 
870
{
870
{
871
  NS_LOG_FUNCTION (this);
871
  NS_LOG_FUNCTION (this);
872
  NS_LOG_DEBUG ("missed block ack");
872
  NS_LOG_DEBUG ("missed block ack");
873
  if (GetAmpduExist (m_currentHdr.GetAddr1 ()))
874
    {
875
      m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), &m_currentHdr, 0, 0);
876
    }
873
  if (NeedBarRetransmission ())
877
  if (NeedBarRetransmission ())
874
    {
878
    {
875
      if (!GetAmpduExist (m_currentHdr.GetAddr1 ()))
879
      if (!GetAmpduExist (m_currentHdr.GetAddr1 ()))
(-)a/src/wifi/model/wifi-remote-station-manager.cc (+16 lines)
 Lines 861-866    Link Here 
861
  DoReportRxOk (station, rxSnr, txMode);
861
  DoReportRxOk (station, rxSnr, txMode);
862
}
862
}
863
863
864
void
865
WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, const WifiMacHeader *header,
866
                                               uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus)
867
{
868
  NS_LOG_FUNCTION (this << address << *header << nSuccessfulMpdus << nFailedMpdus);
869
  NS_ASSERT (!address.IsGroup ());
870
  WifiRemoteStation *station = Lookup (address, header);
871
  DoReportAmpduTxStatus (station, nSuccessfulMpdus, nFailedMpdus);
872
}
873
864
bool
874
bool
865
WifiRemoteStationManager::NeedRts (Mac48Address address, const WifiMacHeader *header,
875
WifiRemoteStationManager::NeedRts (Mac48Address address, const WifiMacHeader *header,
866
                                   Ptr<const Packet> packet, WifiTxVector txVector)
876
                                   Ptr<const Packet> packet, WifiTxVector txVector)
 Lines 1687-1692    Link Here 
1687
  return normally;
1697
  return normally;
1688
}
1698
}
1689
1699
1700
void
1701
WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus)
1702
{
1703
  NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1704
}
1705
1690
WifiMode
1706
WifiMode
1691
WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint32_t i) const
1707
WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint32_t i) const
1692
{
1708
{
(-)a/src/wifi/model/wifi-remote-station-manager.h (+23 lines)
 Lines 580-585    Link Here 
580
   * \param header MAC header of the DATA packet
580
   * \param header MAC header of the DATA packet
581
   */
581
   */
582
  void ReportFinalDataFailed (Mac48Address address, const WifiMacHeader *header);
582
  void ReportFinalDataFailed (Mac48Address address, const WifiMacHeader *header);
583
  /**
584
   * Should be invoked whenever a Block ACK following an A-MPDU transmission
585
   * has been received, or when the Block ACK timeout has elapsed.
586
   *
587
   * \param address the address of the receiver
588
   * \param header MAC header of the DATA packet
589
   * \param nSuccessfulMpdus number of successfully transmitted MPDUs.
590
   * A value of 0 means that the Block ACK was missed.
591
   * \param nFailedMpdus number of unsuccessfully transmitted MPDUs.
592
   * A value of 0 means that all MPDUs aggregated in the A-MPDU were successfully transmitted.
593
   */
594
  void ReportAmpduTxStatus (Mac48Address address, const WifiMacHeader *header, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus);
583
595
584
  /**
596
  /**
585
   * \param address remote address
597
   * \param address remote address
 Lines 1069-1074    Link Here 
1069
   */
1081
   */
1070
  virtual void DoReportRxOk (WifiRemoteStation *station,
1082
  virtual void DoReportRxOk (WifiRemoteStation *station,
1071
                             double rxSnr, WifiMode txMode) = 0;
1083
                             double rxSnr, WifiMode txMode) = 0;
1084
  /**
1085
   * This method is a virtual method that must be implemented by the sub-class intended to hanble A-MPDUs.
1086
   * This allows different types of WifiRemoteStationManager to respond differently,
1087
   *
1088
   * \param station the station that sent the DATA to us
1089
   * \param nSuccessfulMpdus number of successfully transmitted MPDUs.
1090
   * A value of 0 means that the Block ACK was missed.
1091
   * \param nFailedMpdus number of unsuccessfully transmitted MPDUs.
1092
   * A value of 0 means that all MPDUs aggregated in the A-MPDU were successfully transmitted.
1093
   */
1094
  virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus);
1072
1095
1073
  /**
1096
  /**
1074
   * Return the state of the station associated with the given address.
1097
   * Return the state of the station associated with the given address.

Return to bug 2305