wifi: Update Basic MLE variant to newer 802.11be draft
This commit is contained in:
committed by
Stefano Avallone
parent
e95689673e
commit
9c49377716
@@ -21,7 +21,8 @@ CommonInfoBasicMle::GetPresenceBitmap() const
|
||||
(m_bssParamsChangeCount.has_value() ? 0x0002 : 0x0) |
|
||||
(m_mediumSyncDelayInfo.has_value() ? 0x0004 : 0x0) |
|
||||
(m_emlCapabilities.has_value() ? 0x0008 : 0x0) |
|
||||
(m_mldCapabilities.has_value() ? 0x0010 : 0x0);
|
||||
(m_mldCapabilities.has_value() ? 0x0010 : 0x0) | (m_apMldId.has_value() ? 0x0020 : 0x0) |
|
||||
(m_extMldCapabilities.has_value() ? 0x0040 : 0x0);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
@@ -33,6 +34,8 @@ CommonInfoBasicMle::GetSize() const
|
||||
ret += (m_mediumSyncDelayInfo.has_value() ? 2 : 0);
|
||||
ret += (m_emlCapabilities.has_value() ? 2 : 0);
|
||||
ret += (m_mldCapabilities.has_value() ? 2 : 0);
|
||||
ret += (m_apMldId.has_value() ? 1 : 0);
|
||||
ret += (m_extMldCapabilities.has_value() ? 2 : 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -73,6 +76,17 @@ CommonInfoBasicMle::Serialize(Buffer::Iterator& start) const
|
||||
(m_mldCapabilities->freqSepForStrApMld << 7) | (m_mldCapabilities->aarSupport << 12);
|
||||
start.WriteHtolsbU16(val);
|
||||
}
|
||||
if (m_apMldId.has_value())
|
||||
{
|
||||
start.WriteU8(*m_apMldId);
|
||||
}
|
||||
if (m_extMldCapabilities.has_value())
|
||||
{
|
||||
uint16_t val = m_extMldCapabilities->opParamUpdateSupp |
|
||||
(m_extMldCapabilities->recommMaxSimulLinks << 1) |
|
||||
(m_extMldCapabilities->nstrStatusUpdateSupp << 5);
|
||||
start.WriteHtolsbU16(val);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t
|
||||
@@ -126,6 +140,20 @@ CommonInfoBasicMle::Deserialize(Buffer::Iterator start, uint16_t presence)
|
||||
m_mldCapabilities->aarSupport = (val >> 12) & 0x0001;
|
||||
count += 2;
|
||||
}
|
||||
if ((presence & 0x0020) != 0)
|
||||
{
|
||||
m_apMldId = i.ReadU8();
|
||||
count++;
|
||||
}
|
||||
if ((presence & 0x0040) != 0)
|
||||
{
|
||||
m_extMldCapabilities = ExtMldCapabilities();
|
||||
auto val = i.ReadLsbtohU16();
|
||||
m_extMldCapabilities->opParamUpdateSupp = val & 0x0001;
|
||||
m_extMldCapabilities->recommMaxSimulLinks = (val >> 1) & 0x000f;
|
||||
m_extMldCapabilities->nstrStatusUpdateSupp = (val >> 5) & 0x0001;
|
||||
count += 2;
|
||||
}
|
||||
|
||||
NS_ABORT_MSG_IF(count != length,
|
||||
"Common Info Length (" << +length
|
||||
|
||||
@@ -60,6 +60,16 @@ struct CommonInfoBasicMle
|
||||
uint8_t aarSupport : 1; //!< AAR Support
|
||||
};
|
||||
|
||||
/**
|
||||
* Extended MLD Capabilities and Operations subfield
|
||||
*/
|
||||
struct ExtMldCapabilities
|
||||
{
|
||||
uint8_t opParamUpdateSupp : 1; ///< Operation Parameter Update Support
|
||||
uint8_t recommMaxSimulLinks : 4; ///< Recommended Max Simultaneous Links
|
||||
uint8_t nstrStatusUpdateSupp : 1; ///< NSTR Status Update Support
|
||||
};
|
||||
|
||||
/**
|
||||
* Subfields
|
||||
*/
|
||||
@@ -70,6 +80,8 @@ struct CommonInfoBasicMle
|
||||
m_mediumSyncDelayInfo; //!< Medium Synchronization Delay Information
|
||||
std::optional<EmlCapabilities> m_emlCapabilities; //!< EML Capabilities
|
||||
std::optional<MldCapabilities> m_mldCapabilities; //!< MLD Capabilities
|
||||
std::optional<uint8_t> m_apMldId; ///< AP MLD ID
|
||||
std::optional<ExtMldCapabilities> m_extMldCapabilities; ///< Extended MLD Capabilities
|
||||
|
||||
/**
|
||||
* Get the Presence Bitmap subfield of the Common Info field
|
||||
|
||||
@@ -231,6 +231,39 @@ MultiLinkElement::GetTransitionTimeout() const
|
||||
return MicroSeconds(1 << (6 + emlCapabilities->transitionTimeout));
|
||||
}
|
||||
|
||||
void
|
||||
MultiLinkElement::SetApMldId(uint8_t id)
|
||||
{
|
||||
const auto variant = GetVariant();
|
||||
switch (variant)
|
||||
{
|
||||
case BASIC_VARIANT:
|
||||
std::get<CommonInfoBasicMle>(m_commonInfo).m_apMldId = id;
|
||||
return;
|
||||
case PROBE_REQUEST_VARIANT:
|
||||
std::get<CommonInfoProbeReqMle>(m_commonInfo).m_apMldId = id;
|
||||
return;
|
||||
default:
|
||||
NS_ABORT_MSG("AP MLD ID field not present in input variant " << variant);
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<uint8_t>
|
||||
MultiLinkElement::GetApMldId() const
|
||||
{
|
||||
const auto variant = GetVariant();
|
||||
switch (variant)
|
||||
{
|
||||
case BASIC_VARIANT:
|
||||
return std::get<CommonInfoBasicMle>(m_commonInfo).m_apMldId;
|
||||
case PROBE_REQUEST_VARIANT:
|
||||
return std::get<CommonInfoProbeReqMle>(m_commonInfo).m_apMldId;
|
||||
default:
|
||||
NS_LOG_DEBUG("AP MLD ID field not present in input variant");
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
MultiLinkElement::PerStaProfileSubelement::PerStaProfileSubelement(Variant variant)
|
||||
: m_variant(variant),
|
||||
m_staControl(0)
|
||||
|
||||
@@ -36,12 +36,10 @@ using AssocReqRefVariant = std::variant<std::reference_wrapper<MgtAssocRequestHe
|
||||
* @brief The Multi-Link element
|
||||
* @ingroup wifi
|
||||
*
|
||||
* The 802.11be Multi-Link element (see Sec.9.4.2.312 of 802.11be D1.5)
|
||||
* The 802.11be Multi-Link element (see Sec.9.4.2.312 of 802.11be D5.0)
|
||||
*
|
||||
* TODO:
|
||||
* - Add setters/getters for EML Capabilities and MLD Capabilities subfields of
|
||||
* the Common Info field of the Basic variant of a Multi-Link Element.
|
||||
* - Add support for variants other than the Basic one.
|
||||
* - Add support for variants other than the Basic and Probe Request.
|
||||
*/
|
||||
class MultiLinkElement : public WifiInformationElement
|
||||
{
|
||||
@@ -245,6 +243,21 @@ class MultiLinkElement : public WifiInformationElement
|
||||
*/
|
||||
Time GetTransitionTimeout() const;
|
||||
|
||||
/**
|
||||
* Set the AP MLD ID subfield of Common Info field. Valid variants are Basic and Probe Request.
|
||||
*
|
||||
* @param id AP MLD ID
|
||||
*/
|
||||
void SetApMldId(uint8_t id);
|
||||
|
||||
/**
|
||||
* Get the AP MLD ID subfield of Common Info field (if present). Valid variants are Basic and
|
||||
* Probe Request.
|
||||
*
|
||||
* @return the AP MLD ID
|
||||
*/
|
||||
std::optional<uint8_t> GetApMldId() const;
|
||||
|
||||
mutable ContainingFrame m_containingFrame; //!< reference to the mgt frame containing this MLE
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user