From 8571ceea0e06298ab9b718052ac16f2fe32ababa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Richart?= Date: Tue, 1 Mar 2016 19:53:17 +0100 Subject: [PATCH] wifi: (fixes #2311) store state received about the remote station being HT or VHT capable --- src/wifi/model/wifi-remote-station-manager.cc | 16 ++++++++++++++ src/wifi/model/wifi-remote-station-manager.h | 21 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 74a08b2ba..90ec03197 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -1432,6 +1432,8 @@ WifiRemoteStationManager::LookupState (Mac48Address address) const state->m_ness = 0; state->m_aggregation = false; state->m_stbc = false; + state->m_htSupported = false; + state->m_vhtSupported = false; const_cast (this)->m_states.push_back (state); NS_LOG_DEBUG ("WifiRemoteStationManager::LookupState returning new state"); return state; @@ -1491,6 +1493,7 @@ WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabil { state->m_channelWidth = 20; } + state->m_htSupported = true; state->m_greenfield = htCapabilities.GetGreenfield (); state->m_rx = htCapabilities.GetRxHighestSupportedAntennas (); } @@ -1516,6 +1519,7 @@ WifiRemoteStationManager::AddStationVhtCapabilities (Mac48Address from, VhtCapab { state->m_channelWidth = m_wifiPhy->GetChannelWidth (); } + state->m_vhtSupported = true; } bool @@ -1805,6 +1809,18 @@ WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const return station->m_state->m_operationalRateSet.size (); } +bool +WifiRemoteStationManager::GetHtSupported (const WifiRemoteStation *station) const +{ + return station->m_state->m_htSupported; +} + +bool +WifiRemoteStationManager::GetVhtSupported (const WifiRemoteStation *station) const +{ + return station->m_state->m_vhtSupported; +} + uint32_t WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) const { diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index fdce64f0b..90b993dee 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -753,6 +753,24 @@ protected: * \return the number of modes supported by the given station */ uint32_t GetNSupported (const WifiRemoteStation *station) const; + /** + * Return whether the given station is HT capable. + * + * \param station the station being queried + * + * \return true if the station has HT capabilities, + * false otherwise + */ + bool GetHtSupported (const WifiRemoteStation *station) const; + /** + * Return whether the given station is VHT capable. + * + * \param station the station being queried + * + * \return true if the station has VHT capabilities, + * false otherwise + */ + bool GetVhtSupported (const WifiRemoteStation *station) const; /** * Return the WifiMode supported by the specified station at the specified index. * @@ -761,6 +779,7 @@ protected: * * \return the WifiMode at the given index of the specified station */ + WifiMode GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const; /** * Return the number of MCS supported by the given station. @@ -1232,6 +1251,8 @@ struct WifiRemoteStationState bool m_greenfield; //!< Flag if greenfield is supported by the remote station bool m_shortPreamble; //!< Flag if short PLCP preamble is supported by the remote station bool m_shortSlotTime; //!< Flag if short ERP slot time is supported by the remote station + bool m_htSupported; //!< Flag if HT is supported by the station + bool m_vhtSupported; //!< Flag if VHT is supported by the station }; /**