This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/741 IuPS: Introduce function to change PMM state This is where IuPS will redirect GTP-U endpoints in a subsequent commit. Also add comprehensive logging of pmm_state transitions. Change-Id: I7c2cd1abc1805659b01dffffff31c49fe5161086 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 29 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/41/741/1 diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 82f7f79..d94217b 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -109,6 +109,29 @@ static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx); +void mmctx_set_pmm_state(struct sgsn_mm_ctx *ctx, enum gprs_pmm_state state) +{ + if (ctx->pmm_state == state) + return; + + LOGMMCTXP(LOGL_INFO, ctx, "Changing PMM state from %i to %i\n", ctx->pmm_state, state); + + if (ctx->ran_type == MM_CTX_T_UTRAN_Iu) + { + switch (state) { + case PMM_IDLE: + /* TODO: Change GTP-U endpoints to SGSN, start RA Upd timer */ + break; + case PMM_CONNECTED: + break; + default: + break; + } + } + + ctx->pmm_state = state; +} + #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) @@ -132,7 +155,7 @@ /* Clean up ue_conn_ctx here */ LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); if (mm->pmm_state == PMM_CONNECTED) - mm->pmm_state = PMM_IDLE; + mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; case IU_EVENT_SECURITY_MODE_COMPLETE: @@ -241,7 +264,8 @@ /* Mark MM state as deregistered */ ctx->mm_state = GMM_DEREGISTERED; - ctx->pmm_state = PMM_DETACHED; + + mmctx_set_pmm_state(ctx, PMM_DETACHED); sgsn_mm_ctx_cleanup_free(ctx); } @@ -852,9 +876,8 @@ return gsm48_tx_gmm_att_ack(ctx); #ifdef BUILD_IU case GSM48_MT_GMM_SERVICE_REQ: - /* TODO: PMM State transition */ ctx->pending_req = 0; - ctx->pmm_state = PMM_CONNECTED; + mmctx_set_pmm_state(ctx, PMM_CONNECTED); rc = gsm48_tx_gmm_service_ack(ctx); if (ctx->iu.service.type != GPRS_SERVICE_T_SIGNALLING) @@ -1792,7 +1815,7 @@ mmctx->gb.tlli_new); } mmctx->mm_state = GMM_REGISTERED_NORMAL; - mmctx->pmm_state = PMM_CONNECTED; + mmctx_set_pmm_state(mmctx, PMM_CONNECTED); rc = 0; memset(&sig_data, 0, sizeof(sig_data)); @@ -1815,7 +1838,7 @@ mmctx->gb.tlli_new); } mmctx->mm_state = GMM_REGISTERED_NORMAL; - mmctx->pmm_state = PMM_CONNECTED; + mmctx_set_pmm_state(mmctx, PMM_CONNECTED); rc = 0; memset(&sig_data, 0, sizeof(sig_data)); -- To view, visit https://gerrit.osmocom.org/741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c2cd1abc1805659b01dffffff31c49fe5161086 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de> Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>