wifi: STAs store AP's Transition Timeout in EMLSR manager

This commit is contained in:
Stefano Avallone
2023-02-07 11:29:37 +01:00
committed by Stefano Avallone
parent 8331a46cf7
commit 85f833fa34
3 changed files with 34 additions and 1 deletions

View File

@@ -97,4 +97,17 @@ EmlsrManager::GetEhtFem(uint8_t linkId) const
return StaticCast<EhtFrameExchangeManager>(m_staMac->GetFrameExchangeManager(linkId));
}
void
EmlsrManager::SetTransitionTimeout(Time timeout)
{
NS_LOG_FUNCTION(this << timeout.As(Time::US));
m_emlsrTransitionTimeout = timeout;
}
std::optional<Time>
EmlsrManager::GetTransitionTimeout() const
{
return m_emlsrTransitionTimeout;
}
} // namespace ns3

View File

@@ -52,6 +52,18 @@ class EmlsrManager : public Object
*/
void SetWifiMac(Ptr<StaWifiMac> mac);
/**
* Set the Transition Timeout advertised by the associated AP with EMLSR activated.
*
* \param timeout the advertised Transition Timeout
*/
void SetTransitionTimeout(Time timeout);
/**
* \return the Transition Timeout, if advertised by the associated AP
*/
std::optional<Time> GetTransitionTimeout() const;
protected:
void DoDispose() override;
@@ -70,7 +82,9 @@ class EmlsrManager : public Object
Time m_emlsrTransitionDelay; //!< EMLSR Transition delay
private:
Ptr<StaWifiMac> m_staMac; //!< the MAC of the managed non-AP MLD
Ptr<StaWifiMac> m_staMac; //!< the MAC of the managed non-AP MLD
std::optional<Time> m_emlsrTransitionTimeout; /**< Transition timeout advertised by APs with
EMLSR activated */
};
} // namespace ns3

View File

@@ -1430,6 +1430,12 @@ StaWifiMac::UpdateApInfo(const MgtFrameType& frame,
// TODO: once we support non constant rate managers, we should add checks here whether EHT
// is supported by the peer
GetWifiRemoteStationManager(linkId)->AddStationEhtCapabilities(apAddr, *ehtCapabilities);
if (const auto& mle = frame.template Get<MultiLinkElement>();
mle && mle->HasEmlCapabilities() && m_emlsrManager)
{
m_emlsrManager->SetTransitionTimeout(mle->GetTransitionTimeout());
}
};
// process Information Elements included in the current frame variant