wifi: (fixes #2877) Use uint32_t for CWmin and CWmax

This commit is contained in:
Sébastien Deronne
2018-02-23 19:33:22 +01:00
parent 76ce6128cf
commit e6dcbf9f38
6 changed files with 36 additions and 35 deletions

View File

@@ -56,6 +56,7 @@ Bugs fixed
- Bug 2848 - wifi: Association ID not correctly set upon association
- Bug 2849 - lte: Received RLC and PDCP PDUs are missing in the stats files
- Bug 2854 - wifi: he-wifi-network crashes when frequency is set at 2.4 GHz
- Bug 2877 - wifi: Wrong data types for CWmin and CWmax
Known issues
------------

View File

@@ -46,7 +46,7 @@ cpp_examples = [
("he-wifi-network --simulationTime=0.3 --frequency=5 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=639", "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"),
("simple-ht-hidden-stations --simulationTime=1 --minExpectedThroughput=22 --maxExpectedThroughput=22.5", "True", "True"),
("mixed-network --simulationTime=1", "True", "True"),
("wifi-aggregation --simulationTime=1 --verifyResults=1", "True", "True"),
("80211e-txop --simulationTime=1 --verifyResults=1", "True", "True"),

View File

@@ -77,14 +77,14 @@ EdcaParameterSet::SetBeAci (uint8_t aci)
}
void
EdcaParameterSet::SetBeCWmin (uint8_t cwMin)
EdcaParameterSet::SetBeCWmin (uint32_t cwMin)
{
uint8_t ECWmin = log2 (cwMin + 1);
m_acBE |= (ECWmin & 0x0f) << 8;
}
void
EdcaParameterSet::SetBeCWmax (uint8_t cwMax)
EdcaParameterSet::SetBeCWmax (uint32_t cwMax)
{
uint8_t ECWmax = log2 (cwMax + 1);
m_acBE |= (ECWmax & 0x0f) << 12;
@@ -115,14 +115,14 @@ EdcaParameterSet::SetBkAci (uint8_t aci)
}
void
EdcaParameterSet::SetBkCWmin (uint8_t cwMin)
EdcaParameterSet::SetBkCWmin (uint32_t cwMin)
{
uint8_t ECWmin = log2 (cwMin + 1);
m_acBK |= (ECWmin & 0x0f) << 8;
}
void
EdcaParameterSet::SetBkCWmax (uint8_t cwMax)
EdcaParameterSet::SetBkCWmax (uint32_t cwMax)
{
uint8_t ECWmax = log2 (cwMax + 1);
m_acBK |= (ECWmax & 0x0f) << 12;
@@ -153,14 +153,14 @@ EdcaParameterSet::SetViAci (uint8_t aci)
}
void
EdcaParameterSet::SetViCWmin (uint8_t cwMin)
EdcaParameterSet::SetViCWmin (uint32_t cwMin)
{
uint8_t ECWmin = log2 (cwMin + 1);
m_acVI |= (ECWmin & 0x0f) << 8;
}
void
EdcaParameterSet::SetViCWmax (uint8_t cwMax)
EdcaParameterSet::SetViCWmax (uint32_t cwMax)
{
uint8_t ECWmax = log2 (cwMax + 1);
m_acVI |= (ECWmax & 0x0f) << 12;
@@ -191,14 +191,14 @@ EdcaParameterSet::SetVoAci (uint8_t aci)
}
void
EdcaParameterSet::SetVoCWmin (uint8_t cwMin)
EdcaParameterSet::SetVoCWmin (uint32_t cwMin)
{
uint8_t ECWmin = log2 (cwMin + 1);
m_acVO |= (ECWmin & 0x0f) << 8;
}
void
EdcaParameterSet::SetVoCWmax (uint8_t cwMax)
EdcaParameterSet::SetVoCWmax (uint32_t cwMax)
{
uint8_t ECWmax = log2 (cwMax + 1);
m_acVO |= (ECWmax & 0x0f) << 12;
@@ -234,14 +234,14 @@ EdcaParameterSet::GetBeAci (void) const
return ((m_acBE >> 5) & 0x03);
}
uint8_t
uint32_t
EdcaParameterSet::GetBeCWmin (void) const
{
uint8_t ECWmin = ((m_acBE >> 8) & 0x0f);
return (exp2 (ECWmin) - 1);
}
uint8_t
uint32_t
EdcaParameterSet::GetBeCWmax (void) const
{
uint8_t ECWmax = ((m_acBE >> 12) & 0x0f);
@@ -272,14 +272,14 @@ EdcaParameterSet::GetBkAci (void) const
return ((m_acBK >> 5) & 0x03);
}
uint8_t
uint32_t
EdcaParameterSet::GetBkCWmin (void) const
{
uint8_t ECWmin = ((m_acBK >> 8) & 0x0f);
return (exp2 (ECWmin) - 1);
}
uint8_t
uint32_t
EdcaParameterSet::GetBkCWmax (void) const
{
uint8_t ECWmax = ((m_acBK >> 12) & 0x0f);
@@ -310,14 +310,14 @@ EdcaParameterSet::GetViAci (void) const
return ((m_acVI >> 5) & 0x03);
}
uint8_t
uint32_t
EdcaParameterSet::GetViCWmin (void) const
{
uint8_t ECWmin = ((m_acVI >> 8) & 0x0f);
return (exp2 (ECWmin) - 1);
}
uint8_t
uint32_t
EdcaParameterSet::GetViCWmax (void) const
{
uint8_t ECWmax = ((m_acVI >> 12) & 0x0f);
@@ -348,14 +348,14 @@ EdcaParameterSet::GetVoAci (void) const
return ((m_acVO >> 5) & 0x03);
}
uint8_t
uint32_t
EdcaParameterSet::GetVoCWmin (void) const
{
uint8_t ECWmin = ((m_acVO >> 8) & 0x0f);
return (exp2 (ECWmin) - 1);
}
uint8_t
uint32_t
EdcaParameterSet::GetVoCWmax (void) const
{
uint8_t ECWmax = ((m_acVO >> 12) & 0x0f);

View File

@@ -75,13 +75,13 @@ public:
*
* \param cwMin the AC_BE CWmin field in the EdcaParameterSet information element
*/
void SetBeCWmin (uint8_t cwMin);
void SetBeCWmin (uint32_t cwMin);
/**
* Set the AC_BE CWmax field in the EdcaParameterSet information element.
*
* \param cwMax the AC_BE CWmax field in the EdcaParameterSet information element
*/
void SetBeCWmax (uint8_t cwMax);
void SetBeCWmax (uint32_t cwMax);
/**
* Set the AC_BE TXOP Limit field in the EdcaParameterSet information element.
*
@@ -111,13 +111,13 @@ public:
*
* \param cwMin the AC_BK CWmin field in the EdcaParameterSet information element
*/
void SetBkCWmin (uint8_t cwMin);
void SetBkCWmin (uint32_t cwMin);
/**
* Set the AC_BK CWmax field in the EdcaParameterSet information element.
*
* \param cwMax the AC_BK CWmax field in the EdcaParameterSet information element
*/
void SetBkCWmax (uint8_t cwMax);
void SetBkCWmax (uint32_t cwMax);
/**
* Set the AC_BK TXOP Limit field in the EdcaParameterSet information element.
*
@@ -147,13 +147,13 @@ public:
*
* \param cwMin the AC_VI CWmin field in the EdcaParameterSet information element
*/
void SetViCWmin (uint8_t cwMin);
void SetViCWmin (uint32_t cwMin);
/**
* Set the AC_VI CWmax field in the EdcaParameterSet information element.
*
* \param cwMax the AC_VI CWmax field in the EdcaParameterSet information element
*/
void SetViCWmax (uint8_t cwMax);
void SetViCWmax (uint32_t cwMax);
/**
* Set the AC_VI TXOP Limit field in the EdcaParameterSet information element.
*
@@ -183,13 +183,13 @@ public:
*
* \param cwMin the AC_VO CWmin field in the EdcaParameterSet information element
*/
void SetVoCWmin (uint8_t cwMin);
void SetVoCWmin (uint32_t cwMin);
/**
* Set the AC_VO CWmax field in the EdcaParameterSet information element.
*
* \param cwMax the AC_VO CWmax field in the EdcaParameterSet information element
*/
void SetVoCWmax (uint8_t cwMax);
void SetVoCWmax (uint32_t cwMax);
/**
* Set the AC_VO TXOP Limit field in the EdcaParameterSet information element.
*
@@ -226,13 +226,13 @@ public:
*
* \return the AC_BE CWmin field in the EdcaParameterSet information element
*/
uint8_t GetBeCWmin (void) const;
uint32_t GetBeCWmin (void) const;
/**
* Return the AC_BE CWmax field in the EdcaParameterSet information element.
*
* \return the AC_BE CWmax field in the EdcaParameterSet information element
*/
uint8_t GetBeCWmax (void) const;
uint32_t GetBeCWmax (void) const;
/**
* Return the AC_BE TXOP Limit field in the EdcaParameterSet information element.
*
@@ -262,13 +262,13 @@ public:
*
* \return the AC_BK CWmin field in the EdcaParameterSet information element
*/
uint8_t GetBkCWmin (void) const;
uint32_t GetBkCWmin (void) const;
/**
* Return the AC_BK CWmax field in the EdcaParameterSet information element.
*
* \return the AC_BK CWmax field in the EdcaParameterSet information element
*/
uint8_t GetBkCWmax (void) const;
uint32_t GetBkCWmax (void) const;
/**
* Return the AC_BK TXOP Limit field in the EdcaParameterSet information element.
*
@@ -298,13 +298,13 @@ public:
*
* \return the AC_VI CWmin field in the EdcaParameterSet information element
*/
uint8_t GetViCWmin (void) const;
uint32_t GetViCWmin (void) const;
/**
* Return the AC_VI CWmax field in the EdcaParameterSet information element.
*
* \return the AC_VI CWmax field in the EdcaParameterSet information element
*/
uint8_t GetViCWmax (void) const;
uint32_t GetViCWmax (void) const;
/**
* Return the AC_VI TXOP Limit field in the EdcaParameterSet information element.
*
@@ -334,13 +334,13 @@ public:
*
* \return the AC_VO CWmin field in the EdcaParameterSet information element
*/
uint8_t GetVoCWmin (void) const;
uint32_t GetVoCWmin (void) const;
/**
* Return the AC_VO CWmax field in the EdcaParameterSet information element.
*
* \return the AC_VO CWmax field in the EdcaParameterSet information element
*/
uint8_t GetVoCWmax (void) const;
uint32_t GetVoCWmax (void) const;
/**
* Return the AC_VO TXOP Limit field in the EdcaParameterSet information element.
*

View File

@@ -929,7 +929,7 @@ StaWifiMac::SetState (MacState value)
}
void
StaWifiMac::SetEdcaParameters (AcIndex ac, uint8_t cwMin, uint8_t cwMax, uint8_t aifsn, Time txopLimit)
StaWifiMac::SetEdcaParameters (AcIndex ac, uint32_t cwMin, uint32_t cwMax, uint8_t aifsn, Time txopLimit)
{
Ptr<EdcaTxopN> edca = m_edca.find (ac)->second;
edca->SetMinCw (cwMin);

View File

@@ -156,7 +156,7 @@ private:
* \param aifsn the number of slots that make up an AIFS
* \param txopLimit the TXOP limit
*/
void SetEdcaParameters (AcIndex ac, uint8_t cwMin, uint8_t cwMax, uint8_t aifsn, Time txopLimit);
void SetEdcaParameters (AcIndex ac, uint32_t cwMin, uint32_t cwMax, uint8_t aifsn, Time txopLimit);
/**
* Return the Capability information of the current STA.
*