From 8544519e76a2ed22aa1ff4cb5629216c2e2c23bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Mon, 18 Dec 2017 19:20:22 +0100 Subject: [PATCH] wifi: remove unused input parameters --- src/wifi/helper/athstats-helper.cc | 2 +- src/wifi/model/he-capabilities.cc | 2 +- src/wifi/model/he-capabilities.h | 3 +-- src/wifi/model/mac-low.cc | 35 +++++++++++++++--------------- src/wifi/model/mac-low.h | 6 ++--- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/wifi/helper/athstats-helper.cc b/src/wifi/helper/athstats-helper.cc index a664e6868..0216de0d6 100644 --- a/src/wifi/helper/athstats-helper.cc +++ b/src/wifi/helper/athstats-helper.cc @@ -208,7 +208,7 @@ AthstatsWifiTraceSink::TxFinalDataFailedTrace (std::string context, Mac48Address void AthstatsWifiTraceSink::PhyRxOkTrace (std::string context, Ptr packet, double snr, WifiMode mode, enum WifiPreamble preamble) { - NS_LOG_FUNCTION (this << context << packet << " mode=" << mode << " snr=" << snr ); + NS_LOG_FUNCTION (this << context << packet << " mode=" << mode << " snr=" << snr << "preamble=" << preamble); ++m_phyRxOkCount; } diff --git a/src/wifi/model/he-capabilities.cc b/src/wifi/model/he-capabilities.cc index 1845d49bd..790fccb73 100644 --- a/src/wifi/model/he-capabilities.cc +++ b/src/wifi/model/he-capabilities.cc @@ -458,7 +458,7 @@ HeCapabilities::GetHeLtfAndGiForHePpdus (void) const } uint8_t -HeCapabilities::GetHighestMcsSupported (uint8_t mcs) const +HeCapabilities::GetHighestMcsSupported (void) const { return m_highestMcsSupported + 7; } diff --git a/src/wifi/model/he-capabilities.h b/src/wifi/model/he-capabilities.h index d35d2f426..edc22af0d 100644 --- a/src/wifi/model/he-capabilities.h +++ b/src/wifi/model/he-capabilities.h @@ -143,10 +143,9 @@ public: /** * Get highest MCS supported. * - * \param mcs the MCS * \returns the highest MCS is supported */ - uint8_t GetHighestMcsSupported (uint8_t mcs) const; + uint8_t GetHighestMcsSupported (void) const; /** * Get highest NSS supported. * diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index cfe4d2226..2e956bdfa 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -666,7 +666,7 @@ MacLow::ReceiveOk (Ptr packet, double rxSnr, WifiTxVector txVector, bool bool isPrevNavZero = IsNavZero (); NS_LOG_DEBUG ("duration/id=" << hdr.GetDuration ()); - NotifyNav (packet, hdr, txVector.GetPreambleType ()); + NotifyNav (packet, hdr); if (hdr.IsRts ()) { /* see section 9.2.5.7 802.11-1999 @@ -1012,7 +1012,7 @@ MacLow::GetAckDuration (WifiTxVector ackTxVector) const } Time -MacLow::GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, BlockAckType type) const +MacLow::GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const { /* * For immediate Basic BlockAck we should transmit the frame with the same WifiMode @@ -1129,7 +1129,7 @@ MacLow::CalculateTransmissionTime (Ptr packet, } void -MacLow::NotifyNav (Ptr packet,const WifiMacHeader &hdr, WifiPreamble preamble) +MacLow::NotifyNav (Ptr packet, const WifiMacHeader &hdr) { NS_ASSERT (m_lastNavStart <= Simulator::Now ()); Time duration = hdr.GetDuration (); @@ -1466,12 +1466,12 @@ MacLow::SendRtsForPacket (void) if (m_txParams.MustWaitBasicBlockAck ()) { WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, BASIC_BLOCK_ACK); } else if (m_txParams.MustWaitCompressedBlockAck ()) { WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (m_txParams.MustWaitAck ()) { @@ -1589,13 +1589,13 @@ MacLow::SendDataPacket (void) { duration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, BASIC_BLOCK_ACK); } else if (m_txParams.MustWaitCompressedBlockAck ()) { duration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (m_txParams.MustWaitAck ()) { @@ -1661,13 +1661,13 @@ MacLow::SendCtsToSelf (void) { duration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, BASIC_BLOCK_ACK); } else if (m_txParams.MustWaitCompressedBlockAck ()) { duration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (m_txParams.MustWaitAck ()) { @@ -1683,7 +1683,7 @@ MacLow::SendCtsToSelf (void) { duration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + duration += GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (m_txParams.MustWaitAck ()) { @@ -1771,13 +1771,13 @@ MacLow::SendDataAfterCts (Mac48Address source, Time duration) { newDuration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); + newDuration += GetBlockAckDuration (blockAckReqTxVector, BASIC_BLOCK_ACK); } else if (m_txParams.MustWaitCompressedBlockAck ()) { newDuration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + newDuration += GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (m_txParams.MustWaitAck ()) { @@ -1799,7 +1799,7 @@ MacLow::SendDataAfterCts (Mac48Address source, Time duration) { newDuration += GetSifs (); WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); - newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + newDuration += GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (m_txParams.MustWaitAck ()) { @@ -2141,11 +2141,11 @@ MacLow::SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Addre duration -= GetSifs (); if (blockAck->IsBasic ()) { - duration -= GetBlockAckDuration (originator, blockAckReqTxVector, BASIC_BLOCK_ACK); + duration -= GetBlockAckDuration (blockAckReqTxVector, BASIC_BLOCK_ACK); } else if (blockAck->IsCompressed ()) { - duration -= GetBlockAckDuration (originator, blockAckReqTxVector, COMPRESSED_BLOCK_ACK); + duration -= GetBlockAckDuration (blockAckReqTxVector, COMPRESSED_BLOCK_ACK); } else if (blockAck->IsMultiTid ()) { @@ -2309,8 +2309,7 @@ MacLow::DeaggregateAmpduAndReceive (Ptr aggregatedPacket, double rxSnr, WifiMacHeader firsthdr; (*n).first->PeekHeader (firsthdr); NS_LOG_DEBUG ("duration/id=" << firsthdr.GetDuration ()); - WifiPreamble preamble = txVector.GetPreambleType (); - NotifyNav ((*n).first, firsthdr, preamble); + NotifyNav ((*n).first, firsthdr); if (firsthdr.GetAddr1 () == m_self) { @@ -2321,7 +2320,7 @@ MacLow::DeaggregateAmpduAndReceive (Ptr aggregatedPacket, double rxSnr, NS_LOG_DEBUG ("Receive S-MPDU"); ampduSubframe = false; } - else if (preamble != WIFI_PREAMBLE_NONE || !m_sendAckEvent.IsRunning ()) + else if (txVector.GetPreambleType () != WIFI_PREAMBLE_NONE || !m_sendAckEvent.IsRunning ()) { m_sendAckEvent = Simulator::Schedule (ampdu.GetRemainingAmpduDuration () + GetSifs (), &MacLow::SendBlockAckAfterAmpdu, this, diff --git a/src/wifi/model/mac-low.h b/src/wifi/model/mac-low.h index 368096468..41f909c25 100644 --- a/src/wifi/model/mac-low.h +++ b/src/wifi/model/mac-low.h @@ -532,12 +532,11 @@ private: * Return the time required to transmit the Block ACK to the specified address * given the TXVECTOR of the BAR (including preamble and FCS). * - * \param to * \param blockAckReqTxVector * \param type the Block ACK type * \return the time required to transmit the Block ACK (including preamble and FCS) */ - Time GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, BlockAckType type) const; + Time GetBlockAckDuration (WifiTxVector blockAckReqTxVector, BlockAckType type) const; /** * Check if the current packet should be sent with a RTS protection. * @@ -558,9 +557,8 @@ private: * * \param packet the packet * \param hdr the header - * \param preamble the preamble */ - void NotifyNav (Ptr packet,const WifiMacHeader &hdr, WifiPreamble preamble); + void NotifyNav (Ptr packet,const WifiMacHeader &hdr); /** * Reset NAV with the given duration. *