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/.

tnt gerrit-no-reply at lists.osmocom.org
Fri May 8 11:58:58 UTC 2020


tnt has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/18118/1

diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index 304f873..c75732c 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: 1
Gerrit-Owner: tnt <tnt at 246tNt.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200508/9e1e8b3b/attachment.htm>


More information about the gerrit-log mailing list