wifi: (fixes #2629) Fill in supported supported rates and MCS values from beacons

This commit is contained in:
Sébastien Deronne
2017-01-30 21:12:31 +01:00
parent 271dda4910
commit 8f6ea2883d
2 changed files with 41 additions and 7 deletions

View File

@@ -73,6 +73,7 @@ Bugs fixed
- Bug 2614 - RIP header version should be set to 2
- Bug 2627 - Ipv6RawSocket does not honor the bound interface when sending packets
- Bug 2628 - Simulation crashes because of an out of range TID
- Bug 2629 - Assert failure in MinstrelHtWifiManager::GetLowestIndex
Known issues
------------

View File

@@ -517,6 +517,15 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons);
RestartBeaconWatchdog (delay);
SetBssid (hdr->GetAddr3 ());
SupportedRates rates = beacon.GetSupportedRates ();
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
}
}
bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
if (m_erpSupported)
{
@@ -575,6 +584,14 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
{
m_stationManager->SetUseGreenfieldProtection (false);
}
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
{
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
}
}
}
}
if (m_vhtSupported)
@@ -585,13 +602,29 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
{
m_stationManager->AddStationVhtCapabilities (hdr->GetAddr2 (), vhtCapabilities);
VhtOperation vhtOperation = beacon.GetVhtOperation ();
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
{
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
}
}
}
}
if (m_heSupported)
{
HeCapabilities hecapabilities = beacon.GetHeCapabilities ();
HeCapabilities heCapabilities = beacon.GetHeCapabilities ();
//todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
m_stationManager->AddStationHeCapabilities (hdr->GetAddr2 (), hecapabilities);
m_stationManager->AddStationHeCapabilities (hdr->GetAddr2 (), heCapabilities);
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
{
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
}
}
}
m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
@@ -807,11 +840,11 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
}
if (m_htSupported)
{
HtCapabilities htcapabilities = assocResp.GetHtCapabilities ();
HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
{
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
//here should add a control to add basic MCS when it is implemented
@@ -824,7 +857,7 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
{
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
//here should add a control to add basic MCS when it is implemented
@@ -833,11 +866,11 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
}
if (m_heSupported)
{
HeCapabilities hecapabilities = assocResp.GetHeCapabilities ();
HeCapabilities heCapabilities = assocResp.GetHeCapabilities ();
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
{
WifiMode mcs = m_phy->GetMcs (i);
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
{
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
//here should add a control to add basic MCS when it is implemented