diff --git a/src/wifi/model/wifi-ack-manager.cc b/src/wifi/model/wifi-ack-manager.cc index 49bb380f0..0d243f288 100644 --- a/src/wifi/model/wifi-ack-manager.cc +++ b/src/wifi/model/wifi-ack-manager.cc @@ -66,6 +66,12 @@ WifiAckManager::SetWifiMac (Ptr mac) m_mac = mac; } +Ptr +WifiAckManager::GetWifiRemoteStationManager (void) const +{ + return m_mac->GetWifiRemoteStationManager (m_linkId); +} + void WifiAckManager::SetLinkId (uint8_t linkId) { diff --git a/src/wifi/model/wifi-ack-manager.h b/src/wifi/model/wifi-ack-manager.h index 0c4156f23..d02c8c381 100644 --- a/src/wifi/model/wifi-ack-manager.h +++ b/src/wifi/model/wifi-ack-manager.h @@ -32,6 +32,7 @@ class WifiTxParameters; class WifiMpdu; class WifiPsdu; class WifiMac; +class WifiRemoteStationManager; /** * \ingroup wifi @@ -108,6 +109,11 @@ public: protected: void DoDispose (void) override; + /** + * \return the remote station manager operating on our link + */ + Ptr GetWifiRemoteStationManager (void) const; + Ptr m_mac; //!< MAC which is using this Acknowledgment Manager uint8_t m_linkId; //!< ID of the link this Acknowledgment Manager is operating on }; diff --git a/src/wifi/model/wifi-default-ack-manager.cc b/src/wifi/model/wifi-default-ack-manager.cc index 2ed1462bc..aa16d348f 100644 --- a/src/wifi/model/wifi-default-ack-manager.cc +++ b/src/wifi/model/wifi-default-ack-manager.cc @@ -259,7 +259,7 @@ WifiDefaultAckManager::TryAddMpdu (Ptr mpdu, { NS_LOG_DEBUG ("Non-QoS data frame or Block Ack agreement not established, request Normal Ack"); WifiNormalAck* acknowledgment = new WifiNormalAck; - acknowledgment->ackTxVector = m_mac->GetWifiRemoteStationManager ()->GetAckTxVector (receiver, txParams.m_txVector); + acknowledgment->ackTxVector = GetWifiRemoteStationManager ()->GetAckTxVector (receiver, txParams.m_txVector); if (hdr.IsQosData ()) { acknowledgment->SetQosAckPolicy (receiver, hdr.GetQosTid (), WifiMacHeader::NORMAL_ACK); @@ -297,7 +297,7 @@ WifiDefaultAckManager::TryAddMpdu (Ptr mpdu, { NS_LOG_DEBUG ("Sending a single MPDU, no previous frame to ack: request Normal Ack"); WifiNormalAck* acknowledgment = new WifiNormalAck; - acknowledgment->ackTxVector = m_mac->GetWifiRemoteStationManager ()->GetAckTxVector (receiver, txParams.m_txVector); + acknowledgment->ackTxVector = GetWifiRemoteStationManager ()->GetAckTxVector (receiver, txParams.m_txVector); acknowledgment->SetQosAckPolicy (receiver, tid, WifiMacHeader::NORMAL_ACK); return std::unique_ptr (acknowledgment); } @@ -312,7 +312,7 @@ WifiDefaultAckManager::TryAddMpdu (Ptr mpdu, NS_LOG_DEBUG ("Request to schedule a Block Ack Request"); WifiBarBlockAck* acknowledgment = new WifiBarBlockAck; - acknowledgment->blockAckReqTxVector = m_mac->GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector); + acknowledgment->blockAckReqTxVector = GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector); acknowledgment->blockAckTxVector = acknowledgment->blockAckReqTxVector; acknowledgment->barType = m_mac->GetQosTxop (tid)->GetBlockAckReqType (receiver, tid); acknowledgment->baType = m_mac->GetQosTxop (tid)->GetBlockAckType (receiver, tid); @@ -322,7 +322,7 @@ WifiDefaultAckManager::TryAddMpdu (Ptr mpdu, NS_LOG_DEBUG ("A-MPDU using Implicit Block Ack Request policy or BlockAckReq, request Block Ack"); WifiBlockAck* acknowledgment = new WifiBlockAck; - acknowledgment->blockAckTxVector = m_mac->GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector); + acknowledgment->blockAckTxVector = GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector); acknowledgment->baType = m_mac->GetQosTxop (tid)->GetBlockAckType (receiver, tid); acknowledgment->SetQosAckPolicy (receiver, tid, WifiMacHeader::NORMAL_ACK); return std::unique_ptr (acknowledgment); @@ -400,7 +400,7 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence (Ptr mpdu, (receiver, WifiDlMuBarBaSequence::BlockAckInfo { - m_mac->GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector), + GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector), edca->GetBlockAckType (receiver, tid) }); return std::unique_ptr (acknowledgment); @@ -432,9 +432,9 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence (Ptr mpdu, (receiver, WifiDlMuBarBaSequence::BlockAckReqInfo { - m_mac->GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector), + GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector), edca->GetBlockAckReqType (receiver, tid), - m_mac->GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector), + GetWifiRemoteStationManager ()->GetBlockAckTxVector (receiver, txParams.m_txVector), edca->GetBlockAckType (receiver, tid) }); @@ -460,7 +460,7 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence (Ptr mpdu, (receiver, WifiDlMuBarBaSequence::AckInfo { - m_mac->GetWifiRemoteStationManager ()->GetAckTxVector (receiver, txParams.m_txVector) + GetWifiRemoteStationManager ()->GetAckTxVector (receiver, txParams.m_txVector) }); acknowledgment->SetQosAckPolicy (receiver, tid, WifiMacHeader::NORMAL_ACK); @@ -537,7 +537,7 @@ WifiDefaultAckManager::GetAckInfoIfTfMuBar (Ptr mpdu, }); acknowledgment->barTypes.push_back (edca->GetBlockAckReqType (receiver, tid)); - acknowledgment->muBarTxVector = m_mac->GetWifiRemoteStationManager ()->GetRtsTxVector (receiver); + acknowledgment->muBarTxVector = GetWifiRemoteStationManager ()->GetRtsTxVector (receiver); acknowledgment->SetQosAckPolicy (receiver, tid, WifiMacHeader::BLOCK_ACK); return std::unique_ptr (acknowledgment); } @@ -687,7 +687,7 @@ WifiDefaultAckManager::TryUlMuTransmission (Ptr mpdu, uint16_t staId = trigger.begin ()->GetAid12 (); acknowledgment->tbPpduTxVector = trigger.GetHeTbTxVector (staId); - acknowledgment->multiStaBaTxVector = m_mac->GetWifiRemoteStationManager ()->GetBlockAckTxVector (apMac->GetStaList ().find (staId)->second, + acknowledgment->multiStaBaTxVector = GetWifiRemoteStationManager ()->GetBlockAckTxVector (apMac->GetStaList ().find (staId)->second, acknowledgment->tbPpduTxVector); return std::unique_ptr (acknowledgment); } diff --git a/src/wifi/model/wifi-default-protection-manager.cc b/src/wifi/model/wifi-default-protection-manager.cc index e97f2e8d0..9e8304274 100644 --- a/src/wifi/model/wifi-default-protection-manager.cc +++ b/src/wifi/model/wifi-default-protection-manager.cc @@ -158,21 +158,21 @@ WifiDefaultProtectionManager::GetPsduProtection (const WifiMacHeader& hdr, uint3 } // check if RTS/CTS is needed - if (m_mac->GetWifiRemoteStationManager ()->NeedRts (hdr, size)) + if (GetWifiRemoteStationManager ()->NeedRts (hdr, size)) { WifiRtsCtsProtection* protection = new WifiRtsCtsProtection; - protection->rtsTxVector = m_mac->GetWifiRemoteStationManager ()->GetRtsTxVector (hdr.GetAddr1 ()); - protection->ctsTxVector = m_mac->GetWifiRemoteStationManager ()->GetCtsTxVector (hdr.GetAddr1 (), + protection->rtsTxVector = GetWifiRemoteStationManager ()->GetRtsTxVector (hdr.GetAddr1 ()); + protection->ctsTxVector = GetWifiRemoteStationManager ()->GetCtsTxVector (hdr.GetAddr1 (), protection->rtsTxVector.GetMode ()); return std::unique_ptr (protection); } // check if CTS-to-Self is needed - if (m_mac->GetWifiRemoteStationManager ()->GetUseNonErpProtection () - && m_mac->GetWifiRemoteStationManager ()->NeedCtsToSelf (txVector)) + if (GetWifiRemoteStationManager ()->GetUseNonErpProtection () + && GetWifiRemoteStationManager ()->NeedCtsToSelf (txVector)) { WifiCtsToSelfProtection* protection = new WifiCtsToSelfProtection; - protection->ctsTxVector = m_mac->GetWifiRemoteStationManager ()->GetCtsToSelfTxVector (); + protection->ctsTxVector = GetWifiRemoteStationManager ()->GetCtsToSelfTxVector (); return std::unique_ptr (protection); } diff --git a/src/wifi/model/wifi-protection-manager.cc b/src/wifi/model/wifi-protection-manager.cc index d2366a15b..582d4b2de 100644 --- a/src/wifi/model/wifi-protection-manager.cc +++ b/src/wifi/model/wifi-protection-manager.cc @@ -65,6 +65,12 @@ WifiProtectionManager::SetWifiMac (Ptr mac) m_mac = mac; } +Ptr +WifiProtectionManager::GetWifiRemoteStationManager (void) const +{ + return m_mac->GetWifiRemoteStationManager (m_linkId); +} + void WifiProtectionManager::SetLinkId (uint8_t linkId) { diff --git a/src/wifi/model/wifi-protection-manager.h b/src/wifi/model/wifi-protection-manager.h index 4b0371226..2a9efa995 100644 --- a/src/wifi/model/wifi-protection-manager.h +++ b/src/wifi/model/wifi-protection-manager.h @@ -31,6 +31,7 @@ namespace ns3 { class WifiTxParameters; class WifiMpdu; class WifiMac; +class WifiRemoteStationManager; /** * \ingroup wifi @@ -91,6 +92,11 @@ public: protected: virtual void DoDispose (void); + /** + * \return the remote station manager operating on our link + */ + Ptr GetWifiRemoteStationManager (void) const; + Ptr m_mac; //!< MAC which is using this Protection Manager uint8_t m_linkId; //!< ID of the link this Protection Manager is operating on };