From 766f59096ec05a899dd51c9f59eff0248098ecf3 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 18 Sep 2020 02:49:15 +0200 Subject: refactor paging: introduce bsc_paging_params For LCS, I would like to add an enum indicating the paging reason. Instead of modifying extremely many function signatures to pass the reason across all levels of paging, introduce a struct combining these. Change-Id: I27ca78fc6ff8ef1101554c0a8429e34945ca6f3c --- include/osmocom/bsc/paging.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 449a2ebaa..3dd5dc6b4 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -28,9 +28,28 @@ #include #include +#include struct bsc_msc_data; +#define LOG_PAGING(PARAMS, SUBSYS, LEVEL, fmt, args...) \ + LOGP(SUBSYS, LEVEL, "(msc%d) Paging: %s TMSI-0x%08x: " fmt, \ + (PARAMS)->msc ? (PARAMS)->msc->nr : -1, \ + osmo_mobile_identity_to_str_c(OTC_SELECT, &(PARAMS)->imsi), \ + (PARAMS)->tmsi, \ + ##args) + +#define LOG_PAGING_BTS(PARAMS, BTS, SUBSYS, LEVEL, fmt, args...) \ + LOG_PAGING(PARAMS, SUBSYS, LEVEL, "(bts%u) " fmt, (BTS) ? (BTS)->nr : 255, ##args) + +struct bsc_paging_params { + struct bsc_msc_data *msc; + uint32_t tmsi; + struct osmo_mobile_identity imsi; + uint8_t chan_needed; + struct gsm0808_cell_id_list2 cil; +}; + /** * A pending paging request */ @@ -56,8 +75,7 @@ struct gsm_paging_request { }; /* schedule paging request */ -int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc); +int paging_request_bts(const struct bsc_paging_params *params, struct bsc_subscr *bsub, struct gsm_bts *bts); struct bsc_msc_data *paging_request_stop(struct gsm_bts *bts, struct bsc_subscr *bsub); -- cgit v1.2.3