From 07b4ad8efd65945094521880b0670d445147fc95 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 8 Feb 2022 12:21:12 +0100 Subject: [PATCH] wifi: Inactivity callback must be setup on originator, not on recipient --- .../model/ht/ht-frame-exchange-manager.cc | 1 - src/wifi/model/ht/ht-frame-exchange-manager.h | 20 +++++++++---------- src/wifi/model/wifi-mac.cc | 5 +++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 4bd7d5794..6e4c38cdf 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -313,7 +313,6 @@ HtFrameExchangeManager::CreateBlockAckAgreement (const MgtAddBaResponseHeader *r } m_agreements.insert ({{originator, tid}, agreement}); - GetBaManager (tid)->SetBlockAckInactivityCallback (MakeCallback (&HtFrameExchangeManager::SendDelbaFrame, this)); } void diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.h b/src/wifi/model/ht/ht-frame-exchange-manager.h index bd0699ca7..76f8a0352 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.h +++ b/src/wifi/model/ht/ht-frame-exchange-manager.h @@ -198,6 +198,16 @@ public: */ BlockAckType GetBlockAckType (Mac48Address originator, uint8_t tid) const; + /** + * Sends DELBA frame to cancel a block ack agreement with STA + * addressed by addr for TID tid. + * + * \param addr address of the recipient. + * \param tid traffic ID. + * \param byOriginator flag to indicate whether this is set by the originator. + */ + void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator); + protected: void DoDispose () override; @@ -334,16 +344,6 @@ protected: void SendAddBaRequest (Mac48Address recipient, uint8_t tid, uint16_t startingSeq, uint16_t timeout, bool immediateBAck); - /** - * Sends DELBA frame to cancel a block ack agreement with STA - * addressed by addr for TID tid. - * - * \param addr address of the recipient. - * \param tid traffic ID. - * \param byOriginator flag to indicate whether this is set by the originator. - */ - void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator); - /** * Create a BlockAck frame with header equal to blockAck and start its transmission. * diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index fdc70cdff..e535dfd66 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -984,6 +984,11 @@ WifiMac::Receive (Ptr mpdu) //and act by locally establishing the agreement on //the appropriate queue. GetQosTxop (respHdr.GetTid ())->GotAddBaResponse (&respHdr, from); + auto htFem = DynamicCast (m_feManager); + if (htFem != 0) + { + GetQosTxop (respHdr.GetTid ())->GetBaManager ()->SetBlockAckInactivityCallback (MakeCallback (&HtFrameExchangeManager::SendDelbaFrame, htFem)); + } //This frame is now completely dealt with, so we're done. return; }