From 49d915ac08240d2a5f3bf4efe96fbfeea040cc16 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 4 Jul 2022 19:07:48 +0200 Subject: [PATCH] wifi: Add link ID parameter to more StaWifiMac methods --- src/wifi/model/sta-wifi-mac.cc | 24 ++++++++++++------------ src/wifi/model/sta-wifi-mac.h | 8 +++++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index 1bc050a4e..e4ee7b441 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -228,7 +228,7 @@ StaWifiMac::SendProbeRequest (void) Ptr packet = Create (); MgtProbeRequestHeader probe; probe.SetSsid (GetSsid ()); - probe.SetSupportedRates (GetSupportedRates ()); + probe.SetSupportedRates (GetSupportedRates (SINGLE_LINK_OP_ID)); if (GetHtSupported ()) { probe.SetExtendedCapabilities (GetExtendedCapabilities ()); @@ -281,8 +281,8 @@ StaWifiMac::SendAssociationRequest (bool isReassoc) { MgtAssocRequestHeader assoc; assoc.SetSsid (GetSsid ()); - assoc.SetSupportedRates (GetSupportedRates ()); - assoc.SetCapabilities (GetCapabilities ()); + assoc.SetSupportedRates (GetSupportedRates (SINGLE_LINK_OP_ID)); + assoc.SetCapabilities (GetCapabilities (SINGLE_LINK_OP_ID)); assoc.SetListenInterval (0); if (GetHtSupported ()) { @@ -308,8 +308,8 @@ StaWifiMac::SendAssociationRequest (bool isReassoc) MgtReassocRequestHeader reassoc; reassoc.SetCurrentApAddress (GetBssid (0)); // TODO use appropriate linkId reassoc.SetSsid (GetSsid ()); - reassoc.SetSupportedRates (GetSupportedRates ()); - reassoc.SetCapabilities (GetCapabilities ()); + reassoc.SetSupportedRates (GetSupportedRates (SINGLE_LINK_OP_ID)); + reassoc.SetCapabilities (GetCapabilities (SINGLE_LINK_OP_ID)); reassoc.SetListenInterval (0); if (GetHtSupported ()) { @@ -1006,18 +1006,18 @@ StaWifiMac::UpdateApInfo (const MgtFrameType& frame, const Mac48Address& apAddr, } SupportedRates -StaWifiMac::GetSupportedRates (void) const +StaWifiMac::GetSupportedRates (uint8_t linkId) const { SupportedRates rates; - for (const auto & mode : GetWifiPhy ()->GetModeList ()) + for (const auto & mode : GetWifiPhy (linkId)->GetModeList ()) { - uint64_t modeDataRate = mode.GetDataRate (GetWifiPhy ()->GetChannelWidth ()); + uint64_t modeDataRate = mode.GetDataRate (GetWifiPhy (linkId)->GetChannelWidth ()); NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate); rates.AddSupportedRate (modeDataRate); } if (GetHtSupported ()) { - for (const auto & selector : GetWifiPhy ()->GetBssMembershipSelectorList ()) + for (const auto & selector : GetWifiPhy (linkId)->GetBssMembershipSelectorList ()) { rates.AddBssMembershipSelectorRate (selector); } @@ -1026,11 +1026,11 @@ StaWifiMac::GetSupportedRates (void) const } CapabilityInformation -StaWifiMac::GetCapabilities (void) const +StaWifiMac::GetCapabilities (uint8_t linkId) const { CapabilityInformation capabilities; - capabilities.SetShortPreamble (GetWifiPhy ()->GetShortPhyPreambleSupported () || GetErpSupported (SINGLE_LINK_OP_ID)); - capabilities.SetShortSlotTime (GetShortSlotTimeSupported () && GetErpSupported (SINGLE_LINK_OP_ID)); + capabilities.SetShortPreamble (GetWifiPhy (linkId)->GetShortPhyPreambleSupported () || GetErpSupported (linkId)); + capabilities.SetShortSlotTime (GetShortSlotTimeSupported () && GetErpSupported (linkId)); return capabilities; } diff --git a/src/wifi/model/sta-wifi-mac.h b/src/wifi/model/sta-wifi-mac.h index a958be861..64588d99d 100644 --- a/src/wifi/model/sta-wifi-mac.h +++ b/src/wifi/model/sta-wifi-mac.h @@ -372,9 +372,10 @@ private: * Return an instance of SupportedRates that contains all rates that we support * including HT rates. * + * \param linkId the ID of the link for which the request is made * \return SupportedRates all rates that we support */ - SupportedRates GetSupportedRates (void) const; + SupportedRates GetSupportedRates (uint8_t linkId) const; /** * Set the current MAC state. * @@ -402,11 +403,12 @@ private: */ void SetMuEdcaParameters (AcIndex ac, uint16_t cwMin, uint16_t cwMax, uint8_t aifsn, Time muEdcaTimer); /** - * Return the Capability information of the current STA. + * Return the Capability information for the given link. * + * \param linkId the ID of the given link * \return the Capability information that we support */ - CapabilityInformation GetCapabilities (void) const; + CapabilityInformation GetCapabilities (uint8_t linkId) const; /** * Indicate that PHY capabilities have changed.