From c9b0b262c367e29b6785ee994d741658841b1a5a Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 23 Feb 2018 17:57:13 +0100 Subject: paging: fix paging attemt rate counter The rate counter BSC_CTR_PAGING_ATTEMPTED does not increment when a paging request is sent to the BSC. The reson for this is that the function call to rate_ctr_inc() is located in a dead code section. - Move the function call to rate_ctr_inc() to osmo_bsc_bssmap.c. incremanet on any paging attempt (valid or not) that is recived on the A-Interface. - Remove dead code from paging.c Change-Id: Iec3eb6724bc655806c3ce3c28448069590d99f91 --- src/libbsc/paging.c | 38 -------------------------------------- src/osmo-bsc/osmo_bsc_bssap.c | 2 ++ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 825d31e35..43532d1a8 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -345,44 +345,6 @@ int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, return 1; } -/*! Receive a new PAGING request from the MSC - * \param network gsm_network we operate in - * \param[in] bsub subscriber we want to page - * \param[in] type type of radio channel we're requirign - * \param[in] msc MSC which has issue this paging - * \returns number of BTSs on which we issued the paging */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - int num_pages = 0; - - rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]); - - /* start paging subscriber on all BTS within Location Area */ - do { - int rc; - - bts = gsm_bts_by_lac(network, bsub->lac, bts); - if (!bts) - break; - - rc = paging_request_bts(bts, bsub, type, msc); - if (rc < 0) { - paging_request_stop(&network->bts_list, NULL, bsub, - NULL, NULL); - return rc; - } - num_pages += rc; - } while (1); - - if (num_pages == 0) - rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_PAGING_DETACHED]); - - return num_pages; -} - - /*! Stop paging a given subscriber on a given BTS. * If \a conn is non-NULL, we also call the paging call-back function * to notify the paging originator that paging has completed. diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 573625e9d..d07cc558e 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -522,6 +522,8 @@ static int bssmap_handle_paging(struct bsc_msc_data *msc, cell_ident = data[0] & 0xf; remain -= 1; /* cell ident consumed */ + rate_ctr_inc(&msc->network->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]); + switch (cell_ident) { case CELL_IDENT_NO_CELL: page_all_bts(msc, tmsi, mi_string, chan_needed); -- cgit v1.2.3