wifi: EMLSR Manager relies on CAM for resetting backoffs when no PHY on link
This commit is contained in:
@@ -364,7 +364,7 @@ AdvancedEmlsrManager::DoNotifyTxopEnd(uint8_t linkId)
|
||||
!m_switchAuxPhy || m_mainPhySwitchInfo.end >= Simulator::Now(),
|
||||
"Aux PHY next link ID should have a value when interrupting a main PHY switch");
|
||||
uint8_t nextLinkId = m_switchAuxPhy ? m_mainPhySwitchInfo.from : GetMainPhyId();
|
||||
SwitchMainPhy(nextLinkId, false, DONT_RESET_BACKOFF, REQUEST_ACCESS, std::move(*traceInfo));
|
||||
SwitchMainPhy(nextLinkId, false, REQUEST_ACCESS, std::move(*traceInfo));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -381,11 +381,7 @@ AdvancedEmlsrManager::DoNotifyTxopEnd(uint8_t linkId)
|
||||
// no TXOP started on another link (which will require the main PHY to switch link)
|
||||
if (!GetEhtFem(linkId)->UsingOtherEmlsrLink())
|
||||
{
|
||||
SwitchMainPhy(GetMainPhyId(),
|
||||
false,
|
||||
DONT_RESET_BACKOFF,
|
||||
REQUEST_ACCESS,
|
||||
std::move(*traceInfo));
|
||||
SwitchMainPhy(GetMainPhyId(), false, REQUEST_ACCESS, std::move(*traceInfo));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -760,7 +756,6 @@ AdvancedEmlsrManager::SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex
|
||||
|
||||
SwitchMainPhy(linkId,
|
||||
false,
|
||||
RESET_BACKOFF,
|
||||
DONT_REQUEST_ACCESS,
|
||||
EmlsrUlTxopAuxPhyNotTxCapableTrace(aci, Time{0}, remNav));
|
||||
|
||||
@@ -917,7 +912,6 @@ AdvancedEmlsrManager::SwitchMainPhyIfTxopToBeGainedByAuxPhy(uint8_t linkId,
|
||||
|
||||
SwitchMainPhy(linkId,
|
||||
false,
|
||||
RESET_BACKOFF,
|
||||
DONT_REQUEST_ACCESS,
|
||||
EmlsrUlTxopAuxPhyNotTxCapableTrace(aci, delay, remNav));
|
||||
|
||||
|
||||
@@ -263,7 +263,6 @@ DefaultEmlsrManager::SwitchMainPhyBackToPreferredLink(uint8_t linkId,
|
||||
{
|
||||
SwitchMainPhy(GetMainPhyId(),
|
||||
false,
|
||||
DONT_RESET_BACKOFF,
|
||||
REQUEST_ACCESS,
|
||||
std::forward<EmlsrMainPhySwitchTrace>(traceInfo));
|
||||
}
|
||||
@@ -275,11 +274,7 @@ DefaultEmlsrManager::SwitchMainPhyBackToPreferredLink(uint8_t linkId,
|
||||
// require the main PHY to switch link)
|
||||
if (!GetEhtFem(linkId)->UsingOtherEmlsrLink())
|
||||
{
|
||||
SwitchMainPhy(GetMainPhyId(),
|
||||
false,
|
||||
DONT_RESET_BACKOFF,
|
||||
REQUEST_ACCESS,
|
||||
std::move(*info));
|
||||
SwitchMainPhy(GetMainPhyId(), false, REQUEST_ACCESS, std::move(*info));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -395,11 +390,7 @@ DefaultEmlsrManager::NotifyRtsSent(uint8_t linkId,
|
||||
|
||||
NS_LOG_DEBUG("Schedule main Phy switch in " << delay.As(Time::US));
|
||||
m_ulMainPhySwitch[linkId] = Simulator::Schedule(delay, [=, this]() {
|
||||
SwitchMainPhy(linkId,
|
||||
false,
|
||||
RESET_BACKOFF,
|
||||
DONT_REQUEST_ACCESS,
|
||||
EmlsrUlTxopRtsSentByAuxPhyTrace{});
|
||||
SwitchMainPhy(linkId, false, DONT_REQUEST_ACCESS, EmlsrUlTxopRtsSentByAuxPhyTrace{});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,6 @@ EmlsrManager::NotifyIcfReceived(uint8_t linkId)
|
||||
{
|
||||
SwitchMainPhy(linkId,
|
||||
true, // channel switch should occur instantaneously
|
||||
RESET_BACKOFF,
|
||||
DONT_REQUEST_ACCESS,
|
||||
EmlsrDlTxopIcfReceivedByAuxPhyTrace{});
|
||||
}
|
||||
@@ -873,12 +872,10 @@ EmlsrManager::SetCcaEdThresholdOnLinkSwitch(Ptr<WifiPhy> phy, uint8_t linkId)
|
||||
void
|
||||
EmlsrManager::SwitchMainPhy(uint8_t linkId,
|
||||
bool noSwitchDelay,
|
||||
bool resetBackoff,
|
||||
bool requestAccess,
|
||||
EmlsrMainPhySwitchTrace&& traceInfo)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << linkId << noSwitchDelay << resetBackoff << requestAccess
|
||||
<< traceInfo.GetName());
|
||||
NS_LOG_FUNCTION(this << linkId << noSwitchDelay << requestAccess << traceInfo.GetName());
|
||||
|
||||
auto mainPhy = m_staMac->GetDevice()->GetPhy(m_mainPhyId);
|
||||
|
||||
@@ -947,12 +944,6 @@ EmlsrManager::SwitchMainPhy(uint8_t linkId,
|
||||
m_staMac->NotifySwitchingEmlsrLink(mainPhy, linkId, timeToSwitchEnd);
|
||||
}
|
||||
|
||||
if (resetBackoff && currMainPhyLinkId.has_value())
|
||||
{
|
||||
// reset the backoffs on the link left by the main PHY
|
||||
m_staMac->GetChannelAccessManager(*currMainPhyLinkId)->ResetAllBackoffs();
|
||||
}
|
||||
|
||||
if (requestAccess)
|
||||
{
|
||||
// schedule channel access request on the new link when switch is completed
|
||||
@@ -1346,20 +1337,6 @@ EmlsrManager::ApplyMaxChannelWidthAndModClassOnAuxPhys()
|
||||
auxPhy->SetAttribute("ChannelSwitchDelay", TimeValue(Time{0}));
|
||||
auxPhy->SetOperatingChannel(channel);
|
||||
auxPhy->SetAttribute("ChannelSwitchDelay", TimeValue(delay));
|
||||
|
||||
// the way the ChannelAccessManager handles EMLSR link switch implies that a PHY listener
|
||||
// is removed when the channel switch starts and another one is attached when the channel
|
||||
// switch ends. In the meantime, no PHY is connected to the ChannelAccessManager. Thus,
|
||||
// reset all backoffs (so that access timeout is also cancelled) when the channel switch
|
||||
// starts and request channel access (if needed) when the channel switch ends.
|
||||
cam->ResetAllBackoffs();
|
||||
for (const auto& [acIndex, ac] : wifiAcList)
|
||||
{
|
||||
m_staMac->GetQosTxop(acIndex)->StartAccessAfterEvent(
|
||||
linkId,
|
||||
Txop::DIDNT_HAVE_FRAMES_TO_TRANSMIT,
|
||||
Txop::CHECK_MEDIUM_BUSY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -408,8 +408,6 @@ class EmlsrManager : public Object
|
||||
*
|
||||
* @param linkId the ID of the link on which the main PHY has to operate
|
||||
* @param noSwitchDelay whether switching delay should be zero
|
||||
* @param resetBackoff whether backoff should be reset on the link on which the main PHY
|
||||
* is operating
|
||||
* @param requestAccess whether channel access should be requested on the link on which the
|
||||
* main PHY is moving onto
|
||||
* @param traceInfo information to pass to the main PHY switch traced callback (the fromLinkId
|
||||
@@ -417,12 +415,9 @@ class EmlsrManager : public Object
|
||||
*/
|
||||
void SwitchMainPhy(uint8_t linkId,
|
||||
bool noSwitchDelay,
|
||||
bool resetBackoff,
|
||||
bool requestAccess,
|
||||
EmlsrMainPhySwitchTrace&& traceInfo);
|
||||
|
||||
static constexpr bool RESET_BACKOFF = true; //!< reset backoff on main PHY switch
|
||||
static constexpr bool DONT_RESET_BACKOFF = false; //!< do not reset backoff on main PHY switch
|
||||
static constexpr bool REQUEST_ACCESS = true; //!< request channel access when PHY switch ends
|
||||
static constexpr bool DONT_REQUEST_ACCESS =
|
||||
false; //!< do not request channel access when PHY switch ends
|
||||
|
||||
@@ -4923,7 +4923,6 @@ EmlsrCcaBusyTest::StartTraffic()
|
||||
m_staMacs[0]->GetEmlsrManager()->SwitchMainPhy(
|
||||
m_nextMainPhyLinkId,
|
||||
false,
|
||||
EmlsrManager::DONT_RESET_BACKOFF,
|
||||
EmlsrManager::DONT_REQUEST_ACCESS,
|
||||
EmlsrDlTxopIcfReceivedByAuxPhyTrace{}); // trace info not used
|
||||
|
||||
|
||||
Reference in New Issue
Block a user