Change in osmo-bsc[master]: om2k: Dispatch TS_EV_OML_READY to TS FSM only when it's actually ready

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri May 8 16:07:22 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18118 )

Change subject: om2k: Dispatch TS_EV_OML_READY to TS FSM only when it's actually ready
......................................................................

om2k: Dispatch TS_EV_OML_READY to TS FSM only when it's actually ready

Signed-off-by: Sylvain Munaut <tnt at 246tNt.com>
Change-Id: Ic2a84ea406e9a39332313d63b27d73f334d4e0a0
---
M src/osmo-bsc/abis_om2000.c
1 file changed, 10 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index b99fbc5..9ae5a26 100644
--- a/src/osmo-bsc/abis_om2000.c
+++ b/src/osmo-bsc/abis_om2000.c
@@ -2019,7 +2019,7 @@
 
 struct om2k_trx_fsm_priv {
 	struct gsm_bts_trx *trx;
-	uint8_t next_ts_nr;
+	uint8_t cur_ts_nr;
 };
 
 static void om2k_trx_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -2063,8 +2063,8 @@
 	/* Initialize Timeslots after TX */
 	osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_WAIT_TS,
 				TRX_FSM_TIMEOUT, 0);
-	otfp->next_ts_nr = 0;
-	ts = &otfp->trx->ts[otfp->next_ts_nr++];
+	otfp->cur_ts_nr = 0;
+	ts = &otfp->trx->ts[otfp->cur_ts_nr];
 	om2k_mo_fsm_start(fi, OM2K_TRX_EVT_TS_DONE, otfp->trx,
 			  &ts->rbs2000.om2k_mo);
 }
@@ -2074,9 +2074,14 @@
 	struct om2k_trx_fsm_priv *otfp = fi->priv;
 	struct gsm_bts_trx_ts *ts;
 
-	if (otfp->next_ts_nr < 8) {
+	/* notify TS is ready */
+	ts = &otfp->trx->ts[otfp->cur_ts_nr];
+	osmo_fsm_inst_dispatch(ts->fi, TS_EV_OML_READY, NULL);
+
+	/* next ? */
+	if (++otfp->cur_ts_nr < 8) {
 		/* iterate to the next timeslot */
-		ts = &otfp->trx->ts[otfp->next_ts_nr++];
+		ts = &otfp->trx->ts[otfp->cur_ts_nr];
 		om2k_mo_fsm_start(fi, OM2K_TRX_EVT_TS_DONE, otfp->trx,
 				  &ts->rbs2000.om2k_mo);
 	} else {
@@ -2820,7 +2825,6 @@
 		om2k_mo_init(&ts->rbs2000.om2k_mo, OM2K_MO_CLS_TS,
 				bts->nr, trx->nr, i);
 		OSMO_ASSERT(ts->fi);
-		osmo_fsm_inst_dispatch(ts->fi, TS_EV_OML_READY, NULL);
 	}
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18118
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic2a84ea406e9a39332313d63b27d73f334d4e0a0
Gerrit-Change-Number: 18118
Gerrit-PatchSet: 2
Gerrit-Owner: tnt <tnt at 246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200508/0eed1336/attachment.htm>


More information about the gerrit-log mailing list