aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-09-14 15:08:21 +0200
committerneels <nhofmeyr@sysmocom.de>2020-09-16 21:54:52 +0000
commite60254118c79fa7a9c8144be7fa16855876c5981 (patch)
treeb602f0ed6d3409f5b5378a68b48330a84b4e2b12
parentf072fbad3ef161c2629e90e3406a280e29f5ddd6 (diff)
dissolve bsc_grace_paging_request()
RF-locking: simply ask bsc_grace_allow_new_connection() at the start of page_subscriber(). Before this patch, we would log an INFO of "Paging request failed" when RF-locked, for each BTS. Instead log "RF-locked". (An upcoming patch will introduce a LOG_PAGING() macro that will trivially add more log context there, so not bothering now.) Drop LAC condition: since Stefan introduced page_subscriber() starting 2018 Ic3c62ff0fccea586794ea4b3c275a0685cc9326e, matching a requested LAC to a specific BTS is done *before* calling page_subscriber(). BTW: the msc->core_lac (config 'core-location-area-code') has not had an effect on Paging maybe ever. I opened OS#4751. Change-Id: Ic8696414a1db8f4b1be502d6434599f684746ed6
-rw-r--r--include/osmocom/bsc/osmo_bsc_grace.h5
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c7
-rw-r--r--src/osmo-bsc/osmo_bsc_grace.c39
3 files changed, 6 insertions, 45 deletions
diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h
index d78e41c82..07dce8cd5 100644
--- a/include/osmocom/bsc/osmo_bsc_grace.h
+++ b/include/osmocom/bsc/osmo_bsc_grace.h
@@ -27,10 +27,5 @@
struct bsc_msc_data;
int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts);
-int bsc_grace_paging_request(enum signal_rf rf_policy,
- struct bsc_subscr *subscr,
- int chan_needed,
- struct bsc_msc_data *msc,
- struct gsm_bts *bts);
#endif
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index a253b01f1..14cd2c03e 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -121,6 +121,11 @@ page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts,
struct bsc_subscr *subscr;
int ret;
+ if (!bsc_grace_allow_new_connection(bsc_gsmnet, bts)) {
+ LOGP(DMSC, LOGL_DEBUG, "RF-locked: not paging on BTS %u\n", bts->nr);
+ return;
+ }
+
subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers,
mi_string);
@@ -138,7 +143,7 @@ page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts,
subscr->lac = lac;
subscr->tmsi = tmsi;
- ret = bsc_grace_paging_request(msc->network->rf_ctrl->policy, subscr, chan_needed, msc, bts);
+ ret = paging_request_bts(bts, subscr, chan_needed, msc);
if (ret == 0)
LOGP(DMSC, LOGL_INFO, "Paging request failed or repeated paging: BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n",
bts->nr, mi_string, tmsi, tmsi, lac);
diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c
index a26a716ad..19ffe65aa 100644
--- a/src/osmo-bsc/osmo_bsc_grace.c
+++ b/src/osmo-bsc/osmo_bsc_grace.c
@@ -33,42 +33,3 @@ int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *
return 1;
return network->rf_ctrl->policy == S_RF_ON;
}
-
-
-/* Return value is like paging_request_bts():
- * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */
-static int locked_paging_bts(struct gsm_bts *bts,
- struct bsc_subscr *subscr,
- int chan_needed,
- struct bsc_msc_data *msc)
-{
- /* Return error if the BTS is not excluded from the lock. */
- if (!bts->excl_from_rf_lock)
- return 0;
-
- /* in case of no lac patching is in place, check the BTS */
- if (msc->core_lac == -1 && subscr->lac != bts->location_area_code)
- return 0;
-
- return paging_request_bts(bts, subscr, chan_needed, msc);
-}
-
-/**
- * Page a subscriber in an MSC.
- * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock
- * \param[in] subscr subscriber we want to page
- * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE
- * \param[in] msc MSC which has issued this paging
- * \param[in] bts The BTS to issue the paging on
- * \returns 1 if paging was issued to the BTS, 0 if not
- */
-int bsc_grace_paging_request(enum signal_rf rf_policy,
- struct bsc_subscr *subscr,
- int chan_needed,
- struct bsc_msc_data *msc,
- struct gsm_bts *bts)
-{
- if (rf_policy == S_RF_ON)
- return paging_request_bts(bts, subscr, chan_needed, msc);
- return locked_paging_bts(bts, subscr, chan_needed, msc);
-}