diff --git a/src/wifi/model/block-ack-cache.h b/src/wifi/model/block-ack-cache.h index e3d45642b..c54fa3e89 100644 --- a/src/wifi/model/block-ack-cache.h +++ b/src/wifi/model/block-ack-cache.h @@ -77,7 +77,7 @@ private: void ResetPortionOfBitmap (uint16_t start, uint16_t end); uint16_t m_winStart; ///< window start - uint8_t m_winSize; ///< window size + uint16_t m_winSize; ///< window size uint16_t m_winEnd; ///< window end uint16_t m_bitmap[4096]; ///< bitmap diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 509dde55a..5f83fb02d 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -545,8 +545,8 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4 if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)) { bool foundFirstLost = false; - uint32_t nSuccessfulMpdus = 0; - uint32_t nFailedMpdus = 0; + uint8_t nSuccessfulMpdus = 0; + uint8_t nFailedMpdus = 0; AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); PacketQueueI queueEnd = it->second.second.end (); diff --git a/src/wifi/model/dsss-error-rate-model.cc b/src/wifi/model/dsss-error-rate-model.cc index 0630c86ee..a59985404 100644 --- a/src/wifi/model/dsss-error-rate-model.cc +++ b/src/wifi/model/dsss-error-rate-model.cc @@ -40,7 +40,7 @@ DsssErrorRateModel::DqpskFunction (double x) } double -DsssErrorRateModel::GetDsssDbpskSuccessRate (double sinr, uint32_t nbits) +DsssErrorRateModel::GetDsssDbpskSuccessRate (double sinr, uint64_t nbits) { NS_LOG_FUNCTION_NOARGS (); double EbN0 = sinr * 22000000.0 / 1000000.0; //1 bit per symbol with 1 MSPS @@ -49,7 +49,7 @@ DsssErrorRateModel::GetDsssDbpskSuccessRate (double sinr, uint32_t nbits) } double -DsssErrorRateModel::GetDsssDqpskSuccessRate (double sinr, uint32_t nbits) +DsssErrorRateModel::GetDsssDqpskSuccessRate (double sinr, uint64_t nbits) { NS_LOG_FUNCTION_NOARGS (); double EbN0 = sinr * 22000000.0 / 1000000.0 / 2.0; //2 bits per symbol, 1 MSPS @@ -58,7 +58,7 @@ DsssErrorRateModel::GetDsssDqpskSuccessRate (double sinr, uint32_t nbits) } double -DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate (double sinr, uint32_t nbits) +DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate (double sinr, uint64_t nbits) { NS_LOG_FUNCTION_NOARGS (); #ifdef HAVE_GSL @@ -92,7 +92,7 @@ DsssErrorRateModel::GetDsssDqpskCck5_5SuccessRate (double sinr, uint32_t nbits) } double -DsssErrorRateModel::GetDsssDqpskCck11SuccessRate (double sinr, uint32_t nbits) +DsssErrorRateModel::GetDsssDqpskCck11SuccessRate (double sinr, uint64_t nbits) { NS_LOG_FUNCTION_NOARGS (); #ifdef HAVE_GSL diff --git a/src/wifi/model/dsss-error-rate-model.h b/src/wifi/model/dsss-error-rate-model.h index 48f406fc5..bf7af6811 100644 --- a/src/wifi/model/dsss-error-rate-model.h +++ b/src/wifi/model/dsss-error-rate-model.h @@ -82,7 +82,7 @@ public: * * \return the chunk success rate of the differential BPSK */ - static double GetDsssDbpskSuccessRate (double sinr, uint32_t nbits); + static double GetDsssDbpskSuccessRate (double sinr, uint64_t nbits); /** * Return the chunk success rate of the differential encoded QPSK. * @@ -91,7 +91,7 @@ public: * * \return the chunk success rate of the differential encoded QPSK. */ - static double GetDsssDqpskSuccessRate (double sinr,uint32_t nbits); + static double GetDsssDqpskSuccessRate (double sinr,uint64_t nbits); /** * Return the chunk success rate of the differential encoded QPSK for * 5.5Mbps data rate. @@ -101,7 +101,7 @@ public: * * \return the chunk success rate of the differential encoded QPSK for */ - static double GetDsssDqpskCck5_5SuccessRate (double sinr,uint32_t nbits); + static double GetDsssDqpskCck5_5SuccessRate (double sinr,uint64_t nbits); /** * Return the chunk success rate of the differential encoded QPSK for * 11Mbps data rate. @@ -111,7 +111,7 @@ public: * * \return the chunk success rate of the differential encoded QPSK for */ - static double GetDsssDqpskCck11SuccessRate (double sinr,uint32_t nbits); + static double GetDsssDqpskCck11SuccessRate (double sinr,uint64_t nbits); #ifdef HAVE_GSL static double SymbolErrorProb16Cck (double e2); /// equation (18) in Pursley's paper static double SymbolErrorProb256Cck (double e1); /// equation (17) in Pursley's paper diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index 5cec952f4..d2cb30e63 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -332,7 +332,7 @@ RegularWifiMac::GetHeCapabilities (void) const } void -RegularWifiMac::SetVoMaxAmsduSize (uint32_t size) +RegularWifiMac::SetVoMaxAmsduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_voMaxAmsduSize = size; @@ -340,7 +340,7 @@ RegularWifiMac::SetVoMaxAmsduSize (uint32_t size) } void -RegularWifiMac::SetViMaxAmsduSize (uint32_t size) +RegularWifiMac::SetViMaxAmsduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_viMaxAmsduSize = size; @@ -348,7 +348,7 @@ RegularWifiMac::SetViMaxAmsduSize (uint32_t size) } void -RegularWifiMac::SetBeMaxAmsduSize (uint32_t size) +RegularWifiMac::SetBeMaxAmsduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_beMaxAmsduSize = size; @@ -356,7 +356,7 @@ RegularWifiMac::SetBeMaxAmsduSize (uint32_t size) } void -RegularWifiMac::SetBkMaxAmsduSize (uint32_t size) +RegularWifiMac::SetBkMaxAmsduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_bkMaxAmsduSize = size; @@ -364,7 +364,7 @@ RegularWifiMac::SetBkMaxAmsduSize (uint32_t size) } void -RegularWifiMac::SetVoMaxAmpduSize (uint32_t size) +RegularWifiMac::SetVoMaxAmpduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_voMaxAmpduSize = size; @@ -372,7 +372,7 @@ RegularWifiMac::SetVoMaxAmpduSize (uint32_t size) } void -RegularWifiMac::SetViMaxAmpduSize (uint32_t size) +RegularWifiMac::SetViMaxAmpduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_viMaxAmpduSize = size; @@ -380,7 +380,7 @@ RegularWifiMac::SetViMaxAmpduSize (uint32_t size) } void -RegularWifiMac::SetBeMaxAmpduSize (uint32_t size) +RegularWifiMac::SetBeMaxAmpduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_beMaxAmpduSize = size; @@ -388,7 +388,7 @@ RegularWifiMac::SetBeMaxAmpduSize (uint32_t size) } void -RegularWifiMac::SetBkMaxAmpduSize (uint32_t size) +RegularWifiMac::SetBkMaxAmpduSize (uint16_t size) { NS_LOG_FUNCTION (this << size); m_bkMaxAmpduSize = size; @@ -1117,49 +1117,49 @@ RegularWifiMac::GetTypeId (void) "Value 0 means A-MSDU is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmsduSize), - MakeUintegerChecker (0, 11426)) + MakeUintegerChecker (0, 11426)) .AddAttribute ("VI_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_VI access class." "Value 0 means A-MSDU is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmsduSize), - MakeUintegerChecker (0, 11426)) + MakeUintegerChecker (0, 11426)) .AddAttribute ("BE_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_BE access class." "Value 0 means A-MSDU is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmsduSize), - MakeUintegerChecker (0, 11426)) + MakeUintegerChecker (0, 11426)) .AddAttribute ("BK_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_BK access class." "Value 0 means A-MSDU is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmsduSize), - MakeUintegerChecker (0, 11426)) + MakeUintegerChecker (0, 11426)) .AddAttribute ("VO_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_VO access class." "Value 0 means A-MPDU is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmpduSize), - MakeUintegerChecker (0, 65535)) + MakeUintegerChecker ()) .AddAttribute ("VI_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_VI access class." "Value 0 means A-MPDU is disabled for that AC.", UintegerValue (65535), MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmpduSize), - MakeUintegerChecker (0, 65535)) + MakeUintegerChecker ()) .AddAttribute ("BE_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_BE access class." "Value 0 means A-MPDU is disabled for that AC.", UintegerValue (65535), MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmpduSize), - MakeUintegerChecker (0, 65535)) + MakeUintegerChecker ()) .AddAttribute ("BK_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_BK access class." "Value 0 means A-MPDU is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmpduSize), - MakeUintegerChecker (0, 65535)) + MakeUintegerChecker ()) .AddAttribute ("VO_BlockAckThreshold", "If number of packets in VO queue reaches this value, " "block ack mechanism is used. If this value is 0, block ack is never used." diff --git a/src/wifi/model/regular-wifi-mac.h b/src/wifi/model/regular-wifi-mac.h index 6f30c96f6..cfcc8a143 100644 --- a/src/wifi/model/regular-wifi-mac.h +++ b/src/wifi/model/regular-wifi-mac.h @@ -596,50 +596,50 @@ private: * * \param size the maximum A-MSDU size for AC_VO. */ - void SetVoMaxAmsduSize (uint32_t size); + void SetVoMaxAmsduSize (uint16_t size); /** * Set the maximum A-MSDU size for AC_VI. * * \param size the maximum A-MSDU size for AC_VI. */ - void SetViMaxAmsduSize (uint32_t size); + void SetViMaxAmsduSize (uint16_t size); /** * Set the maximum A-MSDU size for AC_BE. * * \param size the maximum A-MSDU size for AC_BE. */ - void SetBeMaxAmsduSize (uint32_t size); + void SetBeMaxAmsduSize (uint16_t size); /** * Set the maximum A-MSDU size for AC_BK. * * \param size the maximum A-MSDU size for AC_BK. */ - void SetBkMaxAmsduSize (uint32_t size); + void SetBkMaxAmsduSize (uint16_t size); /** * Set the maximum A-MPDU size for AC_VO. * * \param size the maximum A-MPDU size for AC_VO. */ - void SetVoMaxAmpduSize (uint32_t size); + void SetVoMaxAmpduSize (uint16_t size); /** * Set the maximum A-MPDU size for AC_VI. * * \param size the maximum A-MPDU size for AC_VI. */ - void SetViMaxAmpduSize (uint32_t size); + void SetViMaxAmpduSize (uint16_t size); /** * Set the maximum A-MPDU size for AC_BE. * * \param size the maximum A-MPDU size for AC_BE. */ - void SetBeMaxAmpduSize (uint32_t size); + void SetBeMaxAmpduSize (uint16_t size); /** * Set the maximum A-MPDU size for AC_BK. * * \param size the maximum A-MPDU size for AC_BK. */ - void SetBkMaxAmpduSize (uint32_t size); + void SetBkMaxAmpduSize (uint16_t size); /** * Set the Block ACK threshold for AC_VO. @@ -698,15 +698,15 @@ private: /// Disable aggregation function void DisableAggregation (void); - uint32_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO - uint32_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI - uint32_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE - uint32_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK + uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO + uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI + uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE + uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK - uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO - uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI - uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE - uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK + uint16_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO + uint16_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI + uint16_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE + uint16_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK TracedCallback m_txOkCallback; ///< transmit OK callback TracedCallback m_txErrCallback; ///< transmit error callback diff --git a/src/wifi/model/wifi-mac-header.cc b/src/wifi/model/wifi-mac-header.cc index bd3e2ae40..6487f9719 100644 --- a/src/wifi/model/wifi-mac-header.cc +++ b/src/wifi/model/wifi-mac-header.cc @@ -662,7 +662,7 @@ WifiMacHeader::GetSequenceNumber (void) const return m_seqSeq; } -uint16_t +uint8_t WifiMacHeader::GetFragmentNumber (void) const { return m_seqFrag; diff --git a/src/wifi/model/wifi-mac-header.h b/src/wifi/model/wifi-mac-header.h index 8d6c604e8..e7578b3a2 100644 --- a/src/wifi/model/wifi-mac-header.h +++ b/src/wifi/model/wifi-mac-header.h @@ -452,7 +452,7 @@ public: * * \return the fragment number of the header */ - uint16_t GetFragmentNumber (void) const; + uint8_t GetFragmentNumber (void) const; /** * Return if the Retry bit is set. * diff --git a/src/wifi/model/wifi-mac-queue.h b/src/wifi/model/wifi-mac-queue.h index 394eb80f5..f0262f6c2 100644 --- a/src/wifi/model/wifi-mac-queue.h +++ b/src/wifi/model/wifi-mac-queue.h @@ -28,6 +28,7 @@ #include "wifi-mac-header.h" namespace ns3 { + class QosBlockedDestinations; /** diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 82fd72f7e..bf00253d4 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -207,7 +207,7 @@ WifiPhy::GetTypeId (void) "TxPowerStart and TxPowerEnd included.", UintegerValue (1), MakeUintegerAccessor (&WifiPhy::m_nTxPower), - MakeUintegerChecker ()) + MakeUintegerChecker ()) .AddAttribute ("TxPowerEnd", "Maximum available transmission level (dbm).", DoubleValue (16.0206), @@ -535,13 +535,13 @@ WifiPhy::GetTxPowerEnd (void) const } void -WifiPhy::SetNTxPower (uint32_t n) +WifiPhy::SetNTxPower (uint8_t n) { - NS_LOG_FUNCTION (this << n); + NS_LOG_FUNCTION (this << static_cast(n)); m_nTxPower = n; } -uint32_t +uint8_t WifiPhy::GetNTxPower (void) const { return m_nTxPower; diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index ea291401e..9c7c2d040 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -1431,13 +1431,13 @@ public: * * \param n the number of available levels */ - void SetNTxPower (uint32_t n); + void SetNTxPower (uint8_t n); /** * Return the number of available transmission power levels. * * \return the number of available transmission power levels */ - uint32_t GetNTxPower (void) const; + uint8_t GetNTxPower (void) const; /** * Sets the transmission gain (dB). * @@ -1956,7 +1956,7 @@ private: double m_rxGainDb; //!< Reception gain (dB) double m_txPowerBaseDbm; //!< Minimum transmission power (dBm) double m_txPowerEndDbm; //!< Maximum transmission power (dBm) - uint32_t m_nTxPower; //!< Number of available transmission power levels + uint8_t m_nTxPower; //!< Number of available transmission power levels bool m_ldpc; //!< Flag if LDPC is used bool m_stbc; //!< Flag if STBC is used