wifi: Fill in HE-SIG-B content channels for unassigned RUs

This commit is contained in:
Sébastien Deronne
2023-04-24 23:09:01 +02:00
committed by Sébastien Deronne
parent 77643aec3a
commit 6c67e70fb6
2 changed files with 27 additions and 8 deletions

View File

@@ -217,6 +217,10 @@ HePpdu::SetHeMuUserInfos(WifiTxVector& txVector,
auto ruAllocIndex = contentChannelIndex;
for (const auto& userInfo : contentChannel)
{
if (userInfo.staId == NO_USER_STA_ID)
{
continue;
}
auto ruSpecs = HeRu::GetRuSpecs(ruAllocation.at(ruAllocIndex));
if (ruSpecs.empty())
{

View File

@@ -688,22 +688,37 @@ WifiTxVector::GetContentChannels(uint8_t p20Index) const
continue;
}
size_t numRus{1};
if (ruType < HeRu::RU_242_TONE)
{
numRus = HeRu::m_heRuSubcarrierGroups.at({20, ruType}).size();
}
std::size_t numRus = (ruType >= HeRu::RU_242_TONE)
? 1
: HeRu::m_heRuSubcarrierGroups.at({20, ruType}).size();
if (((ruIdx - 1) / numRus) % 2 == 0)
{
contentChannels[0].push_back({staId, userInfo.nss, userInfo.mcs});
contentChannels.at(0).push_back({staId, userInfo.nss, userInfo.mcs});
}
else
{
contentChannels[1].push_back({staId, userInfo.nss, userInfo.mcs});
contentChannels.at(1).push_back({staId, userInfo.nss, userInfo.mcs});
}
}
// Add unassigned RUs
auto numNumRusPerHeSigBContentChannel =
HePpdu::GetNumRusPerHeSigBContentChannel(m_channelWidth, GetRuAllocation(p20Index));
std::size_t contentChannelIndex = 1;
for (auto& contentChannel : contentChannels)
{
const auto totalUsersInContentChannel = (contentChannelIndex == 1)
? numNumRusPerHeSigBContentChannel.first
: numNumRusPerHeSigBContentChannel.second;
NS_ASSERT(contentChannel.size() <= totalUsersInContentChannel);
std::size_t unallocatedRus = totalUsersInContentChannel - contentChannel.size();
for (std::size_t i = 0; i < unallocatedRus; i++)
{
contentChannel.push_back({NO_USER_STA_ID, 0, 0});
}
contentChannelIndex++;
}
return contentChannels;
}