wifi: (fixes #2854) Fix 802.11ax channel width capabilities

This commit is contained in:
Sébastien Deronne
2018-01-24 19:09:29 +01:00
parent 8c6d28009b
commit 95917105bf
4 changed files with 29 additions and 7 deletions

View File

@@ -43,6 +43,7 @@ Bugs fixed
- Bug 2838 - wifi: ht-wifi-network crashes with RTS/CTS enabled and frequency set to 2.4GHz
- Bug 2843 - spectrum, wifi: Incorrect channel width and center frequency provided for non-HT PPDUs when building SpectralDensity
- Bug 2848 - wifi: Association ID not correctly set upon association
- Bug 2854 - wifi: he-wifi-network crashes when frequency is set at 2.4 GHz
Known issues
------------

View File

@@ -41,12 +41,11 @@ cpp_examples = [
("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=132", "True", "True"),
("ht-wifi-network --simulationTime=0.1 --frequency=2.4 --useRts=1 --minExpectedThroughput=4.5 --maxExpectedThroughput=128", "True", "True"),
("vht-wifi-network --simulationTime=0.1 --useRts=0 --minExpectedThroughput=5 --maxExpectedThroughput=555", "True", "True"),
("vht-wifi-network --simulationTime=0.1 --useRts=1", "False", "False"), # see bug 2853
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0 --minExpectedThroughput=6.35 --maxExpectedThroughput=754", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0 --minExpectedThroughput=6.35 --maxExpectedThroughput=754", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=1", "False", "False"), # see bug 2853
("he-wifi-network --simulationTime=0.25 --frequency=1.4 --useRts=0", "False", "False"), # see bug 2854
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=1", "False", "False"), # see bug 2854
("vht-wifi-network --simulationTime=0.2 --useRts=1", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=0 --minExpectedThroughput=6 --maxExpectedThroughput=754", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=5 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=627", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=2.4 --useRts=0 --minExpectedThroughput=6 --maxExpectedThroughput=238", "True", "True"),
("he-wifi-network --simulationTime=0.25 --frequency=2.4 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=224", "True", "True"),
("simple-ht-hidden-stations --simulationTime=1 --minExpectedThroughput=16.5 --maxExpectedThroughput=17", "True", "True"),
("mixed-network --simulationTime=1", "True", "True"),
("wifi-aggregation --simulationTime=1 --verifyResults=1", "True", "True"),

View File

@@ -89,7 +89,8 @@ int main (int argc, char *argv[])
{
uint8_t index = 0;
double previous = 0;
for (int channelWidth = 20; channelWidth <= 160; ) //MHz
uint8_t maxChannelWidth = frequency == 2.4 ? 40 : 160;
for (int channelWidth = 20; channelWidth <= maxChannelWidth; ) //MHz
{
for (int gi = 3200; gi >= 800; ) //Nanoseconds
{
@@ -282,6 +283,11 @@ int main (int argc, char *argv[])
gi /= 2;
}
channelWidth *= 2;
//At 5 GHz, possible maximum supported channel widths are 20, 80 and 160 MHz
if (channelWidth == 40 && frequency == 5)
{
channelWidth = 80;
}
}
}
return 0;

View File

@@ -1781,6 +1781,22 @@ WifiRemoteStationManager::AddStationHeCapabilities (Mac48Address from, HeCapabil
NS_LOG_FUNCTION (this << from << heCapabilities);
WifiRemoteStationState *state;
state = LookupState (from);
if (heCapabilities.GetChannelWidthSet () & 0x04 && Is5Ghz (m_wifiPhy->GetFrequency ()))
{
state->m_channelWidth = 160;
}
else if (heCapabilities.GetChannelWidthSet () & 0x02 && Is5Ghz (m_wifiPhy->GetFrequency ()))
{
state->m_channelWidth = 80;
}
else if ((heCapabilities.GetChannelWidthSet () & 0x01) && Is2_4Ghz (m_wifiPhy->GetFrequency ()))
{
state->m_channelWidth = 40;
}
else
{
state->m_channelWidth = 20;
}
if (heCapabilities.GetHeLtfAndGiForHePpdus () >= 2)
{
state->m_guardInterval = 800;