Change in osmo-ttcn3-hacks[master]: pcu: Set up PCU TDMA clock by sending initial DATA.ind

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

pespin gerrit-no-reply at lists.osmocom.org
Thu Mar 11 20:28:38 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23324 )


Change subject: pcu: Set up PCU TDMA clock by sending initial DATA.ind
......................................................................

pcu: Set up PCU TDMA clock by sending initial DATA.ind

In recent osmo-pcu commits, initial fn was changed to invalid value -1,
in order to be able to detect FN jumps. previously, the initial value
was set randomly to 0, which was wrong anyway because first FN received
from the BTS could be any other FN counted by the BTS at that time.

This makes some tests fail because they send RACH.ind + RTS.ind to
receive the Imm Assignment, and the Request reference in the Imm Assign
was calculated on the invalid unset FN "-1", hence it won't match test
expectancies.

In order to fix it, simply make sure the TDMA clock is initiated by
sending a DATA.ind to the PCU before tests start doing stuff
(f_init_raw() is blocked waiting for BTS_EV_SI13_NEGO).

Related: osmo-pcu.git Change-Id I29fb27981597edc69abb976049ba41aa840488cb
Related: OS#5020
Change-Id: I00c4dd9133ec9a236bf28fb8cb0afd0615791012
---
M pcu/PCUIF_Components.ttcn
1 file changed, 33 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/24/23324/1

diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn
index 6b0a412..47c65c7 100644
--- a/pcu/PCUIF_Components.ttcn
+++ b/pcu/PCUIF_Components.ttcn
@@ -216,10 +216,12 @@
 	return ss;
 }
 
-function f_ClckGen_CT_handler()
+function f_ClckGen_CT_handler(integer start_fn := 0)
 runs on RAW_PCU_ClckGen_CT {
 	var integer fn104, fn52, fn13;
 
+	fn := start_fn;
+
 	while (true) {
 		fn104 := fn mod 104;
 		fn52 := fn mod 52;
@@ -343,6 +345,32 @@
 		}
 }
 
+/* Submit empty data on any available TS, to set up initial TDMA clock */
+private function f_tx_first_data_ind(integer bts_nr, PCUIF_info_ind info_ind, integer start_fn)
+runs on RAW_PCU_BTS_CT
+{
+	var PCUIF_Message pcu_msg;
+	var PCUIF_InfoV10TrxList trx_list := g_info_ind.trx.v10;
+
+	/* Find an active TS: */
+	for (var uint8_t ts_nr := 0; ts_nr < 8; ts_nr := ts_nr + 1) {
+		for (var integer trx_nr := 0; trx_nr < lengthof(trx_list); trx_nr := trx_nr + 1) {
+			if (trx_list[trx_nr].pdch_mask[ts_nr] == '0'B) {
+				continue; /* TRX+TS not activated */
+			}
+
+			/* Send empty DATA.ind to set up FN */
+			pcu_msg := valueof(ts_PCUIF_DATA_IND(bts_nr, trx_nr, ts_nr, 0 /* FIXME */,
+							     PCU_IF_SAPI_PDTCH, ''O, start_fn,
+							     trx_list[trx_nr].arfcn,
+							     rssi := -80, ber10k := 0,
+							     ta_offs_qbits := 0, lqual_cb := 10));
+			PCUIF.send(pcu_msg);
+			return;
+		}
+	}
+}
+
 /* Get first message from queue. true if non-empty, false otherwise */
 private function f_tx_data_ind_fn(integer bts_nr, integer fn)
 runs on RAW_PCU_BTS_CT
@@ -477,11 +505,14 @@
 			u := { info_ind := info_ind }
 		});
 
+		var integer start_fn := 0;
+		f_tx_first_data_ind(bts_nr, info_ind, start_fn);
+
 		/* Notify the test case that we're done with SI13 */
 		TC.send(ts_RAW_PCU_EV(BTS_EV_SI13_NEGO));
 
 		/* Start feeding clock to the PCU */
-		vc_CLCK_GEN.start(f_ClckGen_CT_handler());
+		vc_CLCK_GEN.start(f_ClckGen_CT_handler(start_fn));
 		repeat;
 		}
 	/* PCU -> TS becomes active */

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I00c4dd9133ec9a236bf28fb8cb0afd0615791012
Gerrit-Change-Number: 23324
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210311/2d62334d/attachment.htm>


More information about the gerrit-log mailing list