wifi: (fixes #2320) Add method to check whether a WifiTxVector contains a valid combination of WifiMode, number of spatial streams and channel width

This commit is contained in:
Matías Richart
2016-03-09 20:37:26 +01:00
parent 58c4f13f59
commit 901c249f78
3 changed files with 46 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ Bugs fixed
- Bug 2316 - MacLow shall use a single TXVECTOR for all MPDUs belonging to a same A-MPDU
- Bug 2318 - MPDU Aggregation fails with TCP
- Bug 2319 - BlockAckTimeout value is too low for 802.11n operating at 2.4 GHz
- Bug 2320 - Add method to check whether a WifiTxVector contains a valid combination of WifiMode, number of spatial streams and channel width
- Bug 2321 - Wifi rate managers should not be triggered for each MPDU when A-MPDU is used
- Bug 2327 - CWmin value selection for 802.11g is not compliant with the standard rules

View File

@@ -1559,6 +1559,42 @@ WifiPhy::GetVhtMcs9 ()
return mcs;
}
bool
WifiPhy::IsValidTxVector (WifiTxVector txVector)
{
uint32_t chWidth = txVector.GetChannelWidth();
uint8_t nss = txVector.GetNss();
std::string modeName = txVector.GetMode().GetUniqueName();
if (chWidth == 20)
{
if (nss != 3 && nss != 6)
{
return (modeName != "VhtMcs9");
}
}
else if (chWidth == 80)
{
if (nss == 3 || nss == 7)
{
return (modeName != "VhtMcs6");
}
else if (nss == 6)
{
return (modeName != "VhtMcs9");
}
}
else if (chWidth == 160)
{
if (nss == 3)
{
return (modeName != "VhtMcs9");
}
}
return true;
}
std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state)
{
switch (state)

View File

@@ -1056,6 +1056,15 @@ public:
* \return MCS 9 from VHT MCS values
*/
static WifiMode GetVhtMcs9 ();
/**
* The standard disallows certain combinations of WifiMode, number of
* spatial streams, and channel widths. This method can be used to
* check whether this WifiTxVector contains an invalid combination.
*
* \param txVector the WifiTxVector to inspect
* \return true if the WifiTxVector parameters are allowed by the standard
*/
static bool IsValidTxVector (WifiTxVector txVector);
/**
* Public method used to fire a PhyTxBegin trace.