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

(-)a/src/wifi/model/block-ack-manager.cc (+9 lines)
 Lines 84-89   BlockAckManager::ExistsAgreement (Mac48Address recipient, uint8_t tid) const Link Here 
84
  return (m_agreements.find (std::make_pair (recipient, tid)) != m_agreements.end ());
84
  return (m_agreements.find (std::make_pair (recipient, tid)) != m_agreements.end ());
85
}
85
}
86
86
87
uint16_t
88
BlockAckManager::GetAgreementBufferSize (Mac48Address recipient, uint8_t tid) const
89
{
90
  NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
91
  NS_ASSERT (ExistsAgreement (recipient, tid));
92
  uint16_t bufferSize = m_agreements.find (std::make_pair (recipient, tid))->second.first.GetBufferSize ();
93
  return bufferSize;
94
}
95
87
bool
96
bool
88
BlockAckManager::ExistsAgreementInState (Mac48Address recipient, uint8_t tid,
97
BlockAckManager::ExistsAgreementInState (Mac48Address recipient, uint8_t tid,
89
                                         OriginatorBlockAckAgreement::State state) const
98
                                         OriginatorBlockAckAgreement::State state) const
(-)a/src/wifi/model/block-ack-manager.h (+10 lines)
 Lines 109-114   public: Link Here 
109
  /**
109
  /**
110
   * \param recipient Address of peer station involved in block ack mechanism.
110
   * \param recipient Address of peer station involved in block ack mechanism.
111
   * \param tid Traffic ID.
111
   * \param tid Traffic ID.
112
   *
113
   * \return the buffer size negotiated for this peer and for the given TID
114
   *
115
   * Returns the negotiated buffer size of an existing block ack agreement
116
   * with station addressed by <i>recipient</i> for tid <i>tid</i>.
117
   */
118
  uint16_t GetAgreementBufferSize (Mac48Address recipient, uint8_t tid) const;
119
  /**
120
   * \param recipient Address of peer station involved in block ack mechanism.
121
   * \param tid Traffic ID.
112
   * \param state The state for block ack agreement
122
   * \param state The state for block ack agreement
113
   *
123
   *
114
   * \return true if a block ack agreement exists, false otherwise
124
   * \return true if a block ack agreement exists, false otherwise
(-)a/src/wifi/model/edca-txop-n.cc (+9 lines)
 Lines 106-111   EdcaTxopN::GetBaAgreementExists (Mac48Address address, uint8_t tid) const Link Here 
106
  return m_baManager->ExistsAgreement (address, tid);
106
  return m_baManager->ExistsAgreement (address, tid);
107
}
107
}
108
108
109
uint16_t
110
EdcaTxopN::GetAgreementBufferSize (Mac48Address recipient, uint8_t tid) const
111
{
112
  NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
113
  NS_ASSERT (GetBaAgreementExists (recipient, tid));
114
  uint16_t bufferSize = m_baManager->GetAgreementBufferSize (recipient, tid);
115
  return bufferSize;
116
}
117
109
void
118
void
110
EdcaTxopN::CompleteAmpduTransfer (Mac48Address recipient, uint8_t tid)
119
EdcaTxopN::CompleteAmpduTransfer (Mac48Address recipient, uint8_t tid)
111
{
120
{
(-)a/src/wifi/model/edca-txop-n.h (+10 lines)
 Lines 132-137   public: Link Here 
132
   */
132
   */
133
  bool GetBaAgreementExists (Mac48Address address, uint8_t tid) const;
133
  bool GetBaAgreementExists (Mac48Address address, uint8_t tid) const;
134
  /**
134
  /**
135
   * \param recipient Address of peer station involved in block ack mechanism.
136
   * \param tid traffic ID.
137
   *
138
   * \return the buffer size negotiated for this peer and for the given TID
139
   *
140
   * Returns the negotiated buffer size of an existing block ack agreement
141
   * with station addressed by <i>recipient</i> for tid <i>tid</i>.
142
   */
143
  uint16_t GetAgreementBufferSize (Mac48Address recipient, uint8_t tid) const;
144
  /**
135
   * \param recipient address of peer station involved in block ack mechanism.
145
   * \param recipient address of peer station involved in block ack mechanism.
136
   * \param tid Ttraffic ID of transmitted packet.
146
   * \param tid Ttraffic ID of transmitted packet.
137
   *
147
   *
(-)a/src/wifi/model/mac-low.cc (-2 / +4 lines)
 Lines 2531-2537   MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr) Link Here 
2531
                  currentSequenceNumber = peekedHdr.GetSequenceNumber ();
2531
                  currentSequenceNumber = peekedHdr.GetSequenceNumber ();
2532
                }
2532
                }
2533
2533
2534
              while (IsInWindow (currentSequenceNumber, startingSequenceNumber, 64) && !StopMpduAggregation (peekedPacket, peekedHdr, currentAggregatedPacket, blockAckSize))
2534
              while (IsInWindow (currentSequenceNumber, startingSequenceNumber, edcaIt->second->GetAgreementBufferSize (hdr.GetAddr1 (), tid))
2535
                  && !StopMpduAggregation (peekedPacket, peekedHdr, currentAggregatedPacket, blockAckSize))
2535
                {
2536
                {
2536
                  //for now always send AMPDU with normal ACK
2537
                  //for now always send AMPDU with normal ACK
2537
                  if (retry == false)
2538
                  if (retry == false)
 Lines 2641-2647   MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr) Link Here 
2641
                          //find what will the sequence number be so that we don't send more than 64 packets apart
2642
                          //find what will the sequence number be so that we don't send more than 64 packets apart
2642
                          currentSequenceNumber = edcaIt->second->PeekNextSequenceNumberFor (&peekedHdr);
2643
                          currentSequenceNumber = edcaIt->second->PeekNextSequenceNumberFor (&peekedHdr);
2643
2644
2644
                          if (edcaIt->second->GetMsduAggregator () != 0 && IsInWindow (currentSequenceNumber, startingSequenceNumber, 64))
2645
                          if (edcaIt->second->GetMsduAggregator () != 0
2646
                              && IsInWindow (currentSequenceNumber, startingSequenceNumber, edcaIt->second->GetAgreementBufferSize (peekedHdr.GetAddr1 (), tid)))
2645
                            {
2647
                            {
2646
                              tempPacket = PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, blockAckSize);
2648
                              tempPacket = PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, blockAckSize);
2647
                              if (tempPacket != 0) //MSDU aggregation
2649
                              if (tempPacket != 0) //MSDU aggregation

Return to bug 2870