diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 46df2dc9b..918dbe393 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -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 diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index e314ba65f..8c6a77552 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -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 gcrGroup); /// TracedCallback for block ack agreement established events typedef - using BaEstablishedTracedCallback = TracedCallback; + using BaEstablishedTracedCallback = + TracedCallback>; BaEstablishedTracedCallback m_baEstablishedCallback; //!< traced callback for block ack agreement established events diff --git a/src/wifi/test/wifi-retransmit-test.cc b/src/wifi/test/wifi-retransmit-test.cc index f36316188..1d01e9875 100644 --- a/src/wifi/test/wifi-retransmit-test.cc +++ b/src/wifi/test/wifi-retransmit-test.cc @@ -269,14 +269,15 @@ WifiRetransmitTest::DoSetup() dev->GetMac()->GetWifiPhy(linkId)->SetPostReceptionErrorModel(m_apErrorModel); } - Callback 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> baEstablished = + [this](Mac48Address, uint8_t, std::optional) { + 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);