|
|
| 421 |
return information; |
421 |
return information; |
| 422 |
} |
422 |
} |
| 423 |
|
423 |
|
| 424 |
HtCapabilities |
|
|
| 425 |
ApWifiMac::GetHtCapabilities (void) const |
| 426 |
{ |
| 427 |
HtCapabilities capabilities; |
| 428 |
capabilities.SetHtSupported (1); |
| 429 |
if (m_htSupported) |
| 430 |
{ |
| 431 |
capabilities.SetLdpc (m_phy->GetLdpc ()); |
| 432 |
capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40); |
| 433 |
capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval ()); |
| 434 |
capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () == 40 && m_phy->GetGuardInterval ()); |
| 435 |
capabilities.SetGreenfield (m_phy->GetGreenfield ()); |
| 436 |
capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD) |
| 437 |
capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ()); |
| 438 |
capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD) |
| 439 |
uint64_t maxSupportedRate = 0; //in bit/s |
| 440 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
| 441 |
{ |
| 442 |
WifiMode mcs = m_phy->GetMcs (i); |
| 443 |
if (mcs.GetModulationClass () != WIFI_MOD_CLASS_HT) |
| 444 |
{ |
| 445 |
continue; |
| 446 |
} |
| 447 |
capabilities.SetRxMcsBitmask (mcs.GetMcsValue ()); |
| 448 |
uint8_t nss = (mcs.GetMcsValue () / 8) + 1; |
| 449 |
NS_ASSERT (nss > 0 && nss < 5); |
| 450 |
if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss) > maxSupportedRate) |
| 451 |
{ |
| 452 |
maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss); |
| 453 |
NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate); |
| 454 |
} |
| 455 |
} |
| 456 |
capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s |
| 457 |
capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0); |
| 458 |
capabilities.SetTxMaxNSpatialStreams (m_phy->GetSupportedTxSpatialStreams ()); |
| 459 |
} |
| 460 |
return capabilities; |
| 461 |
} |
| 462 |
|
| 463 |
HtOperations |
424 |
HtOperations |
| 464 |
ApWifiMac::GetHtOperations (void) const |
425 |
ApWifiMac::GetHtOperations (void) const |
| 465 |
{ |
426 |
{ |
|
|
| 479 |
return operations; |
440 |
return operations; |
| 480 |
} |
441 |
} |
| 481 |
|
442 |
|
| 482 |
VhtCapabilities |
|
|
| 483 |
ApWifiMac::GetVhtCapabilities (void) const |
| 484 |
{ |
| 485 |
VhtCapabilities capabilities; |
| 486 |
capabilities.SetVhtSupported (1); |
| 487 |
if (m_vhtSupported) |
| 488 |
{ |
| 489 |
if (m_phy->GetChannelWidth () == 160) |
| 490 |
{ |
| 491 |
capabilities.SetSupportedChannelWidthSet (1); |
| 492 |
} |
| 493 |
else |
| 494 |
{ |
| 495 |
capabilities.SetSupportedChannelWidthSet (0); |
| 496 |
} |
| 497 |
capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD) |
| 498 |
capabilities.SetRxLdpc (m_phy->GetLdpc ()); |
| 499 |
capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetGuardInterval ()); |
| 500 |
capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetGuardInterval ()); |
| 501 |
capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD) |
| 502 |
uint8_t maxMcs = 0; |
| 503 |
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++) |
| 504 |
{ |
| 505 |
WifiMode mcs = m_phy->GetMcs (i); |
| 506 |
if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT) |
| 507 |
&& (mcs.GetMcsValue () > maxMcs)) |
| 508 |
{ |
| 509 |
maxMcs = mcs.GetMcsValue (); |
| 510 |
} |
| 511 |
} |
| 512 |
// Support same MaxMCS for each spatial stream |
| 513 |
for (uint8_t nss = 1; nss <= m_phy->GetSupportedRxSpatialStreams (); nss++) |
| 514 |
{ |
| 515 |
capabilities.SetRxMcsMap (maxMcs, nss); |
| 516 |
} |
| 517 |
for (uint8_t nss = 1; nss <= m_phy->GetSupportedTxSpatialStreams (); nss++) |
| 518 |
{ |
| 519 |
capabilities.SetTxMcsMap (maxMcs, nss); |
| 520 |
} |
| 521 |
} |
| 522 |
return capabilities; |
| 523 |
} |
| 524 |
|
| 525 |
void |
443 |
void |
| 526 |
ApWifiMac::SendProbeResp (Mac48Address to) |
444 |
ApWifiMac::SendProbeResp (Mac48Address to) |
| 527 |
{ |
445 |
{ |