aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_init.c
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-04-16 14:00:52 +0200
committerStefan Sperling <ssperling@sysmocom.de>2018-04-16 14:00:52 +0200
commitdc09470c40ae595806f6b52d60e815cfb2fb9434 (patch)
tree762ccf24bb51b807fa81f532c5692f4301800dfc /openbsc/src/libbsc/bsc_init.c
parentfdff72d924fdca5a1d2c646b6d8c7b4e47e99e38 (diff)
fix handling of state changes in acc ramping
Take both the operative and administrative states into account when deciding whether to start ACC ramping, and examine old/new state values to avoid triggering ramping for a no-op state change. This requires a fix to gsm_trx_lock_rf(): This function overwrote the old administrative state of a trx before enqueuing a state change request towards the BTS. The BTS will confirm this request with an ACK, at which time a signal is generated which the ACC ramp code listens to. We must not overwrite the old state value until the signal has been handled, otherwise the signal handler cannot tell what the old state was. Tested with a virtphy setup, nanobts, and osmo-bts. This is a port of osmo-bsc commit cda994edb20d24032d6ab4e916d0e9411671cfc0 Change-Id: I235d2c5fa962f2f338e77d0c11502921b37f4c36 Related: OS#2591
Diffstat (limited to 'openbsc/src/libbsc/bsc_init.c')
-rw-r--r--openbsc/src/libbsc/bsc_init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 120955b53..21ed2e1cf 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -318,8 +318,10 @@ static void bootstrap_rsl(struct gsm_bts_trx *trx)
/*
* Trigger ACC ramping before sending system information to BTS.
* This ensures that RACH control in system information is configured correctly.
+ * TRX 0 should be usable and unlocked, otherwise starting ACC ramping is pointless.
*/
- acc_ramp_trigger(&trx->bts->acc_ramp);
+ if (trx_is_usable(trx) && trx->mo.nm_state.administrative == NM_STATE_UNLOCKED)
+ acc_ramp_trigger(&trx->bts->acc_ramp);
gsm_bts_trx_set_system_infos(trx);