aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-07-27 12:36:58 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-07-27 12:40:11 +0200
commitbe15a12c87983ef07fb133fedea4ef18d2213bc6 (patch)
tree97d8fb9b1bd38ae42b22e872458c441ee0769cbf
parent912ff0d7599fd7707d4679ac4f89ee2c178bdd82 (diff)
bts-trx: Fix handling ADM state change while previous one WIP
Fix power ramping if administrative state changes while previous opposite change was already ACKED but power ramping was still ongoing. With previous code, osmo-bts-trx would have sent a NACK and BSc would drop the BTs link as a result. Change-Id: I6c5240710ef6d223651dfb4a8db939b5d2f974ca
-rw-r--r--src/osmo-bts-trx/l1_if.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index cd7ecc0e..48305b5b 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -662,11 +662,29 @@ int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
break;
if (mo->procedure_pending) {
- LOGPTRX(trx, DL1C, LOGL_ERROR, "Discarding adm change command: "
- "pending procedure on RC %d\n",
- ((struct gsm_bts_trx *)obj)->nr);
- rc = -1;
- break;
+ LOGPTRX(trx, DL1C, LOGL_INFO,
+ "ADM change received while previous one still WIP\n");
+
+ if (mo->nm_state.administrative == NM_STATE_LOCKED &&
+ adm_state == NM_STATE_UNLOCKED) {
+ /* Previous change was UNLOCKED->LOCKED, so we
+ * were ramping down and we didn't deactivate
+ * yet, so now simply skip old ramp down compl
+ * cb, skip TS activation and go for ramp up
+ * directly. */
+ goto ramp_up;
+ } else if (mo->nm_state.administrative == NM_STATE_UNLOCKED &&
+ adm_state == NM_STATE_LOCKED) {
+ /* Previous change was LOCKED->UNLOCKED, which
+ * means TS were also enabled during start of
+ * ramping up. So we simply need to skip
+ * ramping up and start ramping down instead,
+ * disabling TS at the end as usual. Fall
+ * through usual procedure below.
+ */
+ } else if (mo->nm_state.administrative == adm_state) {
+ OSMO_ASSERT(0);
+ }
}
switch (adm_state) {
case NM_STATE_LOCKED:
@@ -687,6 +705,7 @@ int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
}
trx_set_ts(ts);
}
+ramp_up:
rc = l1if_trx_start_power_ramp(trx, bts_model_chg_adm_state_ramp_compl_cb);
if (rc == 0) {
mo->nm_state.administrative = adm_state;