42 start.WriteHtolsbU16(val);
83 (
static_cast<uint64_t
>(
maxNc) << 36) |
101 start.WriteHtolsbU64(val1);
110 uint8_t val2 = i.
ReadU8();
135 maxNc = (val1 >> 36) & 0x000f;
169 size += ehtMcsAndNssSet.second.size();
180 for (
const auto&
byte : ehtMcsAndNssSet.second)
190 uint8_t heSupportedChannelWidthSet,
191 bool support320MhzIn6Ghz)
196 std::vector<uint8_t> bytes;
199 if ((heSupportedChannelWidthSet & 0x01) == 0)
202 for (std::size_t j = 0; j < 4; ++j)
204 uint8_t
byte = i.
ReadU8();
205 bytes.push_back(
byte);
213 for (std::size_t j = 0; j < 3; ++j)
215 uint8_t
byte = i.
ReadU8();
216 bytes.push_back(
byte);
224 if ((heSupportedChannelWidthSet & 0x0e) == 0)
227 for (std::size_t j = 0; j < 4; ++j)
229 uint8_t
byte = i.
ReadU8();
230 bytes.push_back(
byte);
235 if ((heSupportedChannelWidthSet & 0x02) != 0)
238 for (std::size_t j = 0; j < 3; ++j)
240 uint8_t
byte = i.
ReadU8();
241 bytes.push_back(
byte);
246 if ((heSupportedChannelWidthSet & 0x04) != 0)
249 for (std::size_t j = 0; j < 3; ++j)
251 uint8_t
byte = i.
ReadU8();
252 bytes.push_back(
byte);
257 if (support320MhzIn6Ghz)
260 for (std::size_t j = 0; j < 3; ++j)
262 uint8_t
byte = i.
ReadU8();
263 bytes.push_back(
byte);
276 const uint64_t nBitsNoPadding = 4 + 5 + (6 * numBitsSet * (
nssPe + 1));
277 return std::ceil(
static_cast<double>(nBitsNoPadding) / 8.0);
283 uint64_t nBitsNoPadding = 0;
289 uint8_t bitsPerPpet = 3;
292 uint8_t offset = nBitsNoPadding % 8;
293 uint8_t bitsLeft = (8 - offset);
294 uint8_t bitMask = (0x01 << bitsLeft) - 0x01;
295 val |= (info.ppetMax & bitMask) << offset;
296 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
297 if (nBitsNoPadding % 8 == 0)
302 const uint8_t remainingBits = (3 - bitsLeft);
303 bitMask = (0x01 << remainingBits) - 0x01;
304 val = (info.ppetMax >> bitsLeft) & bitMask;
305 nBitsNoPadding += remainingBits;
312 offset = nBitsNoPadding % 8;
313 bitsLeft = (8 - offset);
314 bitMask = (0x01 << bitsLeft) - 0x01;
315 val |= (info.ppet8 & bitMask) << offset;
316 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
317 if (nBitsNoPadding % 8 == 0)
322 const uint8_t remainingBits = (3 - bitsLeft);
323 bitMask = (0x01 << remainingBits) - 0x01;
324 val = (info.ppet8 >> bitsLeft) & bitMask;
325 nBitsNoPadding += remainingBits;
333 if (nBitsNoPadding % 8 > 0)
343 uint64_t nBitsNoPadding = 0;
352 const uint64_t bitsToDeserialize = (4 + 5 + (6 * numBitsSet * (
nssPe + 1)));
353 uint8_t bitsPerPpet = 3;
354 while (nBitsNoPadding < bitsToDeserialize)
357 uint8_t offset = nBitsNoPadding % 8;
358 uint8_t bitsLeft = (8 - offset);
359 uint8_t bitMask = (1 << bitsLeft) - 1;
360 info.
ppetMax = ((val >> offset) & bitMask);
361 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
362 if (nBitsNoPadding % 8 == 0)
367 const uint8_t remainingBits = (3 - bitsLeft);
368 bitMask = (1 << remainingBits) - 1;
369 info.
ppetMax |= ((val & bitMask) << bitsLeft);
370 nBitsNoPadding += remainingBits;
373 offset = nBitsNoPadding % 8;
374 bitsLeft = (8 - offset);
375 bitMask = (1 << bitsLeft) - 1;
376 info.
ppet8 = ((val >> offset) & bitMask);
377 nBitsNoPadding += std::min(bitsLeft, bitsPerPpet);
378 if (nBitsNoPadding % 8 == 0)
383 const uint8_t remainingBits = (3 - bitsLeft);
384 bitMask = (1 << remainingBits) - 1;
385 info.
ppet8 |= ((val & bitMask) << bitsLeft);
386 nBitsNoPadding += remainingBits;
391 return std::ceil(
static_cast<double>(bitsToDeserialize) / 8.0);
395 : m_macCapabilities{},
397 m_supportedEhtMcsAndNssSet{},
400 m_heCapabilities{
std::nullopt}
405 : m_macCapabilities{},
407 m_supportedEhtMcsAndNssSet{},
409 m_is2_4Ghz{is2_4Ghz},
410 m_heCapabilities{heCapabilities}
429 os <<
"EHT Capabilities=";
484 for (uint8_t i = 0; i <= 1; i++)
486 if ((1UL << (23 + i)) - 1 == maxAmpduLength)
507 NS_ASSERT_MSG(maxNss <= 8,
"Invalid maximum NSS " << maxNss);
508 std::size_t index = 0;
550 it->second[index] |= (maxNss & 0x0f);
559 NS_ASSERT_MSG(maxNss <= 8,
"Invalid maximum NSS " << maxNss);
560 std::size_t index = 0;
598 ((maxNss & 0x0f) << 4);
603 it->second[index] |= ((maxNss & 0x0f) << 4);
618 if ((it->second[i] & 0x0f) > 0)
624 NS_ASSERT_MSG(index >= 0,
"Supported EHT-MCS And NSS Set subfield is incorrect");
653 if ((it->second[i] & 0xf0) > 0)
659 NS_ASSERT_MSG(index >= 0,
"Supported EHT-MCS And NSS Set subfield is incorrect");
679 uint8_t ruIndexBitmask,
680 const std::vector<std::pair<uint8_t, uint8_t>>& ppeThresholds)
682 NS_ASSERT(ppeThresholds.size() == (std::bitset<5>(ruIndexBitmask).count() * (nssPe + 1)));
687 for (
const auto& [ppetMax, ppet8] : ppeThresholds)
iterator in a Buffer instance
void Next()
go forward by one byte
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetPpeThresholds(uint8_t nssPe, uint8_t ruIndexBitmask, const std::vector< std::pair< uint8_t, uint8_t > > &ppeThresholds)
Set the EHT PPE threshold info subfield.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
void SetSupportedTxEhtMcsAndNss(EhtMcsAndNssSet::EhtMcsMapType mapType, uint8_t upperMcs, uint8_t maxNss)
Set a subfield of the Supported EHT-MCS And NSS Set.
bool m_is2_4Ghz
flag indicating whether PHY is operating in 2.4 GHz based on other IEs contained in the same manageme...
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
EhtCapabilities()
Constructor.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
EhtMcsAndNssSet m_supportedEhtMcsAndNssSet
Supported EHT-MCS And NSS Set subfield.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
EhtPpeThresholds m_ppeThresholds
EHT PPE Threshold Info subfield.
EhtPhyCapabilities m_phyCapabilities
EHT PHY Capabilities Info subfield.
uint8_t GetHighestSupportedTxMcs(EhtMcsAndNssSet::EhtMcsMapType mapType)
Get the highest supported TX MCS for a given EHT-MCS map type.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint32_t GetMaxAmpduLength() const
Return the maximum A-MPDU length.
EhtMacCapabilities m_macCapabilities
EHT MAC Capabilities Info subfield.
uint16_t GetMaxMpduLength() const
Get the maximum MPDU length.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum A-MPDU length.
void SetSupportedRxEhtMcsAndNss(EhtMcsAndNssSet::EhtMcsMapType mapType, uint8_t upperMcs, uint8_t maxNss)
Set a subfield of the Supported EHT-MCS And NSS Set.
uint8_t GetHighestSupportedRxMcs(EhtMcsAndNssSet::EhtMcsMapType mapType)
Get the highest supported RX MCS for a given EHT-MCS map type.
std::optional< HeCapabilities > m_heCapabilities
HE capabilities contained in the same management frame if present.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
uint16_t GetSize() const
Get the size of the serialized EHT MAC capabilities subfield.
uint8_t maxMpduLength
Maximum MPDU Length.
uint8_t epcsPriorityAccessSupported
EPCS Priority Access Supported.
uint8_t triggeredTxopSharingMode1Support
Triggered TXOP Sharing Mode 1 Support.
uint8_t restrictedTwtSupport
Restricted TWT Support.
uint8_t ehtOmControlSupport
EHT OM Control Support.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT MAC capabilities subfield.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT MAC capabilities subfield.
uint8_t scsTrafficDescriptionSupport
SCS Traffic Description Support.
uint8_t maxAmpduLengthExponentExtension
Maximum A-MPDU length exponent extension.
uint8_t triggeredTxopSharingMode2Support
Triggered TXOP Sharing Mode 2 Support.
uint16_t Deserialize(Buffer::Iterator start, bool is2_4Ghz, uint8_t heSupportedChannelWidthSet, bool support320MhzIn6Ghz)
Deserialize the Supported EHT-MCS And NSS Set subfield.
uint16_t GetSize() const
Get the size of the serialized Supported EHT-MCS And NSS Set subfield.
void Serialize(Buffer::Iterator &start) const
Serialize the Supported EHT-MCS And NSS Set subfield.
std::map< EhtMcsMapType, std::vector< uint8_t > > supportedEhtMcsAndNssSet
Supported EHT-MCS And NSS Set.
EhtMcsMapType
The different EHT-MCS map types as defined in 9.4.2.313.4 Supported EHT-MCS And NSS Set field.
@ EHT_MCS_MAP_TYPE_320_MHZ
@ EHT_MCS_MAP_TYPE_20_MHZ_ONLY
@ EHT_MCS_MAP_TYPE_NOT_LARGER_THAN_80_MHZ
@ EHT_MCS_MAP_TYPE_160_MHZ
uint8_t support242ToneRuInBwLargerThan20Mhz
Support For 242-tone RU In BW Wider Than 20 MHz.
uint8_t triggeredSuBeamformingFeedback
Triggered SU Beamforming Feedback.
uint8_t ndpWith4TimesEhtLtfAnd32usGi
NDP With 4x EHT-LTF And 3.2 μs GI.
uint8_t ppeThresholdsPresent
PPE Thresholds Present.
uint8_t muBeamformer320Mhz
MU Beamformer (BW = 320 MHz)
uint8_t nSoundingDimensions160Mhz
Beamformee SS (= 160 MHz)
uint8_t rx1024QamInWiderBwDlOfdmaSupport
Rx 1024-QAM In Wider Bandwidth DL OFDMA Support.
uint8_t supportMcs15
Support Of MCS 15.
uint8_t beamformeeSsBwNotLargerThan80Mhz
Beamformee SS (≤ 80 MHz)
uint8_t partialBandwidthDlMuMimo
Partial Bandwidth DL MU-MIMO.
uint8_t nonOfdmaUlMuMimo320Mhz
Non-OFDMA UL MU-MIMO (BW = 320 MHz)
uint8_t muBeamformerBwNotLargerThan80Mhz
MU Beamformer (BW ≤ 80 MHz)
uint8_t triggeredCqiFeedback
Triggered CQI Feedback.
uint8_t nonOfdmaUlMuMimoBwNotLargerThan80Mhz
Non-OFDMA UL MU-MIMO (BW ≤ 80 MHz)
uint16_t GetSize() const
Get the size of the serialized EHT PHY capabilities subfield.
uint8_t nSoundingDimensions320Mhz
Beamformee SS (= 320 MHz)
uint8_t beamformeeSs320Mhz
Beamformee SS (= 320 MHz)
uint8_t partialBandwidthUlMuMimo
Partial Bandwidth UL MU-MIMO.
uint8_t psrBasedSpatialReuseSupport
EHT PSR-Based SR Support.
uint8_t nonOfdmaUlMuMimo160Mhz
Non-OFDMA UL MU-MIMO (BW = 160 MHz)
uint8_t suBeamformee
SU Beamformee.
uint8_t rx4096QamInWiderBwDlOfdmaSupport
Rx 4096-QAM In Wider Bandwidth DL OFDMA Support.
uint8_t tbSoundingFeedbackRateLimit
TB Sounding Feedback Rate Limit.
uint8_t muPpdu4xEhtLtfAnd800nsGi
EHT MU PPDU With 4x EHT-LTF And 0.8 μs GI.
uint8_t muBeamformer160Mhz
MU Beamformer (BW = 160 MHz)
uint8_t support320MhzIn6Ghz
Support For 320 MHz In 6 GHz.
uint8_t support20MhzOperatingStaReceivingNdpWithWiderBw
Support For 20 MHz Operating STA Receiving NDP With Wider Bandwidth.
uint8_t beamformeeSs160Mhz
Beamformee SS (= 160 MHz)
uint8_t codebooksizeSuFeedback
Support for a codebook size for SU feedback.
uint8_t triggeredMuBeamformingPartialBwFeedback
Triggered MU Beamforming Partial BW Feedback.
uint8_t nonTriggeredCqiFeedback
Non-Triggered CQI Feedback.
uint8_t powerBoostFactorSupport
Power Boost Factor Support.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT PHY capabilities subfield.
uint8_t supportEhtDupIn6GHz
Support Of EHT DUP (MCS 14) In 6 GHz.
uint8_t ng16MuFeedback
Support for subcarrier grouping of 16 for MU feedback.
uint8_t ng16SuFeedback
Support for subcarrier grouping of 16 for SU feedback.
uint8_t commonNominalPacketPadding
Common Nominal Packet Padding.
uint8_t codebooksizeMuFeedback
Support for a codebook size for MU feedback.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT PHY capabilities subfield.
uint8_t supportTx1024And4096QamForRuSmallerThan242Tones
Tx 1024-QAM And 4096-QAM < 242-tone RU Support.
uint8_t suBeamformer
SU Beamformer.
uint8_t nSoundingDimensionsBwNotLargerThan80Mhz
Beamformee SS (≤ 80 MHz)
uint8_t supportRx1024And4096QamForRuSmallerThan242Tones
Rx 1024-QAM And 4096-QAM < 242-tone RU Support.
uint8_t maxNumSupportedEhtLtfs
Maximum Number Of Supported EHT-LTFs.
uint16_t Deserialize(Buffer::Iterator start)
Deserialize the EHT PPE Thresholds subfield.
std::vector< EhtPpeThresholdsInfo > ppeThresholdsInfo
PPE Thresholds Info.
void Serialize(Buffer::Iterator &start) const
Serialize the EHT PPE Thresholds subfield.
uint8_t ruIndexBitmask
RU Index Bitmask.
uint16_t GetSize() const
Get the size of the serialized EHT PPE Thresholds subfield.