LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2016 | 3 * Copyright (c) 2016 |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Sébastien Deronne <sebastien.deronne@gmail.com> | 18 * Author: Sébastien Deronne <sebastien.deronne@gmail.com> |
19 */ | 19 */ |
20 | 20 |
21 #include "he-capabilities.h" | 21 #include "he-capabilities.h" |
22 #include "ns3/unused.h" | 22 #include "ns3/unused.h" |
23 | 23 |
24 namespace ns3 { | 24 namespace ns3 { |
25 | 25 |
26 HeCapabilities::HeCapabilities () | 26 HeCapabilities::HeCapabilities () |
27 : m_plusHtcHeSupport (0), | 27 : m_plusHtcHeSupport (0), |
28 m_twtRequesterSupport (0), | 28 m_twtRequesterSupport (0), |
29 m_twtResponderSupport (0), | 29 m_twtResponderSupport (0), |
30 m_fragmentationSupport (0), | 30 m_fragmentationSupport (0), |
31 m_maximumNumberOfFragmentedMsdus (0), | 31 m_maximumNumberOfFragmentedMsdus (0), |
32 m_minimumFragmentSize (0), | 32 m_minimumFragmentSize (0), |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 val |= (m_ldpcCodingInPayload & 0x01) << 13; | 282 val |= (m_ldpcCodingInPayload & 0x01) << 13; |
283 val |= (m_heLtfAndGiForHePpdus & 0x03) << 14; | 283 val |= (m_heLtfAndGiForHePpdus & 0x03) << 14; |
284 val |= (m_heLtfAndGiForNdp & 0x03) << 16; | 284 val |= (m_heLtfAndGiForNdp & 0x03) << 16; |
285 val |= (m_stbcTxAndRx & 0x03) << 18; | 285 val |= (m_stbcTxAndRx & 0x03) << 18; |
286 val |= (m_doppler & 0x03) << 20; | 286 val |= (m_doppler & 0x03) << 20; |
287 val |= (m_ulMu & 0x03) << 22; | 287 val |= (m_ulMu & 0x03) << 22; |
288 val |= (m_dcmEncodingTx & 0x0f) << 24; | 288 val |= (m_dcmEncodingTx & 0x0f) << 24; |
289 val |= (m_dcmEncodingRx & 0x0f) << 27; | 289 val |= (m_dcmEncodingRx & 0x0f) << 27; |
290 val |= (m_ulHeMuPpduPayloadSupport & 0x01) << 30; | 290 val |= (m_ulHeMuPpduPayloadSupport & 0x01) << 30; |
291 val |= (m_suBeamformer & 0x01) << 31; | 291 val |= (m_suBeamformer & 0x01) << 31; |
292 val |= ((uint64_t)m_suBeamformee & 0x01) << 32; | 292 val |= (static_cast<uint64_t> (m_suBeamformee) & 0x01) << 32; |
293 val |= ((uint64_t)m_muBeamformer & 0x01) << 33; | 293 val |= (static_cast<uint64_t> (m_muBeamformer) & 0x01) << 33; |
294 val |= ((uint64_t)m_beamformeeStsForSmallerOrEqualThan80Mhz & 0x07) << 34; | 294 val |= (static_cast<uint64_t> (m_beamformeeStsForSmallerOrEqualThan80Mhz) & 0x
07) << 34; |
295 val |= ((uint64_t)m_nstsTotalForSmallerOrEqualThan80Mhz & 0x07) << 37; | 295 val |= (static_cast<uint64_t> (m_nstsTotalForSmallerOrEqualThan80Mhz) & 0x07)
<< 37; |
296 val |= ((uint64_t)m_beamformeeStsForLargerThan80Mhz & 0x07) << 40; | 296 val |= (static_cast<uint64_t> (m_beamformeeStsForLargerThan80Mhz) & 0x07) << 4
0; |
297 val |= ((uint64_t)m_nstsTotalForLargerThan80Mhz & 0x07) << 43; | 297 val |= (static_cast<uint64_t> (m_nstsTotalForLargerThan80Mhz) & 0x07) << 43; |
298 val |= ((uint64_t)m_numberOfSoundingDimensionsForSmallerOrEqualThan80Mhz & 0x0
7) << 46; | 298 val |= (static_cast<uint64_t> (m_numberOfSoundingDimensionsForSmallerOrEqualTh
an80Mhz) & 0x07) << 46; |
299 val |= ((uint64_t)m_numberOfSoundingDimensionsForLargerThan80Mhz & 0x07) << 49
; | 299 val |= (static_cast<uint64_t> (m_numberOfSoundingDimensionsForLargerThan80Mhz)
& 0x07) << 49; |
300 val |= ((uint64_t)m_ngEqual16ForSuFeedbackSupport & 0x01) << 52; | 300 val |= (static_cast<uint64_t> (m_ngEqual16ForSuFeedbackSupport) & 0x01) << 52; |
301 val |= ((uint64_t)m_ngEqual16ForMuFeedbackSupport & 0x01) << 53; | 301 val |= (static_cast<uint64_t> (m_ngEqual16ForMuFeedbackSupport) & 0x01) << 53; |
302 val |= ((uint64_t)m_codebookSize42ForSuSupport & 0x01) << 54; | 302 val |= (static_cast<uint64_t> (m_codebookSize42ForSuSupport) & 0x01) << 54; |
303 val |= ((uint64_t)m_codebookSize75ForSuSupport & 0x01) << 55; | 303 val |= (static_cast<uint64_t> (m_codebookSize75ForSuSupport) & 0x01) << 55; |
304 val |= ((uint64_t)m_beamformingFeedbackWithTriggerFrame & 0x07) << 56; | 304 val |= (static_cast<uint64_t> (m_beamformingFeedbackWithTriggerFrame) & 0x07)
<< 56; |
305 val |= ((uint64_t)m_heErSuPpduPayload & 0x01) << 59; | 305 val |= (static_cast<uint64_t> (m_heErSuPpduPayload) & 0x01) << 59; |
306 val |= ((uint64_t)m_dlMuMimoOnPartialBandwidth & 0x01) << 60; | 306 val |= (static_cast<uint64_t> (m_dlMuMimoOnPartialBandwidth) & 0x01) << 60; |
307 val |= ((uint64_t)m_ppeThresholdPresent & 0x01) << 61; | 307 val |= (static_cast<uint64_t> (m_ppeThresholdPresent) & 0x01) << 61; |
308 val |= ((uint64_t)m_srpBasedSrSupport & 0x01) << 62; | 308 val |= (static_cast<uint64_t> (m_srpBasedSrSupport) & 0x01) << 62; |
309 val |= ((uint64_t)m_powerBoostFactorAlphaSupport & 0x01) << 63; | 309 val |= (static_cast<uint64_t> (m_powerBoostFactorAlphaSupport) & 0x01) << 63; |
310 return val; | 310 return val; |
311 } | 311 } |
312 | 312 |
313 uint8_t | 313 uint8_t |
314 HeCapabilities::GetHePhyCapabilitiesInfo2 () const | 314 HeCapabilities::GetHePhyCapabilitiesInfo2 () const |
315 { | 315 { |
316 uint8_t val = 0; | 316 uint8_t val = 0; |
317 val |= m_4TimesHeLtfAnd800NsGiSupportForHePpdus & 0x01; | 317 val |= m_4TimesHeLtfAnd800NsGiSupportForHePpdus & 0x01; |
318 return val; | 318 return val; |
319 } | 319 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return m_channelWidthSet; | 452 return m_channelWidthSet; |
453 } | 453 } |
454 | 454 |
455 uint8_t | 455 uint8_t |
456 HeCapabilities::GetHeLtfAndGiForHePpdus (void) const | 456 HeCapabilities::GetHeLtfAndGiForHePpdus (void) const |
457 { | 457 { |
458 return m_heLtfAndGiForHePpdus; | 458 return m_heLtfAndGiForHePpdus; |
459 } | 459 } |
460 | 460 |
461 uint8_t | 461 uint8_t |
462 HeCapabilities::GetHighestMcsSupported (uint8_t mcs) const | 462 HeCapabilities::GetHighestMcsSupported (void) const |
463 { | 463 { |
464 NS_UNUSED(mcs); | |
465 return m_highestMcsSupported + 7; | 464 return m_highestMcsSupported + 7; |
466 } | 465 } |
467 | 466 |
468 uint8_t | 467 uint8_t |
469 HeCapabilities::GetHighestNssSupported (void) const | 468 HeCapabilities::GetHighestNssSupported (void) const |
470 { | 469 { |
471 return m_highestNssSupportedM1 + 1; | 470 return m_highestNssSupportedM1 + 1; |
472 } | 471 } |
473 | 472 |
474 ATTRIBUTE_HELPER_CPP (HeCapabilities); | 473 ATTRIBUTE_HELPER_CPP (HeCapabilities); |
475 | 474 |
476 /** | 475 /** |
477 * output stream output operator | 476 * output stream output operator |
478 * \param os the output stream | 477 * \param os the output stream |
479 * \param HeCapabilities the HE capabilities | 478 * \param HeCapabilities the HE capabilities |
480 * \returns the output stream | 479 * \returns the output stream |
481 */ | 480 */ |
482 std::ostream & | 481 std::ostream & |
483 operator << (std::ostream &os, const HeCapabilities &HeCapabilities) | 482 operator << (std::ostream &os, const HeCapabilities &HeCapabilities) |
484 { | 483 { |
485 os << HeCapabilities.GetHeMacCapabilitiesInfo1 () << "|" | 484 os << HeCapabilities.GetHeMacCapabilitiesInfo1 () << "|" |
486 << (uint16_t) HeCapabilities.GetHeMacCapabilitiesInfo2 () << "|" | 485 << static_cast<uint16_t> (HeCapabilities.GetHeMacCapabilitiesInfo2 ()) << "
|" |
487 << HeCapabilities.GetHePhyCapabilitiesInfo1 () << "|" | 486 << HeCapabilities.GetHePhyCapabilitiesInfo1 () << "|" |
488 << (uint16_t) HeCapabilities.GetHePhyCapabilitiesInfo2 () << "|" | 487 << static_cast<uint16_t> (HeCapabilities.GetHePhyCapabilitiesInfo2 ()) << "
|" |
489 << HeCapabilities.GetSupportedMcsAndNss (); | 488 << HeCapabilities.GetSupportedMcsAndNss (); |
490 return os; | 489 return os; |
491 } | 490 } |
492 | 491 |
493 /** | 492 /** |
494 * input stream input operator | 493 * input stream input operator |
495 * \param is the output stream | 494 * \param is the output stream |
496 * \param HeCapabilities the HE capabilities | 495 * \param HeCapabilities the HE capabilities |
497 * \returns the input stream | 496 * \returns the input stream |
498 */ | 497 */ |
499 std::istream &operator >> (std::istream &is, HeCapabilities &HeCapabilities) | 498 std::istream &operator >> (std::istream &is, HeCapabilities &HeCapabilities) |
500 { | 499 { |
501 uint32_t c1; | 500 uint32_t c1; |
502 uint8_t c2; | 501 uint8_t c2; |
503 uint64_t c3; | 502 uint64_t c3; |
504 uint8_t c4; | 503 uint8_t c4; |
505 uint16_t c5; | 504 uint16_t c5; |
506 is >> c1 >> c2 >> c3 >> c4 >> c5; | 505 is >> c1 >> c2 >> c3 >> c4 >> c5; |
507 HeCapabilities.SetHeMacCapabilitiesInfo (c1, c2); | 506 HeCapabilities.SetHeMacCapabilitiesInfo (c1, c2); |
508 HeCapabilities.SetHePhyCapabilitiesInfo (c3, c4); | 507 HeCapabilities.SetHePhyCapabilitiesInfo (c3, c4); |
509 HeCapabilities.SetSupportedMcsAndNss (c5); | 508 HeCapabilities.SetSupportedMcsAndNss (c5); |
510 return is; | 509 return is; |
511 } | 510 } |
512 | 511 |
513 } //namespace ns3 | 512 } //namespace ns3 |
LEFT | RIGHT |