diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-05-04 19:32:09 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2022-05-06 12:34:59 +0000 |
commit | 7b36d0b0a0d87a80160f6c2398ea7bb7ff0ccd67 (patch) | |
tree | 128fbe08ada9b7a8170d6e979b26449d71c722ba /src/osmo-bsc/acc.c | |
parent | 7d621e0a79e940864cc3d3d4a057ccea9aeeb64a (diff) |
acc: Fix erratic ramping behavior when several BTS configured
One callback function was being registered for each BTS.
That means, when a C0 RCARRIER of one specific BTS changed NM state,
the outcome on whether to trigger/abort ramping would end up being
applied to all BTS.
Change-Id: I56c4dd1809fdcf8441a69bf77ad173e1ccc8eea7
Diffstat (limited to 'src/osmo-bsc/acc.c')
-rw-r--r-- | src/osmo-bsc/acc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/osmo-bsc/acc.c b/src/osmo-bsc/acc.c index 755ffd1a2..1172fd898 100644 --- a/src/osmo-bsc/acc.c +++ b/src/osmo-bsc/acc.c @@ -414,7 +414,6 @@ static void do_acc_ramping_step(void *data) static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { struct nm_statechg_signal_data *nsd = signal_data; - struct acc_ramp *acc_ramp = handler_data; struct gsm_bts_trx *trx = NULL; bool trigger_ramping = false, abort_ramping = false; @@ -523,9 +522,9 @@ static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *ha } if (trigger_ramping) - acc_ramp_trigger(acc_ramp); + acc_ramp_trigger(&trx->bts->acc_ramp); else if (abort_ramping) - acc_ramp_abort(acc_ramp); + acc_ramp_abort(&trx->bts->acc_ramp); return 0; } @@ -548,7 +547,6 @@ void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts) acc_ramp->chan_load_lower_threshold = ACC_RAMP_CHAN_LOAD_THRESHOLD_LOW; acc_ramp->chan_load_upper_threshold = ACC_RAMP_CHAN_LOAD_THRESHOLD_UP; osmo_timer_setup(&acc_ramp->step_timer, do_acc_ramping_step, acc_ramp); - osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, acc_ramp); } /*! @@ -646,3 +644,8 @@ void acc_ramp_abort(struct acc_ramp *acc_ramp) acc_mgr_set_len_allowed_ramp(&acc_ramp->bts->acc_mgr, 10); } + +void acc_ramp_global_init(void) +{ + osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, NULL); +} |