diff --git a/src/wifi/model/block-ack-agreement.cc b/src/wifi/model/block-ack-agreement.cc index 36680cf3b..d9fbc1361 100644 --- a/src/wifi/model/block-ack-agreement.cc +++ b/src/wifi/model/block-ack-agreement.cc @@ -40,7 +40,7 @@ BlockAckAgreement::BlockAckAgreement (Mac48Address peer, uint8_t tid) m_htSupported (0), m_inactivityEvent () { - NS_LOG_FUNCTION (this << peer << static_cast (tid)); + NS_LOG_FUNCTION (this << peer << (uint16_t)tid); m_tid = tid; m_peer = peer; } diff --git a/src/wifi/model/block-ack-cache.cc b/src/wifi/model/block-ack-cache.cc index 8d86dd41f..a8538324c 100644 --- a/src/wifi/model/block-ack-cache.cc +++ b/src/wifi/model/block-ack-cache.cc @@ -102,7 +102,7 @@ void BlockAckCache::ResetPortionOfBitmap (uint16_t start, uint16_t end) { NS_LOG_FUNCTION (this << start << end); - uint32_t i = start; + uint16_t i = start; for (; i != end; i = (i + 1) % 4096) { m_bitmap[i] = 0; @@ -127,8 +127,8 @@ BlockAckCache::FillBlockAckBitmap (CtrlBAckResponseHeader *blockAckHeader) } else if (blockAckHeader->IsCompressed ()) { - uint32_t i = blockAckHeader->GetStartingSequence (); - uint32_t end = (i + m_winSize - 1) % 4096; + uint16_t i = blockAckHeader->GetStartingSequence (); + uint16_t end = (i + m_winSize - 1) % 4096; for (; i != end; i = (i + 1) % 4096) { if (m_bitmap[i] == 1) diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 9e8c34759..0b53d1451 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -53,7 +53,7 @@ Bar::Bar (Ptr bar, Mac48Address recipient, uint8_t tid, bool immed tid (tid), immediate (immediate) { - NS_LOG_FUNCTION (this << bar << recipient << static_cast (tid) << immediate); + NS_LOG_FUNCTION (this << bar << recipient << (uint16_t)tid << immediate); } BlockAckManager::BlockAckManager () @@ -72,7 +72,7 @@ BlockAckManager::~BlockAckManager () bool BlockAckManager::ExistsAgreement (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid); return (m_agreements.find (std::make_pair (recipient, tid)) != m_agreements.end ()); } @@ -80,7 +80,7 @@ bool BlockAckManager::ExistsAgreementInState (Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid) << state); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid << state); AgreementsCI it; it = m_agreements.find (std::make_pair (recipient, tid)); if (it != m_agreements.end ()) @@ -134,7 +134,7 @@ BlockAckManager::CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Addr void BlockAckManager::DestroyAgreement (Mac48Address recipient, uint8_t tid) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid); AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); if (it != m_agreements.end ()) { @@ -456,7 +456,7 @@ BlockAckManager::RemovePacket (uint8_t tid, Mac48Address recipient, uint16_t seq i->second.second.erase ((*it)); m_retryPackets.erase (it); - NS_LOG_DEBUG ("Removed Packet from retry queue = " << hdr.GetSequenceNumber () << " " << (uint32_t) tid << " " << recipient << " Buffer Size = " << m_retryPackets.size ()); + NS_LOG_DEBUG ("Removed Packet from retry queue = " << hdr.GetSequenceNumber () << " " << (uint16_t)tid << " " << recipient << " Buffer Size = " << m_retryPackets.size ()); return true; } } @@ -486,7 +486,7 @@ BlockAckManager::HasPackets (void) const uint32_t BlockAckManager::GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid); uint32_t nPackets = 0; if (ExistsAgreement (recipient, tid)) { @@ -511,7 +511,7 @@ BlockAckManager::GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const uint32_t BlockAckManager::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid); uint32_t nPackets = 0; uint16_t currentSeq = 0; if (ExistsAgreement (recipient, tid)) @@ -546,7 +546,7 @@ BlockAckManager::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) co void BlockAckManager::SetBlockAckThreshold (uint8_t nPackets) { - NS_LOG_FUNCTION (this << static_cast (nPackets)); + NS_LOG_FUNCTION (this << (uint16_t)nPackets); m_blockAckThreshold = nPackets; } @@ -804,7 +804,7 @@ BlockAckManager::SetQueue (Ptr queue) bool BlockAckManager::SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid) << startingSeq); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid << startingSeq); NS_ASSERT (!ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::PENDING)); if (!ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::UNSUCCESSFUL) && ExistsAgreement (recipient, tid)) { @@ -822,7 +822,7 @@ BlockAckManager::SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, void BlockAckManager::TearDownBlockAck (Mac48Address recipient, uint8_t tid) { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid); DestroyAgreement (recipient, tid); } @@ -951,7 +951,7 @@ BlockAckManager::SetTxMiddle (MacTxMiddle* txMiddle) uint16_t BlockAckManager::GetSeqNumOfNextRetryPacket (Mac48Address recipient, uint8_t tid) const { - NS_LOG_FUNCTION (this << recipient << static_cast (tid)); + NS_LOG_FUNCTION (this << recipient << (uint16_t)tid); std::list::const_iterator it = m_retryPackets.begin (); while (it != m_retryPackets.end ()) { diff --git a/src/wifi/model/edca-txop-n.cc b/src/wifi/model/edca-txop-n.cc index 647178b38..8e3b8570b 100644 --- a/src/wifi/model/edca-txop-n.cc +++ b/src/wifi/model/edca-txop-n.cc @@ -115,7 +115,7 @@ public: { m_txop->GotBlockAck (blockAck, source, rxSnr, txMode, dataSnr); } - virtual void MissedBlockAck (uint32_t nMpdus) + virtual void MissedBlockAck (uint8_t nMpdus) { m_txop->MissedBlockAck (nMpdus); } @@ -369,7 +369,7 @@ EdcaTxopN::SetWifiRemoteStationManager (Ptr remoteMana void EdcaTxopN::SetTypeOfStation (TypeOfStation type) { - NS_LOG_FUNCTION (this << static_cast (type)); + NS_LOG_FUNCTION (this << (uint32_t)type); m_typeOfStation = type; } @@ -960,10 +960,9 @@ EdcaTxopN::MissedAck (void) } void -EdcaTxopN::MissedBlockAck (uint32_t nMpdus) +EdcaTxopN::MissedBlockAck (uint8_t nMpdus) { - NS_LOG_FUNCTION (this); - NS_LOG_DEBUG ("missed block ack"); + NS_LOG_FUNCTION (this << (uint16_t)nMpdus); uint8_t tid = GetTid (m_currentPacket, m_currentHdr); if (GetAmpduExist (m_currentHdr.GetAddr1 ())) { @@ -1401,7 +1400,7 @@ EdcaTxopN::GetFragmentPacket (WifiMacHeader *hdr) void EdcaTxopN::SetAccessCategory (AcIndex ac) { - NS_LOG_FUNCTION (this << static_cast (ac)); + NS_LOG_FUNCTION (this << (uint16_t)ac); m_ac = ac; } @@ -1651,7 +1650,7 @@ EdcaTxopN::CompleteConfig (void) void EdcaTxopN::SetBlockAckThreshold (uint8_t threshold) { - NS_LOG_FUNCTION (this << static_cast (threshold)); + NS_LOG_FUNCTION (this << (uint16_t)threshold); m_blockAckThreshold = threshold; m_baManager->SetBlockAckThreshold (threshold); } @@ -1674,7 +1673,7 @@ void EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq, uint16_t timeout, bool immediateBAck) { - NS_LOG_FUNCTION (this << dest << static_cast (tid) << startSeq << timeout << immediateBAck); + NS_LOG_FUNCTION (this << dest << (uint16_t)tid << startSeq << timeout << immediateBAck); NS_LOG_DEBUG ("sent ADDBA request to " << dest); WifiMacHeader hdr; hdr.SetAction (); @@ -1737,7 +1736,7 @@ EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq, void EdcaTxopN::SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator) { - NS_LOG_FUNCTION (this << addr << static_cast (tid) << byOriginator); + NS_LOG_FUNCTION (this << addr << (uint16_t)tid << byOriginator); WifiMacHeader hdr; hdr.SetAction (); hdr.SetAddr1 (addr); diff --git a/src/wifi/model/edca-txop-n.h b/src/wifi/model/edca-txop-n.h index 49972dd92..f8874e55f 100644 --- a/src/wifi/model/edca-txop-n.h +++ b/src/wifi/model/edca-txop-n.h @@ -262,7 +262,7 @@ public: /** * Event handler when a Block ACK timeout has occurred. */ - void MissedBlockAck (uint32_t nMpdus); + void MissedBlockAck (uint8_t nMpdus); void GotAddBaResponse (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient); void GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient); /** diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index d9b53301a..4aa072aa8 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -228,9 +228,9 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st, } void -IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr) +IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) { - NS_LOG_FUNCTION (this << st << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << st << (uint16_t)nSuccessfulMpdus << (uint16_t)nFailedMpdus << rxSnr << dataSnr); IdealWifiRemoteStation *station = (IdealWifiRemoteStation *)st; if (dataSnr == 0) { diff --git a/src/wifi/model/ideal-wifi-manager.h b/src/wifi/model/ideal-wifi-manager.h index d1409532a..7615d95e0 100644 --- a/src/wifi/model/ideal-wifi-manager.h +++ b/src/wifi/model/ideal-wifi-manager.h @@ -63,7 +63,7 @@ private: double ctsSnr, WifiMode ctsMode, double rtsSnr); virtual void DoReportDataOk (WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr); - virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr); + virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); virtual void DoReportFinalRtsFailed (WifiRemoteStation *station); virtual void DoReportFinalDataFailed (WifiRemoteStation *station); virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station); diff --git a/src/wifi/model/interference-helper.cc b/src/wifi/model/interference-helper.cc index ca8f1a7c8..5b8a021da 100644 --- a/src/wifi/model/interference-helper.cc +++ b/src/wifi/model/interference-helper.cc @@ -272,13 +272,13 @@ InterferenceHelper::CalculateChunkSuccessRate (double snir, Time duration, WifiM { return 1.0; } - uint32_t rate = mode.GetPhyRate (txVector); + uint64_t rate = mode.GetPhyRate (txVector); uint64_t nbits = (uint64_t)(rate * duration.GetSeconds ()); if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT || txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) { nbits /= txVector.GetNss (); //divide effective number of bits by NSS to achieve same chunk error rate as SISO for AWGN double gain = (txVector.GetNTx () * m_numRxAntennas); //compute gain offered by MIMO, SIMO or MISO compared to SISO for AWGN - NS_LOG_DEBUG ("TX=" << (uint32_t)txVector.GetNTx () << ", RX=" << (uint32_t)m_numRxAntennas << ", SNIR improvement=+" << 10.0 * std::log10 (gain) << "dB"); + NS_LOG_DEBUG ("TX=" << (uint16_t)txVector.GetNTx () << ", RX=" << (uint16_t)m_numRxAntennas << ", SNIR improvement=+" << 10.0 * std::log10 (gain) << "dB"); snir *= gain; } double csr = m_errorRateModel->GetChunkSuccessRate (mode, txVector, snir, (uint32_t)nbits); diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 86795f053..29d8f35c9 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -47,7 +47,7 @@ MacLowTransmissionListener::GotBlockAck (const CtrlBAckResponseHeader *blockAck, { } void -MacLowTransmissionListener::MissedBlockAck (uint32_t nMpdus) +MacLowTransmissionListener::MissedBlockAck (uint8_t nMpdus) { } @@ -754,7 +754,7 @@ MacLow::StartTransmission (Ptr packet, { //m_aggregateQueue > 0 occurs when a RTS/CTS exchange failed before an A-MPDU transmission. //In that case, we transmit the same A-MPDU as previously. - uint32_t sentMpdus = m_aggregateQueue->GetSize (); + uint8_t sentMpdus = m_aggregateQueue->GetSize (); m_ampdu = true; if (sentMpdus > 1) { @@ -1524,7 +1524,7 @@ MacLow::ForwardDown (Ptr packet, const WifiMacHeader* hdr, WifiTxV Ptr dequeuedPacket; WifiMacHeader newHdr; WifiMacTrailer fcs; - uint32_t queueSize = m_aggregateQueue->GetSize (); + uint8_t queueSize = m_aggregateQueue->GetSize (); bool vhtSingleMpdu = false; bool last = false; MpduType mpdutype = NORMAL_MPDU; @@ -1672,7 +1672,7 @@ MacLow::BlockAckTimeout (void) MacLowTransmissionListener *listener = m_listener; m_listener = 0; m_ampdu = false; - uint32_t nTxMpdus = m_aggregateQueue->GetSize (); + uint8_t nTxMpdus = m_aggregateQueue->GetSize (); FlushAggregateQueue (); listener->MissedBlockAck (nTxMpdus); } @@ -2936,7 +2936,7 @@ MacLow::AggregateToAmpdu (Ptr packet, const WifiMacHeader hdr) } else { - uint32_t queueSize = m_aggregateQueue->GetSize (); + uint8_t queueSize = m_aggregateQueue->GetSize (); NS_ASSERT (queueSize <= 2); //since it is not an A-MPDU then only 2 packets should have been added to the queue no more if (queueSize >= 1) { diff --git a/src/wifi/model/mac-low.h b/src/wifi/model/mac-low.h index 5e8fcb440..d60389bd3 100644 --- a/src/wifi/model/mac-low.h +++ b/src/wifi/model/mac-low.h @@ -103,7 +103,7 @@ public: * will send the block ack back to the tx station which will reply with a * normal ack to the rx station. */ - virtual void MissedBlockAck (uint32_t nMpdus); + virtual void MissedBlockAck (uint8_t nMpdus); /** * Invoked when ns3::MacLow wants to start a new transmission * as configured by MacLowTransmissionParameters::EnableNextData. diff --git a/src/wifi/model/minstrel-ht-wifi-manager.cc b/src/wifi/model/minstrel-ht-wifi-manager.cc index 9ce0b4fbc..de351a736 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/minstrel-ht-wifi-manager.cc @@ -686,9 +686,9 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) } void -MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr) +MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) { - NS_LOG_FUNCTION (this << st << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << st << (uint16_t)nSuccessfulMpdus << (uint16_t)nFailedMpdus << rxSnr << dataSnr); MinstrelHtWifiRemoteStation *station = (MinstrelHtWifiRemoteStation *) st; CheckInit (station); @@ -703,7 +703,7 @@ MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint32_t nS } NS_LOG_DEBUG ("DoReportAmpduTxStatus. TxRate=" << station->m_txrate << " SuccMpdus= " << - nSuccessfulMpdus << " FailedMpdus= " << nFailedMpdus); + (uint16_t)nSuccessfulMpdus << " FailedMpdus= " << (uint16_t)nFailedMpdus); station->m_ampduPacketCount++; station->m_ampduLen += nSuccessfulMpdus + nFailedMpdus; @@ -735,7 +735,7 @@ MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint32_t nS { station->m_txrate = FindRate (station); } - NS_LOG_DEBUG ("Next rate to use TxRate = " << station->m_txrate ); + NS_LOG_DEBUG ("Next rate to use TxRate = " << station->m_txrate); } } @@ -850,9 +850,9 @@ MinstrelHtWifiManager::UpdateRetry (MinstrelHtWifiRemoteStation *station) } void -MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus) +MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus) { - NS_LOG_FUNCTION (this << station << nSuccessfulMpdus << nFailedMpdus); + NS_LOG_FUNCTION (this << station << (uint16_t)nSuccessfulMpdus << (uint16_t)nFailedMpdus); station->m_totalPacketsCount += nSuccessfulMpdus + nFailedMpdus; if (station->m_isSampling) @@ -917,9 +917,9 @@ MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st) McsGroup group = m_minstrelGroups[groupId]; // Check consistency of rate selected. - if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station) || (uint32_t) group.streams > GetNumberOfSupportedStreams (station)) + if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station) || group.streams > GetNumberOfSupportedStreams (station)) { - NS_ASSERT_MSG (false,"Inconsistent group selected. Group: (" << (uint32_t)group.streams << "," << (uint32_t)group.sgi << "," << group.chWidth << ")" << + NS_ASSERT_MSG (false,"Inconsistent group selected. Group: (" << (uint16_t)group.streams << "," << (uint16_t)group.sgi << "," << (uint16_t)group.chWidth << ")" << " Station capabilities: (" << GetNumberOfSupportedStreams (station) << "," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")"); } @@ -1089,7 +1089,7 @@ MinstrelHtWifiManager::GetNextSample (MinstrelHtWifiRemoteStation *station) uint32_t sampleIndex = station->m_sampleTable[index][col]; uint32_t rateIndex = GetIndex (sampleGroup, sampleIndex); - NS_LOG_DEBUG ("Next Sample is " << rateIndex ); + NS_LOG_DEBUG ("Next Sample is " << rateIndex); SetNextSample (station); //Calculate the next sample rate. @@ -1189,8 +1189,8 @@ MinstrelHtWifiManager::FindRate (MinstrelHtWifiRemoteStation *station) Time maxProbDuration = station->m_groupsTable[maxProbGroupId].m_ratesTable[maxProbRateId].perfectTxTime; NS_LOG_DEBUG ("Use sample rate? SampleDuration= " << sampleDuration << " maxTp2Duration= " << maxTp2Duration << - " maxProbDuration= " << maxProbDuration << " sampleStreams= " << (uint32_t)sampleStreams << - " maxTpStreams= " << (uint32_t)maxTpStreams); + " maxProbDuration= " << maxProbDuration << " sampleStreams= " << (uint16_t)sampleStreams << + " maxTpStreams= " << (uint16_t)maxTpStreams); if (sampleDuration < maxTp2Duration || (sampleStreams < maxTpStreams && sampleDuration < maxProbDuration)) { /// Set flag that we are currently sampling. @@ -1523,8 +1523,8 @@ MinstrelHtWifiManager::RateInit (MinstrelHtWifiRemoteStation *station) && (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth) ///Is channel width supported by the receiver? && (GetNumberOfSupportedStreams (station) >= m_minstrelGroups[groupId].streams)) ///Are streams supported by the receiver? { - NS_LOG_DEBUG ("Group " << groupId << ": (" << (uint32_t)m_minstrelGroups[groupId].streams << - "," << (uint32_t)m_minstrelGroups[groupId].sgi << "," << m_minstrelGroups[groupId].chWidth << ")"); + NS_LOG_DEBUG ("Group " << groupId << ": (" << (uint16_t)m_minstrelGroups[groupId].streams << + "," << (uint16_t)m_minstrelGroups[groupId].sgi << "," << (uint16_t)m_minstrelGroups[groupId].chWidth << ")"); station->m_groupsTable[groupId].m_supported = true; ///Group supported. station->m_groupsTable[groupId].m_col = 0; diff --git a/src/wifi/model/minstrel-ht-wifi-manager.h b/src/wifi/model/minstrel-ht-wifi-manager.h index 4b6342d62..846a20679 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.h +++ b/src/wifi/model/minstrel-ht-wifi-manager.h @@ -244,7 +244,7 @@ private: virtual void DoReportFinalDataFailed (WifiRemoteStation *station); virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station); virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station); - virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr); + virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); virtual bool IsLowLatency (void) const; virtual bool DoNeedDataRetransmission (WifiRemoteStation *st, Ptr packet, bool normally); virtual void DoDisposeStation (WifiRemoteStation *station); @@ -274,7 +274,7 @@ private: void UpdateRetry (MinstrelHtWifiRemoteStation *station); /// Update the number of sample count variables. - void UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus); + void UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus); /// Getting the next sample from Sample Table. uint32_t GetNextSample (MinstrelHtWifiRemoteStation *station); diff --git a/src/wifi/model/wifi-mode.cc b/src/wifi/model/wifi-mode.cc index 10c0930fc..a7ccc1c1e 100644 --- a/src/wifi/model/wifi-mode.cc +++ b/src/wifi/model/wifi-mode.cc @@ -73,7 +73,7 @@ WifiMode::GetPhyRate (uint8_t channelWidth, bool isShortGuardInterval, uint8_t n { //TODO: nss > 4 not supported yet NS_ASSERT (nss <= 4); - uint32_t dataRate, phyRate; + uint64_t dataRate, phyRate; dataRate = GetDataRate (channelWidth, isShortGuardInterval, nss); switch (GetCodeRate ()) { @@ -122,7 +122,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, bool isShortGuardInterval, uint8_t NS_ASSERT (nss <= 4); WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid); uint64_t dataRate = 0; - uint32_t usableSubCarriers = 0; + uint16_t usableSubCarriers = 0; double symbolRate = 0; double codingRate = 0; uint32_t numberOfBitsPerSubcarrier = log2 (GetConstellationSize ()); diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 33c6b9097..fdcb4c75c 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -244,14 +244,14 @@ WifiPhy::GetTypeId (void) "The number of supported Tx antennas.", UintegerValue (1), MakeUintegerAccessor (&WifiPhy::m_numberOfTransmitters), - MakeUintegerChecker (), + MakeUintegerChecker (1, 8), TypeId::DEPRECATED, "Not used anymore.") .AddAttribute ("RxAntennas", "The number of supported Rx antennas.", UintegerValue (1), MakeUintegerAccessor (&WifiPhy::m_numberOfReceivers), - MakeUintegerChecker (), + MakeUintegerChecker (1, 8), TypeId::DEPRECATED, "Not used anymore.") .AddAttribute ("Antennas", @@ -259,21 +259,21 @@ WifiPhy::GetTypeId (void) UintegerValue (1), MakeUintegerAccessor (&WifiPhy::GetNumberOfAntennas, &WifiPhy::SetNumberOfAntennas), - MakeUintegerChecker ()) + MakeUintegerChecker (1, 8)) .AddAttribute ("MaxSupportedTxSpatialStreams", "The maximum number of supported TX spatial streams." "This parameter is only valuable for 802.11n/ac STAs and APs.", UintegerValue (1), MakeUintegerAccessor (&WifiPhy::GetMaxSupportedTxSpatialStreams, &WifiPhy::SetMaxSupportedTxSpatialStreams), - MakeUintegerChecker ()) + MakeUintegerChecker (1, 8)) .AddAttribute ("MaxSupportedRxSpatialStreams", "The maximum number of supported RX spatial streams." "This parameter is only valuable for 802.11n/ac STAs and APs.", UintegerValue (1), MakeUintegerAccessor (&WifiPhy::GetMaxSupportedRxSpatialStreams, &WifiPhy::SetMaxSupportedRxSpatialStreams), - MakeUintegerChecker ()) + MakeUintegerChecker (1, 8)) .AddAttribute ("ShortGuardEnabled", "Whether or not short guard interval is enabled." "This parameter is only valuable for 802.11n/ac STAs and APs.", @@ -360,8 +360,8 @@ WifiPhy::GetTypeId (void) WifiPhy::WifiPhy () : m_mpdusNum (0), m_plcpSuccess (false), - m_txMpduReferenceNumber (0xffffffff), - m_rxMpduReferenceNumber (0xffffffff), + m_txMpduReferenceNumber (0xffffffffffffffff), + m_rxMpduReferenceNumber (0xffffffffffffffff), m_endRxEvent (), m_endPlcpRxEvent (), m_standard (WIFI_PHY_STANDARD_UNSPECIFIED), @@ -2436,7 +2436,7 @@ WifiPhy::StartReceivePacket (Ptr packet, MpduType mpdutype, Ptr event) { - NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetPreambleType () << (uint32_t)mpdutype); + NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetPreambleType () << (uint16_t)mpdutype); NS_ASSERT (IsStateRx ()); NS_ASSERT (m_endPlcpRxEvent.IsExpired ()); WifiMode txMode = txVector.GetMode (); diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index f339377f5..bd2adbaa9 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -62,7 +62,7 @@ struct SignalNoiseDbm struct MpduInfo { MpduType type; - uint32_t mpduRefNumber; + uint64_t mpduRefNumber; }; /** @@ -1567,8 +1567,8 @@ protected: uint16_t m_mpdusNum; //!< carries the number of expected mpdus that are part of an A-MPDU bool m_plcpSuccess; //!< Flag if the PLCP of the packet or the first MPDU in an A-MPDU has been received - uint32_t m_txMpduReferenceNumber; //!< A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU - uint32_t m_rxMpduReferenceNumber; //!< A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU + uint64_t m_txMpduReferenceNumber; //!< A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU + uint64_t m_rxMpduReferenceNumber; //!< A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU EventId m_endRxEvent; EventId m_endPlcpRxEvent; @@ -1796,12 +1796,12 @@ private: bool m_guardInterval; //!< Flag if short guard interval is used bool m_shortPreamble; //!< Flag if short PLCP preamble is supported - uint32_t m_numberOfTransmitters; //!< Number of transmitters (DEPRECATED) - uint32_t m_numberOfReceivers; //!< Number of receivers (DEPRECATED) + uint8_t m_numberOfTransmitters; //!< Number of transmitters (DEPRECATED) + uint8_t m_numberOfReceivers; //!< Number of receivers (DEPRECATED) - uint32_t m_numberOfAntennas; //!< Number of transmitters - uint32_t m_txSpatialStreams; //!< Number of supported TX spatial streams - uint32_t m_rxSpatialStreams; //!< Number of supported RX spatial streams + uint8_t m_numberOfAntennas; //!< Number of transmitters + uint8_t m_txSpatialStreams; //!< Number of supported TX spatial streams + uint8_t m_rxSpatialStreams; //!< Number of supported RX spatial streams typedef std::map ChannelToFrequencyWidthMap; static ChannelToFrequencyWidthMap m_channelToFrequencyWidth; diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 0bcf6651c..5c7a85e2b 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -891,9 +891,10 @@ WifiRemoteStationManager::ReportRxOk (Mac48Address address, const WifiMacHeader void WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t tid, - uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr) + uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr) { - NS_LOG_FUNCTION (this << address << (uint16_t)tid << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << address << (uint16_t)tid << (uint16_t)nSuccessfulMpdus << (uint16_t)nFailedMpdus << rxSnr << dataSnr); NS_ASSERT (!address.IsGroup ()); WifiRemoteStation *station = Lookup (address, tid); for (uint32_t i = 0; i < nFailedMpdus; i++) @@ -1753,7 +1754,7 @@ WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, } void -WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr) +WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) { NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!"); } diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index ff714ae4c..4092046ca 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -610,7 +610,7 @@ public: * \param rxSnr received SNR of the block ack frame itself * \param dataSnr data SNR reported by remote station */ - void ReportAmpduTxStatus (Mac48Address address, uint8_t tid, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr); + void ReportAmpduTxStatus (Mac48Address address, uint8_t tid, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); /** * \param address remote address @@ -1143,7 +1143,7 @@ private: * \param rxSnr received SNR of the block ack frame itself * \param dataSnr data SNR reported by remote station */ - virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr); + virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); /** * Return the state of the station associated with the given address. diff --git a/src/wifi/model/yans-error-rate-model.cc b/src/wifi/model/yans-error-rate-model.cc index a2e435bdd..fa8bed3ab 100644 --- a/src/wifi/model/yans-error-rate-model.cc +++ b/src/wifi/model/yans-error-rate-model.cc @@ -51,7 +51,7 @@ YansErrorRateModel::Log2 (double val) const } double -YansErrorRateModel::GetBpskBer (double snr, uint32_t signalSpread, uint32_t phyRate) const +YansErrorRateModel::GetBpskBer (double snr, uint32_t signalSpread, uint64_t phyRate) const { NS_LOG_FUNCTION (this << snr << signalSpread << phyRate); double EbNo = snr * signalSpread / phyRate; @@ -62,7 +62,7 @@ YansErrorRateModel::GetBpskBer (double snr, uint32_t signalSpread, uint32_t phyR } double -YansErrorRateModel::GetQamBer (double snr, unsigned int m, uint32_t signalSpread, uint32_t phyRate) const +YansErrorRateModel::GetQamBer (double snr, unsigned int m, uint32_t signalSpread, uint64_t phyRate) const { NS_LOG_FUNCTION (this << snr << m << signalSpread << phyRate); double EbNo = snr * signalSpread / phyRate; @@ -143,7 +143,7 @@ YansErrorRateModel::CalculatePd (double ber, unsigned int d) const double YansErrorRateModel::GetFecBpskBer (double snr, double nbits, - uint32_t signalSpread, uint32_t phyRate, + uint32_t signalSpread, uint64_t phyRate, uint32_t dFree, uint32_t adFree) const { NS_LOG_FUNCTION (this << snr << nbits << signalSpread << phyRate << dFree << adFree); @@ -162,7 +162,7 @@ YansErrorRateModel::GetFecBpskBer (double snr, double nbits, double YansErrorRateModel::GetFecQamBer (double snr, uint32_t nbits, uint32_t signalSpread, - uint32_t phyRate, + uint64_t phyRate, uint32_t m, uint32_t dFree, uint32_t adFree, uint32_t adFreePlusOne) const { diff --git a/src/wifi/model/yans-error-rate-model.h b/src/wifi/model/yans-error-rate-model.h index e2b11032c..395c22601 100644 --- a/src/wifi/model/yans-error-rate-model.h +++ b/src/wifi/model/yans-error-rate-model.h @@ -83,7 +83,7 @@ private: * * \return BER of BPSK at the given SNR */ - double GetBpskBer (double snr, uint32_t signalSpread, uint32_t phyRate) const; + double GetBpskBer (double snr, uint32_t signalSpread, uint64_t phyRate) const; /** * Return BER of QAM-m with the given parameters. * @@ -94,7 +94,7 @@ private: * * \return BER of BPSK at the given SNR */ - double GetQamBer (double snr, unsigned int m, uint32_t signalSpread, uint32_t phyRate) const; + double GetQamBer (double snr, unsigned int m, uint32_t signalSpread, uint64_t phyRate) const; /** * Return k! * @@ -145,7 +145,7 @@ private: * \return double */ double GetFecBpskBer (double snr, double nbits, - uint32_t signalSpread, uint32_t phyRate, + uint32_t signalSpread, uint64_t phyRate, uint32_t dFree, uint32_t adFree) const; /** * \param snr SNR ratio (not dB) @@ -161,7 +161,7 @@ private: */ double GetFecQamBer (double snr, uint32_t nbits, uint32_t signalSpread, - uint32_t phyRate, + uint64_t phyRate, uint32_t m, uint32_t dfree, uint32_t adFree, uint32_t adFreePlusOne) const; };