diff --git a/CHANGES.md b/CHANGES.md index efd727ee2..006e905cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,7 @@ This file is a best-effort approach to solving this issue; we will do our best b * (dsr) Reformatted documentation and added a new concept figure. * (flow-monitor) Reformatted documentation and added a new concept figure. * (internet-apps) Added a parameter to the RADVD helper to announce a prefix without the autoconfiguration flag. +* (wifi) Callbacks connected to the `WifiMac::IcfDropReason` trace source are now passed a `struct IcfDropInfo` object that has three fields indicating the reason for dropping the ICF, the ID of the link on which the ICF was dropped and the MAC address of the sender of the ICF. ### Changes to build system diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index bf17230cd..332a16d80 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -1658,7 +1658,7 @@ EhtFrameExchangeManager::DropReceivedIcf() // started before the reception of the ICF ended. We drop this ICF and let the // UL TXOP continue. NS_LOG_DEBUG("Drop ICF because another EMLSR link is being used"); - m_icfDropCallback(WifiIcfDrop::USING_OTHER_LINK, m_linkId); + m_icfDropCallback({WifiIcfDrop::USING_OTHER_LINK, m_linkId, m_bssid}); return true; } } @@ -1692,7 +1692,7 @@ EhtFrameExchangeManager::DropReceivedIcf() NS_LOG_DEBUG( "Drop ICF due to not enough time for the main PHY to switch link; reason = " << *reason); - m_icfDropCallback(*reason, m_linkId); + m_icfDropCallback({*reason, m_linkId, m_bssid}); return true; } } diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.h b/src/wifi/model/eht/eht-frame-exchange-manager.h index 2f2eb9c3f..b90cf9ce9 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.h +++ b/src/wifi/model/eht/eht-frame-exchange-manager.h @@ -171,7 +171,7 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager void SetIcfPaddingAndTxVector(CtrlTriggerHeader& trigger, WifiTxVector& txVector) const; /// ICF drop reason traced callback (WifiMac exposes this trace source) - TracedCallback m_icfDropCallback; + WifiMac::IcfDropTracedCallback m_icfDropCallback; protected: void DoDispose() override; diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index a87ee7967..32b363ffd 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -376,10 +376,10 @@ WifiMac::GetTypeId() MakeTraceSourceAccessor(&WifiMac::m_psduMapResponseTimeoutCallback), "ns3::WifiMac::PsduMapResponseTimeoutCallback") .AddTraceSource("IcfDropReason", - "An ICF is dropped by an EMLSR client for the given reason on the " - "link with the given ID. This trace source is actually fed by the " - "EHT Frame Exchange Manager through the m_icfDropCallback member " - "variable.", + "An ICF sent by the given sender is dropped by an EMLSR client for " + "the given reason on the link with the given ID. This trace source " + "is actually fed by the EHT Frame Exchange Manager through the " + "m_icfDropCallback member variable.", MakeTraceSourceAccessor(&WifiMac::m_icfDropCallback), "ns3::WifiMac::IcfDropCallback"); return tid; diff --git a/src/wifi/model/wifi-mac.h b/src/wifi/model/wifi-mac.h index cb961c6f9..bbfd32c71 100644 --- a/src/wifi/model/wifi-mac.h +++ b/src/wifi/model/wifi-mac.h @@ -811,6 +811,24 @@ class WifiMac : public Object uint8_t tid, uint8_t linkId) const; + /// Information reported by ICF drop trace + struct IcfDropInfo + { + WifiIcfDrop reason{}; ///< the reason why the ICF was dropped by the EMLSR client + uint8_t linkId{}; ///< the ID of the link on which the ICF was dropped + Mac48Address sender; ///< the sender of the ICF + }; + + /** + * TracedCallback signature for ICF drop events. + * + * @param info information reported by ICF drop trace + */ + typedef void (*IcfDropCallback)(const IcfDropInfo& info); + + /// TracedCallback for ICF drop events typedef + using IcfDropTracedCallback = TracedCallback; + protected: void DoInitialize() override; void DoDispose() override; @@ -1380,17 +1398,6 @@ class WifiMac : public Object */ PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback; - /** - * TracedCallback signature for ICF drop events. - * - * @param reason the reason why the ICF was dropped by the EMLSR client - * @param linkId the ID of the link on which the ICF was dropped - */ - typedef void (*IcfDropCallback)(WifiIcfDrop reason, uint8_t linkId); - - /// TracedCallback for ICF drop events typedef - using IcfDropTracedCallback = TracedCallback; - IcfDropTracedCallback m_icfDropCallback; //!< traced callback for ICF drop events };