wifi: Fix supported streams in VHT operation and HE operation IEs

This commit is contained in:
Sébastien Deronne
2018-09-02 22:40:21 +02:00
parent 40b1dc2db8
commit 96b970f1b1
3 changed files with 38 additions and 9 deletions

View File

@@ -671,17 +671,20 @@ ApWifiMac::GetVhtOperation (void) const
{
operation.SetChannelWidth (0);
}
for (uint8_t nss = 1; nss <= 8; nss++)
uint8_t maxSpatialStream = m_phy->GetMaxSupportedRxSpatialStreams ();
for (std::map<uint16_t, Mac48Address>::const_iterator i = m_staList.begin (); i != m_staList.end (); i++)
{
uint8_t maxMcs;
if (nss <= m_phy->GetMaxSupportedRxSpatialStreams ())
if (m_stationManager->GetVhtSupported (i->second))
{
maxMcs = 9; //TBD: hardcode to 9 for now since we assume all MCS values are supported
}
else
{
maxMcs = 0;
if (m_stationManager->GetNumberOfSupportedStreams (i->second) < maxSpatialStream)
{
maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (i->second);
}
}
}
for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
{
uint8_t maxMcs = 9; //TBD: hardcode to 9 for now since we assume all MCS values are supported
operation.SetMaxVhtMcsPerNss (nss, maxMcs);
}
}
@@ -696,7 +699,18 @@ ApWifiMac::GetHeOperation (void) const
if (GetHeSupported ())
{
operation.SetHeSupported (1);
for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
uint8_t maxSpatialStream = m_phy->GetMaxSupportedRxSpatialStreams ();
for (std::map<uint16_t, Mac48Address>::const_iterator i = m_staList.begin (); i != m_staList.end (); i++)
{
if (m_stationManager->GetHeSupported (i->second))
{
if (m_stationManager->GetNumberOfSupportedStreams (i->second) < maxSpatialStream)
{
maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (i->second);
}
}
}
for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
{
operation.SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
}

View File

@@ -2215,6 +2215,12 @@ WifiRemoteStationManager::GetVhtSupported (Mac48Address address) const
return LookupState (address)->m_vhtSupported;
}
bool
WifiRemoteStationManager::GetHeSupported (Mac48Address address) const
{
return LookupState (address)->m_heSupported;
}
void
WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower)
{

View File

@@ -485,6 +485,15 @@ public:
* false otherwise
*/
bool GetVhtSupported (Mac48Address address) const;
/**
* Return whether the station supports HE or not.
*
* \param address the address of the station
*
* \return true if HE is supported by the station,
* false otherwise
*/
bool GetHeSupported (Mac48Address address) const;
/**
* Return a mode for non-unicast packets.