wifi: Add some new QosTxop methods

This commit is contained in:
Stefano Avallone
2020-11-29 19:11:10 +01:00
parent 597b78aaee
commit 255499b3c7
2 changed files with 74 additions and 14 deletions

View File

@@ -127,6 +127,22 @@ QosTxop::DoDispose (void)
Txop::DoDispose ();
}
void
QosTxop::SetQosQueueSize (Ptr<WifiMacQueueItem> mpdu)
{
NS_LOG_FUNCTION (this << *mpdu);
WifiMacHeader& hdr = mpdu->GetHeader ();
NS_ASSERT (hdr.IsQosData ());
uint32_t bufferSize = m_queue->GetNBytes (hdr.GetQosTid (), hdr.GetAddr1 ())
+ m_baManager->GetRetransmitQueue ()->GetNBytes (hdr.GetQosTid (), hdr.GetAddr1 ());
// A queue size value of 254 is used for all sizes greater than 64 768 octets.
uint8_t queueSize = static_cast<uint8_t> (std::ceil (std::min (bufferSize, 64769u) / 256.0));
NS_LOG_DEBUG ("Buffer size=" << bufferSize << " Queue Size=" << +queueSize);
hdr.SetQosQueueSize (queueSize);
}
void
QosTxop::SetQosFrameExchangeManager (const Ptr<QosFrameExchangeManager> qosFem)
{
@@ -134,6 +150,12 @@ QosTxop::SetQosFrameExchangeManager (const Ptr<QosFrameExchangeManager> qosFem)
m_qosFem = qosFem;
}
Ptr<BlockAckManager>
QosTxop::GetBaManager (void)
{
return m_baManager;
}
bool
QosTxop::GetBaAgreementEstablished (Mac48Address address, uint8_t tid) const
{
@@ -213,6 +235,12 @@ QosTxop::GetTypeOfStation (void) const
return m_typeOfStation;
}
bool
QosTxop::UseExplicitBarAfterMissedBlockAck (void) const
{
return m_useExplicitBarAfterMissedBlockAck;
}
bool
QosTxop::HasFramesToTransmit (void)
{
@@ -1785,6 +1813,12 @@ QosTxop::GetBlockAckThreshold (void) const
return m_blockAckThreshold;
}
uint16_t
QosTxop::GetBlockAckInactivityTimeout (void) const
{
return m_blockAckInactivityTimeout;
}
void
QosTxop::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq,
uint16_t timeout, bool immediateBAck)

View File

@@ -165,6 +165,19 @@ public:
*/
void SetQosFrameExchangeManager (const Ptr<QosFrameExchangeManager> qosFem);
/**
* Return true if an explicit BlockAckRequest is sent after a missed BlockAck
*
* \return true if an explicit BlockAckRequest is sent after a missed BlockAck
*/
bool UseExplicitBarAfterMissedBlockAck (void) const;
/**
* Get the Block Ack Manager associated with this QosTxop.
*
* \returns the Block Ack Manager
*/
Ptr<BlockAckManager> GetBaManager (void);
/**
* \param address recipient address of the peer station
* \param tid traffic ID.
@@ -255,6 +268,20 @@ public:
* \param recipient address of the recipient.
*/
void GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient);
/**
* Callback when ADDBA response is not received after timeout.
*
* \param recipient MAC address of recipient
* \param tid traffic ID
*/
void AddBaResponseTimeout (Mac48Address recipient, uint8_t tid);
/**
* Reset BA agreement after BA negotiation failed.
*
* \param recipient MAC address of recipient
* \param tid traffic ID
*/
void ResetBa (Mac48Address recipient, uint8_t tid);
/**
* Check if BlockAckRequest should be re-transmitted.
@@ -305,6 +332,12 @@ public:
* \param timeout the BlockAck inactivity timeout.
*/
void SetBlockAckInactivityTimeout (uint16_t timeout);
/**
* Get the BlockAck inactivity timeout.
*
* \return the BlockAck inactivity timeout.
*/
uint16_t GetBlockAckInactivityTimeout (void) const;
/**
* Sends DELBA frame to cancel a block ack agreement with STA
* addressed by <i>addr</i> for TID <i>tid</i>.
@@ -532,6 +565,13 @@ public:
*/
Mac48Address MapDestAddressForAggregation (const WifiMacHeader &hdr);
/**
* Set the Queue Size subfield of the QoS Control field of the given QoS data frame.
*
* \param mpdu the given QoS data frame
*/
void SetQosQueueSize (Ptr<WifiMacQueueItem> mpdu);
/**
* Return true if a TXOP has started.
*
@@ -623,20 +663,6 @@ private:
* \returns the TXOP fragment offset in bytes
*/
uint32_t GetTxopFragmentOffset (uint32_t fragmentNumber) const;
/**
* Callback when ADDBA response is not received after timeout.
*
* \param recipient MAC address of recipient
* \param tid traffic ID
*/
void AddBaResponseTimeout (Mac48Address recipient, uint8_t tid);
/**
* Reset BA agreement after BA negotiation failed.
*
* \param recipient MAC address of recipient
* \param tid traffic ID
*/
void ResetBa (Mac48Address recipient, uint8_t tid);
AcIndex m_ac; //!< the access category
TypeOfStation m_typeOfStation; //!< the type of station