From 030824e172bbcc29edd01a9906e2108615541cf0 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 17 Sep 2019 01:43:50 +0200 Subject: sgsn_libgtp: refactor ps paging into gprs_gb Paging should be done in gprs_gb Change-Id: I3020020f52005aa460ca6b245ee2297aec9821b3 --- src/sgsn/gprs_gb.c | 23 +++++++++++++++++++++++ src/sgsn/sgsn_libgtp.c | 13 ++----------- 2 files changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/sgsn/gprs_gb.c b/src/sgsn/gprs_gb.c index 9fa8e00b4..d470cfab9 100644 --- a/src/sgsn/gprs_gb.c +++ b/src/sgsn/gprs_gb.c @@ -80,3 +80,26 @@ int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, return rc; } + + +int gprs_gb_page_ps_ra(struct sgsn_mm_ctx *mmctx) +{ + struct bssgp_paging_info pinfo; + int rc; + + /* FIXME: page whole routing area, not only the last known cell */ + + /* initiate PS PAGING procedure */ + memset(&pinfo, 0, sizeof(pinfo)); + pinfo.mode = BSSGP_PAGING_PS; + pinfo.scope = BSSGP_PAGING_BVCI; + pinfo.bvci = mmctx->gb.bvci; + pinfo.imsi = mmctx->imsi; + pinfo.ptmsi = &mmctx->p_tmsi; + pinfo.drx_params = mmctx->drx_parms; + pinfo.qos[0] = 0; // FIXME + rc = bssgp_tx_paging(mmctx->gb.nsei, 0, &pinfo); + rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PAGING_PS]); + + return rc; +} diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index c5bc5b811..a39687f8a 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -614,7 +615,6 @@ static int cb_extheader_ind(struct sockaddr_in *peer) /* Called whenever we receive a DATA packet */ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len) { - struct bssgp_paging_info pinfo; struct sgsn_pdp_ctx *pdp; struct sgsn_mm_ctx *mm; struct msgb *msg; @@ -660,16 +660,7 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len) switch (mm->gmm_fsm->state) { case ST_GMM_REGISTERED_SUSPENDED: /* initiate PS PAGING procedure */ - memset(&pinfo, 0, sizeof(pinfo)); - pinfo.mode = BSSGP_PAGING_PS; - pinfo.scope = BSSGP_PAGING_BVCI; - pinfo.bvci = mm->gb.bvci; - pinfo.imsi = mm->imsi; - pinfo.ptmsi = &mm->p_tmsi; - pinfo.drx_params = mm->drx_parms; - pinfo.qos[0] = 0; // FIXME - bssgp_tx_paging(mm->gb.nsei, 0, &pinfo); - rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PAGING_PS]); + gprs_gb_page_ps_ra(mm); /* FIXME: queue the packet we received from GTP */ break; case ST_GMM_REGISTERED_NORMAL: -- cgit v1.2.3