|
Lines 154-162
RegularWifiMac::GetHtCapabilities (void) const
|
Link Here
|
|---|
|
| 154 |
capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ()); |
154 |
capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ()); |
| 155 |
capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ()); |
155 |
capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ()); |
| 156 |
capabilities.SetGreenfield (m_phy->GetGreenfield ()); |
156 |
capabilities.SetGreenfield (m_phy->GetGreenfield ()); |
| 157 |
capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD) |
157 |
uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)); |
|
|
158 |
capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935 |
| 158 |
capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ()); |
159 |
capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ()); |
| 159 |
capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD) |
160 |
double maxAmpduLengthExponent = std::ceil (std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) |
|
|
161 |
+ 1.0) |
| 162 |
- 13.0); |
| 163 |
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255); |
| 164 |
capabilities.SetMaxAmpduLength (std::max<uint8_t> (3, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 3 for HT |
| 160 |
uint64_t maxSupportedRate = 0; //in bit/s |
165 |
uint64_t maxSupportedRate = 0; //in bit/s |
| 161 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
166 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
| 162 |
{ |
167 |
{ |
|
Lines 198-208
RegularWifiMac::GetVhtCapabilities (void) const
|
Link Here
|
|---|
|
| 198 |
{ |
203 |
{ |
| 199 |
capabilities.SetSupportedChannelWidthSet (0); |
204 |
capabilities.SetSupportedChannelWidthSet (0); |
| 200 |
} |
205 |
} |
| 201 |
capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD) |
206 |
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 |
|
|
207 |
capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454 |
| 202 |
capabilities.SetRxLdpc (m_phy->GetLdpc ()); |
208 |
capabilities.SetRxLdpc (m_phy->GetLdpc ()); |
| 203 |
capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ()); |
209 |
capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ()); |
| 204 |
capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ()); |
210 |
capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ()); |
| 205 |
capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD) |
211 |
double maxAmpduLengthExponent = std::ceil (std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) |
|
|
212 |
+ 1.0) |
| 213 |
- 13.0); |
| 214 |
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255); |
| 215 |
capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT |
| 206 |
uint8_t maxMcs = 0; |
216 |
uint8_t maxMcs = 0; |
| 207 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
217 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
| 208 |
{ |
218 |
{ |
|
Lines 274-280
RegularWifiMac::GetHeCapabilities (void) const
|
Link Here
|
|---|
|
| 274 |
gi |= 0x02; |
284 |
gi |= 0x02; |
| 275 |
} |
285 |
} |
| 276 |
capabilities.SetHeLtfAndGiForHePpdus (gi); |
286 |
capabilities.SetHeLtfAndGiForHePpdus (gi); |
| 277 |
capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD) |
287 |
double maxAmpduLengthExponent = std::ceil (std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) |
|
|
288 |
+ 1.0) |
| 289 |
- 13.0); |
| 290 |
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255); |
| 291 |
capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE |
| 278 |
uint8_t maxMcs = 0; |
292 |
uint8_t maxMcs = 0; |
| 279 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
293 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
| 280 |
{ |
294 |
{ |