wifi: Update trace source to notify of block ack agreement established for GCR

This commit is contained in:
Sébastien Deronne
2025-02-01 09:39:28 +01:00
parent bc5fa906f7
commit e6d3feeb34
3 changed files with 17 additions and 12 deletions

View File

@@ -90,7 +90,7 @@ QosTxop::GetTypeId()
"ns3::QosTxop::TxopTracedCallback")
.AddTraceSource("BaEstablished",
"A block ack agreement is established with the given recipient for "
"the given TID.",
"the given TID (and the given GCR group address, if any).",
MakeTraceSourceAccessor(&QosTxop::m_baEstablishedCallback),
"ns3::QosTxop::BaEstablishedCallback");
return tid;
@@ -689,7 +689,7 @@ QosTxop::GotAddBaResponse(const MgtAddBaResponseHeader& respHdr, Mac48Address re
NS_LOG_DEBUG("block ack agreement established with "
<< recipient << " tid " << +tid << (gcrGroup ? " group " : "")
<< (gcrGroup ? gcrGroup->ConvertTo() : Address()));
m_baEstablishedCallback(recipient, tid);
m_baEstablishedCallback(recipient, tid, gcrGroup);
// A (destination, TID) pair is "blocked" (i.e., no more packets are sent) when an
// Add BA Request is sent to the destination. However, when the Add BA Request timer
// expires, the (destination, TID) pair is "unblocked" and packets to the destination are

View File

@@ -477,11 +477,15 @@ class QosTxop : public Txop
*
* @param recipient the MAC address of the recipient
* @param tid the TID for which block ack agreement is established
* @param gcrGroup the GCR group address (if any)
*/
typedef void (*BaEstablishedCallback)(Mac48Address recipient, uint8_t tid);
typedef void (*BaEstablishedCallback)(Mac48Address recipient,
uint8_t tid,
std::optional<Mac48Address> gcrGroup);
/// TracedCallback for block ack agreement established events typedef
using BaEstablishedTracedCallback = TracedCallback<Mac48Address, uint8_t>;
using BaEstablishedTracedCallback =
TracedCallback<Mac48Address, uint8_t, std::optional<Mac48Address>>;
BaEstablishedTracedCallback
m_baEstablishedCallback; //!< traced callback for block ack agreement established events

View File

@@ -269,14 +269,15 @@ WifiRetransmitTest::DoSetup()
dev->GetMac()->GetWifiPhy(linkId)->SetPostReceptionErrorModel(m_apErrorModel);
}
Callback<void, Mac48Address, uint8_t> baEstablished = [this](Mac48Address, uint8_t) {
m_baEstablished = true;
// force the first TXOP to be started on link 0 in case of MLDs
if (m_nLinks > 1)
{
m_staMac->BlockTxOnLink(1, WifiQueueBlockedReason::TID_NOT_MAPPED);
}
};
Callback<void, Mac48Address, uint8_t, std::optional<Mac48Address>> baEstablished =
[this](Mac48Address, uint8_t, std::optional<Mac48Address>) {
m_baEstablished = true;
// force the first TXOP to be started on link 0 in case of MLDs
if (m_nLinks > 1)
{
m_staMac->BlockTxOnLink(1, WifiQueueBlockedReason::TID_NOT_MAPPED);
}
};
m_staMac->GetQosTxop(AC_BE)->TraceConnectWithoutContext("BaEstablished", baEstablished);