Commit 04899872 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 9b36a7da
...@@ -86,31 +86,27 @@ void NasMm::triggerMmCycle() ...@@ -86,31 +86,27 @@ void NasMm::triggerMmCycle()
void NasMm::performMmCycle() void NasMm::performMmCycle()
{ {
/* Do nothing in case of MM-NULL */
if (m_mmState == EMmState::MM_NULL) if (m_mmState == EMmState::MM_NULL)
return; return;
if (m_sm->anyUplinkDataPending() && missingSessionBearer()) auto currentCell = m_base->shCtx.currentCell.get();
serviceNeededForUplinkData(); Tai currentTai = Tai{currentCell.plmn, currentCell.tac};
if (m_mmState == EMmState::MM_DEREGISTERED)
{
if (switchToECallInactivityIfNeeded())
return;
/* Perform substate selection in case of primary substate */
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_PS) if (m_mmSubState == EMmSubState::MM_DEREGISTERED_PS)
{ {
if (m_cmState == ECmState::CM_IDLE) if (m_cmState == ECmState::CM_IDLE)
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH); switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
else else
{ {
auto cell = m_base->shCtx.currentCell.get(); if (currentCell.hasValue())
if (cell.hasValue())
{ {
if (!m_usim->isValid()) if (!m_usim->isValid())
switchMmState(EMmSubState::MM_DEREGISTERED_NO_SUPI); switchMmState(EMmSubState::MM_DEREGISTERED_NO_SUPI);
else if (cell.category == ECellCategory::SUITABLE_CELL) else if (currentCell.category == ECellCategory::SUITABLE_CELL)
switchMmState(EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE); switchMmState(EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
else if (cell.category == ECellCategory::ACCEPTABLE_CELL) else if (currentCell.category == ECellCategory::ACCEPTABLE_CELL)
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE); switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
else else
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH); switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
...@@ -122,7 +118,51 @@ void NasMm::performMmCycle() ...@@ -122,7 +118,51 @@ void NasMm::performMmCycle()
} }
return; return;
} }
else if (m_mmSubState == EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE)
if (m_mmSubState == EMmSubState::MM_REGISTERED_PS)
{
if (m_cmState == ECmState::CM_IDLE)
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
else
{
auto cell = m_base->shCtx.currentCell.get();
if (cell.hasValue())
{
if (cell.category == ECellCategory::SUITABLE_CELL)
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
else if (cell.category == ECellCategory::ACCEPTABLE_CELL)
switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
else
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
}
else
{
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
}
}
return;
}
/* Check for uplink data pending */
if (m_sm->anyUplinkDataPending() && missingSessionBearer())
serviceNeededForUplinkData();
/* Process TAI changes if any */
if (!nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{currentTai}))
{
if (m_rmState == ERmState::RM_REGISTERED)
sendMobilityRegistration(ERegUpdateCause::ENTER_UNLISTED_TRACKING_AREA);
}
else
m_storage->lastVisitedRegisteredTai->set(currentTai);
/* Other operations */
if (m_mmState == EMmState::MM_DEREGISTERED)
{
if (switchToECallInactivityIfNeeded())
return;
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE)
{ {
if (!m_timers->t3346.isRunning()) if (!m_timers->t3346.isRunning())
sendInitialRegistration(EInitialRegCause::MM_DEREG_NORMAL_SERVICE); sendInitialRegistration(EInitialRegCause::MM_DEREG_NORMAL_SERVICE);
...@@ -166,30 +206,7 @@ void NasMm::performMmCycle() ...@@ -166,30 +206,7 @@ void NasMm::performMmCycle()
if (startECallInactivityIfNeeded()) if (startECallInactivityIfNeeded())
return; return;
if (m_mmSubState == EMmSubState::MM_REGISTERED_PS) if (m_mmSubState == EMmSubState::MM_REGISTERED_NORMAL_SERVICE)
{
if (m_cmState == ECmState::CM_IDLE)
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
else
{
auto cell = m_base->shCtx.currentCell.get();
if (cell.hasValue())
{
if (cell.category == ECellCategory::SUITABLE_CELL)
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
else if (cell.category == ECellCategory::ACCEPTABLE_CELL)
switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
else
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
}
else
{
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
}
}
return;
}
else if (m_mmSubState == EMmSubState::MM_REGISTERED_NORMAL_SERVICE)
{ {
return; return;
} }
......
...@@ -194,11 +194,6 @@ void NasMm::handleActiveCellChange(const Tai &prevTai) ...@@ -194,11 +194,6 @@ void NasMm::handleActiveCellChange(const Tai &prevTai)
switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE); switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
else else
switchMmState(EMmSubState::MM_REGISTERED_PS); switchMmState(EMmSubState::MM_REGISTERED_PS);
if (!nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{currentTai}))
sendMobilityRegistration(ERegUpdateCause::ENTER_UNLISTED_TRACKING_AREA);
else
m_storage->lastVisitedRegisteredTai->set(currentTai);
} }
} }
else if (m_mmState == EMmState::MM_DEREGISTERED) else if (m_mmState == EMmState::MM_DEREGISTERED)
...@@ -219,9 +214,6 @@ void NasMm::handleActiveCellChange(const Tai &prevTai) ...@@ -219,9 +214,6 @@ void NasMm::handleActiveCellChange(const Tai &prevTai)
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE); switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
else else
switchMmState(EMmSubState::MM_DEREGISTERED_PS); switchMmState(EMmSubState::MM_DEREGISTERED_PS);
if (nas::utils::TaiListContains(m_storage->taiList->get(), nas::VTrackingAreaIdentity{currentTai}))
m_storage->lastVisitedRegisteredTai->set(currentTai);
} }
} }
else if (m_mmState == EMmState::MM_REGISTERED_INITIATED || m_mmState == EMmState::MM_DEREGISTERED_INITIATED || else if (m_mmState == EMmState::MM_REGISTERED_INITIATED || m_mmState == EMmState::MM_DEREGISTERED_INITIATED ||
......
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