pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/15382


Change subject: gmm: Move code handling GMM PTMSI Realloc Complete to its own 
function
......................................................................

gmm: Move code handling GMM PTMSI Realloc Complete to its own function

Change-Id: I3b21a976c6683bea5419a33f0ccb8b56483d6e21
---
M src/sgsn/gprs_gmm.c
1 file changed, 17 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/82/15382/1

diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index ea6daae..399f7bf 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -1789,6 +1789,22 @@
        return 0;
 }

+/* 3GPP TS 24.008 § 9.4.8: P-TMSI reallocation complete */
+static int gsm48_rx_gmm_ptmsi_reall_compl(struct sgsn_mm_ctx *mmctx)
+{
+       LOGMMCTXP(LOGL_INFO, mmctx, "-> PTMSI REALLOCATION COMPLETE\n");
+       mmctx_timer_stop(mmctx, 3350);
+       mmctx->t3350_mode = GMM_T3350_MODE_NONE;
+       mmctx->p_tmsi_old = 0;
+       mmctx->pending_req = 0;
+       if (mmctx->ran_type == MM_CTX_T_GERAN_Gb) {
+               /* Unassign the old TLLI */
+               mmctx->gb.tlli = mmctx->gb.tlli_new;
+               //gprs_llgmm_assign(mmctx->gb.llme, TLLI_UNASSIGNED, 
mmctx->gb.tlli_new, GPRS_ALGO_GEA0, NULL);
+       }
+       return 0;
+}
+
 /* 3GPP TS 24.008 § 9.4.20 Service request.
  * In Iu, a UE in PMM-IDLE mode can use GSM48_MT_GMM_SERVICE_REQ to switch back
  * to PMM-CONNECTED mode. */
@@ -2032,17 +2048,7 @@
        case GSM48_MT_GMM_PTMSI_REALL_COMPL:
                if (!mmctx)
                        goto null_mmctx;
-               LOGMMCTXP(LOGL_INFO, mmctx, "-> PTMSI REALLOCATION COMPLETE\n");
-               mmctx_timer_stop(mmctx, 3350);
-               mmctx->t3350_mode = GMM_T3350_MODE_NONE;
-               mmctx->p_tmsi_old = 0;
-               mmctx->pending_req = 0;
-               if (mmctx->ran_type == MM_CTX_T_GERAN_Gb) {
-                       /* Unassign the old TLLI */
-                       mmctx->gb.tlli = mmctx->gb.tlli_new;
-                       //gprs_llgmm_assign(mmctx->gb.llme, TLLI_UNASSIGNED, 
mmctx->gb.tlli_new, GPRS_ALGO_GEA0, NULL);
-               }
-               rc = 0;
+               rc = gsm48_rx_gmm_ptmsi_reall_compl(mmctx);
                break;
        case GSM48_MT_GMM_AUTH_CIPH_RESP:
                if (!mmctx)

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15382
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I3b21a976c6683bea5419a33f0ccb8b56483d6e21
Gerrit-Change-Number: 15382
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to