From 0b1a5a2e7625e5b07d575a96fa249ecbc20167ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Mon, 5 Jun 2023 18:42:07 +0200 Subject: [PATCH] wifi: Rename OrderedRus to UserInfoMapOrderedByRus --- src/wifi/model/eht/eht-ppdu.cc | 10 +++++----- src/wifi/model/he/he-ppdu.cc | 14 +++++++------- src/wifi/model/wifi-tx-vector.cc | 14 +++++++------- src/wifi/model/wifi-tx-vector.h | 10 +++++----- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/wifi/model/eht/eht-ppdu.cc b/src/wifi/model/eht/eht-ppdu.cc index 7ddbd8952..e23824380 100644 --- a/src/wifi/model/eht/eht-ppdu.cc +++ b/src/wifi/model/eht/eht-ppdu.cc @@ -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 */; } diff --git a/src/wifi/model/he/he-ppdu.cc b/src/wifi/model/he/he-ppdu.cc index b4c30e325..1834a1513 100644 --- a/src/wifi/model/he/he-ppdu.cc +++ b/src/wifi/model/he/he-ppdu.cc @@ -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 */; } diff --git a/src/wifi/model/wifi-tx-vector.cc b/src/wifi/model/wifi-tx-vector.cc index f90e67fb1..8e50f56fd 100644 --- a/src/wifi/model/wifi-tx-vector.cc +++ b/src/wifi/model/wifi-tx-vector.cc @@ -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 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); diff --git a/src/wifi/model/wifi-tx-vector.h b/src/wifi/model/wifi-tx-vector.h index 3265b0756..91cda9dbb 100644 --- a/src/wifi/model/wifi-tx-vector.h +++ b/src/wifi/model/wifi-tx-vector.h @@ -423,16 +423,16 @@ class WifiTxVector */ HeMuUserInfoMap& GetHeMuUserInfoMap(); - /// Ordered RUs per increasing frequency - using OrderedRus = std::map; + /// map of specific user info parameters ordered per increasing frequency RUs + using UserInfoMapOrderedByRus = std::map; /** - * 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.