diff --git a/src/wifi/helper/wifi-mac-helper.cc b/src/wifi/helper/wifi-mac-helper.cc index b7c403ed7..261255fd5 100644 --- a/src/wifi/helper/wifi-mac-helper.cc +++ b/src/wifi/helper/wifi-mac-helper.cc @@ -65,10 +65,12 @@ WifiMacHelper::Create (Ptr device, WifiStandard standard) const { Ptr protectionManager = m_protectionManager.Create (); protectionManager->SetWifiMac (mac); + protectionManager->SetLinkId (SINGLE_LINK_OP_ID); fem->SetProtectionManager (protectionManager); Ptr ackManager = m_ackManager.Create (); ackManager->SetWifiMac (mac); + ackManager->SetLinkId (SINGLE_LINK_OP_ID); fem->SetAckManager (ackManager); // create and install the Multi User Scheduler if this is an HE AP diff --git a/src/wifi/model/wifi-ack-manager.cc b/src/wifi/model/wifi-ack-manager.cc index 5485bd494..d83b5a85b 100644 --- a/src/wifi/model/wifi-ack-manager.cc +++ b/src/wifi/model/wifi-ack-manager.cc @@ -40,6 +40,12 @@ WifiAckManager::GetTypeId (void) return tid; } +WifiAckManager::WifiAckManager () + : m_linkId (0) +{ + NS_LOG_FUNCTION (this); +} + WifiAckManager::~WifiAckManager () { NS_LOG_FUNCTION_NOARGS (); @@ -60,6 +66,13 @@ WifiAckManager::SetWifiMac (Ptr mac) m_mac = mac; } +void +WifiAckManager::SetLinkId (uint8_t linkId) +{ + NS_LOG_FUNCTION (this << +linkId); + m_linkId = linkId; +} + void WifiAckManager::SetQosAckPolicy (Ptr item, const WifiAcknowledgment* acknowledgment) { diff --git a/src/wifi/model/wifi-ack-manager.h b/src/wifi/model/wifi-ack-manager.h index 1e97b1bbb..7b923ce8a 100644 --- a/src/wifi/model/wifi-ack-manager.h +++ b/src/wifi/model/wifi-ack-manager.h @@ -47,6 +47,7 @@ public: * \return the object TypeId */ static TypeId GetTypeId (void); + WifiAckManager (); virtual ~WifiAckManager (); /** @@ -55,6 +56,12 @@ public: * \param mac a pointer to the MAC */ void SetWifiMac (Ptr mac); + /** + * Set the ID of the link this Acknowledgment Manager is associated with. + * + * \param linkId the ID of the link this Acknowledgment Manager is associated with + */ + void SetLinkId (uint8_t linkId); /** * Set the QoS Ack policy for the given MPDU, which must be a QoS data frame. @@ -102,6 +109,7 @@ protected: void DoDispose (void) override; 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 2c8b973c8..af18fe42d 100644 --- a/src/wifi/model/wifi-default-ack-manager.cc +++ b/src/wifi/model/wifi-default-ack-manager.cc @@ -644,7 +644,7 @@ WifiDefaultAckManager::TryUlMuTransmission (Ptr mpdu, Ptr apMac = DynamicCast (m_mac); NS_ABORT_MSG_IF (apMac == nullptr, "HE APs only can send Trigger Frames"); - Ptr heFem = DynamicCast (m_mac->GetFrameExchangeManager ()); + auto heFem = DynamicCast (m_mac->GetFrameExchangeManager (m_linkId)); NS_ABORT_MSG_IF (heFem == nullptr, "HE APs only can send Trigger Frames"); CtrlTriggerHeader trigger; diff --git a/src/wifi/model/wifi-protection-manager.cc b/src/wifi/model/wifi-protection-manager.cc index f21563413..d2366a15b 100644 --- a/src/wifi/model/wifi-protection-manager.cc +++ b/src/wifi/model/wifi-protection-manager.cc @@ -39,6 +39,12 @@ WifiProtectionManager::GetTypeId (void) return tid; } +WifiProtectionManager::WifiProtectionManager () + : m_linkId (0) +{ + NS_LOG_FUNCTION (this); +} + WifiProtectionManager::~WifiProtectionManager () { NS_LOG_FUNCTION_NOARGS (); @@ -59,4 +65,11 @@ WifiProtectionManager::SetWifiMac (Ptr mac) m_mac = mac; } +void +WifiProtectionManager::SetLinkId (uint8_t linkId) +{ + NS_LOG_FUNCTION (this << +linkId); + m_linkId = linkId; +} + } //namespace ns3 diff --git a/src/wifi/model/wifi-protection-manager.h b/src/wifi/model/wifi-protection-manager.h index 7d00e9cb0..22e1ae6b4 100644 --- a/src/wifi/model/wifi-protection-manager.h +++ b/src/wifi/model/wifi-protection-manager.h @@ -46,6 +46,7 @@ public: * \return the object TypeId */ static TypeId GetTypeId (void); + WifiProtectionManager (); virtual ~WifiProtectionManager (); /** @@ -54,6 +55,12 @@ public: * \param mac a pointer to the MAC */ void SetWifiMac (Ptr mac); + /** + * Set the ID of the link this Protection Manager is associated with. + * + * \param linkId the ID of the link this Protection Manager is associated with + */ + void SetLinkId (uint8_t linkId); /** * Determine the protection method to use if the given MPDU is added to the current @@ -85,6 +92,7 @@ protected: virtual void DoDispose (void); Ptr m_mac; //!< MAC which is using this Protection Manager + uint8_t m_linkId; //!< ID of the link this Protection Manager is operating on };