wifi: Make TXVECTOR available while receiving the PHY header of a PPDU
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user