summaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-03-26 15:38:31 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-03-27 14:42:40 +0200
commitba06cc6cb84531155d246f7fce576f1d103ed7ed (patch)
tree02024fd35b96aca1b62c40e0bd04b07ab27bfd94 /openbsc/src/osmo-bsc
parent408856088bcf376f5317803fd8d1747f8b920054 (diff)
bsc: Improve handling of paging_request return value
Detail better in the API documentation what's the expected return value for paging_request. Change-Id: I17fa3b549bff297531b2777d658b0e0112a3031f
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_bssap.c9
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_grace.c17
2 files changed, 20 insertions, 6 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
index 349c98f3c..26278d96c 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
@@ -138,6 +138,7 @@ static int bssmap_handle_paging(struct bsc_msc_data *msc,
uint8_t data_length;
const uint8_t *data;
uint8_t chan_needed = RSL_CHANNEED_ANY;
+ int rc;
tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0);
@@ -199,8 +200,14 @@ static int bssmap_handle_paging(struct bsc_msc_data *msc,
subscr->tmsi = tmsi;
LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac);
- bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy,
+ rc = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy,
subscr, chan_needed, msc);
+ if (rc <= 0) {
+ LOGP(DMSC, LOGL_ERROR, "Paging request failed (%d): IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n",
+ rc, mi_string, tmsi, tmsi, lac);
+ return -1;
+ }
+
return 0;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/openbsc/src/osmo-bsc/osmo_bsc_grace.c
index 63afa20d0..bb2634fa7 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_grace.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_grace.c
@@ -37,14 +37,18 @@ int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *
static int normal_paging(struct bsc_subscr *subscr, int chan_needed,
struct bsc_msc_data *msc)
{
+ int rc, num_pages = 0;
/* we can't page by lac.. we need to page everything */
if (msc->core_lac != -1) {
struct gsm_bts *bts;
- llist_for_each_entry(bts, &msc->network->bts_list, list)
- paging_request_bts(bts, subscr, chan_needed, NULL, msc);
+ llist_for_each_entry(bts, &msc->network->bts_list, list) {
+ rc = paging_request_bts(bts, subscr, chan_needed, NULL, msc);
+ if (rc > 0)
+ num_pages += rc;
+ }
- return 0;
+ return num_pages;
}
return paging_request(msc->network, subscr, chan_needed, NULL, msc);
@@ -54,6 +58,7 @@ static int locked_paging(struct bsc_subscr *subscr, int chan_needed,
struct bsc_msc_data *msc)
{
struct gsm_bts *bts = NULL;
+ int rc, num_pages = 0;
/*
* Check if there is any BTS that is on for the given lac. Start
@@ -73,11 +78,13 @@ static int locked_paging(struct bsc_subscr *subscr, int chan_needed,
/*
* now page on this bts
*/
- paging_request_bts(bts, subscr, chan_needed, NULL, msc);
+ rc = paging_request_bts(bts, subscr, chan_needed, NULL, msc);
+ if (rc > 0)
+ num_pages += rc;
};
/* All bts are either off or in the grace period */
- return 0;
+ return num_pages;
}
/**