|
|
| 1976 |
NS_ASSERT (m_currentPacket != 0); |
1976 |
NS_ASSERT (m_currentPacket != 0); |
| 1977 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
1977 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
| 1978 |
|
1978 |
|
|
|
1979 |
if (m_aggregateQueue->GetSize () != 0) |
| 1980 |
{ |
| 1981 |
for(int i = 0; i < m_txPackets.size(); i++) |
| 1982 |
{ |
| 1983 |
uint8_t tid = GetTid (m_txPackets.at(i).packet, m_txPackets.at(i).hdr); |
| 1984 |
AcIndex ac = QosUtilsMapTidToAc (tid); |
| 1985 |
std::map<AcIndex, MacLowBlockAckEventListener*>::const_iterator listenerIt= m_edcaListeners.find(ac); |
| 1986 |
|
| 1987 |
listenerIt->second->CompleteMpduTx (m_txPackets.at(i).packet, m_txPackets.at(i).hdr, m_txPackets.at(i).timestamp); |
| 1988 |
} |
| 1989 |
m_txPackets.clear (); |
| 1990 |
} |
| 1991 |
|
| 1979 |
WifiPreamble preamble; |
1992 |
WifiPreamble preamble; |
| 1980 |
if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ())) |
1993 |
if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ())) |
| 1981 |
//In the future has to make sure that receiver has greenfield enabled |
1994 |
//In the future has to make sure that receiver has greenfield enabled |
|
|
| 2719 |
m_aggregateQueue->Enqueue (aggPacket, peekedHdr); |
2732 |
m_aggregateQueue->Enqueue (aggPacket, peekedHdr); |
| 2720 |
if (i == 1 && hdr.IsQosData ()) |
2733 |
if (i == 1 && hdr.IsQosData ()) |
| 2721 |
{ |
2734 |
{ |
|
|
2735 |
if (!m_txParams.MustSendRts ()) |
| 2736 |
{ |
| 2722 |
listenerIt->second->CompleteMpduTx (packet, hdr, tstamp); |
2737 |
listenerIt->second->CompleteMpduTx (packet, hdr, tstamp); |
|
|
2738 |
} |
| 2739 |
else |
| 2740 |
{ |
| 2741 |
InsertInTxQueue (packet, hdr, tstamp); |
| 2742 |
} |
| 2723 |
} |
2743 |
} |
| 2724 |
NS_LOG_DEBUG ("Adding packet with Sequence number " << peekedHdr.GetSequenceNumber()<<" to A-MPDU"); |
2744 |
NS_LOG_DEBUG ("Adding packet with Sequence number " << peekedHdr.GetSequenceNumber()<<" to A-MPDU"); |
| 2725 |
i++; |
2745 |
i++; |
| 2726 |
isAmpdu = true; |
2746 |
isAmpdu = true; |
| 2727 |
m_sentMpdus++; |
2747 |
m_sentMpdus++; |
| 2728 |
listenerIt->second->CompleteMpduTx (peekedPacket, peekedHdr, tstamp); |
2748 |
if (!m_txParams.MustSendRts ()) |
|
|
2749 |
{ |
| 2750 |
listenerIt->second->CompleteMpduTx (peekedPacket, peekedHdr, tstamp); |
| 2751 |
} |
| 2752 |
else |
| 2753 |
{ |
| 2754 |
InsertInTxQueue (peekedPacket, peekedHdr, tstamp); |
| 2755 |
} |
| 2729 |
if (retry) |
2756 |
if (retry) |
| 2730 |
listenerIt->second->RemoveFromBaQueue(tid, hdr.GetAddr1 (), peekedHdr.GetSequenceNumber ()); |
2757 |
listenerIt->second->RemoveFromBaQueue(tid, hdr.GetAddr1 (), peekedHdr.GetSequenceNumber ()); |
| 2731 |
else |
2758 |
else |
|
|
| 2811 |
{ |
2838 |
{ |
| 2812 |
NS_LOG_DEBUG("Flush aggregate queue"); |
2839 |
NS_LOG_DEBUG("Flush aggregate queue"); |
| 2813 |
m_aggregateQueue->Flush (); |
2840 |
m_aggregateQueue->Flush (); |
|
|
2841 |
m_txPackets.clear (); |
| 2842 |
} |
| 2843 |
|
| 2844 |
void |
| 2845 |
MacLow::InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp) |
| 2846 |
{ |
| 2847 |
Item item; |
| 2848 |
|
| 2849 |
item.packet = packet; |
| 2850 |
item.hdr = hdr; |
| 2851 |
item.timestamp = tStamp; |
| 2852 |
|
| 2853 |
m_txPackets.push_back (item); |
| 2814 |
} |
2854 |
} |
| 2815 |
|
2855 |
|
| 2816 |
} // namespace ns3 |
2856 |
} // namespace ns3 |