wifi: Move getters for BA and BAR type to WifiMac
This commit is contained in:
committed by
Stefano Avallone
parent
e7dbd9ff45
commit
8edde5c8f9
@@ -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
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -564,18 +564,6 @@ QosTxop::AssignSequenceNumber(Ptr<WifiMpdu> 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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -318,8 +318,8 @@ WifiDefaultAckManager::TryAddMpdu(Ptr<const WifiMpdu> 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<WifiAcknowledgment>(acknowledgment);
|
||||
}
|
||||
@@ -329,7 +329,7 @@ WifiDefaultAckManager::TryAddMpdu(Ptr<const WifiMpdu> 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<WifiAcknowledgment>(acknowledgment);
|
||||
}
|
||||
@@ -404,7 +404,7 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence(Ptr<const WifiMpdu> mpdu,
|
||||
receiver,
|
||||
WifiDlMuBarBaSequence::BlockAckInfo{
|
||||
GetWifiRemoteStationManager()->GetBlockAckTxVector(receiver, txParams.m_txVector),
|
||||
edca->GetBlockAckType(receiver, tid)});
|
||||
m_mac->GetBaTypeAsOriginator(receiver, tid)});
|
||||
return std::unique_ptr<WifiDlMuBarBaSequence>(acknowledgment);
|
||||
}
|
||||
|
||||
@@ -434,9 +434,9 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence(Ptr<const WifiMpdu> 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<WifiDlMuBarBaSequence>(acknowledgment);
|
||||
@@ -535,9 +535,9 @@ WifiDefaultAckManager::GetAckInfoIfTfMuBar(Ptr<const WifiMpdu> 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<WifiDlMuTfMuBar>(acknowledgment);
|
||||
@@ -619,10 +619,10 @@ WifiDefaultAckManager::GetAckInfoIfAggregatedMuBar(Ptr<const WifiMpdu> 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<WifiDlMuAggregateTf>(acknowledgment);
|
||||
|
||||
@@ -1238,6 +1238,24 @@ WifiMac::DeaggregateAmsduAndForward(Ptr<const WifiMpdu> 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<HtConfiguration>
|
||||
WifiMac::GetHtConfiguration() const
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user