diff options
author | Oliver Smith <osmith@sysmocom.de> | 2023-06-26 15:52:53 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2023-06-27 15:08:17 +0200 |
commit | 805340cb9ce5cd12ac63b132d0e4216c00dd9773 (patch) | |
tree | f15ae15487bbe72f5445408ae9402d330260b743 | |
parent | 81ebfb34b4cb6b9484faf91a3f75ae2b5ed22336 (diff) |
osmo-bts-sysmo: mute PHY until OML is ready
Connecting to OML and PHY is done in parallel. The PHY connection will
always be done first, mute PHY until OML is also ready.
As Pau suggested, move dispatch of NM_EV_SW_ACT to a callback of
trx_rf_lock to have the events serialized and therefore deterministic.
Fixes: SYS#6496
Change-Id: Ia1769f952fa787202a442a33db5ed4a1f7cbe9c3
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 30 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 4 |
2 files changed, 26 insertions, 8 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f6d8b33a..156c4b8d 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1268,14 +1268,16 @@ static int mute_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, if (status != GsmL1_Status_Success) { LOGP(DL1C, LOGL_ERROR, "Rx RF-MUTE.conf with status %s\n", get_value_string(femtobts_l1status_names, status)); - oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 0); + if (trx->mo.fi->state != NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED) + 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); + if (trx->mo.fi->state != NM_RCARRIER_ST_OP_DISABLED_NOTINSTALLED) + 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), @@ -1326,6 +1328,21 @@ int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb) #endif /* < 3.6.0 */ } +static int activate_rf_mute_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) +{ +#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3, 6, 0) + mute_rf_compl_cb(trx, resp, data); +#endif + + /* signal availability */ + osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SW_ACT, NULL); + osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_SW_ACT, NULL); + + return 0; +} + +int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); + static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) { @@ -1352,10 +1369,11 @@ static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, bts_shutdown(trx->bts, "RF-ACT failure"); } else { bts_update_status(BTS_STATUS_RF_ACTIVE, 1); - - /* signal availability */ - osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SW_ACT, NULL); - osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_SW_ACT, NULL); +#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3, 6, 0) + trx_rf_lock(trx, 1, activate_rf_mute_compl_cb); +#else + activate_rf_mute_compl_cb(trx, resp, NULL); +#endif } } else { bts_update_status(BTS_STATUS_RF_ACTIVE, 0); diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 3ee10949..5ac72f2a 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -98,7 +98,7 @@ static const enum GsmL1_LogChComb_t pchan_to_logChComb[_GSM_PCHAN_MAX] = { */ }; -static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); +int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct femtol1_hdl *gl1, HANDLE hLayer3) @@ -483,7 +483,7 @@ void bts_model_trx_close(struct gsm_bts_trx *trx) bts_model_trx_close_cb(trx, rc); } -static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb) +int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb) { struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx); uint8_t mute[8]; |