wifi: Make TXVECTOR available while receiving the PHY header of a PPDU

This commit is contained in:
Stefano Avallone
2024-10-15 17:40:41 +02:00
parent 60b4feb74d
commit f52ef11cfd
5 changed files with 15 additions and 9 deletions

View File

@@ -252,7 +252,7 @@ AdvancedEmlsrManager::DoGetDelayUntilAccessRequest(uint8_t linkId)
continue;
}
if (phy && phy->IsReceivingPhyHeader())
if (phy && phy->GetInfoIfRxingPhyHeader())
{
// we don't know yet the type of the frame being received; prevent or allow
// the UL TXOP based on user configuration

View File

@@ -1654,7 +1654,7 @@ EhtFrameExchangeManager::TxopEnd(const std::optional<Mac48Address>& txopHolder)
{
NS_LOG_FUNCTION(this << txopHolder.has_value());
if (m_phy && m_phy->IsReceivingPhyHeader())
if (m_phy && m_phy->GetInfoIfRxingPhyHeader())
{
// we may get here because the PHY has not issued the PHY-RXSTART.indication before
// the expiration of the timer started to detect new received frames, but the PHY is

View File

@@ -1997,10 +1997,15 @@ WifiPhy::StartReceivePreamble(Ptr<const WifiPpdu> ppdu,
}
}
bool
WifiPhy::IsReceivingPhyHeader() const
std::optional<std::reference_wrapper<const WifiTxVector>>
WifiPhy::GetInfoIfRxingPhyHeader() const
{
return m_endPhyRxEvent.IsPending();
if (m_endPhyRxEvent.IsPending())
{
NS_ASSERT_MSG(m_currentEvent, "No current event while receiving PHY header");
return std::cref(m_currentEvent->GetPpdu()->GetTxVector());
}
return std::nullopt;
}
void

View File

@@ -114,9 +114,10 @@ class WifiPhy : public Object
Time rxDuration);
/**
* @return whether the PHY is busy decoding the PHY header fields of a PPDU
* @return if the PHY is busy decoding the PHY header fields of a PPDU, return the TXVECTOR
* used to transmit the PPDU; otherwise, return a null optional value
*/
bool IsReceivingPhyHeader() const;
std::optional<std::reference_wrapper<const WifiTxVector>> GetInfoIfRxingPhyHeader() const;
/**
* For HE receptions only, check and possibly modify the transmit power restriction state at

View File

@@ -4832,12 +4832,12 @@ EmlsrCcaBusyTest::CheckPoint1()
NS_TEST_EXPECT_MSG_NE(mainPhy, auxPhy, "Main PHY is operating on an unexpected link");
// 2. Aux PHY is receiving the PHY header
NS_TEST_EXPECT_MSG_EQ(auxPhy->IsReceivingPhyHeader(),
NS_TEST_EXPECT_MSG_EQ(auxPhy->GetInfoIfRxingPhyHeader().has_value(),
true,
"Aux PHY is not receiving a PHY header");
// 3. Main PHY dropped the preamble because it is switching
NS_TEST_EXPECT_MSG_EQ(mainPhy->IsReceivingPhyHeader(),
NS_TEST_EXPECT_MSG_EQ(mainPhy->GetInfoIfRxingPhyHeader().has_value(),
false,
"Main PHY is receiving a PHY header");