wifi: Ack and Protection manager call the remote station manager on the same link
This commit is contained in:
committed by
Stefano Avallone
parent
6abb42d1db
commit
3d86cd127c
@@ -66,6 +66,12 @@ WifiAckManager::SetWifiMac (Ptr<WifiMac> mac)
|
||||
m_mac = mac;
|
||||
}
|
||||
|
||||
Ptr<WifiRemoteStationManager>
|
||||
WifiAckManager::GetWifiRemoteStationManager (void) const
|
||||
{
|
||||
return m_mac->GetWifiRemoteStationManager (m_linkId);
|
||||
}
|
||||
|
||||
void
|
||||
WifiAckManager::SetLinkId (uint8_t linkId)
|
||||
{
|
||||
|
||||
@@ -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<WifiRemoteStationManager> GetWifiRemoteStationManager (void) const;
|
||||
|
||||
Ptr<WifiMac> m_mac; //!< MAC which is using this Acknowledgment Manager
|
||||
uint8_t m_linkId; //!< ID of the link this Acknowledgment Manager is operating on
|
||||
};
|
||||
|
||||
@@ -259,7 +259,7 @@ WifiDefaultAckManager::TryAddMpdu (Ptr<const WifiMpdu> 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<const WifiMpdu> 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<WifiAcknowledgment> (acknowledgment);
|
||||
}
|
||||
@@ -312,7 +312,7 @@ WifiDefaultAckManager::TryAddMpdu (Ptr<const WifiMpdu> 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<const WifiMpdu> 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<WifiAcknowledgment> (acknowledgment);
|
||||
@@ -400,7 +400,7 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence (Ptr<const WifiMpdu> 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<WifiDlMuBarBaSequence> (acknowledgment);
|
||||
@@ -432,9 +432,9 @@ WifiDefaultAckManager::GetAckInfoIfBarBaSequence (Ptr<const WifiMpdu> 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<const WifiMpdu> 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<const WifiMpdu> 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<WifiDlMuTfMuBar> (acknowledgment);
|
||||
}
|
||||
@@ -687,7 +687,7 @@ WifiDefaultAckManager::TryUlMuTransmission (Ptr<const WifiMpdu> 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<WifiUlMuMultiStaBa> (acknowledgment);
|
||||
}
|
||||
|
||||
@@ -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<WifiProtection> (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<WifiProtection> (protection);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,12 @@ WifiProtectionManager::SetWifiMac (Ptr<WifiMac> mac)
|
||||
m_mac = mac;
|
||||
}
|
||||
|
||||
Ptr<WifiRemoteStationManager>
|
||||
WifiProtectionManager::GetWifiRemoteStationManager (void) const
|
||||
{
|
||||
return m_mac->GetWifiRemoteStationManager (m_linkId);
|
||||
}
|
||||
|
||||
void
|
||||
WifiProtectionManager::SetLinkId (uint8_t linkId)
|
||||
{
|
||||
|
||||
@@ -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<WifiRemoteStationManager> GetWifiRemoteStationManager (void) const;
|
||||
|
||||
Ptr<WifiMac> m_mac; //!< MAC which is using this Protection Manager
|
||||
uint8_t m_linkId; //!< ID of the link this Protection Manager is operating on
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user