pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32159 )
Change subject: Move paging queue specific handling to signal callback outside RSL code ......................................................................
Move paging queue specific handling to signal callback outside RSL code
The signal is already there but not being used. Let's further split generic paging code from RSL specificites.
Change-Id: Iabc1c29908a5136501d6dc6e60f8777dab511b86 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/paging.c 3 files changed, 30 insertions(+), 6 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 15eb49e..054e5c7 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -150,9 +150,6 @@ struct gsm_bts *bts, struct bsc_subscr *bsub); void paging_request_cancel(struct bsc_subscr *bsub, enum bsc_paging_reason reasons);
-/* update paging load */ -void paging_update_buffer_space(struct gsm_bts *bts, uint16_t); - /* pending paging requests */ unsigned int paging_pending_requests_nr(const struct gsm_bts *bts);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 6a9712e..dfe7da9 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2311,10 +2311,9 @@ switch (rslh->data[0]) { case RSL_IE_PAGING_LOAD: sd.pg_buf_space = rslh->data[1] << 8 | rslh->data[2]; - if (is_ipaccess_bts(sign_link->trx->bts) && sd.pg_buf_space == UINT16_MAX) { + if (is_ipaccess_bts(sd.bts) && sd.pg_buf_space == UINT16_MAX) { sd.pg_buf_space = paging_estimate_available_slots(sd.bts, sd.bts->ccch_load_ind_period); } - paging_update_buffer_space(sign_link->trx->bts, sd.pg_buf_space); osmo_signal_dispatch(SS_CCCH, S_CCCH_PAGING_LOAD, &sd); break; case RSL_IE_RACH_LOAD: diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index e6f6fe4..1cee164 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -684,7 +684,7 @@ }
/*! Update the BTS paging buffer slots on given BTS */ -void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots) +static void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots) { LOG_BTS(bts, DPAG, LOGL_DEBUG, "Rx CCCH Load Indication from BTS (available_slots %u -> %u)\n", bts->paging.available_slots, free_slots); @@ -841,8 +841,24 @@ return 0; }
+/* Callback function to be called every time we receive a signal from CCCH */ +static int ccch_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct ccch_signal_data *sd; + + if (signal != S_CCCH_PAGING_LOAD) + return 0; + + sd = signal_data; + + paging_update_buffer_space(sd->bts, sd->pg_buf_space); + return 0; +} + /* To be called once at startup of the process: */ void paging_global_init(void) { osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_CCCH, ccch_sig_cb, NULL); }