wifi: Rename OrderedRus to UserInfoMapOrderedByRus

This commit is contained in:
Sébastien Deronne
2023-06-05 18:42:07 +02:00
committed by Sébastien Deronne
parent 51b6f880df
commit 0b1a5a2e76
4 changed files with 24 additions and 24 deletions

View File

@@ -158,15 +158,15 @@ EhtPpdu::GetEhtSigFieldSize(uint16_t channelWidth,
8 * (channelWidth / 40) /* one allocation field per 40 MHz */ + 1 /* center RU */;
}
auto numStaPerContentChannel =
auto numRusPerContentChannel =
GetNumRusPerEhtSigBContentChannel(channelWidth, ehtPpduType, ruAllocation);
auto maxNumStaPerContentChannel =
std::max(numStaPerContentChannel.first, numStaPerContentChannel.second);
auto maxNumUserBlockFields = maxNumStaPerContentChannel /
auto maxNumRusPerContentChannel =
std::max(numRusPerContentChannel.first, numRusPerContentChannel.second);
auto maxNumUserBlockFields = maxNumRusPerContentChannel /
2; // handle last user block with single user, if any, further down
std::size_t userSpecificFieldSize =
maxNumUserBlockFields * (2 * 21 /* user fields (2 users) */ + 4 /* tail */ + 6 /* CRC */);
if (maxNumStaPerContentChannel % 2 != 0)
if (maxNumRusPerContentChannel % 2 != 0)
{
userSpecificFieldSize += 21 /* last user field */ + 4 /* CRC */ + 6 /* tail */;
}

View File

@@ -504,8 +504,8 @@ HePpdu::GetContentChannels(const WifiTxVector& txVector, uint8_t p20Index)
contentChannels.emplace_back();
}
const auto& orderedRus = txVector.GetOrderedRus(p20Index);
for (const auto& [ru, staId] : orderedRus)
const auto& orderedMap = txVector.GetUserInfoMapOrderedByRus(p20Index);
for (const auto& [ru, staId] : orderedMap)
{
auto ruType = ru.GetRuType();
auto ruIdx = ru.GetIndex();
@@ -573,14 +573,14 @@ HePpdu::GetSigBFieldSize(uint16_t channelWidth, const RuAllocation& ruAllocation
8 * (channelWidth / 40) /* one allocation field per 40 MHz */ + 1 /* center RU */;
}
auto numStaPerContentChannel = GetNumRusPerHeSigBContentChannel(channelWidth, ruAllocation);
auto maxNumStaPerContentChannel =
std::max(numStaPerContentChannel.first, numStaPerContentChannel.second);
auto maxNumUserBlockFields = maxNumStaPerContentChannel /
auto numRusPerContentChannel = GetNumRusPerHeSigBContentChannel(channelWidth, ruAllocation);
auto maxNumRusPerContentChannel =
std::max(numRusPerContentChannel.first, numRusPerContentChannel.second);
auto maxNumUserBlockFields = maxNumRusPerContentChannel /
2; // handle last user block with single user, if any, further down
std::size_t userSpecificFieldSize =
maxNumUserBlockFields * (2 * 21 /* user fields (2 users) */ + 4 /* tail */ + 6 /* CRC */);
if (maxNumStaPerContentChannel % 2 != 0)
if (maxNumRusPerContentChannel % 2 != 0)
{
userSpecificFieldSize += 21 /* last user field */ + 4 /* CRC */ + 6 /* tail */;
}

View File

@@ -647,17 +647,17 @@ HeMuUserInfo::operator!=(const HeMuUserInfo& other) const
return !(*this == other);
}
WifiTxVector::OrderedRus
WifiTxVector::GetOrderedRus(uint8_t p20Index) const
WifiTxVector::UserInfoMapOrderedByRus
WifiTxVector::GetUserInfoMapOrderedByRus(uint8_t p20Index) const
{
auto heRuComparator = HeRu::RuSpecCompare(m_channelWidth, p20Index);
OrderedRus orderedRus{heRuComparator};
UserInfoMapOrderedByRus orderedMap{heRuComparator};
std::transform(
m_muUserInfos.cbegin(),
m_muUserInfos.cend(),
std::inserter(orderedRus, orderedRus.end()),
std::inserter(orderedMap, orderedMap.end()),
[](auto&& userInfo) { return std::make_pair(userInfo.second.ru, userInfo.first); });
return orderedRus;
return orderedMap;
}
RuAllocation
@@ -666,8 +666,8 @@ WifiTxVector::DeriveRuAllocation(uint8_t p20Index) const
RuAllocation ruAllocations(m_channelWidth / 20, HeRu::EMPTY_242_TONE_RU);
std::vector<HeRu::RuType> ruTypes{};
ruTypes.resize(ruAllocations.size());
const auto& orderedRus = GetOrderedRus(p20Index);
for (const auto& [ru, staId] : orderedRus)
const auto& orderedMap = GetUserInfoMapOrderedByRus(p20Index);
for (const auto& [ru, staId] : orderedMap)
{
const auto ruType = ru.GetRuType();
const auto ruBw = HeRu::GetBandwidth(ruType);

View File

@@ -423,16 +423,16 @@ class WifiTxVector
*/
HeMuUserInfoMap& GetHeMuUserInfoMap();
/// Ordered RUs per increasing frequency
using OrderedRus = std::map<HeRu::RuSpec, uint16_t, HeRu::RuSpecCompare>;
/// map of specific user info parameters ordered per increasing frequency RUs
using UserInfoMapOrderedByRus = std::map<HeRu::RuSpec, uint16_t, HeRu::RuSpecCompare>;
/**
* Get the ordered RUs with their associated STA-IDs per increasing frequency.
* Get the map of specific user info parameters ordered per increasing frequency RUs.
*
* \param p20Index the index of the primary20 channel
* \return the ordered RUs with their associated STA-IDs
* \return the map of specific user info parameters ordered per increasing frequency RUs
*/
OrderedRus GetOrderedRus(uint8_t p20Index) const;
UserInfoMapOrderedByRus GetUserInfoMapOrderedByRus(uint8_t p20Index) const;
/**
* Set the 20 MHz subchannels that are punctured.