pespin has uploaded this change for review.

View Change

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 src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/paging.c
2 files changed, 29 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/32159/1
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..6fc053f 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -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);
}

To view, visit change 32159. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iabc1c29908a5136501d6dc6e60f8777dab511b86
Gerrit-Change-Number: 32159
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange