|
|
| 758 |
NS_LOG_FUNCTION (this << duration); |
758 |
NS_LOG_FUNCTION (this << duration); |
| 759 |
if (m_rxing) |
759 |
if (m_rxing) |
| 760 |
{ |
760 |
{ |
| 761 |
//this may be caused only if PHY has started to receive a packet |
761 |
if (Simulator::Now () - m_lastRxStart <= m_sifs) |
| 762 |
//inside SIFS, so, we check that lastRxStart was maximum a SIFS ago |
762 |
{ |
| 763 |
NS_ASSERT (Simulator::Now () - m_lastRxStart <= m_sifs); |
763 |
//this may be caused if PHY has started to receive a packet |
| 764 |
m_lastRxEnd = Simulator::Now (); |
764 |
//inside SIFS, so, we check that lastRxStart was within a SIFS ago |
| 765 |
m_lastRxDuration = m_lastRxEnd - m_lastRxStart; |
765 |
m_lastRxEnd = Simulator::Now (); |
| 766 |
m_lastRxReceivedOk = true; |
766 |
m_lastRxDuration = m_lastRxEnd - m_lastRxStart; |
| 767 |
m_rxing = false; |
767 |
m_lastRxReceivedOk = true; |
|
|
768 |
m_rxing = false; |
| 769 |
} |
| 770 |
else |
| 771 |
{ |
| 772 |
// Bug 2477: It is possible for the DCF to fall out of |
| 773 |
// sync with the PHY state if there are problems |
| 774 |
// receiving A-MPDUs. PHY will cancel the reception |
| 775 |
// and start to transmit |
| 776 |
NS_LOG_DEBUG ("Phy is transmitting despite DCF being in receive state"); |
| 777 |
m_lastRxEnd = Simulator::Now (); |
| 778 |
m_lastRxDuration = m_lastRxEnd - m_lastRxStart; |
| 779 |
m_lastRxReceivedOk = false; |
| 780 |
m_rxing = false; |
| 781 |
} |
| 768 |
} |
782 |
} |
| 769 |
MY_DEBUG ("tx start for " << duration); |
783 |
MY_DEBUG ("tx start for " << duration); |
| 770 |
UpdateBackoff (); |
784 |
UpdateBackoff (); |