diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-04-12 09:18:36 +0200 |
---|---|---|
committer | Stefan Sperling <ssperling@sysmocom.de> | 2018-04-13 14:42:57 +0200 |
commit | cda994edb20d24032d6ab4e916d0e9411671cfc0 (patch) | |
tree | bd06f0fdc6f13a40e4ee05f60a104425a438d3eb /src/libbsc/abis_nm.c | |
parent | 4d3d2436cdf3296ddc110be4022dc2ec13d3eb86 (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.
Change-Id: Ib3291439655598fb5ddc891a3e4cc35b0bad250f
Related: OS#2591
Diffstat (limited to 'src/libbsc/abis_nm.c')
-rw-r--r-- | src/libbsc/abis_nm.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 2ee2e24fa..e3c440813 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -2844,13 +2844,17 @@ void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason) { uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; - LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s [%s]\n", trx->bts->nr, trx->nr, - get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), - get_value_string(abis_nm_adm_state_names, new_state), reason); - trx->mo.nm_state.administrative = new_state; - if (!trx->bts || !trx->bts->oml_link) + if (!trx->bts || !trx->bts->oml_link) { + /* Set initial state which will be sent when BTS connects. */ + trx->mo.nm_state.administrative = new_state; return; + } + + LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Requesting administrative state change %s -> %s [%s]\n", + trx->bts->nr, trx->nr, + get_value_string(abis_nm_adm_state_names, trx->mo.nm_state.administrative), + get_value_string(abis_nm_adm_state_names, new_state), reason); abis_nm_chg_adm_state(trx->bts, NM_OC_RADIO_CARRIER, trx->bts->bts_nr, trx->nr, 0xff, |