wifi: Do not hardcode maximum RU type
This commit is contained in:
@@ -664,7 +664,7 @@ HePpdu::GetHeSigBContentChannels(const WifiTxVector& txVector, uint8_t p20Index)
|
||||
std::optional<HeSigBUserSpecificField> cc2Central26ToneRu;
|
||||
|
||||
const auto& orderedMap = txVector.GetUserInfoMapOrderedByRus(p20Index);
|
||||
std::optional<HeRu::RuType> prevRuType;
|
||||
HeRu::RuType prevRuType{HeRu::RuType::RU_TYPE_MAX};
|
||||
std::size_t prevRuIndex{0};
|
||||
std::size_t prevCcIndex{0};
|
||||
for (const auto& [ru, staIds] : orderedMap)
|
||||
@@ -688,9 +688,9 @@ HePpdu::GetHeSigBContentChannels(const WifiTxVector& txVector, uint8_t p20Index)
|
||||
}
|
||||
|
||||
const auto ruIndex = ru.GetPhyIndex(channelWidth, p20Index);
|
||||
if (prevRuType && (*prevRuType != ruType))
|
||||
if ((prevRuType < HeRu::RuType::RU_TYPE_MAX) && (prevRuType != ruType))
|
||||
{
|
||||
prevRuIndex *= HeRu::GetBandwidth(*prevRuType) / HeRu::GetBandwidth(ruType);
|
||||
prevRuIndex *= HeRu::GetBandwidth(prevRuType) / HeRu::GetBandwidth(ruType);
|
||||
}
|
||||
if (ruType >= HeRu::RU_484_TONE)
|
||||
{
|
||||
@@ -725,7 +725,7 @@ HePpdu::GetHeSigBContentChannels(const WifiTxVector& txVector, uint8_t p20Index)
|
||||
{
|
||||
ccIndex = ((prevRuIndex / numRus) % 2 == 0) ? 0 : 1;
|
||||
}
|
||||
const auto central26TonesRus = HeRu::GetCentral26TonesRus(channelWidth, *prevRuType);
|
||||
const auto central26TonesRus = HeRu::GetCentral26TonesRus(channelWidth, prevRuType);
|
||||
const auto isCentral26ToneRu =
|
||||
std::none_of(central26TonesRus.cbegin(),
|
||||
central26TonesRus.cend(),
|
||||
|
||||
@@ -36,7 +36,8 @@ class HeRu
|
||||
RU_242_TONE,
|
||||
RU_484_TONE,
|
||||
RU_996_TONE,
|
||||
RU_2x996_TONE
|
||||
RU_2x996_TONE,
|
||||
RU_TYPE_MAX
|
||||
};
|
||||
|
||||
/// (lowest index, highest index) pair defining a subcarrier range
|
||||
|
||||
@@ -152,7 +152,7 @@ SpectrumWifiPhy::GetHeRuBands(Ptr<WifiSpectrumPhyInterface> spectrumPhyInterface
|
||||
{
|
||||
for (uint32_t i = 0; i < (channelWidth / bw); ++i)
|
||||
{
|
||||
for (uint32_t type = 0; type < 7; type++)
|
||||
for (uint32_t type = 0; type < HeRu::RuType::RU_TYPE_MAX; type++)
|
||||
{
|
||||
auto ruType = static_cast<HeRu::RuType>(type);
|
||||
std::size_t nRus = HeRu::GetNRus(bw, ruType);
|
||||
|
||||
Reference in New Issue
Block a user