Commit 2342f910 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 8eb13e64
......@@ -446,7 +446,7 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg)
m_timers->t3519.stop();
m_timers->t3521.stop();
// .. and enter state 5GMM-DEREGISTERED.
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
void NasMm::receiveEapSuccessMessage(const eap::Eap &eap)
......
......@@ -18,6 +18,42 @@
namespace nr::ue
{
static EMmState GetMmStateFromSubState(EMmSubState subState)
{
switch (subState)
{
case EMmSubState::MM_NULL_PS:
return EMmState::MM_NULL;
case EMmSubState::MM_DEREGISTERED_PS:
case EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE:
case EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE:
case EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION:
case EMmSubState::MM_DEREGISTERED_PLMN_SEARCH:
case EMmSubState::MM_DEREGISTERED_NO_SUPI:
case EMmSubState::MM_DEREGISTERED_NO_CELL_AVAILABLE:
case EMmSubState::MM_DEREGISTERED_ECALL_INACTIVE:
case EMmSubState::MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED:
return EMmState::MM_DEREGISTERED;
case EMmSubState::MM_REGISTERED_INITIATED_PS:
return EMmState::MM_REGISTERED_INITIATED;
case EMmSubState::MM_REGISTERED_PS:
case EMmSubState::MM_REGISTERED_NORMAL_SERVICE:
case EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE:
case EMmSubState::MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE:
case EMmSubState::MM_REGISTERED_LIMITED_SERVICE:
case EMmSubState::MM_REGISTERED_PLMN_SEARCH:
case EMmSubState::MM_REGISTERED_NO_CELL_AVAILABLE:
case EMmSubState::MM_REGISTERED_UPDATE_NEEDED:
return EMmState::MM_REGISTERED;
case EMmSubState::MM_DEREGISTERED_INITIATED_PS:
return EMmState::MM_DEREGISTERED_INITIATED;
case EMmSubState::MM_SERVICE_REQUEST_INITIATED_PS:
return EMmState::MM_SERVICE_REQUEST_INITIATED;
}
std::terminate();
}
NasMm::NasMm(TaskBase *base, UeTimers *timers) : m_base{base}, m_timers{timers}, m_sm{}, m_usim{}
{
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "nas");
......@@ -25,7 +61,7 @@ NasMm::NasMm(TaskBase *base, UeTimers *timers) : m_base{base}, m_timers{timers},
m_rmState = ERmState::RM_DEREGISTERED;
m_cmState = ECmState::CM_IDLE;
m_mmState = EMmState::MM_DEREGISTERED;
m_mmSubState = EMmSubState::MM_DEREGISTERED_NA;
m_mmSubState = EMmSubState::MM_DEREGISTERED_PS;
m_storage = new MmStorage(m_base);
}
......@@ -57,9 +93,9 @@ void NasMm::performMmCycle()
if (switchToECallInactivityIfNeeded())
return;
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_NA)
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_PS)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
return;
}
else if (m_mmSubState == EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE)
......@@ -106,9 +142,9 @@ void NasMm::performMmCycle()
if (startECallInactivityIfNeeded())
return;
if (m_mmSubState == EMmSubState::MM_REGISTERED_NA)
if (m_mmSubState == EMmSubState::MM_REGISTERED_PS)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
return;
}
else if (m_mmSubState == EMmSubState::MM_REGISTERED_NORMAL_SERVICE)
......@@ -160,8 +196,10 @@ void NasMm::performMmCycle()
}
}
void NasMm::switchMmState(EMmState state, EMmSubState subState)
void NasMm::switchMmState(EMmSubState subState)
{
EMmState state = GetMmStateFromSubState(subState);
ERmState oldRmState = m_rmState;
if (state == EMmState::MM_DEREGISTERED || state == EMmState::MM_REGISTERED_INITIATED)
m_rmState = ERmState::RM_DEREGISTERED;
......@@ -298,7 +336,7 @@ void NasMm::onSwitchCmState(ECmState oldState, ECmState newState)
if (regType == nas::ERegistrationType::INITIAL_REGISTRATION ||
regType == nas::ERegistrationType::EMERGENCY_REGISTRATION)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
switchUState(E5UState::U2_NOT_UPDATED);
handleAbnormalInitialRegFailure(regType);
......@@ -315,12 +353,12 @@ void NasMm::onSwitchCmState(ECmState oldState, ECmState newState)
// if the de-registration procedure was performed due to disabling of 5GS services, the UE shall enter the
// 5GMM-NULL state;
if (m_lastDeregCause == EDeregCause::DISABLE_5G)
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
// if the de-registration type "normal de-registration" was requested for reasons other than disabling of
// 5GS services, the UE shall enter the 5GMM-DEREGISTERED state.
else if (m_lastDeregistrationRequest->deRegistrationType.switchOff ==
nas::ESwitchOff::NORMAL_DE_REGISTRATION)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
// If the UE enters the 5GMM-IDLE, the RAND and RES* values stored
......
......@@ -79,10 +79,10 @@ void NasMm::sendDeregistration(EDeregCause deregCause)
m_sm->localReleaseAllSessions();
if (m_lastDeregistrationRequest->deRegistrationType.switchOff == nas::ESwitchOff::NORMAL_DE_REGISTRATION)
switchMmState(EMmState::MM_DEREGISTERED_INITIATED, EMmSubState::MM_DEREGISTERED_INITIATED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_INITIATED_PS);
else
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
}
......@@ -90,7 +90,7 @@ void NasMm::receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOrigina
{
m_logger->debug("De-registration accept received");
if (m_mmSubState != EMmSubState::MM_DEREGISTERED_INITIATED_NA)
if (m_mmState != EMmState::MM_DEREGISTERED_INITIATED)
{
m_logger->warn("De-registration accept message ignored. UE is not in MM_DEREGISTERED_INITIATED");
sendMmStatus(nas::EMmCause::MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE);
......@@ -105,9 +105,9 @@ void NasMm::receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOrigina
m_sm->localReleaseAllSessions();
if (m_lastDeregCause == EDeregCause::DISABLE_5G)
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
else
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
m_logger->info("De-registration is successful");
}
......@@ -203,7 +203,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
m_usim->m_nonCurrentNsCtx = {};
switchUState(E5UState::U2_NOT_UPDATED);
m_timers->t3502.start();
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
};
// "If the de-registration type indicates "re-registration not required", the UE shall take the actions depending on
......@@ -258,19 +258,19 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
}
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::ROAMING_NOT_ALLOWED_IN_TA)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
if (cause == nas::EMmCause::TA_NOT_ALLOWED || cause == nas::EMmCause::NO_SUITIBLE_CELLS_IN_TA)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
if (cause == nas::EMmCause::CONGESTION)
{
m_timers->t3346.stop();
switchUState(E5UState::U2_NOT_UPDATED);
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
switchMmState(EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
if (msg.t3346Value.has_value() && nas::utils::HasValue(*msg.t3346Value))
m_timers->t3346.start(*msg.t3346Value);
......@@ -278,7 +278,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
if (cause == nas::EMmCause::N1_MODE_NOT_ALLOWED)
{
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
setN1Capability(false);
}
......
......@@ -95,7 +95,7 @@ bool NasMm::switchToECallInactivityIfNeeded()
m_usim->m_nonCurrentNsCtx = {};
// Perform item d) in 5.5.3
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_ECALL_INACTIVE);
switchMmState(EMmSubState::MM_DEREGISTERED_ECALL_INACTIVE);
return true;
}
......
......@@ -79,7 +79,7 @@ class NasMm
private: /* Base */
void triggerMmCycle();
void performMmCycle();
void switchMmState(EMmState state, EMmSubState subState);
void switchMmState(EMmSubState subState);
void switchCmState(ECmState state);
void switchUState(E5UState state);
void onSwitchMmState(EMmState oldState, EMmState newState, EMmSubState oldSubState, EMmSubState newSubSate);
......
......@@ -28,12 +28,12 @@ void NasMm::performPlmnSelection()
{
if (m_mmSubState == EMmSubState::MM_REGISTERED_PLMN_SEARCH)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NO_CELL_AVAILABLE);
switchMmState(EMmSubState::MM_REGISTERED_NO_CELL_AVAILABLE);
return;
}
else if (m_mmSubState == EMmSubState::MM_DEREGISTERED_PLMN_SEARCH)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NO_CELL_AVAILABLE);
switchMmState(EMmSubState::MM_DEREGISTERED_NO_CELL_AVAILABLE);
return;
}
}
......@@ -128,16 +128,16 @@ void NasMm::performPlmnSelection()
if (cellCategory == ECellCategory::SUITABLE_CELL)
{
if (m_mmState == EMmState::MM_REGISTERED)
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
else
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
}
else
{
if (m_mmState == EMmState::MM_REGISTERED)
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
else
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
}
}
}
......@@ -201,9 +201,9 @@ void NasMm::handleRadioLinkFailure()
handleRrcConnectionRelease();
if (m_mmState == EMmState::MM_REGISTERED)
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NA);
switchMmState(EMmSubState::MM_REGISTERED_PS);
else if (m_mmState == EMmState::MM_DEREGISTERED)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
void NasMm::localReleaseConnection()
......
......@@ -51,7 +51,7 @@ void NasMm::sendInitialRegistration(EInitialRegCause regCause)
m_usim->m_currentNsCtx = {};
// Switch MM state
switchMmState(EMmState::MM_REGISTERED_INITIATED, EMmSubState::MM_REGISTERED_INITIATED_NA);
switchMmState(EMmSubState::MM_REGISTERED_INITIATED_PS);
// Prepare requested NSSAI
bool isDefaultNssai{};
......@@ -140,7 +140,7 @@ void NasMm::sendMobilityRegistration(ERegUpdateCause updateCause)
ToJson(updateCause).str().c_str());
// Switch state
switchMmState(EMmState::MM_REGISTERED_INITIATED, EMmSubState::MM_REGISTERED_INITIATED_NA);
switchMmState(EMmSubState::MM_REGISTERED_INITIATED_PS);
// Prepare FOR pending field
nas::EFollowOnRequest followOn = nas::EFollowOnRequest::FOR_PENDING;
......@@ -251,7 +251,7 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
// Upon receipt of the REGISTRATION ACCEPT message, the UE shall reset the registration attempt counter, enter state
// 5GMM-REGISTERED and set the 5GS update status to 5U1 UPDATED.
resetRegAttemptCounter();
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
switchUState(E5UState::U1_UPDATED);
// If the REGISTRATION ACCEPT message included a T3512 value IE, the UE shall use the value in the T3512 value IE as
......@@ -361,7 +361,7 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
// request attempt counter, enter state 5GMM-REGISTERED and set the 5GS update status to 5U1 UPDATED."
resetRegAttemptCounter();
m_serCounter = 0;
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
switchUState(E5UState::U1_UPDATED);
// "If the ACCEPT message included a T3512 value IE, the UE shall use the value in T3512 value IE as
......@@ -528,24 +528,24 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if (cause == nas::EMmCause::ILLEGAL_UE || cause == nas::EMmCause::ILLEGAL_ME ||
cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
if (cause == nas::EMmCause::TA_NOT_ALLOWED || cause == nas::EMmCause::ROAMING_NOT_ALLOWED_IN_TA ||
cause == nas::EMmCause::NO_SUITIBLE_CELLS_IN_TA)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
}
if (cause == nas::EMmCause::N1_MODE_NOT_ALLOWED)
{
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
setN1Capability(false);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::TA_NOT_ALLOWED ||
......@@ -583,7 +583,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if (msg.t3346value.has_value() && nas::utils::HasValue(*msg.t3346value))
{
switchUState(E5UState::U2_NOT_UPDATED);
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
switchMmState(EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
m_timers->t3346.stop();
if (msg.sht != nas::ESecurityHeaderType::NOT_PROTECTED)
......@@ -609,7 +609,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
else if (regType == nas::ERegistrationType::EMERGENCY_REGISTRATION)
{
if (cause == nas::EMmCause::PEI_NOT_ACCEPTED)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NO_SUPI);
switchMmState(EMmSubState::MM_DEREGISTERED_NO_SUPI);
else
{
// Spec says that upper layers should be informed as well, for additional action for emergency
......@@ -688,29 +688,29 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED ||
cause == nas::EMmCause::UE_IDENTITY_CANNOT_BE_DERIVED_FROM_NETWORK)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
if (cause == nas::EMmCause::IMPLICITY_DEREGISTERED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
}
if (cause == nas::EMmCause::TA_NOT_ALLOWED || cause == nas::EMmCause::ROAMING_NOT_ALLOWED_IN_TA ||
cause == nas::EMmCause::NO_SUITIBLE_CELLS_IN_TA)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
}
if (cause == nas::EMmCause::N1_MODE_NOT_ALLOWED)
{
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
setN1Capability(false);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::TA_NOT_ALLOWED ||
......@@ -749,7 +749,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
if (!hasEmergency())
{
switchUState(E5UState::U2_NOT_UPDATED);
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
switchMmState(EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
}
m_timers->t3346.stop();
......@@ -803,7 +803,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
if (!hasEmergency())
{
m_timers->t3511.start();
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
switchMmState(EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
}
}
else
......@@ -823,7 +823,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
// 5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION or optionally to 5GMM-DEREGISTERED.PLMN-SEARCH in order to perform
// a PLMN selection according to 3GPP TS 23.122 [5].
switchUState(E5UState::U2_NOT_UPDATED);
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
switchMmState(EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION);
}
}
......@@ -851,7 +851,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
// procedure is triggered again"
m_timers->t3511.start(); // todo
switchUState(E5UState::U2_NOT_UPDATED);
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE);
switchMmState(EMmSubState::MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE);
}
// "If the TAI of the current serving cell is included in the TAI list, the 5GS update status is equal to 5U1
......@@ -860,7 +860,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
if (includedInTaiList && m_usim->m_uState == E5UState::U1_UPDATED)
{
// "The UE shall keep the 5GS update status to 5U1 UPDATED and enter state 5GMM-REGISTERED.NORMAL-SERVICE."
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
// "The UE shall start timer T3511"
m_timers->t3511.start();
}
......@@ -874,7 +874,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
// "The UE shall delete the list of equivalent PLMNs and shall change to state
// 5GMM-REGISTERED.ATTEMPTING-REGISTRATION-UPDATE UPDATE"
m_usim->m_equivalentPlmnList = {};
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE);
switchMmState(EMmSubState::MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE);
}
}
......
......@@ -159,7 +159,7 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause)
m_lastServiceRequest = std::move(request);
m_lastServiceReqCause = reqCause;
m_timers->t3517.start();
switchMmState(EMmState::MM_SERVICE_REQUEST_INITIATED, EMmSubState::MM_SERVICE_REQUEST_INITIATED_NA);
switchMmState(EMmSubState::MM_SERVICE_REQUEST_INITIATED_PS);
}
void NasMm::receiveServiceAccept(const nas::ServiceAccept &msg)
......@@ -176,7 +176,7 @@ void NasMm::receiveServiceAccept(const nas::ServiceAccept &msg)
m_logger->info("Service Accept received");
m_serCounter = 0;
m_timers->t3517.stop();
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NA);
switchMmState(EMmSubState::MM_REGISTERED_PS);
}
else
{
......@@ -245,7 +245,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
auto handleAbnormalCase = [this]() {
m_logger->debug("Handling Service Reject abnormal case");
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NA);
switchMmState(EMmSubState::MM_REGISTERED_PS);
m_timers->t3517.stop();
};
......@@ -342,37 +342,37 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
cause == nas::EMmCause::FIVEG_SERVICES_NOT_ALLOWED ||
cause == nas::EMmCause::UE_IDENTITY_CANNOT_BE_DERIVED_FROM_NETWORK)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
if (cause == nas::EMmCause::IMPLICITY_DEREGISTERED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
}
if (cause == nas::EMmCause::PLMN_NOT_ALLOWED || cause == nas::EMmCause::SERVING_NETWORK_NOT_AUTHORIZED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
}
if (cause == nas::EMmCause::TA_NOT_ALLOWED)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
}
if (cause == nas::EMmCause::ROAMING_NOT_ALLOWED_IN_TA)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_PLMN_SEARCH);
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
}
if (cause == nas::EMmCause::NO_SUITIBLE_CELLS_IN_TA)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
}
if (cause == nas::EMmCause::N1_MODE_NOT_ALLOWED)
{
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
setN1Capability(false);
}
......@@ -394,7 +394,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
{
if (!hasEmergency())
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NA);
switchMmState(EMmSubState::MM_REGISTERED_PS);
m_timers->t3517.stop();
}
......@@ -414,7 +414,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if (cause == nas::EMmCause::RESTRICTED_SERVICE_AREA)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE);
if (m_lastServiceRequest->serviceType.serviceType != nas::EServiceType::ELEVATED_SIGNALLING)
sendMobilityRegistration(ERegUpdateCause::RESTRICTED_SERVICE_AREA);
......
......@@ -53,7 +53,7 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
// The UE shall abort the registration procedure for initial registration and the NAS signalling
// connection, if any, shall be released locally if the initial registration request is not for
// emergency services..
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
switchUState(E5UState::U2_NOT_UPDATED);
if (m_lastRegistrationRequest->registrationType.registrationType !=
......@@ -95,7 +95,7 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
{
logExpired();
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NA);
switchMmState(EMmSubState::MM_REGISTERED_PS);
if (m_cmState == ECmState::CM_IDLE && m_lastServiceReqCause != EServiceReqCause::EMERGENCY_FALLBACK)
{
......@@ -129,10 +129,10 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
m_logger->debug("De-registration aborted");
if (m_lastDeregCause == EDeregCause::DISABLE_5G)
switchMmState(EMmState::MM_NULL, EMmSubState::MM_NULL_NA);
switchMmState(EMmSubState::MM_NULL_PS);
else if (m_lastDeregistrationRequest->deRegistrationType.switchOff ==
nas::ESwitchOff::NORMAL_DE_REGISTRATION)
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NA);
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
}
else
......
......@@ -82,7 +82,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg)
case nas::EMmCause::RESTRICTED_SERVICE_AREA: {
if (m_rmState == ERmState::RM_REGISTERED)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE);
switchMmState(EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE);
sendMobilityRegistration(ERegUpdateCause::RESTRICTED_SERVICE_AREA);
}
m_sm->receiveForwardingFailure(smMessage, msg.mmCause->value, std::nullopt);
......
......@@ -87,10 +87,10 @@ Json ToJson(const EMmSubState &state)
{
switch (state)
{
case EMmSubState::MM_NULL_NA:
case EMmSubState::MM_NULL_PS:
return "MM-NULL";
case EMmSubState::MM_DEREGISTERED_NA:
return "MM-DEREGISTERED/NA";
case EMmSubState::MM_DEREGISTERED_PS:
return "MM-DEREGISTERED/PS";
case EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE:
return "MM-DEREGISTERED/NORMAL-SERVICE";
case EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE:
......@@ -107,10 +107,10 @@ Json ToJson(const EMmSubState &state)
return "MM-DEREGISTERED/ECALL-INACTIVE";
case EMmSubState::MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED:
return "MM-DEREGISTERED/INITIAL-REGISTRATION-NEEDED";
case EMmSubState::MM_REGISTERED_INITIATED_NA:
case EMmSubState::MM_REGISTERED_INITIATED_PS:
return "MM-REGISTER-INITIATED";
case EMmSubState::MM_REGISTERED_NA:
return "MM-REGISTERED/NA";
case EMmSubState::MM_REGISTERED_PS:
return "MM-REGISTERED/PS";
case EMmSubState::MM_REGISTERED_NORMAL_SERVICE:
return "MM-REGISTERED/NORMAL-SERVICE";
case EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE:
......@@ -125,9 +125,9 @@ Json ToJson(const EMmSubState &state)
return "MM-REGISTERED/NO-CELL-AVAILABLE";
case EMmSubState::MM_REGISTERED_UPDATE_NEEDED:
return "MM-REGISTERED/UPDATE-NEEDED";
case EMmSubState::MM_DEREGISTERED_INITIATED_NA:
case EMmSubState::MM_DEREGISTERED_INITIATED_PS:
return "MM-DEREGISTER-INITIATED";
case EMmSubState::MM_SERVICE_REQUEST_INITIATED_NA:
case EMmSubState::MM_SERVICE_REQUEST_INITIATED_PS:
return "MM-SERVICE-REQUEST-INITIATED";
default:
return "?";
......
......@@ -259,9 +259,9 @@ enum class EMmState
enum class EMmSubState
{
MM_NULL_NA,
MM_NULL_PS,
MM_DEREGISTERED_NA,
MM_DEREGISTERED_PS,
MM_DEREGISTERED_NORMAL_SERVICE,
MM_DEREGISTERED_LIMITED_SERVICE,
MM_DEREGISTERED_ATTEMPTING_REGISTRATION,
......@@ -271,9 +271,9 @@ enum class EMmSubState
MM_DEREGISTERED_ECALL_INACTIVE,
MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED,
MM_REGISTERED_INITIATED_NA,
MM_REGISTERED_INITIATED_PS,
MM_REGISTERED_NA,
MM_REGISTERED_PS,
MM_REGISTERED_NORMAL_SERVICE,
MM_REGISTERED_NON_ALLOWED_SERVICE,
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE,
......@@ -282,9 +282,9 @@ enum class EMmSubState
MM_REGISTERED_NO_CELL_AVAILABLE,
MM_REGISTERED_UPDATE_NEEDED,
MM_DEREGISTERED_INITIATED_NA,
MM_DEREGISTERED_INITIATED_PS,
MM_SERVICE_REQUEST_INITIATED_NA
MM_SERVICE_REQUEST_INITIATED_PS
};
enum class EPsState
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment