diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index 9a58ae6da..611529165 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -1831,6 +1831,21 @@ WifiMac::GetEhtSupported(const Mac48Address& address) const return false; } +uint16_t +WifiMac::GetMaxBaBufferSize(std::optional address) const +{ + if (address ? GetEhtSupported(*address) : GetEhtSupported()) + { + return 1024; + } + if (address ? GetHeSupported(*address) : GetHeSupported()) + { + return 256; + } + NS_ASSERT(address ? GetHtSupported(*address) : GetHtSupported()); + return 64; +} + void WifiMac::SetVoBlockAckThreshold(uint8_t threshold) { diff --git a/src/wifi/model/wifi-mac.h b/src/wifi/model/wifi-mac.h index 19179fa1f..e7b75677d 100644 --- a/src/wifi/model/wifi-mac.h +++ b/src/wifi/model/wifi-mac.h @@ -685,6 +685,15 @@ class WifiMac : public Object */ BlockAckReqType GetBarTypeAsRecipient(Mac48Address originator, uint8_t tid) const; + /** + * Get the maximum Block Ack buffer size (in number of MPDUs) supported by the given device, + * if any, or by this device, otherwise, based on the supported standard. + * + * \param address the (MLD or link) address of the given device + * \return the maximum supported Block Ack buffer size (in number of MPDUs) + */ + uint16_t GetMaxBaBufferSize(std::optional address = std::nullopt) const; + /** * Get the TID-to-Link Mapping negotiated with the given MLD (if any) for the given direction. * An empty mapping indicates the default mapping.