A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-capabilities.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#include "he-capabilities.h"
10
11#include <algorithm>
12
13namespace ns3
14{
15
17 : m_plusHtcHeSupport(0),
18 m_twtRequesterSupport(0),
19 m_twtResponderSupport(0),
20 m_fragmentationSupport(0),
21 m_maximumNumberOfFragmentedMsdus(0),
22 m_minimumFragmentSize(0),
23 m_triggerFrameMacPaddingDuration(0),
24 m_multiTidAggregationRxSupport(0),
25 m_heLinkAdaptation(0),
26 m_allAckSupport(0),
27 m_trsSupport(0),
28 m_bsrSupport(0),
29 m_broadcastTwtSupport(0),
30 m_32bitBaBitmapSupport(0),
31 m_muCascadeSupport(0),
32 m_ackEnabledAggregationSupport(0),
33 m_omControlSupport(0),
34 m_ofdmaRaSupport(0),
35 m_maxAmpduLengthExponent(0),
36 m_amsduFragmentationSupport(0),
37 m_flexibleTwtScheduleSupport(0),
38 m_rxControlFrameToMultiBss(0),
39 m_bsrpBqrpAmpduAggregation(0),
40 m_qtpSupport(0),
41 m_bqrSupport(0),
42 m_psrResponder(0),
43 m_ndpFeedbackReportSupport(0),
44 m_opsSupport(0),
45 m_amsduNotUnderBaInAmpduSupport(0),
46 m_multiTidAggregationTxSupport(0),
47 m_heSubchannelSelectiveTxSupport(0),
48 m_ul2x996ToneRuSupport(0),
49 m_omControlUlMuDataDisableRxSupport(0),
50 m_heDynamicSmPowerSave(0),
51 m_puncturedSoundingSupport(0),
52 m_heVhtTriggerFrameRxSupport(0),
53 m_channelWidthSet(0),
54 m_puncturedPreambleRx(0),
55 m_deviceClass(0),
56 m_ldpcCodingInPayload(0),
57 m_heSuPpdu1xHeLtf800nsGi(0),
58 m_midambleRxMaxNsts(0),
59 m_ndp4xHeLtfAnd32msGi(0),
60 m_stbcTxLeq80MHz(0),
61 m_stbcRxLeq80MHz(0),
62 m_dopplerTx(0),
63 m_dopplerRx(0),
64 m_fullBwUlMuMimo(0),
65 m_partialBwUlMuMimo(0),
66 m_dcmMaxConstellationTx(0),
67 m_dcmMaxNssTx(0),
68 m_dcmMaxConstellationRx(0),
69 m_dcmMaxNssRx(0),
70 m_rxPartialBwSuInHeMu(0),
71 m_suBeamformer(0),
72 m_suBeamformee(0),
73 m_muBeamformer(0),
74 m_beamformeeStsForSmallerOrEqualThan80Mhz(0),
75 m_beamformeeStsForLargerThan80Mhz(0),
76 m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz(0),
77 m_numberOfSoundingDimensionsForLargerThan80Mhz(0),
78 m_ngEqual16ForSuFeedbackSupport(0),
79 m_ngEqual16ForMuFeedbackSupport(0),
80 m_codebookSize42SuFeedback(0),
81 m_codebookSize75MuFeedback(0),
82 m_triggeredSuBfFeedback(0),
83 m_triggeredMuBfFeedback(0),
84 m_triggeredCqiFeedback(0),
85 m_erPartialBandwidth(0),
86 m_dlMuMimoOnPartialBandwidth(0),
87 m_ppeThresholdPresent(0),
88 m_psrBasedSrSupport(0),
89 m_powerBoostFactorAlphaSupport(0),
90 m_hePpdu4xHeLtf800nsGi(0),
91 m_maxNc(0),
92 m_stbcTxGt80MHz(0),
93 m_stbcRxGt80MHz(0),
94 m_heErSuPpdu4xHeLtf08sGi(0),
95 m_hePpdu20MHzIn40MHz24GHz(0),
96 m_hePpdu20MHzIn160MHz(0),
97 m_hePpdu80MHzIn160MHz(0),
98 m_heErSuPpdu1xHeLtf08Gi(0),
99 m_midamble2xAnd1xHeLtf(0),
100 m_dcmMaxRu(0),
101 m_longerThan16HeSigbOfdm(0),
102 m_nonTriggeredCqiFeedback(0),
103 m_tx1024QamLt242Ru(0),
104 m_rx1024QamLt242Ru(0),
105 m_rxFullBwSuInHeMuCompressedSigB(0),
106 m_rxFullBwSuInHeMuNonCompressedSigB(0),
107 m_nominalPacketPadding(0),
108 m_maxHeLtfRxInHeMuMoreThanOneRu(0),
109 m_highestNssSupportedM1(0),
110 m_highestMcsSupported(0)
111{
112 m_txBwMap.resize(8, 0);
113 m_rxBwMap.resize(8, 0);
114}
115
118{
119 return IE_EXTENSION;
120}
121
127
128void
129HeCapabilities::Print(std::ostream& os) const
130{
131 os << "HE Capabilities=[Max AMPDU Length Exponent: " << +m_maxAmpduLengthExponent
132 << ", Channel Width Set: " << +m_channelWidthSet << "]";
133}
134
135uint16_t
137{
138 // IEEE 802.11ax-2021 9.4.2.248 HE Capabilities element
139 // Element ID Extension (1) + HE MAC Capabilities Information (6)
140 // + HE PHY Capabilities Information (11) + Supported HE-MCS And NSS Set (4)
141 // TODO: Supported HE-MCS And NSS Set field has variable length (4, 8 or 12)
142 // TODO: PPE Thresholds field (optional) is not implemented
143 return 22;
144}
145
146void
148{
149 // write the corresponding value for each bit
150 start.WriteHtolsbU32(GetHeMacCapabilitiesInfo1());
151 start.WriteHtolsbU16(GetHeMacCapabilitiesInfo2());
152 start.WriteHtolsbU64(GetHePhyCapabilitiesInfo1());
153 start.WriteHtolsbU16(GetHePhyCapabilitiesInfo2());
154 start.WriteU8(GetHePhyCapabilitiesInfo3());
155 start.WriteHtolsbU32(GetSupportedMcsAndNss());
156 // TODO: add another 32-bits field if 160 MHz channel is supported (variable length)
157 // TODO: optional PPE Threshold field (variable length)
158}
159
160uint16_t
162{
163 Buffer::Iterator i = start;
164 uint32_t macCapabilities1 = i.ReadLsbtohU32();
165 uint16_t macCapabilities2 = i.ReadLsbtohU16();
166 uint64_t phyCapabilities1 = i.ReadLsbtohU64();
167 uint64_t phyCapabilities2 = i.ReadLsbtohU16();
168 uint8_t phyCapabilities3 = i.ReadU8();
169 uint32_t mcsset = i.ReadU32();
170 SetHeMacCapabilitiesInfo(macCapabilities1, macCapabilities2);
171 SetHePhyCapabilitiesInfo(phyCapabilities1, phyCapabilities2, phyCapabilities3);
172 SetSupportedMcsAndNss(mcsset);
173 // TODO: add another 32-bits field if 160 MHz channel is supported (variable length)
174 // TODO: optional PPE Threshold field (variable length)
175 return length;
176}
177
178void
180{
181 m_plusHtcHeSupport = ctrl1 & 0x01;
182 m_twtRequesterSupport = (ctrl1 >> 1) & 0x01;
183 m_twtResponderSupport = (ctrl1 >> 2) & 0x01;
184 m_fragmentationSupport = (ctrl1 >> 3) & 0x03;
185 m_maximumNumberOfFragmentedMsdus = (ctrl1 >> 5) & 0x07;
186 m_minimumFragmentSize = (ctrl1 >> 8) & 0x03;
187 m_triggerFrameMacPaddingDuration = (ctrl1 >> 10) & 0x03;
188 m_multiTidAggregationRxSupport = (ctrl1 >> 12) & 0x07;
189 m_heLinkAdaptation = (ctrl1 >> 15) & 0x03;
190 m_allAckSupport = (ctrl1 >> 17) & 0x01;
191 m_trsSupport = (ctrl1 >> 18) & 0x01;
192 m_bsrSupport = (ctrl1 >> 19) & 0x01;
193 m_broadcastTwtSupport = (ctrl1 >> 20) & 0x01;
194 m_32bitBaBitmapSupport = (ctrl1 >> 21) & 0x01;
195 m_muCascadeSupport = (ctrl1 >> 22) & 0x01;
196 m_ackEnabledAggregationSupport = (ctrl1 >> 23) & 0x01;
197 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
198 // Bit 24 is reserved
199 m_omControlSupport = (ctrl1 >> 25) & 0x01;
200 m_ofdmaRaSupport = (ctrl1 >> 26) & 0x01;
201 m_maxAmpduLengthExponent = (ctrl1 >> 27) & 0x03;
202 m_amsduFragmentationSupport = (ctrl1 >> 29) & 0x01;
203 m_flexibleTwtScheduleSupport = (ctrl1 >> 30) & 0x01;
204 m_rxControlFrameToMultiBss = (ctrl1 >> 31) & 0x01;
205 m_bsrpBqrpAmpduAggregation = ctrl2 & 0x01;
206 m_qtpSupport = (ctrl2 >> 1) & 0x01;
207 m_bqrSupport = (ctrl2 >> 2) & 0x01;
208 m_psrResponder = (ctrl2 >> 3) & 0x01;
209 m_ndpFeedbackReportSupport = (ctrl2 >> 4) & 0x01;
210 m_opsSupport = (ctrl2 >> 5) & 0x01;
211 m_amsduNotUnderBaInAmpduSupport = (ctrl2 >> 6) & 0x01;
212 m_multiTidAggregationTxSupport = (ctrl2 >> 7) & 0x07;
213 m_heSubchannelSelectiveTxSupport = (ctrl2 >> 10) & 0x01;
214 m_ul2x996ToneRuSupport = (ctrl2 >> 11) & 0x01;
215 m_omControlUlMuDataDisableRxSupport = (ctrl2 >> 12) & 0x01;
216 m_heDynamicSmPowerSave = (ctrl2 >> 13) & 0x01;
217 m_puncturedSoundingSupport = (ctrl2 >> 14) & 0x01;
218 m_heVhtTriggerFrameRxSupport = (ctrl2 >> 15) & 0x01;
219}
220
223{
224 uint32_t val = 0;
225 val |= m_plusHtcHeSupport & 0x01;
226 val |= (m_twtRequesterSupport & 0x01) << 1;
227 val |= (m_twtResponderSupport & 0x01) << 2;
228 val |= (m_fragmentationSupport & 0x03) << 3;
229 val |= (m_maximumNumberOfFragmentedMsdus & 0x07) << 5;
230 val |= (m_minimumFragmentSize & 0x03) << 8;
231 val |= (m_triggerFrameMacPaddingDuration & 0x03) << 10;
232 val |= (m_multiTidAggregationRxSupport & 0x07) << 12;
233 val |= (m_heLinkAdaptation & 0x03) << 15;
234 val |= (m_allAckSupport & 0x01) << 17;
235 val |= (m_trsSupport & 0x01) << 18;
236 val |= (m_bsrSupport & 0x01) << 19;
237 val |= (m_broadcastTwtSupport & 0x01) << 20;
238 val |= (m_32bitBaBitmapSupport & 0x01) << 21;
239 val |= (m_muCascadeSupport & 0x01) << 22;
240 val |= (m_ackEnabledAggregationSupport & 0x01) << 23;
241 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
242 // Bit 24 is reserved
243 val |= (m_omControlSupport & 0x01) << 25;
244 val |= (m_ofdmaRaSupport & 0x01) << 26;
245 val |= (m_maxAmpduLengthExponent & 0x03) << 27;
246 val |= (m_amsduFragmentationSupport & 0x01) << 29;
247 val |= (m_flexibleTwtScheduleSupport & 0x01) << 30;
248 val |= (m_rxControlFrameToMultiBss & 0x01) << 31;
249 return val;
250}
251
252uint16_t
254{
255 uint16_t val = 0;
256 val |= m_bsrpBqrpAmpduAggregation & 0x01;
257 val |= (m_qtpSupport & 0x01) << 1;
258 val |= (m_bqrSupport & 0x01) << 2;
259 val |= (m_psrResponder & 0x01) << 3;
260 val |= (m_ndpFeedbackReportSupport & 0x01) << 4;
261 val |= (m_opsSupport & 0x01) << 5;
262 val |= (m_amsduNotUnderBaInAmpduSupport & 0x01) << 6;
263 val |= (m_multiTidAggregationTxSupport & 0x07) << 7;
264 val |= (m_heSubchannelSelectiveTxSupport & 0x01) << 10;
265 val |= (m_ul2x996ToneRuSupport & 0x01) << 11;
266 val |= (m_omControlUlMuDataDisableRxSupport & 0x01) << 12;
267 val |= (m_heDynamicSmPowerSave & 0x01) << 13;
268 val |= (m_puncturedSoundingSupport & 0x01) << 14;
269 val |= (m_heVhtTriggerFrameRxSupport & 0x01) << 15;
270 return val;
271}
272
273void
274HeCapabilities::SetHePhyCapabilitiesInfo(uint64_t ctrl1, uint16_t ctrl2, uint8_t ctrl3)
275{
276 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
277 // Bit 0 is reserved
278 m_channelWidthSet = (ctrl1 >> 1) & 0x7f;
279 m_puncturedPreambleRx = (ctrl1 >> 8) & 0x0f;
280 m_deviceClass = (ctrl1 >> 12) & 0x01;
281 m_ldpcCodingInPayload = (ctrl1 >> 13) & 0x01;
282 m_heSuPpdu1xHeLtf800nsGi = (ctrl1 >> 14) & 0x01;
283 m_midambleRxMaxNsts = (ctrl1 >> 15) & 0x03;
284 m_ndp4xHeLtfAnd32msGi = (ctrl1 >> 17) & 0x01;
285 m_stbcTxLeq80MHz = (ctrl1 >> 18) & 0x01;
286 m_stbcRxLeq80MHz = (ctrl1 >> 19) & 0x01;
287 m_dopplerTx = (ctrl1 >> 20) & 0x01;
288 m_dopplerRx = (ctrl1 >> 21) & 0x01;
289 m_fullBwUlMuMimo = (ctrl1 >> 22) & 0x01;
290 m_partialBwUlMuMimo = (ctrl1 >> 23) & 0x01;
291 m_dcmMaxConstellationTx = (ctrl1 >> 24) & 0x03;
292 m_dcmMaxNssTx = (ctrl1 >> 26) & 0x01;
293 m_dcmMaxConstellationRx = (ctrl1 >> 27) & 0x03;
294 m_dcmMaxNssRx = (ctrl1 >> 29) & 0x01;
295 m_rxPartialBwSuInHeMu = (ctrl1 >> 30) & 0x01;
296 m_suBeamformer = (ctrl1 >> 31) & 0x01;
297 m_suBeamformee = (ctrl1 >> 32) & 0x01;
298 m_muBeamformer = (ctrl1 >> 33) & 0x01;
299 m_beamformeeStsForSmallerOrEqualThan80Mhz = (ctrl1 >> 34) & 0x07;
300 m_beamformeeStsForLargerThan80Mhz = (ctrl1 >> 37) & 0x07;
303 m_ngEqual16ForSuFeedbackSupport = (ctrl1 >> 46) & 0x01;
304 m_ngEqual16ForMuFeedbackSupport = (ctrl1 >> 47) & 0x01;
305 m_codebookSize42SuFeedback = (ctrl1 >> 48) & 0x01;
306 m_codebookSize75MuFeedback = (ctrl1 >> 49) & 0x01;
307 m_triggeredSuBfFeedback = (ctrl1 >> 50) & 0x01;
308 m_triggeredMuBfFeedback = (ctrl1 >> 51) & 0x01;
309 m_triggeredCqiFeedback = (ctrl1 >> 52) & 0x01;
310 m_erPartialBandwidth = (ctrl1 >> 53) & 0x01;
311 m_dlMuMimoOnPartialBandwidth = (ctrl1 >> 54) & 0x01;
312 m_ppeThresholdPresent = (ctrl1 >> 55) & 0x01;
313 m_psrBasedSrSupport = (ctrl1 >> 56) & 0x01;
314 m_powerBoostFactorAlphaSupport = (ctrl1 >> 57) & 0x01;
315 m_hePpdu4xHeLtf800nsGi = ctrl2 & 0x01;
316 m_maxNc = (ctrl1 >> 59) & 0x07;
317 m_stbcTxGt80MHz = (ctrl1 >> 62) & 0x01;
318 m_stbcRxGt80MHz = (ctrl1 >> 63) & 0x01;
319 m_heErSuPpdu4xHeLtf08sGi = ctrl2 & 0x01;
320 m_hePpdu20MHzIn40MHz24GHz = (ctrl2 >> 1) & 0x01;
321 m_hePpdu20MHzIn160MHz = (ctrl2 >> 2) & 0x01;
322 m_hePpdu80MHzIn160MHz = (ctrl2 >> 3) & 0x01;
323 m_heErSuPpdu1xHeLtf08Gi = (ctrl2 >> 4) & 0x01;
324 m_midamble2xAnd1xHeLtf = (ctrl2 >> 5) & 0x01;
325 m_dcmMaxRu = (ctrl2 >> 6) & 0x03;
326 m_longerThan16HeSigbOfdm = (ctrl2 >> 8) & 0x01;
327 m_nonTriggeredCqiFeedback = (ctrl2 >> 9) & 0x01;
328 m_tx1024QamLt242Ru = (ctrl2 >> 10) & 0x01;
329 m_rx1024QamLt242Ru = (ctrl2 >> 11) & 0x01;
330 m_rxFullBwSuInHeMuCompressedSigB = (ctrl2 >> 12) & 0x01;
331 m_rxFullBwSuInHeMuNonCompressedSigB = (ctrl2 >> 13) & 0x01;
332 m_nominalPacketPadding = (ctrl2 >> 14) & 0x03;
333 m_maxHeLtfRxInHeMuMoreThanOneRu = ctrl3 & 0x01;
334 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
335 // Bits 81-87 are reserved
336}
337
338uint64_t
340{
341 uint64_t val = 0;
342 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
343 // Bit 0 is reserved
344 val |= (m_channelWidthSet & 0x7f) << 1;
345 val |= (m_puncturedPreambleRx & 0x0f) << 8;
346 val |= (m_deviceClass & 0x01) << 12;
347 val |= (m_ldpcCodingInPayload & 0x01) << 13;
348 val |= (m_heSuPpdu1xHeLtf800nsGi & 0x01) << 14;
349 val |= (m_midambleRxMaxNsts & 0x03) << 15;
350 val |= (m_ndp4xHeLtfAnd32msGi & 0x01) << 17;
351 val |= (m_stbcTxLeq80MHz & 0x01) << 18;
352 val |= (m_stbcRxLeq80MHz & 0x01) << 19;
353 val |= (m_dopplerTx & 0x01) << 20;
354 val |= (m_dopplerRx & 0x01) << 21;
355 val |= (m_fullBwUlMuMimo & 0x01) << 22;
356 val |= (m_partialBwUlMuMimo & 0x01) << 23;
357 val |= (m_dcmMaxConstellationTx & 0x03) << 24;
358 val |= (m_dcmMaxNssTx & 0x01) << 26;
359 val |= (m_dcmMaxConstellationRx & 0x03) << 27;
360 val |= (m_dcmMaxNssRx & 0x01) << 29;
361 val |= (m_rxPartialBwSuInHeMu & 0x01) << 30;
362 val |= (m_suBeamformer & 0x01) << 31;
363 val |= (static_cast<uint64_t>(m_suBeamformee) & 0x01) << 32;
364 val |= (static_cast<uint64_t>(m_muBeamformer) & 0x01) << 33;
365 val |= (static_cast<uint64_t>(m_beamformeeStsForSmallerOrEqualThan80Mhz) & 0x07) << 34;
366 val |= (static_cast<uint64_t>(m_beamformeeStsForLargerThan80Mhz) & 0x07) << 37;
367 val |= (static_cast<uint64_t>(m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz) & 0x07)
368 << 40;
369 val |= (static_cast<uint64_t>(m_numberOfSoundingDimensionsForLargerThan80Mhz) & 0x07) << 43;
370 val |= (static_cast<uint64_t>(m_ngEqual16ForSuFeedbackSupport) & 0x01) << 46;
371 val |= (static_cast<uint64_t>(m_ngEqual16ForMuFeedbackSupport) & 0x01) << 47;
372 val |= (static_cast<uint64_t>(m_codebookSize42SuFeedback) & 0x01) << 48;
373 val |= (static_cast<uint64_t>(m_codebookSize75MuFeedback) & 0x01) << 49;
374 val |= (static_cast<uint64_t>(m_triggeredSuBfFeedback) & 0x01) << 50;
375 val |= (static_cast<uint64_t>(m_triggeredMuBfFeedback) & 0x01) << 51;
376 val |= (static_cast<uint64_t>(m_triggeredCqiFeedback) & 0x01) << 52;
377 val |= (static_cast<uint64_t>(m_erPartialBandwidth) & 0x01) << 53;
378 val |= (static_cast<uint64_t>(m_dlMuMimoOnPartialBandwidth) & 0x01) << 54;
379 val |= (static_cast<uint64_t>(m_ppeThresholdPresent) & 0x01) << 55;
380 val |= (static_cast<uint64_t>(m_psrBasedSrSupport) & 0x01) << 56;
381 val |= (static_cast<uint64_t>(m_powerBoostFactorAlphaSupport) & 0x01) << 57;
382 val |= (static_cast<uint64_t>(m_hePpdu4xHeLtf800nsGi) & 0x01) << 58;
383 val |= (static_cast<uint64_t>(m_maxNc) & 0x07) << 59;
384 val |= (static_cast<uint64_t>(m_stbcTxGt80MHz) & 0x01) << 62;
385 val |= (static_cast<uint64_t>(m_stbcRxGt80MHz) & 0x01) << 63;
386 return val;
387}
388
389uint16_t
391{
392 uint16_t val = 0;
393 val |= m_heErSuPpdu4xHeLtf08sGi & 0x01;
394 val |= (m_hePpdu20MHzIn40MHz24GHz & 0x01) << 1;
395 val |= (m_hePpdu20MHzIn160MHz & 0x01) << 2;
396 val |= (m_hePpdu80MHzIn160MHz & 0x01) << 3;
397 val |= (m_heErSuPpdu1xHeLtf08Gi & 0x01) << 4;
398 val |= (m_midamble2xAnd1xHeLtf & 0x01) << 5;
399 val |= (m_dcmMaxRu & 0x03) << 6;
400 val |= (m_longerThan16HeSigbOfdm & 0x01) << 8;
401 val |= (m_nonTriggeredCqiFeedback & 0x01) << 9;
402 val |= (m_tx1024QamLt242Ru & 0x01) << 10;
403 val |= (m_rx1024QamLt242Ru & 0x01) << 11;
404 val |= (m_rxFullBwSuInHeMuCompressedSigB & 0x01) << 12;
405 val |= (m_rxFullBwSuInHeMuNonCompressedSigB & 0x01) << 13;
406 val |= (m_nominalPacketPadding & 0x03) << 14;
407 return val;
408}
409
410uint8_t
412{
413 uint8_t val = 0;
415 // IEEE 802.11ax-2021 9.4.2.248.2 HE MAC Capabilities
416 // Bits 81-87 are reserved
417 return val;
418}
419
420void
422{
423 m_highestNssSupportedM1 = ctrl & 0x07;
424 m_highestMcsSupported = (ctrl >> 3) & 0x07;
426 uint8_t i;
427 for (i = 0; i < 5; i++)
428 {
429 m_txBwMap[i] = (ctrl >> (6 + i)) & 0x01;
430 }
431 for (i = 0; i < 5; i++)
432 {
433 m_rxBwMap[i] = (ctrl >> (11 + i)) & 0x01;
434 }
435 // TODO: MCS NSS Descriptors
436}
437
438uint16_t
440{
441 uint16_t val = 0;
442 val |= m_highestNssSupportedM1 & 0x07;
443 val |= (m_highestMcsSupported & 0x07) << 3;
444 uint8_t i;
445 for (i = 0; i < 5; i++)
446 {
447 val |= (m_txBwMap[i] & 0x01) << (6 + 1);
448 }
449 for (i = 0; i < 5; i++)
450 {
451 val |= (m_rxBwMap[i] & 0x01) << (11 + 1);
452 }
453 // TODO: MCS NSS Descriptors
454 return val;
455}
456
457// TODO: PPE threshold
458
459bool
461{
462 NS_ASSERT(mcs >= 0 && mcs <= 11);
463 if (mcs <= 7)
464 {
465 return true;
466 }
467 if (mcs == 8 && m_highestMcsSupported >= 1)
468 {
469 return true;
470 }
471 if (mcs == 9 && m_highestMcsSupported >= 2)
472 {
473 return true;
474 }
475 if (mcs == 10 && m_highestMcsSupported >= 3)
476 {
477 return true;
478 }
479 if (mcs == 11 && m_highestMcsSupported == 4)
480 {
481 return true;
482 }
483 return false;
484}
485
486bool
488{
489 NS_ASSERT(mcs >= 0 && mcs <= 11);
490 if (mcs <= 7)
491 {
492 return true;
493 }
494 if (mcs == 8 && m_highestMcsSupported >= 1)
495 {
496 return true;
497 }
498 if (mcs == 9 && m_highestMcsSupported >= 2)
499 {
500 return true;
501 }
502 if (mcs == 10 && m_highestMcsSupported >= 3)
503 {
504 return true;
505 }
506 if (mcs == 11 && m_highestMcsSupported == 4)
507 {
508 return true;
509 }
510 return false;
511}
512
513void
515{
516 NS_ASSERT(channelWidthSet <= 0x2f);
517 m_channelWidthSet = channelWidthSet;
518}
519
520void
521HeCapabilities::SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
522{
523 m_ldpcCodingInPayload = ldpcCodingInPayload;
524}
525
526void
528{
529 m_heSuPpdu1xHeLtf800nsGi = (heSuPpdu1xHeLtf800nsGi ? 1 : 0);
530}
531
532void
534{
535 m_hePpdu4xHeLtf800nsGi = (hePpdu4xHeLtf800nsGi ? 1 : 0);
536}
537
538void
540{
541 for (uint8_t i = 0; i <= 3; i++)
542 {
543 if ((1UL << (20 + i)) - 1 == maxAmpduLength)
544 {
546 return;
547 }
548 }
549 NS_ABORT_MSG("Invalid A-MPDU Max Length value");
550}
551
552void
554{
555 NS_ASSERT(mcs >= 7 && mcs <= 11);
556 m_highestMcsSupported = mcs - 7;
557}
558
559void
561{
562 NS_ASSERT(nss >= 1 && nss <= 8);
563 m_highestNssSupportedM1 = nss - 1;
564}
565
566uint8_t
571
572uint8_t
577
578bool
583
584bool
589
590uint8_t
595
596uint8_t
601
604{
605 return std::min<uint32_t>((1UL << (20 + m_maxAmpduLengthExponent)) - 1, 6500631);
606}
607
608} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
uint16_t ReadLsbtohU16()
Definition buffer.cc:1053
uint64_t ReadLsbtohU64()
Definition buffer.cc:1083
uint32_t ReadU32()
Definition buffer.cc:955
uint32_t ReadLsbtohU32()
Definition buffer.cc:1065
bool IsSupportedTxMcs(uint8_t mcs) const
Is RX MCS supported.
uint8_t m_maximumNumberOfFragmentedMsdus
maximum number of fragmentation MSDUs
uint8_t m_rxControlFrameToMultiBss
receive control frame to multi-BSS
uint8_t m_codebookSize75MuFeedback
Codebook Size = {7, 5} MU feedback.
uint8_t m_beamformeeStsForLargerThan80Mhz
beamformee STS for > 80MHz
bool IsSupportedRxMcs(uint8_t mcs) const
Is RX MCS supported.
uint8_t m_dcmMaxRu
DCM Max RU.
uint8_t m_erPartialBandwidth
Extended range partial bandwidth.
uint8_t m_rxFullBwSuInHeMuCompressedSigB
RX full BW SU using HE MU PPDU with compressed SIGB.
uint8_t m_stbcRxLeq80MHz
STBC RX <= 80Mhz.
uint8_t m_amsduFragmentationSupport
A-MSDU fragmentation support.
uint8_t m_bqrSupport
BQR support.
uint8_t m_midambleRxMaxNsts
Midamble TX/RX max NSTS.
uint8_t m_heSubchannelSelectiveTxSupport
HE subchannel selective transmission support.
void SetHePhyCapabilitiesInfo(uint64_t ctrl1, uint16_t ctrl2, uint8_t ctrl3)
Set the HE PHY Capabilities Info field in the HE Capabilities information element.
uint8_t m_partialBwUlMuMimo
Partial Bandwidth UL MU-MIMO.
uint8_t m_qtpSupport
QTP support.
uint8_t m_triggerFrameMacPaddingDuration
trigger frame MAC padding duration
void SetHeSuPpdu1xHeLtf800nsGi(bool heSuPpdu1xHeLtf800nsGi)
Set 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
uint8_t m_heVhtTriggerFrameRxSupport
HE and VHT trigger frame RX support.
uint8_t m_dopplerRx
Doppler Rx.
uint8_t m_codebookSize42SuFeedback
Codebook Size = {4, 2} SU feedback.
uint8_t m_puncturedPreambleRx
Punctured preamble Rx.
uint8_t m_allAckSupport
all Ack support
void SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
Set indication whether the transmission and reception of LDPC encoded packets is supported.
uint8_t m_twtRequesterSupport
TWT requester support.
uint8_t m_ackEnabledAggregationSupport
ack enabled aggregation support
void SetSupportedMcsAndNss(uint16_t ctrl)
Set the MCS and NSS field in the HE Capabilities information element.
uint16_t GetHePhyCapabilitiesInfo2() const
Return the octets 9-10 of the HE PHY Capabilities Info field in the HE Capabilities information eleme...
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)
uint8_t m_bsrSupport
BSR support.
uint8_t m_hePpdu20MHzIn160MHz
20MHz in 160/80+80MHz HE PPDU
uint8_t m_multiTidAggregationRxSupport
multi-TID aggregation Rx support
uint8_t m_heSuPpdu1xHeLtf800nsGi
HE SU PPDU with 1x HE LTF and 0.8us GI.
void SetHePpdu4xHeLtf800nsGi(bool heSuPpdu4xHeLtf800nsGi)
Set 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
uint8_t m_broadcastTwtSupport
broadcast TXT support
uint8_t m_hePpdu20MHzIn40MHz24GHz
20MHz in 40MHz HE PPDU in 2.4GHz band
uint8_t m_nominalPacketPadding
Nominal packet padding.
void SetHeMacCapabilitiesInfo(uint32_t ctrl1, uint16_t ctrl2)
Set the HE MAC Capabilities Info field in the HE Capabilities information element.
uint8_t m_ldpcCodingInPayload
LDPC coding in payload.
uint8_t m_psrBasedSrSupport
PSR based SR support.
std::vector< uint8_t > m_rxBwMap
receive BW map
uint8_t m_muCascadeSupport
MU cascade support.
uint8_t m_ofdmaRaSupport
OFDMA RA support.
uint8_t m_psrResponder
PSR responder.
uint8_t m_nonTriggeredCqiFeedback
Non-Triggered CQI feedback.
uint8_t m_suBeamformee
SU beamformee.
uint8_t m_maxNc
Max Nc for HE compressed beamforming/CQI report.
uint8_t GetHePhyCapabilitiesInfo3() const
Return the last octet of the HE PHY Capabilities Info field in the HE Capabilities information elemen...
uint8_t GetHighestMcsSupported() const
Get highest MCS supported.
uint8_t m_heErSuPpdu1xHeLtf08Gi
HE ER SU PPDU with 1x HE LTF and 0.8us GI.
uint32_t GetHeMacCapabilitiesInfo1() const
Return the 4 first octets of the HE MAC Capabilities Info field in the HE Capabilities information el...
uint8_t m_stbcRxGt80MHz
STBC RX > 80MHz.
uint8_t m_rx1024QamLt242Ru
TX 1024 QAM < 242 =-tone RU support.
uint8_t m_amsduNotUnderBaInAmpduSupport
AMSDU not under BA in Ack enabled A-MPDU support.
uint8_t m_32bitBaBitmapSupport
32-bit BA bitmap support
void SetHighestNssSupported(uint8_t nss)
Set highest NSS supported.
uint8_t m_rxFullBwSuInHeMuNonCompressedSigB
RX full BW SU using HE MU PPDU with non-compressed SIGB.
uint8_t m_opsSupport
OPS support.
uint8_t m_hePpdu4xHeLtf800nsGi
4 times HE-LFT and 800ns GI support for HE-PPDUs
uint8_t m_hePpdu80MHzIn160MHz
80MHz in 160/80+80MHz HE PPDU
uint8_t m_fragmentationSupport
fragmentation support
uint8_t m_highestMcsSupported
highest MCS support
uint8_t m_ngEqual16ForSuFeedbackSupport
equal 16 for SU feedback
uint8_t m_suBeamformer
SU beamformer.
uint8_t m_minimumFragmentSize
minimum fragment size
uint8_t m_twtResponderSupport
TWT responder support.
uint8_t m_flexibleTwtScheduleSupport
flexible TWT schedule support
uint8_t m_bsrpBqrpAmpduAggregation
BSRP BQRP A-MPDU aggregation.
uint8_t m_ngEqual16ForMuFeedbackSupport
equal 16 for MU feedback
uint8_t GetHighestNssSupported() const
Get highest NSS supported.
uint8_t m_puncturedSoundingSupport
punctured sounding support
bool GetHeSuPpdu1xHeLtf800nsGi() const
Get 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
uint8_t m_rxPartialBwSuInHeMu
Rx Partial BW SU in 20 MHz HE MU PPDU.
uint8_t m_omControlSupport
operation mode control support
uint8_t m_ndp4xHeLtfAnd32msGi
NDP with 4x HE-LTF and 3.2us GI.
uint8_t m_stbcTxGt80MHz
STBC Tx > 80MHz.
uint16_t GetHeMacCapabilitiesInfo2() const
Return the last 2 octets of the HE MAC Capabilities Info field in the HE Capabilities information ele...
uint8_t m_midamble2xAnd1xHeLtf
Midamble TX/RX 2x and 1x HE-LTF.
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
uint8_t m_beamformeeStsForSmallerOrEqualThan80Mhz
beam formee STS for < 80 MHz
uint8_t m_plusHtcHeSupport
HTC HE support.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
uint8_t m_channelWidthSet
channel width set
uint8_t m_fullBwUlMuMimo
Full Bandwidth UL MU-MIMO.
uint8_t m_maxAmpduLengthExponent
maximum A-MPDU length exponent extension
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t m_deviceClass
device class
uint8_t m_dlMuMimoOnPartialBandwidth
DL MU-MIMO on partial bandwidth.
uint64_t GetHePhyCapabilitiesInfo1() const
Return the 8 first octets of the HE PHY Capabilities Info field in the HE Capabilities information el...
uint8_t m_powerBoostFactorAlphaSupport
power boost factor alpha support
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t m_ppeThresholdPresent
PPE threshold present.
uint8_t m_muBeamformer
MU beamformer.
uint8_t GetLdpcCodingInPayload() const
Indicates support for the transmission and reception of LDPC encoded packets.
uint8_t m_ndpFeedbackReportSupport
NDP feedback report support.
uint8_t m_trsSupport
TRS support.
uint8_t m_longerThan16HeSigbOfdm
Longer than 16 HE SIG-=B OFDM symbols support.
uint16_t GetSupportedMcsAndNss() const
Return the MCS and NSS field in the HE Capabilities information element.
uint8_t m_dcmMaxConstellationRx
DCM Max Constellation Rx.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint8_t m_triggeredMuBfFeedback
Triggered MU beamforming feedback.
uint8_t m_dcmMaxNssTx
DCM Max NSS Tx.
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
uint8_t m_omControlUlMuDataDisableRxSupport
OM control UL MU data disable RX support.
uint32_t GetMaxAmpduLength() const
Return the maximum A-MPDU length.
uint8_t m_heErSuPpdu4xHeLtf08sGi
HE ER SU PPDU with 4x HE LTF and 0.8us GI.
uint8_t m_triggeredSuBfFeedback
Triggered SU beamforming feedback.
uint8_t m_ul2x996ToneRuSupport
UL 2x996 tone RU support.
uint8_t m_multiTidAggregationTxSupport
Multi-TID aggregation TX support.
std::vector< uint8_t > m_txBwMap
transmit BW map
uint8_t m_tx1024QamLt242Ru
TX 1024 QAM < 242 =-tone RU support.
uint8_t m_dopplerTx
Doppler Tx.
uint8_t m_stbcTxLeq80MHz
STBC TX <= 80MHz.
uint8_t m_maxHeLtfRxInHeMuMoreThanOneRu
max HE-LTF symbols STA can Rx in HE MU PPDU with more than one RU
uint8_t m_numberOfSoundingDimensionsForLargerThan80Mhz
void SetHighestMcsSupported(uint8_t mcs)
Set highest MCS supported.
uint8_t m_heLinkAdaptation
HE link adaptation.
uint8_t m_highestNssSupportedM1
highest NSS support M1
uint8_t m_triggeredCqiFeedback
Triggered CQI feedback.
uint8_t m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz
bool GetHePpdu4xHeLtf800nsGi() const
Get 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
uint8_t m_dcmMaxNssRx
DCM Max NSS Rx.
uint8_t m_dcmMaxConstellationTx
DCM Max Constellation Tx.
uint8_t m_heDynamicSmPowerSave
HE dynamic SM power save.
uint8_t GetChannelWidthSet() const
Get channel width set.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition abort.h:38
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.
#define IE_EXT_HE_CAPABILITIES
#define IE_EXTENSION