OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006, 2009 INRIA | 3 * Copyright (c) 2006, 2009 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 ; | 235 ; |
236 return tid; | 236 return tid; |
237 } | 237 } |
238 | 238 |
239 EdcaTxopN::EdcaTxopN () | 239 EdcaTxopN::EdcaTxopN () |
240 : m_manager (0), | 240 : m_manager (0), |
241 m_currentPacket (0), | 241 m_currentPacket (0), |
242 m_aggregator (0), | 242 m_aggregator (0), |
243 m_typeOfStation (STA), | 243 m_typeOfStation (STA), |
244 m_blockAckType (COMPRESSED_BLOCK_ACK), | 244 m_blockAckType (COMPRESSED_BLOCK_ACK), |
245 m_ampduExist (false) | 245 m_ampduExist (false), |
| 246 m_needToWake (false) |
246 { | 247 { |
247 NS_LOG_FUNCTION (this); | 248 NS_LOG_FUNCTION (this); |
248 m_transmissionListener = new EdcaTxopN::TransmissionListener (this); | 249 m_transmissionListener = new EdcaTxopN::TransmissionListener (this); |
249 m_blockAckListener = new EdcaTxopN::AggregationCapableTransmissionListener (th
is); | 250 m_blockAckListener = new EdcaTxopN::AggregationCapableTransmissionListener (th
is); |
250 m_dcf = new EdcaTxopN::Dcf (this); | 251 m_dcf = new EdcaTxopN::Dcf (this); |
251 m_queue = CreateObject<WifiMacQueue> (); | 252 m_queue = CreateObject<WifiMacQueue> (); |
252 m_rng = new RealRandomStream (); | 253 m_rng = new RealRandomStream (); |
253 m_qosBlockedDestinations = new QosBlockedDestinations (); | 254 m_qosBlockedDestinations = new QosBlockedDestinations (); |
254 m_baManager = new BlockAckManager (); | 255 m_baManager = new BlockAckManager (); |
255 m_baManager->SetQueue (m_queue); | 256 m_baManager->SetQueue (m_queue); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 725 } |
725 | 726 |
726 void | 727 void |
727 EdcaTxopN::Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr) | 728 EdcaTxopN::Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr) |
728 { | 729 { |
729 NS_LOG_FUNCTION (this << packet << &hdr); | 730 NS_LOG_FUNCTION (this << packet << &hdr); |
730 WifiMacTrailer fcs; | 731 WifiMacTrailer fcs; |
731 uint32_t fullPacketSize = hdr.GetSerializedSize () + packet->GetSize () + fcs.
GetSerializedSize (); | 732 uint32_t fullPacketSize = hdr.GetSerializedSize () + packet->GetSize () + fcs.
GetSerializedSize (); |
732 m_stationManager->PrepareForQueue (hdr.GetAddr1 (), &hdr, | 733 m_stationManager->PrepareForQueue (hdr.GetAddr1 (), &hdr, |
733 packet, fullPacketSize); | 734 packet, fullPacketSize); |
| 735 m_needToWake = false; |
| 736 if (m_queue->IsEmpty()) |
| 737 { |
| 738 m_needToWake = true; |
| 739 } |
| 740 |
734 m_queue->Enqueue (packet, hdr); | 741 m_queue->Enqueue (packet, hdr); |
| 742 |
| 743 if (m_queue->GetMaxSize() == m_queue->GetSize()) |
| 744 { |
| 745 m_needToWake = true; |
| 746 } |
| 747 |
735 StartAccessIfNeeded (); | 748 StartAccessIfNeeded (); |
736 } | 749 } |
737 | 750 |
738 void | 751 void |
739 EdcaTxopN::GotAck (double snr, WifiMode txMode) | 752 EdcaTxopN::GotAck (double snr, WifiMode txMode) |
740 { | 753 { |
741 NS_LOG_FUNCTION (this << snr << txMode); | 754 NS_LOG_FUNCTION (this << snr << txMode); |
742 if (!NeedFragmentation () | 755 if (!NeedFragmentation () |
743 || IsLastFragment () | 756 || IsLastFragment () |
744 || m_currentHdr.IsQosAmsdu ()) | 757 || m_currentHdr.IsQosAmsdu ()) |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 void | 1490 void |
1478 EdcaTxopN::BaTxFailed (const WifiMacHeader &hdr) | 1491 EdcaTxopN::BaTxFailed (const WifiMacHeader &hdr) |
1479 { | 1492 { |
1480 NS_LOG_FUNCTION (this << hdr); | 1493 NS_LOG_FUNCTION (this << hdr); |
1481 if (!m_txFailedCallback.IsNull ()) | 1494 if (!m_txFailedCallback.IsNull ()) |
1482 { | 1495 { |
1483 m_txFailedCallback (m_currentHdr); | 1496 m_txFailedCallback (m_currentHdr); |
1484 } | 1497 } |
1485 } | 1498 } |
1486 | 1499 |
| 1500 bool |
| 1501 EdcaTxopN::GetNeedToWake (void) |
| 1502 { |
| 1503 return m_needToWake; |
| 1504 } |
| 1505 |
1487 } // namespace ns3 | 1506 } // namespace ns3 |
OLD | NEW |