|
Lines 517-522
StaWifiMac::Receive (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 517 |
Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons); |
517 |
Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons); |
| 518 |
RestartBeaconWatchdog (delay); |
518 |
RestartBeaconWatchdog (delay); |
| 519 |
SetBssid (hdr->GetAddr3 ()); |
519 |
SetBssid (hdr->GetAddr3 ()); |
|
|
520 |
SupportedRates rates = beacon.GetSupportedRates (); |
| 521 |
for (uint32_t i = 0; i < m_phy->GetNModes (); i++) |
| 522 |
{ |
| 523 |
WifiMode mode = m_phy->GetMode (i); |
| 524 |
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ()))) |
| 525 |
{ |
| 526 |
m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode); |
| 527 |
} |
| 528 |
} |
| 520 |
bool isShortPreambleEnabled = capabilities.IsShortPreamble (); |
529 |
bool isShortPreambleEnabled = capabilities.IsShortPreamble (); |
| 521 |
if (m_erpSupported) |
530 |
if (m_erpSupported) |
| 522 |
{ |
531 |
{ |
|
Lines 566-571
StaWifiMac::Receive (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 566 |
else |
575 |
else |
| 567 |
{ |
576 |
{ |
| 568 |
m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htCapabilities); |
577 |
m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htCapabilities); |
|
|
578 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
| 579 |
{ |
| 580 |
WifiMode mcs = m_phy->GetMcs (i); |
| 581 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ())) |
| 582 |
{ |
| 583 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
| 584 |
} |
| 585 |
} |
| 569 |
} |
586 |
} |
| 570 |
} |
587 |
} |
| 571 |
if (m_vhtSupported) |
588 |
if (m_vhtSupported) |
|
Lines 575-587
StaWifiMac::Receive (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 575 |
if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0) |
592 |
if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0) |
| 576 |
{ |
593 |
{ |
| 577 |
m_stationManager->AddStationVhtCapabilities (hdr->GetAddr2 (), vhtCapabilities); |
594 |
m_stationManager->AddStationVhtCapabilities (hdr->GetAddr2 (), vhtCapabilities); |
|
|
595 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
| 596 |
{ |
| 597 |
WifiMode mcs = m_phy->GetMcs (i); |
| 598 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ())) |
| 599 |
{ |
| 600 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
| 601 |
} |
| 602 |
} |
| 578 |
} |
603 |
} |
| 579 |
} |
604 |
} |
| 580 |
if (m_heSupported) |
605 |
if (m_heSupported) |
| 581 |
{ |
606 |
{ |
| 582 |
HeCapabilities hecapabilities = beacon.GetHeCapabilities (); |
607 |
HeCapabilities heCapabilities = beacon.GetHeCapabilities (); |
| 583 |
//todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer |
608 |
//todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer |
| 584 |
m_stationManager->AddStationHeCapabilities (hdr->GetAddr2 (), hecapabilities); |
609 |
m_stationManager->AddStationHeCapabilities (hdr->GetAddr2 (), heCapabilities); |
|
|
610 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
| 611 |
{ |
| 612 |
WifiMode mcs = m_phy->GetMcs (i); |
| 613 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ())) |
| 614 |
{ |
| 615 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
| 616 |
} |
| 617 |
} |
| 585 |
} |
618 |
} |
| 586 |
m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled); |
619 |
m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled); |
| 587 |
m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ()); |
620 |
m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ()); |
|
Lines 789-799
StaWifiMac::Receive (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 789 |
} |
822 |
} |
| 790 |
if (m_htSupported) |
823 |
if (m_htSupported) |
| 791 |
{ |
824 |
{ |
| 792 |
HtCapabilities htcapabilities = assocResp.GetHtCapabilities (); |
825 |
HtCapabilities htCapabilities = assocResp.GetHtCapabilities (); |
| 793 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
826 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
| 794 |
{ |
827 |
{ |
| 795 |
WifiMode mcs = m_phy->GetMcs (i); |
828 |
WifiMode mcs = m_phy->GetMcs (i); |
| 796 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htcapabilities.IsSupportedMcs (mcs.GetMcsValue ())) |
829 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ())) |
| 797 |
{ |
830 |
{ |
| 798 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
831 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
| 799 |
//here should add a control to add basic MCS when it is implemented |
832 |
//here should add a control to add basic MCS when it is implemented |
|
Lines 806-812
StaWifiMac::Receive (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 806 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
839 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
| 807 |
{ |
840 |
{ |
| 808 |
WifiMode mcs = m_phy->GetMcs (i); |
841 |
WifiMode mcs = m_phy->GetMcs (i); |
| 809 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ())) |
842 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities.IsSupportedRxMcs (mcs.GetMcsValue ())) |
| 810 |
{ |
843 |
{ |
| 811 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
844 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
| 812 |
//here should add a control to add basic MCS when it is implemented |
845 |
//here should add a control to add basic MCS when it is implemented |
|
Lines 815-825
StaWifiMac::Receive (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 815 |
} |
848 |
} |
| 816 |
if (m_heSupported) |
849 |
if (m_heSupported) |
| 817 |
{ |
850 |
{ |
| 818 |
HeCapabilities hecapabilities = assocResp.GetHeCapabilities (); |
851 |
HeCapabilities heCapabilities = assocResp.GetHeCapabilities (); |
| 819 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
852 |
for (uint32_t i = 0; i < m_phy->GetNMcs (); i++) |
| 820 |
{ |
853 |
{ |
| 821 |
WifiMode mcs = m_phy->GetMcs (i); |
854 |
WifiMode mcs = m_phy->GetMcs (i); |
| 822 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ())) |
855 |
if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ())) |
| 823 |
{ |
856 |
{ |
| 824 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
857 |
m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs); |
| 825 |
//here should add a control to add basic MCS when it is implemented |
858 |
//here should add a control to add basic MCS when it is implemented |