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

(-)a/src/wifi/model/mac-low.cc (-3 / +3 lines)
 Lines 674-680   MacLow::StartTransmission (Ptr<const Packet> packet, Link Here 
674
      //queue when previous RTS request has failed.
674
      //queue when previous RTS request has failed.
675
      m_ampdu = false;
675
      m_ampdu = false;
676
    }
676
    }
677
  else if (m_currentHdr.IsQosData () && m_aggregateQueue[GetTid (packet, *hdr)]->GetNPackets () > 0)
677
  else if (m_currentHdr.IsQosData () && !m_aggregateQueue[GetTid (packet, *hdr)]->IsEmpty ())
678
    {
678
    {
679
      //m_aggregateQueue > 0 occurs when a RTS/CTS exchange failed before an A-MPDU transmission.
679
      //m_aggregateQueue > 0 occurs when a RTS/CTS exchange failed before an A-MPDU transmission.
680
      //In that case, we transmit the same A-MPDU as previously.
680
      //In that case, we transmit the same A-MPDU as previously.
 Lines 2026-2032   MacLow::SendDataAfterCts (Mac48Address source, Time duration) Link Here 
2026
  if (m_currentHdr.IsQosData ())
2026
  if (m_currentHdr.IsQosData ())
2027
    {
2027
    {
2028
      uint8_t tid = GetTid (m_currentPacket, m_currentHdr);
2028
      uint8_t tid = GetTid (m_currentPacket, m_currentHdr);
2029
      if (m_aggregateQueue[GetTid (m_currentPacket, m_currentHdr)]->GetNPackets () != 0)
2029
      if (!m_aggregateQueue[GetTid (m_currentPacket, m_currentHdr)]->IsEmpty ())
2030
        {
2030
        {
2031
          for (std::vector<Item>::size_type i = 0; i != m_txPackets[tid].size (); i++)
2031
          for (std::vector<Item>::size_type i = 0; i != m_txPackets[tid].size (); i++)
2032
            {
2032
            {
 Lines 3006-3012   MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr) Link Here 
3006
void
3006
void
3007
MacLow::FlushAggregateQueue (uint8_t tid)
3007
MacLow::FlushAggregateQueue (uint8_t tid)
3008
{
3008
{
3009
  if (m_aggregateQueue[tid]->GetNPackets () > 0)
3009
  if (!m_aggregateQueue[tid]->IsEmpty ())
3010
    {
3010
    {
3011
      NS_LOG_DEBUG ("Flush aggregate queue");
3011
      NS_LOG_DEBUG ("Flush aggregate queue");
3012
      m_aggregateQueue[tid]->Flush ();
3012
      m_aggregateQueue[tid]->Flush ();
(-)a/src/wifi/model/wifi-mac-queue.cc (-10 / +16 lines)
 Lines 163-177   WifiMacQueue::Enqueue (Ptr<WifiMacQueueItem> item) Link Here 
163
163
164
  NS_ASSERT_MSG (GetMode () == QueueBase::QUEUE_MODE_PACKETS, "WifiMacQueues must be in packet mode");
164
  NS_ASSERT_MSG (GetMode () == QueueBase::QUEUE_MODE_PACKETS, "WifiMacQueues must be in packet mode");
165
165
166
  // if the queue is full, check if the time-to-live of the oldest packet has
166
  // if the queue is full, remove the first stale packet (if any) encountered
167
  // expired. If so, it can be removed so as to make room for the new packet.
167
  // starting from the head of the queue, in order to make room for the new packet.
168
  if (GetNPackets () == GetMaxPackets ())
168
  if (QueueBase::GetNPackets () == GetMaxPackets ())
169
    {
169
    {
170
      auto it = Head ();
170
      auto it = Head ();
171
      TtlExceeded (it);
171
      while (it != Tail () && !TtlExceeded (it))
172
        {
173
          it++;
174
        }
172
    }
175
    }
173
176
174
  if (GetNPackets () == GetMaxPackets () && m_dropPolicy == DROP_OLDEST)
177
  if (QueueBase::GetNPackets () == GetMaxPackets () && m_dropPolicy == DROP_OLDEST)
175
    {
178
    {
176
      NS_LOG_DEBUG ("Remove the oldest item in the queue");
179
      NS_LOG_DEBUG ("Remove the oldest item in the queue");
177
      DoRemove (Head ());
180
      DoRemove (Head ());
 Lines 188-202   WifiMacQueue::PushFront (Ptr<WifiMacQueueItem> item) Link Here 
188
191
189
  NS_ASSERT_MSG (GetMode () == QueueBase::QUEUE_MODE_PACKETS, "WifiMacQueues must be in packet mode");
192
  NS_ASSERT_MSG (GetMode () == QueueBase::QUEUE_MODE_PACKETS, "WifiMacQueues must be in packet mode");
190
193
191
  // if the queue is full, check if the time-to-live of the oldest packet has
194
  // if the queue is full, remove the first stale packet (if any) encountered
192
  // expired. If so, it can be removed so as to make room for the new packet.
195
  // starting from the head of the queue, in order to make room for the new packet.
193
  if (GetNPackets () == GetMaxPackets ())
196
  if (QueueBase::GetNPackets () == GetMaxPackets ())
194
    {
197
    {
195
      auto it = Head ();
198
      auto it = Head ();
196
      TtlExceeded (it);
199
      while (it != Tail () && !TtlExceeded (it))
200
        {
201
          it++;
202
        }
197
    }
203
    }
198
204
199
  if (GetNPackets () == GetMaxPackets () && m_dropPolicy == DROP_OLDEST)
205
  if (QueueBase::GetNPackets () == GetMaxPackets () && m_dropPolicy == DROP_OLDEST)
200
    {
206
    {
201
      NS_LOG_DEBUG ("Remove the oldest item in the queue");
207
      NS_LOG_DEBUG ("Remove the oldest item in the queue");
202
      DoRemove (Head ());
208
      DoRemove (Head ());

Return to bug 2744