OLD | NEW |
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) 2006, 2009 INRIA | 3 * Copyright (c) 2006, 2009 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 { | 468 { |
469 edcaParameters.SetQosSupported (1); | 469 edcaParameters.SetQosSupported (1); |
470 Ptr<EdcaTxopN> edca; | 470 Ptr<EdcaTxopN> edca; |
471 Time txopLimit; | 471 Time txopLimit; |
472 | 472 |
473 edca = m_edca.find (AC_BE)->second; | 473 edca = m_edca.find (AC_BE)->second; |
474 txopLimit = edca->GetTxopLimit (); | 474 txopLimit = edca->GetTxopLimit (); |
475 edcaParameters.SetBeAci (0); | 475 edcaParameters.SetBeAci (0); |
476 edcaParameters.SetBeCWmin (edca->GetMinCw ()); | 476 edcaParameters.SetBeCWmin (edca->GetMinCw ()); |
477 edcaParameters.SetBeCWmax (edca->GetMaxCw ()); | 477 edcaParameters.SetBeCWmax (edca->GetMaxCw ()); |
478 edcaParameters.SetBeAifsn (edca->GetAifsn ()); | 478 edcaParameters.SetBeAifsn (static_cast<uint8_t> (edca->GetAifsn ())); |
479 edcaParameters.SetBeTXOPLimit (txopLimit.GetMicroSeconds () / 32); | 479 edcaParameters.SetBeTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSe
conds () / 32)); |
480 | 480 |
481 edca = m_edca.find (AC_BK)->second; | 481 edca = m_edca.find (AC_BK)->second; |
482 txopLimit = edca->GetTxopLimit (); | 482 txopLimit = edca->GetTxopLimit (); |
483 edcaParameters.SetBkAci (1); | 483 edcaParameters.SetBkAci (1); |
484 edcaParameters.SetBkCWmin (edca->GetMinCw ()); | 484 edcaParameters.SetBkCWmin (edca->GetMinCw ()); |
485 edcaParameters.SetBkCWmax (edca->GetMaxCw ()); | 485 edcaParameters.SetBkCWmax (edca->GetMaxCw ()); |
486 edcaParameters.SetBkAifsn (edca->GetAifsn ()); | 486 edcaParameters.SetBkAifsn (static_cast<uint8_t> (edca->GetAifsn ())); |
487 edcaParameters.SetBkTXOPLimit (txopLimit.GetMicroSeconds () / 32); | 487 edcaParameters.SetBkTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSe
conds () / 32)); |
488 | 488 |
489 edca = m_edca.find (AC_VI)->second; | 489 edca = m_edca.find (AC_VI)->second; |
490 txopLimit = edca->GetTxopLimit (); | 490 txopLimit = edca->GetTxopLimit (); |
491 edcaParameters.SetViAci (2); | 491 edcaParameters.SetViAci (2); |
492 edcaParameters.SetViCWmin (edca->GetMinCw ()); | 492 edcaParameters.SetViCWmin (edca->GetMinCw ()); |
493 edcaParameters.SetViCWmax (edca->GetMaxCw ()); | 493 edcaParameters.SetViCWmax (edca->GetMaxCw ()); |
494 edcaParameters.SetViAifsn (edca->GetAifsn ()); | 494 edcaParameters.SetViAifsn (static_cast<uint8_t> (edca->GetAifsn ())); |
495 edcaParameters.SetViTXOPLimit (txopLimit.GetMicroSeconds () / 32); | 495 edcaParameters.SetViTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSe
conds () / 32)); |
496 | 496 |
497 edca = m_edca.find (AC_VO)->second; | 497 edca = m_edca.find (AC_VO)->second; |
498 txopLimit = edca->GetTxopLimit (); | 498 txopLimit = edca->GetTxopLimit (); |
499 edcaParameters.SetVoAci (3); | 499 edcaParameters.SetVoAci (3); |
500 edcaParameters.SetVoCWmin (edca->GetMinCw ()); | 500 edcaParameters.SetVoCWmin (edca->GetMinCw ()); |
501 edcaParameters.SetVoCWmax (edca->GetMaxCw ()); | 501 edcaParameters.SetVoCWmax (edca->GetMaxCw ()); |
502 edcaParameters.SetVoAifsn (edca->GetAifsn ()); | 502 edcaParameters.SetVoAifsn (static_cast<uint8_t> (edca->GetAifsn ())); |
503 edcaParameters.SetVoTXOPLimit (txopLimit.GetMicroSeconds () / 32); | 503 edcaParameters.SetVoTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSe
conds () / 32)); |
504 | 504 |
505 edcaParameters.SetQosInfo (0); | 505 edcaParameters.SetQosInfo (0); |
506 } | 506 } |
507 return edcaParameters; | 507 return edcaParameters; |
508 } | 508 } |
509 | 509 |
510 HtOperation | 510 HtOperation |
511 ApWifiMac::GetHtOperation (void) const | 511 ApWifiMac::GetHtOperation (void) const |
512 { | 512 { |
513 NS_LOG_FUNCTION (this); | 513 NS_LOG_FUNCTION (this); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 if (m_stationManager->GetNMcsSupported (i->second) < nMcs) | 576 if (m_stationManager->GetNMcsSupported (i->second) < nMcs) |
577 { | 577 { |
578 nMcs = m_stationManager->GetNMcsSupported (i->second); | 578 nMcs = m_stationManager->GetNMcsSupported (i->second); |
579 } | 579 } |
580 if (m_stationManager->GetNumberOfSupportedStreams (i->second) < ma
xSpatialStream) | 580 if (m_stationManager->GetNumberOfSupportedStreams (i->second) < ma
xSpatialStream) |
581 { | 581 { |
582 maxSpatialStream = m_stationManager->GetNumberOfSupportedStrea
ms (i->second); | 582 maxSpatialStream = m_stationManager->GetNumberOfSupportedStrea
ms (i->second); |
583 } | 583 } |
584 } | 584 } |
585 } | 585 } |
586 operation.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbi
t/s | 586 operation.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupport
edRate / 1e6)); //in Mbit/s |
587 operation.SetTxMcsSetDefined (nMcs > 0); | 587 operation.SetTxMcsSetDefined (nMcs > 0); |
588 operation.SetTxMaxNSpatialStreams (maxSpatialStream); | 588 operation.SetTxMaxNSpatialStreams (maxSpatialStream); |
589 //To be filled in once supported | 589 //To be filled in once supported |
590 operation.SetObssNonHtStasPresent (0); | 590 operation.SetObssNonHtStasPresent (0); |
591 operation.SetDualBeacon (0); | 591 operation.SetDualBeacon (0); |
592 operation.SetDualCtsProtection (0); | 592 operation.SetDualCtsProtection (0); |
593 operation.SetStbcBeacon (0); | 593 operation.SetStbcBeacon (0); |
594 operation.SetLSigTxopProtectionFullSupport (0); | 594 operation.SetLSigTxopProtectionFullSupport (0); |
595 operation.SetPcoActive (0); | 595 operation.SetPcoActive (0); |
596 operation.SetPhase (0); | 596 operation.SetPhase (0); |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 void | 1412 void |
1413 ApWifiMac::DoInitialize (void) | 1413 ApWifiMac::DoInitialize (void) |
1414 { | 1414 { |
1415 NS_LOG_FUNCTION (this); | 1415 NS_LOG_FUNCTION (this); |
1416 m_beaconDca->Initialize (); | 1416 m_beaconDca->Initialize (); |
1417 m_beaconEvent.Cancel (); | 1417 m_beaconEvent.Cancel (); |
1418 if (m_enableBeaconGeneration) | 1418 if (m_enableBeaconGeneration) |
1419 { | 1419 { |
1420 if (m_enableBeaconJitter) | 1420 if (m_enableBeaconJitter) |
1421 { | 1421 { |
1422 int64_t jitter = m_beaconJitter->GetValue (0, m_beaconInterval.GetMicr
oSeconds ()); | 1422 int64_t jitter = static_cast<int64_t> (m_beaconJitter->GetValue (0, st
atic_cast<double> (m_beaconInterval.GetMicroSeconds ()))); |
1423 NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddr
ess () << " at time " << jitter << " microseconds"); | 1423 NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddr
ess () << " at time " << jitter << " microseconds"); |
1424 m_beaconEvent = Simulator::Schedule (MicroSeconds (jitter), &ApWifiMac
::SendOneBeacon, this); | 1424 m_beaconEvent = Simulator::Schedule (MicroSeconds (jitter), &ApWifiMac
::SendOneBeacon, this); |
1425 } | 1425 } |
1426 else | 1426 else |
1427 { | 1427 { |
1428 NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddr
ess () << " at time 0"); | 1428 NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddr
ess () << " at time 0"); |
1429 m_beaconEvent = Simulator::ScheduleNow (&ApWifiMac::SendOneBeacon, thi
s); | 1429 m_beaconEvent = Simulator::ScheduleNow (&ApWifiMac::SendOneBeacon, thi
s); |
1430 } | 1430 } |
1431 } | 1431 } |
1432 RegularWifiMac::DoInitialize (); | 1432 RegularWifiMac::DoInitialize (); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 if (m_staList.find (nextAid) == m_staList.end ()) | 1471 if (m_staList.find (nextAid) == m_staList.end ()) |
1472 { | 1472 { |
1473 return nextAid; | 1473 return nextAid; |
1474 } | 1474 } |
1475 } | 1475 } |
1476 NS_ASSERT_MSG (false, "No free association ID available!"); | 1476 NS_ASSERT_MSG (false, "No free association ID available!"); |
1477 return 0; | 1477 return 0; |
1478 } | 1478 } |
1479 | 1479 |
1480 } //namespace ns3 | 1480 } //namespace ns3 |
OLD | NEW |