From b31caee0e37e660379a7ba53f6f46e38f3ff332a Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 3 May 2024 18:23:19 +0200 Subject: [PATCH] wifi: Remove unused functions --- src/mesh/model/mesh-wifi-interface-mac.cc | 7 ++++--- src/wifi/model/ap-wifi-mac.cc | 14 +++++++------- src/wifi/model/qos-utils.cc | 15 --------------- src/wifi/model/qos-utils.h | 12 ------------ src/wifi/model/sta-wifi-mac.cc | 10 +++++----- src/wifi/model/txop.cc | 10 ---------- src/wifi/model/txop.h | 8 -------- 7 files changed, 16 insertions(+), 60 deletions(-) diff --git a/src/mesh/model/mesh-wifi-interface-mac.cc b/src/mesh/model/mesh-wifi-interface-mac.cc index 4a4af4454..7a88a30d5 100644 --- a/src/mesh/model/mesh-wifi-interface-mac.cc +++ b/src/mesh/model/mesh-wifi-interface-mac.cc @@ -282,11 +282,11 @@ MeshWifiInterfaceMac::SendManagementFrame(Ptr packet, const WifiMacHeade */ if (hdr.GetAddr1() != Mac48Address::GetBroadcast()) { - GetQosTxop(AC_VO)->Queue(packet, header); + GetQosTxop(AC_VO)->Queue(Create(packet, header)); } else { - GetQosTxop(AC_BK)->Queue(packet, header); + GetQosTxop(AC_BK)->Queue(Create(packet, header)); } } @@ -405,7 +405,8 @@ MeshWifiInterfaceMac::SendBeacon() { (*i)->UpdateBeacon(beacon); } - m_txop->Queue(beacon.CreatePacket(), beacon.CreateHeader(GetAddress(), GetMeshPointAddress())); + m_txop->Queue(Create(beacon.CreatePacket(), + beacon.CreateHeader(GetAddress(), GetMeshPointAddress()))); ScheduleNextBeacon(); } diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index 6094c8b2c..c7b0b993a 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -1119,7 +1119,7 @@ ApWifiMac::SendProbeResp(Mac48Address to, uint8_t linkId) if (!GetQosSupported()) { - GetTxop()->Queue(packet, hdr); + GetTxop()->Queue(Create(packet, hdr)); } // "A QoS STA that transmits a Management frame determines access category used // for medium access in transmission of the Management frame as follows @@ -1130,11 +1130,11 @@ ApWifiMac::SendProbeResp(Mac48Address to, uint8_t linkId) // shall be selected." (Sec. 10.2.3.2 of 802.11-2020) else if (!GetWifiRemoteStationManager(linkId)->GetQosSupported(to)) { - GetBEQueue()->Queue(packet, hdr); + GetBEQueue()->Queue(Create(packet, hdr)); } else { - GetVOQueue()->Queue(packet, hdr); + GetVOQueue()->Queue(Create(packet, hdr)); } } @@ -1408,7 +1408,7 @@ ApWifiMac::SendAssocResp(Mac48Address to, bool isReassoc, uint8_t linkId) if (!GetQosSupported()) { - GetTxop()->Queue(packet, hdr); + GetTxop()->Queue(Create(packet, hdr)); } // "A QoS STA that transmits a Management frame determines access category used // for medium access in transmission of the Management frame as follows @@ -1419,11 +1419,11 @@ ApWifiMac::SendAssocResp(Mac48Address to, bool isReassoc, uint8_t linkId) // shall be selected." (Sec. 10.2.3.2 of 802.11-2020) else if (!GetWifiRemoteStationManager(linkId)->GetQosSupported(to)) { - GetBEQueue()->Queue(packet, hdr); + GetBEQueue()->Queue(Create(packet, hdr)); } else { - GetVOQueue()->Queue(packet, hdr); + GetVOQueue()->Queue(Create(packet, hdr)); } } @@ -1518,7 +1518,7 @@ ApWifiMac::SendOneBeacon(uint8_t linkId) NS_LOG_INFO("Generating beacon from " << link.feManager->GetAddress() << " linkID " << +linkId); // The beacon has it's own special queue, so we load it in there - m_beaconTxop->Queue(packet, hdr); + m_beaconTxop->Queue(Create(packet, hdr)); link.beaconEvent = Simulator::Schedule(GetBeaconInterval(), &ApWifiMac::SendOneBeacon, this, linkId); diff --git a/src/wifi/model/qos-utils.cc b/src/wifi/model/qos-utils.cc index d7778034d..8796ee7e9 100644 --- a/src/wifi/model/qos-utils.cc +++ b/src/wifi/model/qos-utils.cc @@ -152,21 +152,6 @@ QosUtilsMapTidToAc(uint8_t tid) return AC_UNDEF; } -uint8_t -QosUtilsGetTidForPacket(Ptr packet) -{ - SocketPriorityTag qos; - uint8_t tid = 8; - if (packet->PeekPacketTag(qos)) - { - if (qos.GetPriority() < 8) - { - tid = qos.GetPriority(); - } - } - return tid; -} - uint32_t QosUtilsMapSeqControlToUniqueInteger(uint16_t seqControl, uint16_t endSequence) { diff --git a/src/wifi/model/qos-utils.h b/src/wifi/model/qos-utils.h index 0a2521d05..b9d4718d2 100644 --- a/src/wifi/model/qos-utils.h +++ b/src/wifi/model/qos-utils.h @@ -218,18 +218,6 @@ extern const std::map wifiAcList; */ AcIndex QosUtilsMapTidToAc(uint8_t tid); -/** - * \ingroup wifi - * If a QoS tag is attached to the packet, returns a value < 8. - * A value >= 8 is returned otherwise. - * - * \param packet the packet to checked for a QoS tag - * - * \return a value less than 8 if QoS tag was present, a value >= 8 - * is returned if no QoS tag was present - */ -uint8_t QosUtilsGetTidForPacket(Ptr packet); - /** * \ingroup wifi * Next function is useful to correctly sort buffered packets under block ack. diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index b92ccdbce..10dabb3f0 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -396,7 +396,7 @@ StaWifiMac::SendProbeRequest(uint8_t linkId) if (!GetQosSupported()) { - GetTxop()->Queue(packet, hdr); + GetTxop()->Queue(Create(packet, hdr)); } // "A QoS STA that transmits a Management frame determines access category used // for medium access in transmission of the Management frame as follows @@ -407,7 +407,7 @@ StaWifiMac::SendProbeRequest(uint8_t linkId) // shall be selected." (Sec. 10.2.3.2 of 802.11-2020) else { - GetVOQueue()->Queue(packet, hdr); + GetVOQueue()->Queue(Create(packet, hdr)); } } @@ -684,7 +684,7 @@ StaWifiMac::SendAssociationRequest(bool isReassoc) if (!GetQosSupported()) { - GetTxop()->Queue(packet, hdr); + GetTxop()->Queue(Create(packet, hdr)); } // "A QoS STA that transmits a Management frame determines access category used // for medium access in transmission of the Management frame as follows @@ -695,11 +695,11 @@ StaWifiMac::SendAssociationRequest(bool isReassoc) // shall be selected." (Sec. 10.2.3.2 of 802.11-2020) else if (!GetWifiRemoteStationManager(linkId)->GetQosSupported(*link.bssid)) { - GetBEQueue()->Queue(packet, hdr); + GetBEQueue()->Queue(Create(packet, hdr)); } else { - GetVOQueue()->Queue(packet, hdr); + GetVOQueue()->Queue(Create(packet, hdr)); } if (m_assocRequestEvent.IsPending()) diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index 93c8e5418..2de989169 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -619,16 +619,6 @@ Txop::HasFramesToTransmit(uint8_t linkId) return ret; } -void -Txop::Queue(Ptr packet, const WifiMacHeader& hdr) -{ - NS_LOG_FUNCTION(this << packet << &hdr); - // remove the priority tag attached, if any - SocketPriorityTag priorityTag; - packet->RemovePacketTag(priorityTag); - Queue(Create(packet, hdr)); -} - void Txop::Queue(Ptr mpdu) { diff --git a/src/wifi/model/txop.h b/src/wifi/model/txop.h index ba0638669..3b3f6643f 100644 --- a/src/wifi/model/txop.h +++ b/src/wifi/model/txop.h @@ -353,14 +353,6 @@ class Txop : public Object virtual void NotifyOn(); /* Event handlers */ - /** - * \param packet packet to send. - * \param hdr header of packet to send. - * - * Store the packet in the internal queue until it - * can be sent safely. - */ - virtual void Queue(Ptr packet, const WifiMacHeader& hdr); /** * \param mpdu the given MPDU *