aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-05-04 19:32:09 +0200
committerpespin <pespin@sysmocom.de>2022-05-06 12:34:59 +0000
commit7b36d0b0a0d87a80160f6c2398ea7bb7ff0ccd67 (patch)
tree128fbe08ada9b7a8170d6e979b26449d71c722ba
parent7d621e0a79e940864cc3d3d4a057ccea9aeeb64a (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
-rw-r--r--include/osmocom/bsc/acc.h2
-rw-r--r--src/osmo-bsc/acc.c11
-rw-r--r--src/osmo-bsc/osmo_bsc_main.c1
3 files changed, 10 insertions, 4 deletions
diff --git a/include/osmocom/bsc/acc.h b/include/osmocom/bsc/acc.h
index c7be38cb3..531a69acf 100644
--- a/include/osmocom/bsc/acc.h
+++ b/include/osmocom/bsc/acc.h
@@ -161,6 +161,8 @@ static inline unsigned int acc_ramp_is_running(struct acc_ramp *acc_ramp)
return acc_ramp->step_interval_sec;
}
+void acc_ramp_global_init(void);
+
void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts);
int acc_ramp_set_step_size(struct acc_ramp *acc_ramp, unsigned int step_size);
int acc_ramp_set_step_interval(struct acc_ramp *acc_ramp, unsigned int step_interval);
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);
+}
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 12ddbd212..8d63183e8 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -929,6 +929,7 @@ int main(int argc, char **argv)
assignment_fsm_init();
handover_fsm_init();
lb_init();
+ acc_ramp_global_init();
/* Read the config */
rc = bsc_network_configure(config_file);