Change in osmo-ttcn3-hacks[master]: pcu: transmit PCUIF DATA.ind with len=0 when no UL data to transmit

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
Fri Mar 5 16:04:21 UTC 2021


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


Change subject: pcu: transmit PCUIF DATA.ind with len=0 when no UL data to transmit
......................................................................

pcu: transmit PCUIF DATA.ind with len=0 when no UL data to transmit

older osmo-pcu versions can cope well with this change, they will simply
print an error upon ach data_len=0 messages received and submit a GSMTAP
block, then discard it, so tests still pass.

Related: OS#5020
Change-Id: Ib4f97a9bcfa68230945effeb6412218faa64ec78
---
M library/PCUIF_Types.ttcn
M pcu/PCUIF_Components.ttcn
2 files changed, 56 insertions(+), 23 deletions(-)



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

diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index ef27b11..96b2bac 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -161,7 +161,7 @@
 	uint32_t		hLayer1,
 	PCUIF_InfoTrxTsList	ts
 } with { variant (pdch_mask) "BITORDER(msb)" };
-private type record length(8) of PCUIF_InfoV10Trx PCUIF_InfoV10TrxList;
+type record length(8) of PCUIF_InfoV10Trx PCUIF_InfoV10TrxList;
 
 /* Version <= 9 specific coding */
 private type record PCUIF_InfoV09Trx {
diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn
index 50de700..2a505d2 100644
--- a/pcu/PCUIF_Components.ttcn
+++ b/pcu/PCUIF_Components.ttcn
@@ -308,6 +308,8 @@
 
 	/* Whether to forward PTCCH/U burst events to the TC */
 	var boolean cfg_ptcch_burst_fwd := false;
+
+	var PCUIF_info_ind g_info_ind;
 }
 
 /* Queue received messages from Test Case, they will eventually be scheduled and
@@ -337,6 +339,55 @@
 		}
 }
 
+/* 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
+{
+	var PCUIF_Message pcu_msg;
+	var boolean has_msg, use_msg;
+	var PCUIF_InfoV10TrxList trx_list := g_info_ind.trx.v10;
+
+	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) {
+			var charstring prefix := "BTS=" & int2str(bts_nr) & ",TRX=" & int2str(trx_nr) & ",TS=" & int2str(ts_nr) & ",FN=" & int2str(fn) & ": ";
+			if (trx_list[trx_nr].pdch_mask[ts_nr] == '0'B) {
+				log(prefix, "disabled");
+				continue; /* TRX+TS not activated */
+			}
+
+			/* Check if we reached time to serve the first DATA.ind message in the queue: */
+			has_msg := f_PCUIF_MsgQueue_first(pdtch_data_queue, pcu_msg) and
+				   pcu_msg.u.data_ind.trx_nr == trx_nr and
+				   pcu_msg.u.data_ind.ts_nr == ts_nr;
+			use_msg := has_msg and (pcu_msg.u.data_ind.fn == 0 or pcu_msg.u.data_ind.fn == fn);
+			if (use_msg) {
+				/* Dequeue a DATA.ind message */
+				f_PCUIF_MsgQueue_dequeue(pdtch_data_queue, pcu_msg);
+				/* Patch TDMA frame / block number */
+				pcu_msg.u.data_ind.fn := fn;
+				pcu_msg.u.data_ind.block_nr := 0; /* FIXME! */
+				log(prefix, "DATA.ind");
+			} else if (has_msg and pcu_msg.u.data_ind.fn < fn) {
+					setverdict(fail, "We are late scheduling the block! ", pcu_msg.u.data_ind.fn, " < ", fn);
+					mtc.stop;
+			} else {
+				/* NOPE.ind: */
+				pcu_msg := valueof(ts_PCUIF_DATA_IND(bts_nr, trx_nr, ts_nr, 0 /* FIXME */,
+								     PCU_IF_SAPI_PDTCH, ''O, fn,
+								     trx_list[trx_nr].arfcn,
+								     rssi := -80, ber10k := 0,
+								     ta_offs_qbits := 0, lqual_cb := 10));
+				log(prefix, "DATA.ind (len=0)");
+			}
+
+			PCUIF.send(pcu_msg); /* Send to the PCU and notify the TC */
+			if (use_msg) {
+				TC.send(ts_RAW_PCU_CLCK_EV(TDMA_EV_PDTCH_BLOCK_SENT, fn));
+			}
+		}
+	}
+}
+
 /* Handle schedule events and manage actions: Send msgs over PCUIF to PCU,
  * advertise Test Case about sent messages, etc. */
 private altstep as_BTS_CT_TDMASched(integer bts_nr)
