wifi: FEM forwards PSDU RX error/OK notification to AP EMLSR manager
This commit is contained in:
committed by
Stefano Avallone
parent
9af4b544fb
commit
55bae2ed3f
@@ -70,6 +70,13 @@ ApEmlsrManager::SetWifiMac(Ptr<ApWifiMac> mac)
|
||||
NS_ABORT_MSG_IF(m_apMac->GetNLinks() <= 1, "ApEmlsrManager can only be installed on MLDs");
|
||||
NS_ABORT_MSG_IF(m_apMac->GetTypeOfStation() != AP,
|
||||
"ApEmlsrManager can only be installed on AP MLDs");
|
||||
DoSetWifiMac(mac);
|
||||
}
|
||||
|
||||
void
|
||||
ApEmlsrManager::DoSetWifiMac(Ptr<ApWifiMac> mac)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << mac);
|
||||
}
|
||||
|
||||
Ptr<ApWifiMac>
|
||||
@@ -84,4 +91,16 @@ ApEmlsrManager::GetEhtFem(uint8_t linkId) const
|
||||
return StaticCast<EhtFrameExchangeManager>(m_apMac->GetFrameExchangeManager(linkId));
|
||||
}
|
||||
|
||||
void
|
||||
ApEmlsrManager::NotifyPsduRxOk(uint8_t linkId, Ptr<const WifiPsdu> psdu)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << linkId << *psdu);
|
||||
}
|
||||
|
||||
void
|
||||
ApEmlsrManager::NotifyPsduRxError(uint8_t linkId, Ptr<const WifiPsdu> psdu)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << linkId << *psdu);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace ns3
|
||||
|
||||
class ApWifiMac;
|
||||
class EhtFrameExchangeManager;
|
||||
class WifiPsdu;
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
@@ -52,9 +53,32 @@ class ApEmlsrManager : public Object
|
||||
*/
|
||||
void SetWifiMac(Ptr<ApWifiMac> mac);
|
||||
|
||||
/**
|
||||
* This method is called when the reception of a PSDU succeeds on the given link.
|
||||
*
|
||||
* \param linkId the ID of the given link
|
||||
* \param psdu the PSDU whose reception succeeded
|
||||
*/
|
||||
virtual void NotifyPsduRxOk(uint8_t linkId, Ptr<const WifiPsdu> psdu);
|
||||
|
||||
/**
|
||||
* This method is called when the reception of a PSDU fails on the given link.
|
||||
*
|
||||
* \param linkId the ID of the given link
|
||||
* \param psdu the PSDU whose reception failed
|
||||
*/
|
||||
virtual void NotifyPsduRxError(uint8_t linkId, Ptr<const WifiPsdu> psdu);
|
||||
|
||||
protected:
|
||||
void DoDispose() override;
|
||||
|
||||
/**
|
||||
* Allow subclasses to take actions when the MAC is set.
|
||||
*
|
||||
* \param mac the wifi MAC
|
||||
*/
|
||||
virtual void DoSetWifiMac(Ptr<ApWifiMac> mac);
|
||||
|
||||
/**
|
||||
* \return the MAC of the AP MLD managed by this AP EMLSR Manager.
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "eht-frame-exchange-manager.h"
|
||||
|
||||
#include "ap-emlsr-manager.h"
|
||||
#include "eht-phy.h"
|
||||
#include "emlsr-manager.h"
|
||||
|
||||
@@ -1068,6 +1069,11 @@ EhtFrameExchangeManager::PostProcessFrame(Ptr<const WifiPsdu> psdu, const WifiTx
|
||||
|
||||
HeFrameExchangeManager::PostProcessFrame(psdu, txVector);
|
||||
|
||||
if (m_apMac && m_apMac->GetApEmlsrManager())
|
||||
{
|
||||
m_apMac->GetApEmlsrManager()->NotifyPsduRxOk(m_linkId, psdu);
|
||||
}
|
||||
|
||||
if (m_apMac && m_txopHolder == psdu->GetAddr2() &&
|
||||
GetWifiRemoteStationManager()->GetEmlsrEnabled(*m_txopHolder))
|
||||
{
|
||||
@@ -1159,6 +1165,17 @@ EhtFrameExchangeManager::CheckEmlsrClientStartingTxop(const WifiMacHeader& hdr,
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
EhtFrameExchangeManager::PsduRxError(Ptr<const WifiPsdu> psdu)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << psdu);
|
||||
|
||||
if (m_apMac && m_apMac->GetApEmlsrManager())
|
||||
{
|
||||
m_apMac->GetApEmlsrManager()->NotifyPsduRxError(m_linkId, psdu);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
EhtFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
|
||||
RxSignalInfo rxSignalInfo,
|
||||
|
||||
@@ -97,6 +97,31 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager
|
||||
*/
|
||||
bool UsingOtherEmlsrLink() const;
|
||||
|
||||
/**
|
||||
* Check if the frame received (or being received) is sent by an EMLSR client to start an
|
||||
* UL TXOP. If so, take the appropriate actions (e.g., block transmission to the EMLSR client
|
||||
* on the other links). This method is intended to be called when an MPDU (possibly within
|
||||
* an A-MPDU) is received or when the reception of the MAC header in an MPDU is notified.
|
||||
*
|
||||
* \param hdr the MAC header of the received (or being received) MPDU
|
||||
* \param txVector the TXVECTOR used to transmit the frame received (or being received)
|
||||
* \return whether the frame received (or being received) is sent by an EMLSR client to start
|
||||
* an UL TXOP
|
||||
*/
|
||||
bool CheckEmlsrClientStartingTxop(const WifiMacHeader& hdr, const WifiTxVector& txVector);
|
||||
|
||||
/**
|
||||
* This method is intended to be called when an AP MLD detects that an EMLSR client previously
|
||||
* involved in the current TXOP will start waiting for the transition delay interval (to switch
|
||||
* back to listening operation) after the given delay.
|
||||
* This method blocks the transmissions on all the EMLSR links of the given EMLSR client until
|
||||
* the transition delay advertised by the EMLSR client expires.
|
||||
*
|
||||
* \param address the link MAC address of the given EMLSR client
|
||||
* \param delay the given delay
|
||||
*/
|
||||
void EmlsrSwitchToListening(const Mac48Address& address, const Time& delay);
|
||||
|
||||
protected:
|
||||
void DoDispose() override;
|
||||
void RxStartIndication(WifiTxVector txVector, Time psduDuration) override;
|
||||
@@ -119,33 +144,9 @@ class EhtFrameExchangeManager : public HeFrameExchangeManager
|
||||
void NavResetTimeout() override;
|
||||
void IntraBssNavResetTimeout() override;
|
||||
void SendCtsAfterRts(const WifiMacHeader& rtsHdr, WifiMode rtsTxMode, double rtsSnr) override;
|
||||
|
||||
/**
|
||||
* This method is intended to be called when an AP MLD detects that an EMLSR client previously
|
||||
* involved in the current TXOP will start waiting for the transition delay interval (to switch
|
||||
* back to listening operation) after the given delay.
|
||||
* This method blocks the transmissions on all the EMLSR links of the given EMLSR client until
|
||||
* the transition delay advertised by the EMLSR client expires.
|
||||
*
|
||||
* \param address the link MAC address of the given EMLSR client
|
||||
* \param delay the given delay
|
||||
*/
|
||||
void EmlsrSwitchToListening(const Mac48Address& address, const Time& delay);
|
||||
void PsduRxError(Ptr<const WifiPsdu> psdu) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Check if the frame received (or being received) is sent by an EMLSR client to start an
|
||||
* UL TXOP. If so, take the appropriate actions (e.g., block transmission to the EMLSR client
|
||||
* on the other links). This method is intended to be called when an MPDU (possibly within
|
||||
* an A-MPDU) is received or when the reception of the MAC header in an MPDU is notified.
|
||||
*
|
||||
* \param hdr the MAC header of the received (or being received) MPDU
|
||||
* \param txVector the TXVECTOR used to transmit the frame received (or being received)
|
||||
* \return whether the frame received (or being received) is sent by an EMLSR client to start
|
||||
* an UL TXOP
|
||||
*/
|
||||
bool CheckEmlsrClientStartingTxop(const WifiMacHeader& hdr, const WifiTxVector& txVector);
|
||||
|
||||
/**
|
||||
* Generate an in-device interference of the given power on the given link for the given
|
||||
* duration.
|
||||
|
||||
@@ -176,6 +176,7 @@ FrameExchangeManager::SetWifiPhy(Ptr<WifiPhy> phy)
|
||||
m_phy->TraceConnectWithoutContext("PhyRxMacHeaderEnd",
|
||||
MakeCallback(&FrameExchangeManager::ReceivedMacHdr, this));
|
||||
m_phy->SetReceiveOkCallback(MakeCallback(&FrameExchangeManager::Receive, this));
|
||||
m_phy->SetReceiveErrorCallback(MakeCallback(&FrameExchangeManager::PsduRxError, this));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -197,6 +198,7 @@ FrameExchangeManager::ResetPhy()
|
||||
RxSignalInfo,
|
||||
WifiTxVector,
|
||||
std::vector<bool>>());
|
||||
m_phy->SetReceiveErrorCallback(MakeNullCallback<void, Ptr<const WifiPsdu>>());
|
||||
}
|
||||
m_phy = nullptr;
|
||||
m_ongoingRxInfo.macHdr.reset();
|
||||
@@ -1142,6 +1144,12 @@ FrameExchangeManager::NotifyOffNow()
|
||||
Reset();
|
||||
}
|
||||
|
||||
void
|
||||
FrameExchangeManager::PsduRxError(Ptr<const WifiPsdu> psdu)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << psdu);
|
||||
}
|
||||
|
||||
void
|
||||
FrameExchangeManager::Receive(Ptr<const WifiPsdu> psdu,
|
||||
RxSignalInfo rxSignalInfo,
|
||||
|
||||
@@ -360,6 +360,13 @@ class FrameExchangeManager : public Object
|
||||
*/
|
||||
virtual void NavResetTimeout();
|
||||
|
||||
/**
|
||||
* This method is called when the reception of a PSDU fails.
|
||||
*
|
||||
* \param psdu the PSDU whose reception failed
|
||||
*/
|
||||
virtual void PsduRxError(Ptr<const WifiPsdu> psdu);
|
||||
|
||||
/**
|
||||
* This method handles the reception of an MPDU (possibly included in an A-MPDU)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user