[AMF] Remove ngap_send_amf_ue_context_release_command()

ngap_send_amf_ue_context_release_command() is unnecessary.
So, change ngap_send_amf_ue_context_release_command()
to ngap_send_ran_ue_context_release_command.
This commit is contained in:
Sukchan Lee
2024-08-15 18:32:11 +09:00
parent 37430970f7
commit 1a22479977
6 changed files with 8 additions and 43 deletions

View File

@@ -2522,7 +2522,8 @@ void gmm_state_exception(ogs_fsm_t *s, amf_event_t *e)
if (!AMF_SESSION_RELEASE_PENDING(amf_ue) &&
amf_sess_xact_count(amf_ue) == xact_count) {
r = ngap_send_amf_ue_context_release_command(amf_ue,
r = ngap_send_ran_ue_context_release_command(
ran_ue_find_by_id(amf_ue->ran_ue_id),
NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release,
NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0);
ogs_expect(r == OGS_OK);

View File

@@ -1626,7 +1626,7 @@ void ngap_handle_ue_context_release_request(
}
if (amf_sess_xact_count(amf_ue) == xact_count) {
r = ngap_send_amf_ue_context_release_command(amf_ue,
r = ngap_send_ran_ue_context_release_command(ran_ue,
Cause->present, (int)Cause->choice.radioNetwork,
NGAP_UE_CTX_REL_NG_REMOVE_AND_UNLINK, 0);
ogs_expect(r == OGS_OK);

View File

@@ -415,26 +415,6 @@ int ngap_send_ran_ue_context_release_command(
return rv;
}
int ngap_send_amf_ue_context_release_command(
amf_ue_t *amf_ue, NGAP_Cause_PR group, long cause,
uint8_t action, ogs_time_t duration)
{
int rv;
if (!amf_ue) {
ogs_error("UE(amf-ue) context has already been removed");
return OGS_NOTFOUND;
}
rv = ngap_send_ran_ue_context_release_command(
ran_ue_find_by_id(amf_ue->ran_ue_id),
group, cause, action, duration);
ogs_expect(rv == OGS_OK);
ogs_debug(" SUPI[%s]", amf_ue->supi);
return rv;
}
int ngap_send_paging(amf_ue_t *amf_ue)
{
ogs_pkbuf_t *ngapbuf = NULL;

View File

@@ -55,9 +55,6 @@ int ngap_send_ran_configuration_update_failure(
int ngap_send_ran_ue_context_release_command(
ran_ue_t *ran_ue, NGAP_Cause_PR group, long cause,
uint8_t action, ogs_time_t duration);
int ngap_send_amf_ue_context_release_command(
amf_ue_t *amf_ue, NGAP_Cause_PR group, long cause,
uint8_t action, ogs_time_t duration);
int ngap_send_paging(amf_ue_t *amf_ue);

View File

@@ -586,7 +586,7 @@ int amf_nsmf_pdusession_handle_update_sm_context(
ogs_warn("PDUSessionResourceSetupResponse(Unsuccessful)");
ogs_assert(amf_ue->deactivation.group);
r = ngap_send_amf_ue_context_release_command(amf_ue,
r = ngap_send_ran_ue_context_release_command(ran_ue,
amf_ue->deactivation.group,
amf_ue->deactivation.cause,
NGAP_UE_CTX_REL_NG_REMOVE_AND_UNLINK, 0);
@@ -624,7 +624,7 @@ int amf_nsmf_pdusession_handle_update_sm_context(
if (AMF_SESSION_SYNC_DONE(amf_ue, state)) {
ogs_assert(amf_ue->deactivation.group);
r = ngap_send_amf_ue_context_release_command(amf_ue,
r = ngap_send_ran_ue_context_release_command(ran_ue,
amf_ue->deactivation.group,
amf_ue->deactivation.cause,
NGAP_UE_CTX_REL_NG_REMOVE_AND_UNLINK, 0);
@@ -1188,20 +1188,7 @@ int amf_nsmf_pdusession_handle_release_sm_context(amf_sess_t *sess, int state)
if (AMF_SESSION_SYNC_DONE(amf_ue, state)) {
if (state == AMF_RELEASE_SM_CONTEXT_NG_CONTEXT_REMOVE) {
/*
* 1. Initial context setup failure
* 2. Release All SM contexts
* 3. UE Context release command
* 4. UE Context release complete
*/
r = ngap_send_amf_ue_context_release_command(amf_ue,
NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release,
NGAP_UE_CTX_REL_NG_CONTEXT_REMOVE, 0);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else if (state == AMF_RELEASE_SM_CONTEXT_REGISTRATION_ACCEPT) {
if (state == AMF_RELEASE_SM_CONTEXT_REGISTRATION_ACCEPT) {
/* Not reached here */
ogs_assert_if_reached();
@@ -1386,7 +1373,8 @@ int amf_nsmf_pdusession_handle_release_sm_context(amf_sess_t *sess, int state)
* 3. UE Context release command
* 4. UE Context release complete
*/
r = ngap_send_amf_ue_context_release_command(amf_ue,
r = ngap_send_ran_ue_context_release_command(
ran_ue_find_by_id(amf_ue->ran_ue_id),
NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release,
NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0);
ogs_expect(r == OGS_OK);

View File

@@ -58,7 +58,6 @@ bool amf_sbi_send_request(
#define AMF_UPDATE_SM_CONTEXT_HANDOVER_NOTIFY 23
#define AMF_UPDATE_SM_CONTEXT_HANDOVER_CANCEL 24
#define AMF_RELEASE_SM_CONTEXT_NO_STATE 31
#define AMF_RELEASE_SM_CONTEXT_NG_CONTEXT_REMOVE 32
#define AMF_RELEASE_SM_CONTEXT_REGISTRATION_ACCEPT 33
#define AMF_RELEASE_SM_CONTEXT_SERVICE_ACCEPT 34
#define AMF_REMOVE_S1_CONTEXT_BY_LO_CONNREFUSED 51