@@ -344,7 +395,6 @@
 	var PCUIF_Message pcu_msg;
 	var RAW_PCU_Event event;
 	var integer ev_begin_fn;
-	var integer next_fn;
 
 	[] CLCK.receive(tr_RAW_PCU_EV(TDMA_EV_PDTCH_BLOCK_BEG)) -> value event {
 		/* If the RTS queue for PDTCH is not empty, send a message */
@@ -362,29 +412,10 @@
 		PCUIF.send(ts_PCUIF_TIME_IND(bts_nr, event.data.tdma_fn));
 		repeat;
 		}
-	[lengthof(pdtch_data_queue) > 0] CLCK.receive(tr_RAW_PCU_EV(TDMA_EV_PDTCH_BLOCK_END)) -> value event {
+	[] CLCK.receive(tr_RAW_PCU_EV(TDMA_EV_PDTCH_BLOCK_END)) -> value event {
 		/* FN matching the beginning of current block: */
 		ev_begin_fn := event.data.tdma_fn - 3;
-
-		/* Check if we reached time to serve the first DATA.ind message in the queue: */
-		f_PCUIF_MsgQueue_first(pdtch_data_queue, pcu_msg);
-		next_fn := pcu_msg.u.data_ind.fn;
-		if (next_fn != 0 and next_fn != ev_begin_fn) {
-			if (next_fn < ev_begin_fn) {
-				setverdict(fail, "We are late scheduling the block! ", next_fn, " < ", ev_begin_fn);
-				mtc.stop;
-			}
-			repeat;
-		}
-		/* Dequeue a DATA.ind message */
-		f_PCUIF_MsgQueue_dequeue(pdtch_data_queue, pcu_msg);
-
-		/* Patch TDMA frame / block number */
-		pcu_msg.u.data_ind.fn := ev_begin_fn;
-		pcu_msg.u.data_ind.block_nr := 0; /* FIXME! */
-
-		PCUIF.send(pcu_msg); /* Send to the PCU and notify the TC */
-		TC.send(ts_RAW_PCU_CLCK_EV(TDMA_EV_PDTCH_BLOCK_SENT, ev_begin_fn));
+		f_tx_data_ind_fn(bts_nr, ev_begin_fn);
 		repeat;
 		}
 	[lengthof(ptcch_rts_queue) > 0] CLCK.receive(tr_RAW_PCU_EV(TDMA_EV_PTCCH_DL_BLOCK)) -> value event {
@@ -417,6 +448,8 @@
 	var BTS_PTCCH_Block pcu_msg_ptcch;
 	var BTS_CCCH_Block pcu_msg_rr;
 
+	g_info_ind := info_ind;
+
 	/* Init TDMA clock generator (so we can stop and start it) */
 	vc_CLCK_GEN := RAW_PCU_ClckGen_CT.create("ClckGen-" & int2str(bts_nr)) alive;
 	connect(vc_CLCK_GEN:CLCK, self:CLCK);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23256
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: Ib4f97a9bcfa68230945effeb6412218faa64ec78
Gerrit-Change-Number: 23256
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/20210305/95feb198/attachment.htm>


More information about the gerrit-log mailing list