diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-10-28 16:23:46 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-11-14 09:12:10 +0100 |
commit | 0074a77424c95d2d7d0608dc0dfabc1948e62fe0 (patch) | |
tree | 13b91adf9c7e8620b94cdb1908f74b73dffe4f0d /openbsc/src/gprs/gprs_gmm.c | |
parent | 93eae8ec78d145cf87b7858ebee60c72da7a2d20 (diff) |
sgsn: Cleanup GMM state transitions
Currently the GMM state is set to GMM-REGISTERED when an Attach
Accept or a RA Update Accept message is sent, even if a new P-TMSI is
included. In this case 04.08 requires (see 4.7.3.1.3 and 4.7.5.1.3),
that the state is set to GMM-COMMON-PROCEDURE-INITIATED when the
Accept is sent. When the Complete is received, the SGSN shall set
the state to GMM-REGISTERED.
This patch modifies the state updates accordingly.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gprs_gmm.c')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index e661b4875..9f34b4ded 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -629,13 +629,11 @@ static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx) { /* Request IMSI and IMEI from the MS if they are unknown */ if (!strlen(ctx->imei)) { - ctx->mm_state = GMM_COMMON_PROC_INIT; ctx->t3370_id_type = GSM_MI_TYPE_IMEI; mmctx_timer_start(ctx, 3370, GSM0408_T3370_SECS); return gsm48_tx_gmm_id_req(ctx, GSM_MI_TYPE_IMEI); } if (!strlen(ctx->imsi)) { - ctx->mm_state = GMM_COMMON_PROC_INIT; ctx->t3370_id_type = GSM_MI_TYPE_IMSI; mmctx_timer_start(ctx, 3370, GSM0408_T3370_SECS); return gsm48_tx_gmm_id_req(ctx, GSM_MI_TYPE_IMSI); @@ -655,9 +653,10 @@ static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx) /* Start T3350 and re-transmit up to 5 times until ATTACH COMPLETE */ mmctx_timer_start(ctx, 3350, GSM0408_T3350_SECS); ctx->t3350_mode = GMM_T3350_MODE_ATT; +#else + ctx->mm_state = GMM_REGISTERED_NORMAL; #endif - ctx->mm_state = GMM_REGISTERED_NORMAL; return gsm48_tx_gmm_att_ack(ctx); default: LOGMMCTXP(LOGL_ERROR, ctx, @@ -860,6 +859,7 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg, /* Allocate a new P-TMSI (+ P-TMSI signature) and update TLLI */ ctx->p_tmsi_old = ctx->p_tmsi; ctx->p_tmsi = sgsn_alloc_ptmsi(); + ctx->mm_state = GMM_COMMON_PROC_INIT; #endif /* Even if there is no P-TMSI allocated, the MS will switch from * foreign TLLI to local TLLI */ @@ -1078,6 +1078,11 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, /* Start T3350 and re-transmit up to 5 times until ATTACH COMPLETE */ mmctx->t3350_mode = GMM_T3350_MODE_RAU; mmctx_timer_start(mmctx, 3350, GSM0408_T3350_SECS); + + mmctx->mm_state = GMM_COMMON_PROC_INIT; +#else + /* Make sure we are NORMAL (i.e. not SUSPENDED anymore) */ + mmctx->mm_state = GMM_REGISTERED_NORMAL; #endif /* Even if there is no P-TMSI allocated, the MS will switch from * foreign TLLI to local TLLI */ @@ -1094,9 +1099,6 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, process_ms_ctx_status(mmctx, pdp_status); } - /* Make sure we are NORMAL (i.e. not SUSPENDED anymore) */ - mmctx->mm_state = GMM_REGISTERED_NORMAL; - /* Send RA UPDATE ACCEPT */ return gsm48_tx_gmm_ra_upd_ack(mmctx); } @@ -1189,6 +1191,7 @@ static int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg, mmctx->tlli = mmctx->tlli_new; gprs_llgmm_assign(mmctx->llme, 0xffffffff, mmctx->tlli_new, GPRS_ALGO_GEA0, NULL); + mmctx->mm_state = GMM_REGISTERED_NORMAL; rc = 0; break; case GSM48_MT_GMM_RA_UPD_COMPL: @@ -1202,6 +1205,7 @@ static int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg, mmctx->tlli = mmctx->tlli_new; gprs_llgmm_assign(mmctx->llme, 0xffffffff, mmctx->tlli_new, GPRS_ALGO_GEA0, NULL); + mmctx->mm_state = GMM_REGISTERED_NORMAL; rc = 0; break; case GSM48_MT_GMM_PTMSI_REALL_COMPL: |