Currently only mute_state[0] (refers to ts[0]) is inspected to determine, whether the Radio Carrier's state is set to LOCK.
This patch changes this by looking at all channels and using LOCK if (and only if) all channels have been muted successfully.
Sponsored-by: On-Waves ehf --- src/osmo-bts-sysmo/oml.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index c87acb6..4c63fd5 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -342,9 +342,15 @@ int oml_mo_rf_lock_chg(struct gsm_abis_mo *mo, uint8_t mute_state[8], int success) { if (success) { - /* assume mute_state[i] == mute_state[k] */ + int i; + int is_locked = 1; + + for (i = 0; i < ARRAY_SIZE(mute_state); ++i) + if (!mute_state[i]) + is_locked = 0; + mo->nm_state.administrative = - mute_state[0] ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; + is_locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED; mo->procedure_pending = 0; return oml_mo_statechg_ack(mo); } else {
Currently it takes some time (around 30s) until it is detected that the radio link is down after mute. Not till then the BSC is informed and the call terminated.
This patch modifies this behaviour by sending a RSL_MT_CONN_FAIL message with cause RSL_ERR_RADIO_LINK_FAIL for each muted and active lchan immediately after the corresponding Change Administrative State Request has been acknowledged.
Ticket: OW#976 Sponsored-by: On-Waves ehf --- src/osmo-bts-sysmo/l1_if.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 71920ac..de8c239 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1103,6 +1103,27 @@ int l1if_activate_rf(struct femtol1_hdl *hdl, int on) return l1if_req_compl(hdl, msg, activate_rf_compl_cb); }
+static void mute_handle_ts(struct gsm_bts_trx_ts *ts, int is_muted) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(ts->lchan); i++) { + struct gsm_lchan *lchan = &ts->lchan[i]; + + if (!is_muted) + continue; + + if (lchan->state != LCHAN_S_ACTIVE) + continue; + + if (lchan->s <= 0) + continue; + + lchan->s = 0; + rsl_tx_conn_fail(lchan, RSL_ERR_RADIO_LINK_FAIL); + } +} + static int mute_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp) { struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx); @@ -1116,10 +1137,19 @@ static int mute_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp) get_value_string(femtobts_l1status_names, status)); oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 0); } else { + int i; + LOGP(DL1C, LOGL_INFO, "Rx RF-MUTE.conf with status=%s\n", get_value_string(femtobts_l1status_names, status)); bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]); oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 1); + + osmo_static_assert( + ARRAY_SIZE(trx->ts) >= ARRAY_SIZE(fl1h->last_rf_mute), + ts_array_size); + + for (i = 0; i < ARRAY_SIZE(fl1h->last_rf_mute); ++i) + mute_handle_ts(&trx->ts[i], fl1h->last_rf_mute[i]); }
msgb_free(resp);
On Tue, Nov 05, 2013 at 01:43:00PM +0100, Jacob Erlbeck wrote:
Great. I only changed the subject to "BSC" and applied the patch by hand because of my previous addition of #ifdef. So please check that I have done it correctly.
thanks holger
PS: I am adding procedure_pending by hand. We can replace it with your patch tomorrow.