diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-05-29 03:53:59 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2020-06-16 14:56:57 +0200 |
commit | a87646cd8449a0658d1f6af681aa3773a587ca6b (patch) | |
tree | 4f41b6ee5085c54d65d009e8eb8ec683088f171d /src/osmo-bsc/paging.c | |
parent | 2c61245935ed997ad64a9a50a5b76e9a026e2a28 (diff) |
use osmo_mobile_identity API everywhere
Depends: If4f7be606e54cfa1c59084cf169785b1cbda5cf5 (libosmocore)
Change-Id: I71c3b4c65dbfdfa51409e09d4868aea83225338a
Diffstat (limited to 'src/osmo-bsc/paging.c')
-rw-r--r-- | src/osmo-bsc/paging.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 7b89dad9b..7859c69d0 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -78,10 +78,9 @@ static void paging_remove_request(struct gsm_bts_paging_state *paging_bts, static void page_ms(struct gsm_paging_request *request) { - uint8_t mi[128]; - unsigned int mi_len; unsigned int page_group; struct gsm_bts *bts = request->bts; + struct osmo_mobile_identity mi; log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub); @@ -89,14 +88,21 @@ static void page_ms(struct gsm_paging_request *request) "0x%08x for ch. type %d (attempt %d)\n", request->bsub->imsi, request->bsub->tmsi, request->chan_type, request->attempts); - if (request->bsub->tmsi == GSM_RESERVED_TMSI) - mi_len = gsm48_generate_mid_from_imsi(mi, request->bsub->imsi); - else - mi_len = gsm48_generate_mid_from_tmsi(mi, request->bsub->tmsi); + if (request->bsub->tmsi == GSM_RESERVED_TMSI) { + mi = (struct osmo_mobile_identity){ + .type = GSM_MI_TYPE_IMSI, + }; + OSMO_STRLCPY_ARRAY(mi.imsi, request->bsub->imsi); + } else { + mi = (struct osmo_mobile_identity){ + .type = GSM_MI_TYPE_TMSI, + .tmsi = request->bsub->tmsi, + }; + } page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(request->bsub->imsi)); - rsl_paging_cmd(bts, page_group, mi_len, mi, request->chan_type, false); + rsl_paging_cmd(bts, page_group, &mi, request->chan_type, false); log_set_context(LOG_CTX_BSC_SUBSCR, NULL); } |