wifi: Cache results of Get{Ack,Rts,Cts}Size() functions in wifi-utils.h

Thanks to Peter Barnes
This commit is contained in:
Eduardo Almeida
2024-03-12 18:05:30 +00:00
parent 3b2627ac7f
commit 356ab42be8

View File

@@ -57,9 +57,9 @@ RatioToDb(double ratio)
uint32_t
GetAckSize()
{
WifiMacHeader ack;
ack.SetType(WIFI_MAC_CTL_ACK);
return ack.GetSize() + 4;
static const uint32_t size = WifiMacHeader(WIFI_MAC_CTL_ACK).GetSize() + 4;
return size;
}
uint32_t
@@ -102,17 +102,17 @@ GetMuBarSize(std::list<BlockAckReqType> types)
uint32_t
GetRtsSize()
{
WifiMacHeader rts;
rts.SetType(WIFI_MAC_CTL_RTS);
return rts.GetSize() + 4;
static const uint32_t size = WifiMacHeader(WIFI_MAC_CTL_RTS).GetSize() + 4;
return size;
}
uint32_t
GetCtsSize()
{
WifiMacHeader cts;
cts.SetType(WIFI_MAC_CTL_CTS);
return cts.GetSize() + 4;
static const uint32_t size = WifiMacHeader(WIFI_MAC_CTL_CTS).GetSize() + 4;
return size;
}
bool