diff -r b92ee3137f95 src/devices/wifi/dca-txop.cc --- a/src/devices/wifi/dca-txop.cc Wed Oct 27 21:19:12 2010 -0700 +++ b/src/devices/wifi/dca-txop.cc Fri Nov 05 20:34:35 2010 +0100 @@ -89,6 +89,9 @@ virtual void Cancel (void) { m_txop->Cancel (); } + virtual void EndTxNoAck (void) { + m_txop->EndTxNoAck (); + } private: DcaTxop *m_txop; @@ -387,9 +390,6 @@ params, m_transmissionListener); m_currentPacket = 0; - m_dcf->ResetCw (); - m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ())); - StartAccessIfNeeded (); NS_LOG_DEBUG ("tx broadcast"); } else @@ -600,4 +600,15 @@ */ } +void +DcaTxop::EndTxNoAck (void) +{ + NS_LOG_FUNCTION (this); + NS_LOG_DEBUG ("a transmission that did not require an ACK just finished"); + NS_ASSERT (m_currentPacket == 0); + m_dcf->ResetCw (); + m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ())); + StartAccessIfNeeded (); +} + } // namespace ns3 diff -r b92ee3137f95 src/devices/wifi/dca-txop.h --- a/src/devices/wifi/dca-txop.h Wed Oct 27 21:19:12 2010 -0700 +++ b/src/devices/wifi/dca-txop.h Fri Nov 05 20:34:35 2010 +0100 @@ -137,6 +137,7 @@ void MissedAck (void); void StartNext (void); void Cancel (void); + void EndTxNoAck (void); void RestartAccessIfNeeded (void); void StartAccessIfNeeded (void); diff -r b92ee3137f95 src/devices/wifi/edca-txop-n.cc --- a/src/devices/wifi/edca-txop-n.cc Wed Oct 27 21:19:12 2010 -0700 +++ b/src/devices/wifi/edca-txop-n.cc Fri Nov 05 20:34:35 2010 +0100 @@ -96,6 +96,9 @@ virtual void Cancel (void) { m_txop->Cancel (); } + virtual void EndTxNoAck (void) { + m_txop->EndTxNoAck (); + } private: EdcaTxopN *m_txop; @@ -371,9 +374,6 @@ m_transmissionListener); m_currentPacket = 0; - m_dcf->ResetCw (); - m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ())); - StartAccessIfNeeded (); NS_LOG_DEBUG ("tx broadcast"); } else if (m_currentHdr.GetType() == WIFI_MAC_CTL_BACKREQ) @@ -716,6 +716,19 @@ NS_LOG_DEBUG ("transmission cancelled"); } + +void +EdcaTxopN::EndTxNoAck (void) +{ + NS_LOG_FUNCTION (this); + NS_LOG_DEBUG ("a transmission that did not require an ACK just finished"); + NS_ASSERT (m_currentPacket == 0); + m_dcf->ResetCw (); + m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ())); + StartAccessIfNeeded (); +} + + bool EdcaTxopN::NeedFragmentation (void) const { diff -r b92ee3137f95 src/devices/wifi/edca-txop-n.h --- a/src/devices/wifi/edca-txop-n.h Wed Oct 27 21:19:12 2010 -0700 +++ b/src/devices/wifi/edca-txop-n.h Fri Nov 05 20:34:35 2010 +0100 @@ -124,6 +124,7 @@ void MissedAck (void); void StartNext (void); void Cancel (void); + void EndTxNoAck (void); void RestartAccessIfNeeded (void); void StartAccessIfNeeded (void); diff -r b92ee3137f95 src/devices/wifi/mac-low.cc --- a/src/devices/wifi/mac-low.cc Wed Oct 27 21:19:12 2010 -0700 +++ b/src/devices/wifi/mac-low.cc Fri Nov 05 20:34:35 2010 +0100 @@ -344,6 +344,7 @@ m_sendAckEvent (), m_sendDataEvent (), m_waitSifsEvent (), + m_endTxNoAckEvent (), m_currentPacket (0), m_listener (0) { @@ -379,6 +380,7 @@ m_sendAckEvent.Cancel (); m_sendDataEvent.Cancel (); m_waitSifsEvent.Cancel (); + m_endTxNoAckEvent.Cancel (); m_phy = 0; m_stationManager = 0; delete m_phyMacLowListener; @@ -440,6 +442,11 @@ m_waitSifsEvent.Cancel (); oneRunning = true; } + if (m_endTxNoAckEvent.IsRunning ()) + { + m_endTxNoAckEvent.Cancel (); + oneRunning = true; + } if (oneRunning && m_listener != 0) { m_listener->Cancel (); diff -r b92ee3137f95 src/devices/wifi/mac-low.h --- a/src/devices/wifi/mac-low.h Wed Oct 27 21:19:12 2010 -0700 +++ b/src/devices/wifi/mac-low.h Fri Nov 05 20:34:35 2010 +0100 @@ -122,6 +122,14 @@ * down the stack to the PHY. */ virtual void Cancel (void) = 0; + + /** + * Invoked upon the end of the transmission of a frame that does not + * require an ACK (e.g., broadcast and multicast frames). + * + */ + virtual void EndTxNoAck (void) = 0; + }; @@ -596,6 +604,7 @@ EventId m_sendAckEvent; EventId m_sendDataEvent; EventId m_waitSifsEvent; + EventId m_endTxNoAckEvent; EventId m_navCounterResetCtsMissed; Ptr m_currentPacket;