wifi: Add a WifiMac method to check if TX is blocked on a link
This commit is contained in:
@@ -1620,6 +1620,25 @@ WifiMac::UnblockUnicastTxOnLinks(WifiQueueBlockedReason reason,
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
WifiMac::GetTxBlockedOnLink(AcIndex ac,
|
||||
const WifiContainerQueueId& queueId,
|
||||
uint8_t linkId,
|
||||
WifiQueueBlockedReason reason) const
|
||||
{
|
||||
auto mask = m_scheduler->GetQueueLinkMask(ac, queueId, linkId);
|
||||
|
||||
if (!mask.has_value())
|
||||
{
|
||||
return true; // the link may have not been setup
|
||||
}
|
||||
if (reason == WifiQueueBlockedReason::REASONS_COUNT)
|
||||
{
|
||||
return mask->any();
|
||||
}
|
||||
return mask->test(static_cast<std::size_t>(reason));
|
||||
}
|
||||
|
||||
void
|
||||
WifiMac::Enqueue(Ptr<Packet> packet, Mac48Address to)
|
||||
{
|
||||
|
||||
@@ -351,6 +351,22 @@ class WifiMac : public Object
|
||||
const Mac48Address& address,
|
||||
const std::set<uint8_t>& linkIds);
|
||||
|
||||
/**
|
||||
* Check whether the transmission of the packets in the given container queue of the given
|
||||
* Access Category are blocked on the given link for the given reason (if any).
|
||||
*
|
||||
* \param ac the given Access Category
|
||||
* \param queueId the given container queue
|
||||
* \param linkId the ID of the given link
|
||||
* \param reason the reason to block transmissions (REASONS_COUNT indicate no reason)
|
||||
* \return whether transmission is blocked
|
||||
*/
|
||||
bool GetTxBlockedOnLink(
|
||||
AcIndex ac,
|
||||
const WifiContainerQueueId& queueId,
|
||||
uint8_t linkId,
|
||||
WifiQueueBlockedReason reason = WifiQueueBlockedReason::REASONS_COUNT) const;
|
||||
|
||||
/**
|
||||
* Return true if packets can be forwarded to the given destination,
|
||||
* false otherwise.
|
||||
|
||||
Reference in New Issue
Block a user