diff -r 13017af6d1b0 src/wifi/model/ap-wifi-mac.cc --- a/src/wifi/model/ap-wifi-mac.cc Thu May 15 16:09:51 2014 -0700 +++ b/src/wifi/model/ap-wifi-mac.cc Fri May 16 09:43:00 2014 -0400 @@ -81,6 +81,7 @@ m_beaconDca->SetMaxCw (0); m_beaconDca->SetLow (m_low); m_beaconDca->SetManager (m_dcfManager); + m_beaconDca->SetTxMiddle (m_txMiddle); // Let the lower layers know that we are acting as an AP. SetTypeOfStation (AP); diff -r 13017af6d1b0 src/wifi/model/dca-txop.cc --- a/src/wifi/model/dca-txop.cc Thu May 15 16:09:51 2014 -0700 +++ b/src/wifi/model/dca-txop.cc Fri May 16 09:43:00 2014 -0400 @@ -145,7 +145,6 @@ m_dcf = new DcaTxop::Dcf (this); m_queue = CreateObject (); m_rng = new RealRandomStream (); - m_txMiddle = new MacTxMiddle (); } DcaTxop::~DcaTxop () @@ -163,7 +162,6 @@ delete m_transmissionListener; delete m_dcf; delete m_rng; - delete m_txMiddle; m_transmissionListener = 0; m_dcf = 0; m_rng = 0; @@ -178,6 +176,11 @@ m_manager->Add (m_dcf); } +void DcaTxop::SetTxMiddle (MacTxMiddle *txMiddle) +{ + m_txMiddle = txMiddle; +} + void DcaTxop::SetLow (Ptr low) { diff -r 13017af6d1b0 src/wifi/model/dca-txop.h --- a/src/wifi/model/dca-txop.h Thu May 15 16:09:51 2014 -0700 +++ b/src/wifi/model/dca-txop.h Fri May 16 09:43:00 2014 -0400 @@ -101,6 +101,12 @@ * \param remoteManager WifiRemoteStationManager */ void SetWifiRemoteStationManager (Ptr remoteManager); + /** + * Set MacTxMiddle this DcaTxop is associated to. + * + * \param txMiddle MacTxMiddle + */ + void SetTxMiddle (MacTxMiddle *txMiddle); /** * \param callback the callback to invoke when a diff -r 13017af6d1b0 src/wifi/model/regular-wifi-mac.cc --- a/src/wifi/model/regular-wifi-mac.cc Thu May 15 16:09:51 2014 -0700 +++ b/src/wifi/model/regular-wifi-mac.cc Fri May 16 09:43:00 2014 -0400 @@ -57,6 +57,7 @@ m_dca = CreateObject (); m_dca->SetLow (m_low); m_dca->SetManager (m_dcfManager); + m_dca->SetTxMiddle(m_txMiddle); m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this)); m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));