aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-04-12 09:18:36 +0200
committerHarald Welte <laforge@gnumonks.org>2018-04-12 12:51:51 +0000
commit4d3d2436cdf3296ddc110be4022dc2ec13d3eb86 (patch)
tree6527250eecb3162271f39f434b4fa82ec7f1c1b7
parentb06c7a253752ecb67fd20cdf0b069688b561af0e (diff)
only trigger acc ramping if trx 0 is usable and unlocked
Starting an ACC ramping process while TRX 0 is unusable or locked is pointless. For instance, after loading a config with 'rf_locked 1' for trx 0, the ramping process was started as soon as the BTS established RSL, even though the air interface was still down. ACC ramping should instead be triggered once TRX 0 is unlocked. Change-Id: I054829a936f0aa1e3fa34fad6466a1cd6150e307 Related: OS#2591
-rw-r--r--src/libbsc/acc_ramp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libbsc/acc_ramp.c b/src/libbsc/acc_ramp.c
index 16bce3f4b..7116107da 100644
--- a/src/libbsc/acc_ramp.c
+++ b/src/libbsc/acc_ramp.c
@@ -26,6 +26,7 @@
#include <osmocom/bsc/debug.h>
#include <osmocom/bsc/acc_ramp.h>
#include <osmocom/bsc/gsm_data.h>
+#include <osmocom/bsc/chan_alloc.h>
#include <osmocom/bsc/signal.h>
/*
@@ -257,7 +258,7 @@ void acc_ramp_set_step_interval_dynamic(struct acc_ramp *acc_ramp)
/*!
* Determine if ACC ramping should be started according to configuration, and
- * if ACC ramping is enabled, begin the ramping process.
+ * begin the ramping process if the necessary conditions are present.
* Perform at least one ramping step to allow 'step_size' ACCs.
* If 'step_size' is ACC_RAMP_STEP_SIZE_MAX, or if ACC ramping is disabled,
* all ACCs will be allowed immediately.
@@ -269,9 +270,13 @@ void acc_ramp_trigger(struct acc_ramp *acc_ramp)
acc_ramp_abort(acc_ramp);
if (acc_ramp_is_enabled(acc_ramp)) {
- /* Set all available ACCs to barred and start ramping up. */
- barr_all_accs(acc_ramp);
- do_acc_ramping_step(acc_ramp);
+ struct gsm_bts_trx *trx0 = gsm_bts_trx_by_nr(acc_ramp->bts, 0);
+ /* TRX 0 should be usable and unlocked, otherwise starting ACC ramping is pointless. */
+ if (trx0 && trx_is_usable(trx0) && trx0->mo.nm_state.administrative == NM_STATE_UNLOCKED) {
+ /* Set all available ACCs to barred and start ramping up. */
+ barr_all_accs(acc_ramp);
+ do_acc_ramping_step(acc_ramp);
+ }
}
}