diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 2ca4c2a4a..8df523625 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -1000,7 +1000,10 @@ BlockAckManager::ScheduleBar(const CtrlBAckRequestHeader& reqHdr, const WifiMacH uint8_t tid = reqHdr.GetTidInfo(); - WifiContainerQueueId queueId(WIFI_CTL_QUEUE, WIFI_UNICAST, hdr.GetAddr1(), std::nullopt); + WifiContainerQueueId queueId(WIFI_CTL_QUEUE, + WifiRcvAddr::UNICAST, + hdr.GetAddr1(), + std::nullopt); auto pkt = Create(); pkt->AddHeader(reqHdr); Ptr item = nullptr; diff --git a/src/wifi/model/eht/eht-frame-exchange-manager.cc b/src/wifi/model/eht/eht-frame-exchange-manager.cc index 420468145..53fac4168 100644 --- a/src/wifi/model/eht/eht-frame-exchange-manager.cc +++ b/src/wifi/model/eht/eht-frame-exchange-manager.cc @@ -213,7 +213,10 @@ EhtFrameExchangeManager::StartTransmission(Ptr edca, MHz_u allowedWidth) } // check that this link is blocked as expected - WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WIFI_UNICAST, *mldAddress, 0); + WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, + WifiRcvAddr::UNICAST, + *mldAddress, + 0); auto mask = m_apMac->GetMacQueueScheduler()->GetQueueLinkMask(AC_BE, queueId, m_linkId); NS_ASSERT_MSG(mask, @@ -1109,7 +1112,10 @@ EhtFrameExchangeManager::SendCtsAfterRts(const WifiMacHeader& rtsHdr, m_mac->GetWifiRemoteStationManager(linkId)->GetEmlsrEnabled(*mldAddress)) { // check that other links are blocked as expected - WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WIFI_UNICAST, *mldAddress, 0); + WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, + WifiRcvAddr::UNICAST, + *mldAddress, + 0); auto mask = m_apMac->GetMacQueueScheduler()->GetQueueLinkMask(AC_BE, queueId, linkId); NS_ASSERT_MSG(mask, "No mask for client " << *mldAddress << " on link " << +linkId); diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index e8fbbc75c..e5ba3ebfa 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -320,11 +320,11 @@ RrMultiUserScheduler::CanSolicitStaInBsrpTf(const MasterInfo& info) const // check if the station is an EMLSR client that is using another link if (GetWifiRemoteStationManager(m_linkId)->GetEmlsrEnabled(info.address) && (m_apMac->GetTxBlockedOnLink(AC_BE, - {WIFI_QOSDATA_QUEUE, WIFI_UNICAST, *mldAddr, 0}, + {WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, *mldAddr, 0}, m_linkId, WifiQueueBlockedReason::USING_OTHER_EMLSR_LINK) || m_apMac->GetTxBlockedOnLink(AC_BE, - {WIFI_QOSDATA_QUEUE, WIFI_UNICAST, *mldAddr, 0}, + {WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, *mldAddr, 0}, m_linkId, WifiQueueBlockedReason::WAITING_EMLSR_TRANSITION_DELAY))) { diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index f52ce8735..1271a441f 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -126,7 +126,7 @@ HtFrameExchangeManager::NeedSetupBlockAck(Mac48Address recipient, uint8_t tid) // NOLINTEND(bugprone-branch-clone) else { - WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WIFI_UNICAST, recipient, tid}; + WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, recipient, tid}; uint32_t packets = qosTxop->GetWifiMacQueue()->GetNPackets(queueId); establish = (m_mac->Is6GhzBand(m_linkId) || @@ -152,7 +152,7 @@ HtFrameExchangeManager::NeedSetupGcrBlockAck(const WifiMacHeader& header) m_mpduAggregator->GetMaxAmpduSize(groupAddress, tid, WIFI_MOD_CLASS_HT); const auto isGcrBa = (m_apMac->GetGcrManager()->GetRetransmissionPolicy() == GroupAddressRetransmissionPolicy::GCR_BLOCK_ACK); - WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WIFI_GROUPCAST, groupAddress, tid}; + WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WifiRcvAddr::GROUPCAST, groupAddress, tid}; for (const auto& recipients = m_apMac->GetGcrManager()->GetMemberStasForGroupAddress(groupAddress); @@ -570,7 +570,7 @@ HtFrameExchangeManager::GetBar(AcIndex ac, if (bar->GetHeader().GetAddr2() == m_self && recipientMld) { WifiContainerQueueId queueId{WIFI_CTL_QUEUE, - WIFI_UNICAST, + WifiRcvAddr::UNICAST, *recipientMld, std::nullopt}; Ptr otherBar; @@ -606,7 +606,7 @@ HtFrameExchangeManager::GetBar(AcIndex ac, { WifiContainerQueueId queueId( WIFI_QOSDATA_QUEUE, - WIFI_UNICAST, + WifiRcvAddr::UNICAST, GetWifiRemoteStationManager()->GetMldAddress(recipient).value_or(recipient), tid); // check if data is queued and can be transmitted on this link diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 918dbe393..9582ea3f9 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -177,7 +177,7 @@ QosTxop::GetLink(uint8_t linkId) const uint8_t QosTxop::GetQosQueueSize(uint8_t tid, Mac48Address receiver) const { - WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WIFI_UNICAST, receiver, tid}; + WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, receiver, tid}; uint32_t bufferSize = m_queue->GetNBytes(queueId); // A queue size value of 254 is used for all sizes greater than 64 768 octets. uint8_t queueSize = static_cast(std::ceil(std::min(bufferSize, 64769U) / 256.0)); @@ -393,7 +393,8 @@ QosTxop::PeekNextMpdu(uint8_t linkId, uint8_t tid, Mac48Address recipient, PtrPeekFirstAvailable(linkId, mpdu); } WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, - recipient.IsGroup() ? WIFI_GROUPCAST : WIFI_UNICAST, + recipient.IsGroup() ? WifiRcvAddr::GROUPCAST + : WifiRcvAddr::UNICAST, recipient, tid); if (auto mask = m_mac->GetMacQueueScheduler()->GetQueueLinkMask(m_ac, queueId, linkId); diff --git a/src/wifi/model/wifi-default-ack-manager.cc b/src/wifi/model/wifi-default-ack-manager.cc index dfdb7c27e..f8f442e34 100644 --- a/src/wifi/model/wifi-default-ack-manager.cc +++ b/src/wifi/model/wifi-default-ack-manager.cc @@ -152,7 +152,8 @@ WifiDefaultAckManager::IsResponseNeeded(Ptr mpdu, } // * no other frame belonging to this BA agreement is queued (because, in such // a case, a Block Ack is not going to be requested anytime soon) - if (auto queueId = WifiContainerQueueId(WIFI_QOSDATA_QUEUE, WIFI_UNICAST, origReceiver, tid); + if (auto queueId = + WifiContainerQueueId(WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, origReceiver, tid); edca->GetWifiMacQueue()->GetNPackets(queueId) - edca->GetBaManager()->GetNBufferedPackets(origReceiver, tid) - seqNumbers.size() < 1) diff --git a/src/wifi/model/wifi-mac-queue-container.cc b/src/wifi/model/wifi-mac-queue-container.cc index f335242b0..97033e010 100644 --- a/src/wifi/model/wifi-mac-queue-container.cc +++ b/src/wifi/model/wifi-mac-queue-container.cc @@ -70,21 +70,21 @@ WifiMacQueueContainer::GetQueueId(Ptr mpdu) { const WifiMacHeader& hdr = mpdu->GetHeader(); - WifiReceiverAddressType addrType; + WifiRcvAddr addrType; Mac48Address address; if (hdr.GetAddr1().IsBroadcast()) { - addrType = WIFI_BROADCAST; + addrType = WifiRcvAddr::BROADCAST; address = hdr.GetAddr2(); } else if (hdr.GetAddr1().IsGroup()) { - addrType = WIFI_GROUPCAST; + addrType = WifiRcvAddr::GROUPCAST; address = hdr.IsQosAmsdu() ? mpdu->begin()->second.GetDestinationAddr() : hdr.GetAddr1(); } else { - addrType = WIFI_UNICAST; + addrType = WifiRcvAddr::UNICAST; address = hdr.GetAddr1(); } diff --git a/src/wifi/model/wifi-mac-queue-container.h b/src/wifi/model/wifi-mac-queue-container.h index 6d39b4fc8..fbb603c3d 100644 --- a/src/wifi/model/wifi-mac-queue-container.h +++ b/src/wifi/model/wifi-mac-queue-container.h @@ -30,14 +30,29 @@ enum WifiContainerQueueType WIFI_DATA_QUEUE = 3 }; -/// enumeration of frame directions -enum WifiReceiverAddressType : uint8_t +/// enumeration of frame types based on receiver address +enum class WifiRcvAddr : uint8_t { - WIFI_UNICAST = 0, - WIFI_BROADCAST, - WIFI_GROUPCAST + UNICAST = 0, + BROADCAST, + GROUPCAST, + COUNT }; +/** + * Deprecated frame types enums. + * + * Use `WifiRcvAddr` class enum values instead. + * @{ + */ +NS_DEPRECATED_3_46("Use WifiRcvAddr::UNICAST instead") +static constexpr auto WIFI_UNICAST = WifiRcvAddr::UNICAST; +NS_DEPRECATED_3_46("Use WifiRcvAddr::BROADCAST instead") +static constexpr auto WIFI_BROADCAST = WifiRcvAddr::BROADCAST; +NS_DEPRECATED_3_46("Use WifiRcvAddr::GROUPCAST instead") +static constexpr auto WIFI_GROUPCAST = WifiRcvAddr::GROUPCAST; +/**@}*/ + /** * Tuple (queue type, receiver address type, Address, TID) identifying a container queue. * @@ -65,8 +80,8 @@ enum WifiReceiverAddressType : uint8_t * * The TID is only specified for container queue types holding QoS data frames. */ -using WifiContainerQueueId = std:: - tuple>; +using WifiContainerQueueId = + std::tuple>; } // namespace ns3 diff --git a/src/wifi/model/wifi-mac-queue.cc b/src/wifi/model/wifi-mac-queue.cc index c39dc8053..be133a40d 100644 --- a/src/wifi/model/wifi-mac-queue.cc +++ b/src/wifi/model/wifi-mac-queue.cc @@ -318,7 +318,7 @@ WifiMacQueue::PeekByTidAndAddress(uint8_t tid, Mac48Address dest, Ptr mac, std::string description, bool testUnblockedForOtherReasons) { - WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WIFI_UNICAST, dest, 0); + WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, dest, 0); auto mask = mac->GetMacQueueScheduler()->GetQueueLinkMask(AC_BE, queueId, linkId); NS_TEST_EXPECT_MSG_EQ(mask.has_value(), true, diff --git a/src/wifi/test/wifi-mac-queue-test.cc b/src/wifi/test/wifi-mac-queue-test.cc index 50271dfd8..b25f2ea38 100644 --- a/src/wifi/test/wifi-mac-queue-test.cc +++ b/src/wifi/test/wifi-mac-queue-test.cc @@ -214,8 +214,8 @@ WifiExtractExpiredMpdusTest::DoRun() Enqueue(rxAddr2, false, MilliSeconds(70)); Enqueue(rxAddr2, false, MilliSeconds(75)); - WifiContainerQueueId queueId1{WIFI_QOSDATA_QUEUE, WIFI_UNICAST, rxAddr1, 0}; - WifiContainerQueueId queueId2{WIFI_QOSDATA_QUEUE, WIFI_UNICAST, rxAddr2, 0}; + WifiContainerQueueId queueId1{WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, rxAddr1, 0}; + WifiContainerQueueId queueId2{WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, rxAddr2, 0}; Simulator::Schedule(MilliSeconds(25), [&]() { /** diff --git a/src/wifi/test/wifi-mlo-test.cc b/src/wifi/test/wifi-mlo-test.cc index 1665f4975..f33fb6c9e 100644 --- a/src/wifi/test/wifi-mlo-test.cc +++ b/src/wifi/test/wifi-mlo-test.cc @@ -1581,7 +1581,7 @@ MultiLinkSetupTest::CheckDisabledLinks() (legacyAssoc ? m_staMacs[0]->GetFrameExchangeManager(m_staSetupLinks.front())->GetAddress() : m_staMacs[0]->GetAddress()); - WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WIFI_UNICAST, addr, 0); + WifiContainerQueueId queueId(WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, addr, 0); // the queue on the AP should have a mask if and only if the link has been setup auto mask = m_apMac->GetMacQueueScheduler()->GetQueueLinkMask(AC_BE, queueId, linkId); diff --git a/src/wifi/test/wifi-retransmit-test.cc b/src/wifi/test/wifi-retransmit-test.cc index 851f4b719..4331370aa 100644 --- a/src/wifi/test/wifi-retransmit-test.cc +++ b/src/wifi/test/wifi-retransmit-test.cc @@ -309,7 +309,7 @@ WifiRetransmitTest::CheckValues(const std::map& seqNoRetryCo { const auto psduNumber = std::distance(m_events.cbegin(), m_eventIt); const auto apAddr = Mac48Address::ConvertFrom(m_apDevice.Get(0)->GetAddress()); - WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WIFI_UNICAST, apAddr, 0}; + WifiContainerQueueId queueId{WIFI_QOSDATA_QUEUE, WifiRcvAddr::UNICAST, apAddr, 0}; const auto staQueue = m_staMac->GetTxopQueue(AC_BE); NS_TEST_EXPECT_MSG_EQ(seqNoRetryCountMap.size(), staQueue->GetNPackets(queueId),