diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 9756eb6d3..04a059ee8 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -850,22 +850,6 @@ BlockAckManager::GetRecipientBufferSize(Mac48Address recipient, uint8_t tid) con return size; } -BlockAckReqType -BlockAckManager::GetBlockAckReqType(Mac48Address recipient, uint8_t tid) const -{ - AgreementsCI it = m_agreements.find(std::make_pair(recipient, tid)); - NS_ABORT_MSG_IF(it == m_agreements.end(), "No established Block Ack agreement"); - return it->second.first.GetBlockAckReqType(); -} - -BlockAckType -BlockAckManager::GetBlockAckType(Mac48Address recipient, uint8_t tid) const -{ - AgreementsCI it = m_agreements.find(std::make_pair(recipient, tid)); - NS_ABORT_MSG_IF(it == m_agreements.end(), "No established Block Ack agreement"); - return it->second.first.GetBlockAckType(); -} - uint16_t BlockAckManager::GetOriginatorStartingSequence(Mac48Address recipient, uint8_t tid) const { diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index 86be29e8d..bef6f63a4 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -314,24 +314,6 @@ class BlockAckManager : public Object * \returns the buffer size negotiated with the recipient */ uint16_t GetRecipientBufferSize(Mac48Address recipient, uint8_t tid) const; - /** - * This function returns the type of Block Acks sent to the recipient. - * - * \param recipient MAC address of recipient - * \param tid Traffic ID - * - * \returns the type of Block Acks sent to the recipient - */ - BlockAckReqType GetBlockAckReqType(Mac48Address recipient, uint8_t tid) const; - /** - * This function returns the type of Block Acks sent by the recipient. - * - * \param recipient MAC address - * \param tid Traffic ID - * - * \returns the type of Block Acks sent by the recipient - */ - BlockAckType GetBlockAckType(Mac48Address recipient, uint8_t tid) const; /** * This function returns the starting sequence number of the transmit window. * diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 871cf6bd7..19ef5a4fe 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -564,18 +564,6 @@ QosTxop::AssignSequenceNumber(Ptr mpdu) const } } -BlockAckReqType -QosTxop::GetBlockAckReqType(Mac48Address recipient, uint8_t tid) const -{ - return m_baManager->GetBlockAckReqType(recipient, tid); -} - -BlockAckType -QosTxop::GetBlockAckType(Mac48Address recipient, uint8_t tid) const -{ - return m_baManager->GetBlockAckType(recipient, tid); -} - void QosTxop::NotifyChannelAccessed(uint8_t linkId, Time txopDuration) { diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 2f882da1f..970484167 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -144,24 +144,6 @@ class QosTxop : public Txop * recipient for the given TID. */ uint16_t GetBaStartingSequence(Mac48Address address, uint8_t tid) const; - /** - * \param recipient MAC address of recipient - * \param tid traffic ID - * - * \return the type of Block Ack Requests sent to the recipient - * - * This function returns the type of Block Ack Requests sent to the recipient. - */ - BlockAckReqType GetBlockAckReqType(Mac48Address recipient, uint8_t tid) const; - /** - * \param recipient MAC address - * \param tid traffic ID - * - * \return the type of Block Acks sent by the recipient - * - * This function returns the type of Block Acks sent by the recipient. - */ - BlockAckType GetBlockAckType(Mac48Address recipient, uint8_t tid) const; /** * \param recipient Address of recipient. * \param tid traffic ID. diff --git a/src/wifi/model/wifi-default-ack-manager.cc b/src/wifi/model/wifi-default-ack-manager.cc index 2944f702d..90a28a122 100644 --- a/src/wifi/model/wifi-default-ack-manager.cc +++ b/src/wifi/model/wifi-default-ack-manager.cc @@ -318,8 +318,8 @@ WifiDefaultAckManager::TryAddMpdu(Ptr mpdu, const WifiTxParamete 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); + acknowledgment->barType = m_mac->GetBarTypeAsOriginator(receiver, tid); + acknowledgment->baType = m_mac->GetBaTypeAsOriginator(receiver, tid); acknowledgment->SetQosAckPolicy(receiver, tid, WifiMacHeader::BLOCK_ACK); return std::unique_ptr(acknowledgment); } @@ -329,7 +329,7 @@ WifiDefaultAckManager::TryAddMpdu(Ptr mpdu, const WifiTxParamete WifiBlockAck* acknowledgment = new WifiBlockAck; acknowledgment->blockAckTxVector = GetWifiRemoteStationManager()->GetBlockAckTxVector(receiver, txParams.m_txVector); - acknowledgment->baType = m_mac->GetQosTxop(tid)->GetBlockAckType(receiver, tid); + acknowledgment->baType = m_mac->GetBaTypeAsOriginator(receiver, tid); acknowledgment->SetQosAckPolicy(receiver, tid, WifiMacHeader::NORMAL_ACK); return std::unique_ptr(acknowledgment); } @@ -404,7 +404,7 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence(Ptr mpdu, receiver, WifiDlMuBarBaSequence::BlockAckInfo{ GetWifiRemoteStationManager()->GetBlockAckTxVector(receiver, txParams.m_txVector), - edca->GetBlockAckType(receiver, tid)}); + m_mac->GetBaTypeAsOriginator(receiver, tid)}); return std::unique_ptr(acknowledgment); } @@ -434,9 +434,9 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence(Ptr mpdu, receiver, WifiDlMuBarBaSequence::BlockAckReqInfo{ GetWifiRemoteStationManager()->GetBlockAckTxVector(receiver, txParams.m_txVector), - edca->GetBlockAckReqType(receiver, tid), + m_mac->GetBarTypeAsOriginator(receiver, tid), GetWifiRemoteStationManager()->GetBlockAckTxVector(receiver, txParams.m_txVector), - edca->GetBlockAckType(receiver, tid)}); + m_mac->GetBaTypeAsOriginator(receiver, tid)}); acknowledgment->SetQosAckPolicy(receiver, tid, WifiMacHeader::BLOCK_ACK); return std::unique_ptr(acknowledgment); @@ -535,9 +535,9 @@ WifiDefaultAckManager::GetAckInfoIfTfMuBar(Ptr mpdu, receiver, WifiDlMuTfMuBar::BlockAckInfo{edca->GetBaManager()->GetBlockAckReqHeader(receiver, tid), blockAckTxVector, - edca->GetBlockAckType(receiver, tid)}); + m_mac->GetBaTypeAsOriginator(receiver, tid)}); - acknowledgment->barTypes.push_back(edca->GetBlockAckReqType(receiver, tid)); + acknowledgment->barTypes.push_back(m_mac->GetBarTypeAsOriginator(receiver, tid)); acknowledgment->muBarTxVector = GetWifiRemoteStationManager()->GetRtsTxVector(receiver); acknowledgment->SetQosAckPolicy(receiver, tid, WifiMacHeader::BLOCK_ACK); return std::unique_ptr(acknowledgment); @@ -619,10 +619,10 @@ WifiDefaultAckManager::GetAckInfoIfAggregatedMuBar(Ptr mpdu, acknowledgment->stationsReplyingWithBlockAck.emplace( receiver, WifiDlMuAggregateTf::BlockAckInfo{ - GetMuBarSize({edca->GetBlockAckReqType(receiver, tid)}), + GetMuBarSize({m_mac->GetBarTypeAsOriginator(receiver, tid)}), edca->GetBaManager()->GetBlockAckReqHeader(receiver, tid), blockAckTxVector, - edca->GetBlockAckType(receiver, tid)}); + m_mac->GetBaTypeAsOriginator(receiver, tid)}); acknowledgment->SetQosAckPolicy(receiver, tid, WifiMacHeader::NO_EXPLICIT_ACK); return std::unique_ptr(acknowledgment); diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index 39bcccb21..00049afc0 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -1238,6 +1238,24 @@ WifiMac::DeaggregateAmsduAndForward(Ptr mpdu) } } +BlockAckType +WifiMac::GetBaTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const +{ + auto agreement = GetQosTxop(tid)->GetBaManager()->GetAgreementAsOriginator(recipient, tid); + NS_ABORT_MSG_IF(!agreement, + "No existing Block Ack agreement with " << recipient << " TID: " << +tid); + return agreement->get().GetBlockAckType(); +} + +BlockAckReqType +WifiMac::GetBarTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const +{ + auto agreement = GetQosTxop(tid)->GetBaManager()->GetAgreementAsOriginator(recipient, tid); + NS_ABORT_MSG_IF(!agreement, + "No existing Block Ack agreement with " << recipient << " TID: " << +tid); + return agreement->get().GetBlockAckReqType(); +} + Ptr WifiMac::GetHtConfiguration() const { diff --git a/src/wifi/model/wifi-mac.h b/src/wifi/model/wifi-mac.h index 65d0f6da6..d42787f6f 100644 --- a/src/wifi/model/wifi-mac.h +++ b/src/wifi/model/wifi-mac.h @@ -529,6 +529,25 @@ class WifiMac : public Object */ uint16_t GetMaxAmsduSize(AcIndex ac) const; + /** + * \param recipient MAC address + * \param tid traffic ID + * + * \return the type of Block Acks sent by the recipient + * + * This function returns the type of Block Acks sent by the recipient. + */ + BlockAckType GetBaTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const; + /** + * \param recipient MAC address of recipient + * \param tid traffic ID + * + * \return the type of Block Ack Requests sent to the recipient + * + * This function returns the type of Block Ack Requests sent to the recipient. + */ + BlockAckReqType GetBarTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const; + protected: void DoInitialize() override; void DoDispose() override;