wifi: Add 80+80MHz support for PhyEntity::CanStartRx

This commit is contained in:
Sébastien Deronne
2023-05-22 18:21:13 +02:00
parent 9fdb1822e0
commit b4052a8a4e

View File

@@ -1375,13 +1375,19 @@ PhyEntity::CanStartRx(Ptr<const WifiPpdu> ppdu) const
// then we consider the primary20 channel
const auto p20CenterFreq =
m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency(primaryWidth);
const auto p20MinFreq = p20CenterFreq - (primaryWidth / 2);
const auto p20MaxFreq = p20CenterFreq + (primaryWidth / 2);
const auto txCenterFreq = ppdu->GetTxCenterFreqs().front();
const auto txChannelWidth = ppdu->GetTxChannelWidth();
const auto minTxFreq = txCenterFreq - txChannelWidth / 2;
const auto maxTxFreq = txCenterFreq + txChannelWidth / 2;
return p20MinFreq >= minTxFreq && p20MaxFreq <= maxTxFreq;
const uint16_t p20MinFreq = p20CenterFreq - (primaryWidth / 2);
const uint16_t p20MaxFreq = p20CenterFreq + (primaryWidth / 2);
const auto txChannelWidth = (ppdu->GetTxChannelWidth() / ppdu->GetTxCenterFreqs().size());
for (auto txCenterFreq : ppdu->GetTxCenterFreqs())
{
const uint16_t minTxFreq = txCenterFreq - txChannelWidth / 2;
const uint16_t maxTxFreq = txCenterFreq + txChannelWidth / 2;
if ((p20MinFreq >= minTxFreq) && (p20MaxFreq <= maxTxFreq))
{
return true;
}
}
return false;
}
Ptr<const WifiPpdu>