diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-09-18 02:49:15 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-10-07 10:21:12 +0000 |
commit | 766f59096ec05a899dd51c9f59eff0248098ecf3 (patch) | |
tree | 9c6309d378f16e022c469d491c1ad755bcbb7a51 /src/osmo-bsc/paging.c | |
parent | 24f7071936372801dd564233c32ad44e6ccfec86 (diff) |
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
Diffstat (limited to 'src/osmo-bsc/paging.c')
-rw-r--r-- | src/osmo-bsc/paging.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 0e5bf9fd0..186904253 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -325,8 +325,7 @@ static unsigned int calculate_timer_3113(struct gsm_bts *bts) * \param[in] type type of radio channel we're requirign * \param[in] msc MSC which has issue this paging * \returns 0 on success, negative on error */ -static int _paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc) +static int _paging_request(const struct bsc_paging_params *params, struct bsc_subscr *bsub, struct gsm_bts *bts) { struct gsm_bts_paging_state *bts_entry = &bts->paging; struct gsm_paging_request *req; @@ -335,19 +334,18 @@ static int _paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub, int typ rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_ATTEMPTED]); if (paging_pending_request(bts_entry, bsub)) { - LOG_BTS(bts, DPAG, LOGL_INFO, "Paging request already pending for %s\n", - bsc_subscr_name(bsub)); + LOG_PAGING_BTS(params, bts, DPAG, LOGL_INFO, "Paging request already pending for this subscriber\n"); rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_ALREADY]); return -EEXIST; } - LOG_BTS(bts, DPAG, LOGL_DEBUG, "Start paging of subscriber %s\n", bsc_subscr_name(bsub)); + LOG_PAGING_BTS(params, bts, DPAG, LOGL_DEBUG, "Start paging\n"); req = talloc_zero(tall_paging_ctx, struct gsm_paging_request); OSMO_ASSERT(req); req->bsub = bsc_subscr_get(bsub); req->bts = bts; - req->chan_type = type; - req->msc = msc; + req->chan_type = params->chan_needed; + req->msc = params->msc; osmo_timer_setup(&req->T3113, paging_T3113_expired, req); t3113_timeout_s = calculate_timer_3113(bts); osmo_timer_schedule(&req->T3113, t3113_timeout_s, 0); @@ -363,8 +361,7 @@ static int _paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub, int typ * \param[in] type type of radio channel we're requirign * \param[in] msc MSC which has issue this paging * returns 1 on success; 0 in case of error (e.g. TRX down) */ -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) { int rc; @@ -376,7 +373,7 @@ int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, paging_init_if_needed(bts); /* Trigger paging, pass any error to the caller */ - rc = _paging_request(bts, bsub, type, msc); + rc = _paging_request(params, bsub, bts); if (rc < 0) return 0; return 1; |