wifi: HtCapabilities/VhtCapabilities/HeCapabilities subfield binary coding changes

This commit is contained in:
Getachew Redieteab
2017-06-14 22:49:53 +02:00
parent d99d3907df
commit b4e34135e9
4 changed files with 45 additions and 8 deletions

View File

@@ -179,7 +179,7 @@ HtCapabilities::SetTxRxMcsSetUnequal (uint8_t txrxmcssetunequal)
void
HtCapabilities::SetTxMaxNSpatialStreams (uint8_t maxtxspatialstreams)
{
m_txMaxNSpatialStreams = maxtxspatialstreams;
m_txMaxNSpatialStreams = maxtxspatialstreams - 1; //0 for 1 SS, 1 for 2 SSs, etc
}
void
@@ -236,6 +236,12 @@ HtCapabilities::GetMaxAmpduLength (void) const
return m_maxAmpduLength;
}
uint8_t
HtCapabilities::GetMinMpduStartSpace (void) const
{
return m_minMpduStartSpace;
}
uint8_t*
HtCapabilities::GetRxMcsBitmask ()
{
@@ -292,7 +298,7 @@ HtCapabilities::GetTxRxMcsSetUnequal (void) const
uint8_t
HtCapabilities::GetTxMaxNSpatialStreams (void) const
{
return m_txMaxNSpatialStreams;
return m_txMaxNSpatialStreams; //0 for 1 SS, 1 for 2 SSs, etc
}
uint8_t

View File

@@ -268,6 +268,12 @@ public:
* \return the maximum AMPDU length
*/
uint8_t GetMaxAmpduLength (void) const;
/**
* Return the minimum MPDU start space.
*
* \return the minimum MPDU start space
*/
uint8_t GetMinMpduStartSpace (void) const;
/**
* Return the receive MCS bitmask.

View File

@@ -111,7 +111,7 @@ RegularWifiMac::DoDispose ()
i->second->Dispose ();
i->second = 0;
}
delete m_dcfManager;
m_dcfManager = 0;
}
@@ -154,9 +154,16 @@ RegularWifiMac::GetHtCapabilities (void) const
capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ());
capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ());
capabilities.SetGreenfield (m_phy->GetGreenfield ());
capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD)
uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD)
double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
+ 1.0)
/ std::log (2.0))
- 13.0),
0.0);
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
capabilities.SetMaxAmpduLength (std::max<uint8_t> (3, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 3 for HT
uint64_t maxSupportedRate = 0; //in bit/s
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
@@ -198,11 +205,18 @@ RegularWifiMac::GetVhtCapabilities (void) const
{
capabilities.SetSupportedChannelWidthSet (0);
}
capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD)
uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
capabilities.SetRxLdpc (m_phy->GetLdpc ());
capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ());
capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ());
capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
+ 1.0)
/ std::log (2.0))
- 13.0),
0.0);
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
uint8_t maxMcs = 0;
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
@@ -274,7 +288,13 @@ RegularWifiMac::GetHeCapabilities (void) const
gi |= 0x02;
}
capabilities.SetHeLtfAndGiForHePpdus (gi);
capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
+ 1.0)
/ std::log (2.0))
- 13.0),
0.0);
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
uint8_t maxMcs = 0;
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{

View File

@@ -49,6 +49,11 @@ VhtCapabilities::VhtCapabilities ()
{
m_rxMcsMap.resize (8,0);
m_txMcsMap.resize (8,0);
for (uint8_t i = 0; i < 8; i++) //set to 3 by default, i.e. #spatial streams not supported. 0 means supported up to MCS 7, not what we want to imply at this stage.
{
m_rxMcsMap[i] = 3;
m_txMcsMap[i] = 3;
}
}
WifiInformationElementId