Change in osmo-ttcn3-hacks[master]: library/PCUIF_Types.ttcn: extend RACH.ind with TRX / TS number fields

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
Sat Nov 23 07:57:45 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16081 )

Change subject: library/PCUIF_Types.ttcn: extend RACH.ind with TRX / TS number fields
......................................................................

library/PCUIF_Types.ttcn: extend RACH.ind with TRX / TS number fields

Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: Ia5c4e504a21dc5508920553d3856027455dba1b1
Related: OS#4102, OS#1545
---
M bts/BTS_Tests.ttcn
M library/PCUIF_Types.ttcn
M pcu/PCU_Tests_RAW.ttcn
M pcu/PCU_Tests_RAW_SNS.ttcn
4 files changed, 24 insertions(+), 13 deletions(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 87c9131..779f7c3 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -4170,8 +4170,8 @@
 			   chan_nr := ts_RslChanNr_PDCH(7),
 			   link_id := ts_RslLinkID_OSMO_PTCCH(0));
 
-	/* TODO: check time-slot and TRX number as soon as we extend the PCU interface */
-	pcu_rach_ind := tr_PCUIF_RACH_IND(ra := ra, fn := fn, sapi := PCU_IF_SAPI_PTCCH);
+	pcu_rach_ind := tr_PCUIF_RACH_IND(bts_nr := 0, trx_nr := 0, ts_nr := 7,
+					  ra := ra, fn := fn, sapi := PCU_IF_SAPI_PTCCH);
 
 	/* Expect a RACH.ind on the PCU interface (timeout is one multi-frame) */
 	T.start(52.0 * 4.615 / 1000.0);
@@ -4333,7 +4333,7 @@
 		timer T := 2.0;
 		T.start;
 		alt {
-		[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND(0, oct2int(ra), 0, ?, fn))) {
+		[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND(0, 0, 0, oct2int(ra), 0, ?, fn))) {
 			T.stop;
 			}
 		[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) {
@@ -4382,7 +4382,7 @@
 
 		/* Compose the expected message */
 		pcu_rach_ind := tr_PCUIF_RACH_IND(
-			bts_nr := 0,
+			bts_nr := 0, trx_nr := 0, ts_nr := 0,
 			ra := bit2int(ra11),
 			is_11bit := 1,
 			burst_type := pcu_bt,
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index ae0762a..8ce41c4 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -130,7 +130,9 @@
 	uint32_t	fn,
 	uint16_t	arfcn,
 	uint8_t		is_11bit,
-	PCUIF_BurstType	burst_type
+	PCUIF_BurstType	burst_type,
+	uint8_t		trx_nr,
+	uint8_t		ts_nr
 } with { variant "" };
 
 type record PCUIF_InfoTrx {
@@ -565,6 +567,8 @@
 }
 
 template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr,
+						 template (value) uint8_t trx_nr,
+						 template (value) uint8_t ts_nr,
 						 template (value) uint16_t ra,
 						 template (value) uint8_t is_11bit,
 						 template (value) PCUIF_BurstType burst_type,
@@ -584,11 +588,15 @@
 			fn := fn,
 			arfcn := arfcn,
 			is_11bit := is_11bit,
-			burst_type := burst_type
+			burst_type := burst_type,
+			trx_nr := trx_nr,
+			ts_nr := ts_nr
 		}
 	}
 }
 template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
+					 template uint8_t trx_nr := ?,
+					 template uint8_t ts_nr := ?,
 					 template uint16_t ra := ?,
 					 template uint8_t is_11bit := ?,
 					 template PCUIF_BurstType burst_type := ?,
@@ -605,7 +613,9 @@
 			fn := fn,
 			arfcn := ?,
 			is_11bit := is_11bit,
-			burst_type := burst_type
+			burst_type := burst_type,
+			trx_nr := trx_nr,
+			ts_nr := ts_nr
 		}
 	}
 }
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 6a5f5d0..9d0882f 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -515,7 +515,7 @@
 
 	/* Send RACH.ind */
 	log("Sending RACH.ind on fn=", fn, " with RA=", ra, ", TA=", ta);
-	BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
+	BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
 				   ra := ra, is_11bit := is_11bit,
 				   burst_type := burst_type,
 				   fn := fn, arfcn := 871,
@@ -524,7 +524,7 @@
 	/* Expect Immediate (TBF) Assignment on TS0/AGCH */
 	T.start(2.0);
 	alt {
-	[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := ?, ts_nr := 0,
+	[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
 					 sapi := PCU_IF_SAPI_AGCH, data := ?))
 					-> value pcu_msg {
 		rr_imm_ass := dec_GsmRrMessage(pcu_msg.u.data_req.data);
@@ -778,7 +778,7 @@
 	0, 0, 0, 0
 };
 
-private altstep as_ta_ptcch(uint8_t bts_nr := 0, /* TODO: TRX / TS number */
+private altstep as_ta_ptcch(uint8_t bts_nr := 0, uint8_t trx_nr := 0, uint8_t ts_nr := 7,
 			    in PTCCH_TAI_ToA_MAP toa_map := ptcch_toa_map_def)
 runs on RAW_PCU_Test_CT {
 	var RAW_PCU_Event event;
@@ -794,7 +794,7 @@
 		    ", fn=", event.data.tdma_fn,
 		    ", ToA=", toa_map[ss], " (QTA)");
 		/* TODO: do we care about RA and burst format? */
-		BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
+		BTS.send(ts_PCUIF_RACH_IND(bts_nr, trx_nr, ts_nr,
 					   ra := oct2int('3A'O),
 					   is_11bit := 0,
 					   burst_type := BURST_TYPE_0,
@@ -821,7 +821,7 @@
 	alt {
 	/* Keep sending of Access Bursts during two multi-frames (period of PTCCH/D)
 	 * with increasing ToA (Timing of Arrival) values: 0, 7, 14, 28, 35... */
-	[] as_ta_ptcch(bts_nr := 0, toa_map := ptcch_toa_map);
+	[] as_ta_ptcch(bts_nr := 0, trx_nr := 0, ts_nr := 7, toa_map := ptcch_toa_map);
 	/* In the end of 2nd multi-frame we should receive a PTCCH/D block */
 	[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7,
 					 sapi := PCU_IF_SAPI_PTCCH)) -> value pcu_msg {
diff --git a/pcu/PCU_Tests_RAW_SNS.ttcn b/pcu/PCU_Tests_RAW_SNS.ttcn
index 28dd654..c8520e7 100644
--- a/pcu/PCU_Tests_RAW_SNS.ttcn
+++ b/pcu/PCU_Tests_RAW_SNS.ttcn
@@ -374,7 +374,8 @@
 	f_sns_bringup_1c1u();
 	activate(as_pcu_activate());
 
-	f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, ra:=23, is_11bit:=0, burst_type:=BURST_TYPE_0,
+	f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, trx_nr:=0, ts_nr:=0, ra:=23,
+				     is_11bit:=0, burst_type:=BURST_TYPE_0,
 				     fn:=42, arfcn:=871, qta:=0));
 	PCU.receive(t_SD_PCUIF(g_pcu_conn_id,
 			       tr_PCUIF_DATA_REQ(bts_nr:=0, trx_nr:=0, ts_nr:=0, block_nr:=?, fn:=?,

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16081
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: Ia5c4e504a21dc5508920553d3856027455dba1b1
Gerrit-Change-Number: 16081
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
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/20191123/f1578f2f/attachment.htm>


More information about the gerrit-log mailing list