|
|
| 354 |
m_sendCtsEvent (), |
354 |
m_sendCtsEvent (), |
| 355 |
m_sendAckEvent (), |
355 |
m_sendAckEvent (), |
| 356 |
m_sendDataEvent (), |
356 |
m_sendDataEvent (), |
| 357 |
m_waitSifsEvent (), |
357 |
m_waitIfsEvent (), |
| 358 |
m_endTxNoAckEvent (), |
358 |
m_endTxNoAckEvent (), |
| 359 |
m_currentPacket (0), |
359 |
m_currentPacket (0), |
| 360 |
m_listener (0), |
360 |
m_listener (0), |
|
|
| 420 |
m_sendCtsEvent.Cancel (); |
420 |
m_sendCtsEvent.Cancel (); |
| 421 |
m_sendAckEvent.Cancel (); |
421 |
m_sendAckEvent.Cancel (); |
| 422 |
m_sendDataEvent.Cancel (); |
422 |
m_sendDataEvent.Cancel (); |
| 423 |
m_waitSifsEvent.Cancel (); |
423 |
m_waitIfsEvent.Cancel (); |
| 424 |
m_endTxNoAckEvent.Cancel (); |
424 |
m_endTxNoAckEvent.Cancel (); |
| 425 |
m_waitRifsEvent.Cancel (); |
|
|
| 426 |
m_phy = 0; |
425 |
m_phy = 0; |
| 427 |
m_stationManager = 0; |
426 |
m_stationManager = 0; |
| 428 |
if (m_phyMacLowListener != 0) |
427 |
if (m_phyMacLowListener != 0) |
|
|
| 487 |
m_sendDataEvent.Cancel (); |
486 |
m_sendDataEvent.Cancel (); |
| 488 |
oneRunning = true; |
487 |
oneRunning = true; |
| 489 |
} |
488 |
} |
| 490 |
if (m_waitSifsEvent.IsRunning ()) |
489 |
if (m_waitIfsEvent.IsRunning ()) |
| 491 |
{ |
490 |
{ |
| 492 |
m_waitSifsEvent.Cancel (); |
491 |
m_waitIfsEvent.Cancel (); |
| 493 |
oneRunning = true; |
|
|
| 494 |
} |
| 495 |
if (m_waitRifsEvent.IsRunning ()) |
| 496 |
{ |
| 497 |
m_waitRifsEvent.Cancel (); |
| 498 |
oneRunning = true; |
492 |
oneRunning = true; |
| 499 |
} |
493 |
} |
| 500 |
if (m_endTxNoAckEvent.IsRunning ()) |
494 |
if (m_endTxNoAckEvent.IsRunning ()) |
|
|
| 1010 |
} |
1004 |
} |
| 1011 |
if (m_txParams.HasNextPacket ()) |
1005 |
if (m_txParams.HasNextPacket ()) |
| 1012 |
{ |
1006 |
{ |
| 1013 |
m_waitSifsEvent = Simulator::Schedule (GetSifs (), |
1007 |
if (m_stationManager->GetRifsPermitted ()) |
| 1014 |
&MacLow::WaitSifsAfterEndTxFragment, this); |
1008 |
{ |
|
|
1009 |
m_waitIfsEvent = Simulator::Schedule (GetRifs (), |
| 1010 |
&MacLow::WaitIfsAfterEndTxFragment, this); |
| 1011 |
} |
| 1012 |
else |
| 1013 |
{ |
| 1014 |
m_waitIfsEvent = Simulator::Schedule (GetSifs (), |
| 1015 |
&MacLow::WaitIfsAfterEndTxFragment, this); |
| 1016 |
} |
| 1015 |
} |
1017 |
} |
| 1016 |
else if (m_currentHdr.IsQosData () && !m_ampdu && m_listener->HasTxop ()) |
1018 |
else if (m_currentHdr.IsQosData () && !m_ampdu && m_listener->HasTxop ()) |
| 1017 |
{ |
1019 |
{ |
| 1018 |
m_waitSifsEvent = Simulator::Schedule (GetSifs (), |
1020 |
if (m_stationManager->GetRifsPermitted ()) |
| 1019 |
&MacLow::WaitSifsAfterEndTxPacketInTxop, this); |
1021 |
{ |
|
|
1022 |
m_waitIfsEvent = Simulator::Schedule (GetRifs (), |
| 1023 |
&MacLow::WaitIfsAfterEndTxPacketInTxop, this); |
| 1024 |
} |
| 1025 |
else |
| 1026 |
{ |
| 1027 |
m_waitIfsEvent = Simulator::Schedule (GetSifs (), |
| 1028 |
&MacLow::WaitIfsAfterEndTxPacketInTxop, this); |
| 1029 |
} |
| 1020 |
} |
1030 |
} |
| 1021 |
m_ampdu = false; |
1031 |
m_ampdu = false; |
| 1022 |
if (m_currentHdr.IsQosData ()) |
1032 |
if (m_currentHdr.IsQosData ()) |
|
|
| 1830 |
} |
1840 |
} |
| 1831 |
else if (m_txParams.HasNextPacket ()) |
1841 |
else if (m_txParams.HasNextPacket ()) |
| 1832 |
{ |
1842 |
{ |
| 1833 |
if (m_stationManager->HasHtSupported ()) |
1843 |
if (m_stationManager->GetRifsPermitted ()) |
|
|
1844 |
|
| 1834 |
{ |
1845 |
{ |
| 1835 |
Time delay = txDuration + GetRifs (); |
1846 |
Time delay = txDuration + GetRifs (); |
| 1836 |
NS_ASSERT (m_waitRifsEvent.IsExpired ()); |
1847 |
NS_ASSERT (m_waitIfsEvent.IsExpired ()); |
| 1837 |
m_waitRifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTxFragment, this); |
1848 |
m_waitIfsEvent = Simulator::Schedule (delay, &MacLow::WaitIfsAfterEndTxFragment, this); |
| 1838 |
} |
1849 |
} |
| 1839 |
else |
1850 |
else |
| 1840 |
{ |
1851 |
{ |
| 1841 |
Time delay = txDuration + GetSifs (); |
1852 |
Time delay = txDuration + GetSifs (); |
| 1842 |
NS_ASSERT (m_waitSifsEvent.IsExpired ()); |
1853 |
NS_ASSERT (m_waitIfsEvent.IsExpired ()); |
| 1843 |
m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTxFragment, this); |
1854 |
m_waitIfsEvent = Simulator::Schedule (delay, &MacLow::WaitIfsAfterEndTxFragment, this); |
| 1844 |
} |
1855 |
} |
| 1845 |
} |
1856 |
} |
| 1846 |
else if (m_currentHdr.IsQosData () && m_currentHdr.IsQosBlockAck ()) |
1857 |
else if (m_currentHdr.IsQosData () && m_currentHdr.IsQosBlockAck ()) |
| 1847 |
{ |
1858 |
{ |
| 1848 |
Time delay = txDuration + GetSifs (); |
1859 |
Time delay = txDuration; |
| 1849 |
m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTxPacketInBA, this); |
1860 |
if (m_stationManager->GetRifsPermitted ()) |
|
|
1861 |
{ |
| 1862 |
delay += GetRifs (); |
| 1863 |
} |
| 1864 |
else |
| 1865 |
{ |
| 1866 |
delay += GetSifs (); |
| 1867 |
} |
| 1868 |
NS_ASSERT (m_waitIfsEvent.IsExpired ()); |
| 1869 |
m_waitIfsEvent = Simulator::Schedule (delay, &MacLow::WaitIfsAfterEndTxPacketInBA, this); |
| 1850 |
} |
1870 |
} |
| 1851 |
else |
1871 |
else |
| 1852 |
{ |
1872 |
{ |
|
|
| 2081 |
} |
2101 |
} |
| 2082 |
if (m_txParams.HasNextPacket ()) |
2102 |
if (m_txParams.HasNextPacket ()) |
| 2083 |
{ |
2103 |
{ |
| 2084 |
newDuration += GetSifs (); |
2104 |
if (m_stationManager->GetRifsPermitted ()) |
| 2085 |
newDuration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), m_currentTxVector, m_phy->GetFrequency ()); |
2105 |
{ |
|
|
2106 |
newDuration += GetRifs (); |
| 2107 |
} |
| 2108 |
else |
| 2109 |
{ |
| 2110 |
newDuration += GetSifs (); |
| 2111 |
} newDuration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), m_currentTxVector, m_phy->GetFrequency ()); |
| 2086 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
2112 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
| 2087 |
{ |
2113 |
{ |
| 2088 |
newDuration += GetSifs (); |
2114 |
newDuration += GetSifs (); |
|
|
| 2118 |
} |
2144 |
} |
| 2119 |
|
2145 |
|
| 2120 |
void |
2146 |
void |
| 2121 |
MacLow::WaitSifsAfterEndTxFragment (void) |
2147 |
MacLow::WaitIfsAfterEndTxFragment (void) |
| 2122 |
{ |
2148 |
{ |
| 2123 |
m_listener->StartNextFragment (); |
2149 |
m_listener->StartNextFragment (); |
| 2124 |
} |
2150 |
} |
| 2125 |
|
2151 |
|
| 2126 |
void |
2152 |
void |
| 2127 |
MacLow::WaitSifsAfterEndTxPacketInBA (void) |
2153 |
MacLow::WaitIfsAfterEndTxPacketInBA (void) |
| 2128 |
{ |
2154 |
{ |
| 2129 |
m_listener->StartNextPacketInBA (); |
2155 |
m_listener->StartNextPacketInBA (); |
| 2130 |
} |
2156 |
} |
| 2131 |
|
2157 |
|
| 2132 |
void |
2158 |
void |
| 2133 |
MacLow::WaitSifsAfterEndTxPacketInTxop (void) |
2159 |
MacLow::WaitIfsAfterEndTxPacketInTxop (void) |
| 2134 |
{ |
2160 |
{ |
| 2135 |
m_listener->StartNextPacketInTxop (); |
2161 |
m_listener->StartNextPacketInTxop (); |
| 2136 |
} |
2162 |
} |