pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32984 )
Change subject: gmm: Provide rlcmac with IMSI & PTMSI information ......................................................................
gmm: Provide rlcmac with IMSI & PTMSI information
This information will be needed once the GRR layer starts listening for paging requests, which identify MS by either PTMSI or IMSI.
Change-Id: I3a0c4a57c3d624c3ebb40ae2cc0c96626ccc2c99 --- M include/osmocom/gprs/gmm/gmm_prim.h M include/osmocom/gprs/rlcmac/gre.h M include/osmocom/gprs/rlcmac/rlcmac_prim.h M src/gmm/gmm.c M src/rlcmac/gre.c M src/rlcmac/rlcmac_prim.c 6 files changed, 30 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/84/32984/1
diff --git a/include/osmocom/gprs/gmm/gmm_prim.h b/include/osmocom/gprs/gmm/gmm_prim.h index 4b8657f..b774ef8 100644 --- a/include/osmocom/gprs/gmm/gmm_prim.h +++ b/include/osmocom/gprs/gmm/gmm_prim.h @@ -185,6 +185,8 @@ /* OSMO_GPRS_GMM_GMMRR_ASSIGN | Req */ struct { uint32_t new_tlli; + uint32_t ptmsi; + char imsi[OSMO_IMSI_BUF_SIZE]; } assign_req; /* OSMO_GPRS_GMM_GMMRR_PAGE | Ind */ struct { diff --git a/include/osmocom/gprs/rlcmac/gre.h b/include/osmocom/gprs/rlcmac/gre.h index 358d0aa..3afeadc 100644 --- a/include/osmocom/gprs/rlcmac/gre.h +++ b/include/osmocom/gprs/rlcmac/gre.h @@ -12,6 +12,10 @@ struct llist_head entry; /* item in (struct gprs_rlcmac_ctx)->gre_list */ uint32_t tlli;
+ /* Used to match paging requests coming from CS domain: */ + uint32_t ptmsi; + char imsi[OSMO_IMSI_BUF_SIZE]; + struct gprs_rlcmac_llc_queue *llc_queue;
/* Manage TBF Starting Time delay during TBF assignment: */ diff --git a/include/osmocom/gprs/rlcmac/rlcmac_prim.h b/include/osmocom/gprs/rlcmac/rlcmac_prim.h index c44de22..fa1ee52 100644 --- a/include/osmocom/gprs/rlcmac/rlcmac_prim.h +++ b/include/osmocom/gprs/rlcmac/rlcmac_prim.h @@ -91,6 +91,8 @@ /* OSMO_GPRS_RLCMAC_GMMRR_ASSIGN | Req */ struct { uint32_t new_tlli; + uint32_t ptmsi; + char imsi[OSMO_IMSI_BUF_SIZE]; } assign_req; /* OSMO_GPRS_RLCMAC_GMMRR_PAGE | Ind */ struct { diff --git a/src/gmm/gmm.c b/src/gmm/gmm.c index 38ebc98..2a97837 100644 --- a/src/gmm/gmm.c +++ b/src/gmm/gmm.c @@ -459,6 +459,8 @@ int rc;
gmm_prim_tx = gprs_gmm_prim_alloc_gmmrr_assign_req(gmme->old_tlli, gmme->tlli); + gmm_prim_tx->gmmrr.assign_req.ptmsi = gmme->ptmsi; + OSMO_STRLCPY_ARRAY(gmm_prim_tx->gmmrr.assign_req.imsi, gmme->imsi);
rc = gprs_gmm_prim_call_down_cb(gmm_prim_tx); return rc; diff --git a/src/rlcmac/gre.c b/src/rlcmac/gre.c index fe18a43..e728695 100644 --- a/src/rlcmac/gre.c +++ b/src/rlcmac/gre.c @@ -56,6 +56,7 @@ goto err_free_gre;
gre->tlli = tlli; + gre->ptmsi = GSM_RESERVED_TMSI; llist_add_tail(&gre->entry, &g_rlcmac_ctx->gre_list);
return gre; diff --git a/src/rlcmac/rlcmac_prim.c b/src/rlcmac/rlcmac_prim.c index 7337647..6e2285b 100644 --- a/src/rlcmac/rlcmac_prim.c +++ b/src/rlcmac/rlcmac_prim.c @@ -426,6 +426,8 @@ goto free_ret; } gprs_rlcmac_entity_free(gre); + gre = NULL; + goto free_ret; } else { /* Case "update", both old_tlli and new_tlli are valid */ gre = gprs_rlcmac_find_entity_by_tlli(old_tlli); @@ -438,6 +440,11 @@ gre->tlli = new_tlli; }
+ /* cache/update knowledge about this GMME's PTMSI and IMSI. It will be + * needed later on to match paging requests: */ + gre->ptmsi = rlcmac_prim->gmmrr.assign_req.ptmsi; + OSMO_STRLCPY_ARRAY(gre->imsi, rlcmac_prim->gmmrr.assign_req.imsi); + free_ret: msgb_free(rlcmac_prim->oph.msg); return rc;