Change in ...osmo-ttcn3-hacks[master]: library/LAPDm_RAW_PT.ttcn: use templates from GSM_RR_Types

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

fixeria gerrit-no-reply at lists.osmocom.org
Tue Sep 10 07:50:46 UTC 2019


fixeria has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15457 )

Change subject: library/LAPDm_RAW_PT.ttcn: use templates from GSM_RR_Types
......................................................................

library/LAPDm_RAW_PT.ttcn: use templates from GSM_RR_Types

Get rid of t_IMM_ASS_TBF_UL_DYN, use tr_IMM_TBF_ASS instead. Also,
use both tr_PacketUlDynAssign and tr_PacketUlSglAssign for matching
UL TBF assignment.

Change-Id: Icb7dab04a1e2a833c14754d872bd4b85af3d58a5
---
M library/LAPDm_RAW_PT.ttcn
1 file changed, 24 insertions(+), 16 deletions(-)

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



diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn
index 5a8d9ea..75d18d9 100644
--- a/library/LAPDm_RAW_PT.ttcn
+++ b/library/LAPDm_RAW_PT.ttcn
@@ -261,15 +261,6 @@
 		a[idx] := tfi_usf;
 	}
 
-	/* Match an IMM.ASS for an Uplink TBF with a dynamic allocation
-	 * FIXME: this template has nothing to do with LAPDm, move to GSM_RR_Types.ttcn */
-	template ImmediateAssignment t_IMM_ASS_TBF_UL_DYN(uint8_t ra, GsmFrameNumber fn) modifies t_IMM_ASS := {
-		ded_or_tbf := { spare := ?, tma := ?, downlink := false, tbf := true},
-		chan_desc := omit,
-		pkt_chan_desc := ?,
-		rest_octets := tr_IaRestOctets_ULAss(tr_PacketUlDynAssign())
-	};
-
 	template (value) RLCMAC_ph_data_req ts_PH_DATA_ABS(uint8_t tbf_id, GprsCodingScheme cs,
 							   uint8_t ts, uint32_t fn, Arfcn arfcn,
 							   RlcmacUlBlock block) := {
@@ -283,8 +274,10 @@
 		}
 	}
 
-	private function f_establish_tbf(uint8_t ra) runs on lapdm_CT {
+	private function f_establish_tbf(uint8_t ra) runs on lapdm_CT return boolean {
+		var template GsmRrMessage imm_ass_rr;
 		var ImmediateAssignment imm_ass;
+		var PacketUlAssign pkt_ul_ass;
 		var GsmFrameNumber rach_fn;
 		var TfiUsfArr tua := f_TfiUsfArrInit();
 
@@ -294,20 +287,35 @@
 		/* wait for receiving matching IMM ASS */
 		imm_ass := f_L1CTL_WAIT_IMM_ASS(L1CTL, ra, rach_fn);
 
-		if (match(imm_ass, t_IMM_ASS_TBF_UL_DYN(ra, rach_fn))) {
+		/* make sure we got *Packet* (Uplink) Immediate Assignment */
+		imm_ass_rr := tr_IMM_TBF_ASS(dl := false, ra := ra, fn := rach_fn,
+					     rest := tr_IaRestOctets_ULAss(?));
+		if (not match(imm_ass, imm_ass_rr.payload.imm_ass)) {
+			log("Failed to match Packet Immediate Assignment");
+			return false;
+		}
+
+		/* decapsulate PacketUlAssign for further matching */
+		pkt_ul_ass := imm_ass.rest_octets.hh.pa.uldl.ass.ul;
+
+		/* Dynamic Block Allocation */
+		if (match(pkt_ul_ass, tr_PacketUlDynAssign)) {
 			set_ph_state(PH_STATE_TBF);
 
 			/* store/save channel description */
 			//chan_desc := imm_ass.chan_desc;
 
 			/* Important: ARFCN, TN, TSC, USF, USF_GRANULARITY, CH_CODING_CMD */
-			f_TfiUsfArrSet(tua, imm_ass.pkt_chan_desc.tn,
-				       imm_ass.rest_octets.hh.pa.uldl.ass.ul.dynamic.usf);
+			f_TfiUsfArrSet(tua, imm_ass.pkt_chan_desc.tn, pkt_ul_ass.dynamic.usf);
 			f_L1CTL_TBF_CFG(L1CTL, true, tua);
-		} else {
-			/* FIXME: single block uplink allocation */
-			log("Failed to match ", t_IMM_ASS_TBF_UL_DYN(ra, rach_fn));
+			return true;
+		/* FIXME: Single Block Allocation */
+		} else if (match(pkt_ul_ass, tr_PacketUlSglAssign)) {
 			log("Non-dynamic UL TBF assignment not supported yet");
+			return false;
+		} else {
+			log("Failed to match Uplink Block Allocation: ", pkt_ul_ass);
+			return false;
 		}
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15457
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: Icb7dab04a1e2a833c14754d872bd4b85af3d58a5
Gerrit-Change-Number: 15457
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.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/20190910/e275cb9f/attachment.htm>


More information about the gerrit-log mailing list