Change in osmo-ttcn3-hacks[master]: BTS_Tests: group hopping parameters into a separate record

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
Sat Sep 12 13:46:26 UTC 2020


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


Change subject: BTS_Tests: group hopping parameters into a separate record
......................................................................

BTS_Tests: group hopping parameters into a separate record

Change-Id: Iedb5d858a2d4f5d5a45e7465ae6586b3ae4bbb72
Related: SYS#4868, OS#4708
---
M bts/BTS_Tests.ttcn
M bts/BTS_Tests_LAPDm.ttcn
M library/LAPDm_RAW_PT.ttcn
3 files changed, 62 insertions(+), 46 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index ac781f6..3100d03 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -237,6 +237,17 @@
 	}
 }
 
+friend type record FreqHopPars {
+	/* Whether frequency hopping is in use */
+	boolean enabled,
+	/* Mobile Allocation Index Offset / Hopping Sequence Number */
+	MaioHsn maio_hsn,
+	/* MA bitmap to be indicated in RR Immediate Assignment */
+	MobileAllocationLV ma_map,
+	/* The actual Mobile Allocation (ARFCN list) to be used */
+	L1ctlMA ma
+};
+
 type record ConnHdlrPars {
 	RslChannelNr chan_nr,
 	RSL_IE_ChannelMode chan_mode,
@@ -246,13 +257,9 @@
 	RSL_IE_EncryptionInfo encr optional,
 	BtsBand bts0_band optional,
 
-	/* Frequency hopping parameters (disabled if absent) */
-	MaioHsn maio_hsn optional,
-	/* MA bitmap to be indicated in RR Immediate Assignment */
-	MobileAllocationLV ma_map,
-	/* The actual Mobile Allocation (ARFCN list) to be used */
-	L1ctlMA ma
-}
+	/* Frequency hopping parameters */
+	FreqHopPars fhp
+};
 
 /* Test-specific parameters */
 private type union TestSpecUnion {
@@ -529,36 +536,40 @@
 	uint6_t			maio
 };
 
-friend function f_resolve_fh_params(inout ConnHdlrPars pars, uint8_t trx_nr := 0)
+friend function f_resolve_fh_params(inout FreqHopPars fhp, uint8_t tn,
+				    uint8_t trx_nr := 0)
 {
-	var FreqHopGroups groups := mp_fh_config[pars.chan_nr.tn];
+	var FreqHopGroups groups := mp_fh_config[tn];
 	var integer i, j;
 
+	fhp.enabled := false;
+
 	for (i := 0; i < lengthof(groups); i := i + 1) {
 		var FreqHopGroup g := groups[i];
 		for (j := 0; j < lengthof(g.trx_maio); j := j + 1) {
 			var FreqHopGroupItem gi := g.trx_maio[j];
 			if (gi.trx_nr == trx_nr) {
-				pars.maio_hsn := valueof(ts_HsnMaio(g.hsn, gi.maio));
-				pars.ma := { }; /* to be composed below */
+				fhp.maio_hsn.maio := gi.maio;
+				fhp.maio_hsn.hsn := g.hsn;
+				fhp.enabled := true;
 				break;
 			}
 		}
 
-		if (ispresent(pars.maio_hsn)) {
+		if (fhp.enabled) {
 			/* Prepare the Mobile Allocation bitmask (length & padding) */
-			pars.ma_map.len := (mp_transceiver_num + 8 - 1) / 8; /* in bytes */
-			pars.ma_map.ma := f_pad_bit('0'B, pars.ma_map.len * 8, '0'B);
+			fhp.ma_map.len := (mp_transceiver_num + 8 - 1) / 8; /* in bytes */
+			fhp.ma_map.ma := f_pad_bit('0'B, fhp.ma_map.len * 8, '0'B);
+			fhp.ma := { }; /* to be composed below */
 
 			/* Compose the actual Mobile Allocation and the bitmask */
 			for (j := 0; j < lengthof(g.trx_maio); j := j + 1) {
 				var FreqHopGroupItem gi := g.trx_maio[j];
-				pars.ma := pars.ma & { l1ctl_ma_def[gi.trx_nr] };
-				pars.ma_map.ma[gi.trx_nr] := '1'B;
+				fhp.ma := fhp.ma & { l1ctl_ma_def[gi.trx_nr] };
+				fhp.ma_map.ma[gi.trx_nr] := '1'B;
 			}
 
-			log("Freq. hopping parameters: maio_hsn := ", pars.maio_hsn,
-			    ", ma := ", pars.ma, ", ma_map := ", pars.ma_map);
+			log("Freq. hopping parameters: ", fhp);
 			break; /* We're done */
 		}
 	}
@@ -591,7 +602,7 @@
 
 	/* Obtain frequency hopping parameters for a given timeslot */
 	if (mp_freq_hop_enabled and mp_transceiver_num > 1) {
-		f_resolve_fh_params(pars);
+		f_resolve_fh_params(pars.fhp, pars.chan_nr.tn);
 	}
 
 	vc_conn.start(f_handler_init(fn, id, pars));
@@ -700,7 +711,6 @@
 
 friend template ConnHdlrPars t_Pars(template RslChannelNr chan_nr,
 					template RSL_IE_ChannelMode chan_mode,
-					template (omit) MaioHsn maio_hsn := omit,
 					float t_guard := 20.0) := {
 	chan_nr := valueof(chan_nr),
 	chan_mode := valueof(chan_mode),
@@ -726,9 +736,12 @@
 	spec := omit,
 	encr := omit,
 	bts0_band := omit,
-	maio_hsn := maio_hsn,
-	ma_map := c_MA_null,
-	ma := l1ctl_ma_def
+	fhp := {
+		enabled := false,
+		maio_hsn := ts_HsnMaio(0, 0),
+		ma_map := c_MA_null,
+		ma := l1ctl_ma_def
+	}
 }
 
 /***********************************************************************
@@ -2002,16 +2015,16 @@
 
 /* Tune to a dedicated channel: L1CTL only */
 private function f_l1ctl_est_dchan(L1CTL_PT pt, ConnHdlrPars pars) {
-	if (not ispresent(pars.maio_hsn)) {
+	if (not pars.fhp.enabled) {
 		pt.send(ts_L1CTL_DM_EST_REQ_H0(pars.chan_nr,
 						7 /* TODO: mp_tsc */,
 						mp_trx0_arfcn));
 	} else {
 		pt.send(ts_L1CTL_DM_EST_REQ_H1(pars.chan_nr,
 						7 /* TODO: mp_tsc */,
-						pars.maio_hsn.hsn,
-						pars.maio_hsn.maio,
-						pars.ma));
+						pars.fhp.maio_hsn.hsn,
+						pars.fhp.maio_hsn.maio,
+						pars.fhp.ma));
 	}
 }
 
@@ -2029,14 +2042,14 @@
 	f_rsl_chan_act(g_pars.chan_mode, encr_enable, more_ies);
 
 	/* Craft channel description (with or without frequency hopping parameters) */
-	if (ispresent(g_pars.maio_hsn)) {
-		ch_desc := valueof(ts_ChanDescH1(g_pars.chan_nr, g_pars.maio_hsn));
+	if (g_pars.fhp.enabled) {
+		ch_desc := valueof(ts_ChanDescH1(g_pars.chan_nr, g_pars.fhp.maio_hsn));
 	} else {
 		ch_desc := valueof(ts_ChanDescH0(g_pars.chan_nr, mp_trx0_arfcn));
 	}
 
 	/* Send IMM.ASS via CCHAN */
-	var GsmRrMessage rr_msg := valueof(ts_IMM_ASS(ra, fn, 0, ch_desc, g_pars.ma_map));
+	var GsmRrMessage rr_msg := valueof(ts_IMM_ASS(ra, fn, 0, ch_desc, g_pars.fhp.ma_map));
 	RSL.send(ts_RSL_IMM_ASSIGN(enc_GsmRrMessage(rr_msg)));
 
 	/* receive IMM.ASS on MS side */
@@ -2049,7 +2062,7 @@
 	}
 
 	/* enable dedicated mode */
-	f_L1CTL_DM_EST_REQ_IA(L1CTL, ia_um, ma := g_pars.ma);
+	f_L1CTL_DM_EST_REQ_IA(L1CTL, ia_um, ma := g_pars.fhp.ma);
 	/* enable encryption, if requested */
 	if (encr_enable) {
 		var uint8_t alg_id := f_alg_id_to_l1ctl(g_pars.encr.alg_id);
@@ -4661,7 +4674,7 @@
 	/* Tune trxcon to that PDCH channel */
 	var ConnHdlrPars pars := valueof(t_Pars(ts_RslChanNr_PDCH(7), ts_RSL_ChanMode_SIGN));
 	if (mp_freq_hop_enabled and mp_transceiver_num > 1)
-		{ f_resolve_fh_params(pars); }
+		{ f_resolve_fh_params(pars.fhp, pars.chan_nr.tn); }
 	f_l1ctl_est_dchan(L1CTL, pars);
 
 	/* Verify PTCCH/U: send several access bursts, make sure they're received */
@@ -4925,7 +4938,7 @@
 	/* Tune trxcon to that PDCH channel on TS7 */
 	var ConnHdlrPars pars := valueof(t_Pars(ts_RslChanNr_PDCH(7), ts_RSL_ChanMode_SIGN));
 	if (mp_freq_hop_enabled and mp_transceiver_num > 1)
-		{ f_resolve_fh_params(pars); }
+		{ f_resolve_fh_params(pars.fhp, pars.chan_nr.tn); }
 	f_l1ctl_est_dchan(L1CTL, pars);
 
 	/* C/I in centiBels, test range: -256 .. +1280, step 128 */
@@ -5395,7 +5408,7 @@
 /* Verify hopping parameters in the INFO.ind message (version >= 10) */
 testcase TC_pcu_info_ind_fh_params() runs on test_CT {
 	var PCUIF_info_ind info_ind;
-	var ConnHdlrPars pars;
+	var FreqHopPars fhp;
 
 	f_init();
 
@@ -5408,17 +5421,18 @@
 				continue;
 			}
 
-			pars := valueof(t_Pars(t_RslChanNr_PDCH(tn), ts_RSL_ChanMode_SIGN));
 			if (mp_freq_hop_enabled and mp_transceiver_num > 1)
-				{ f_resolve_fh_params(pars); }
+				{ f_resolve_fh_params(fhp, tn); }
+			else
+				{ fhp.enabled := false; }
 
 			var template PCUIF_InfoTrxTs tr_ts;
-			if (ispresent(pars.maio_hsn)) {
+			if (fhp.enabled) {
 				tr_ts := tr_PCUIF_InfoTrxTsH1(
-						hsn := pars.maio_hsn.hsn,
-						maio := pars.maio_hsn.maio,
-						ma := f_pad_bit(pars.ma_map.ma, 64, '0'B),
-						ma_bit_len := lengthof(pars.ma_map.ma));
+						hsn := fhp.maio_hsn.hsn,
+						maio := fhp.maio_hsn.maio,
+						ma := f_pad_bit(fhp.ma_map.ma, 64, '0'B),
+						ma_bit_len := lengthof(fhp.ma_map.ma));
 			} else {
 				tr_ts := tr_PCUIF_InfoTrxTsH0;
 			}
diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn
index 9981bbc..0e27ad1 100644
--- a/bts/BTS_Tests_LAPDm.ttcn
+++ b/bts/BTS_Tests_LAPDm.ttcn
@@ -54,13 +54,15 @@
 /* master function switching to a dedicated radio channel */
 function f_switch_dcch() runs on ConnHdlr {
 	var BCCH_tune_req tune_req := { arfcn := { false, mp_trx0_arfcn }, combined_ccch := true };
-	var DCCH_switch_req sw_req := { ma := g_pars.ma };
+	var DCCH_switch_req sw_req;
 
 	/* Craft channel description (with or without frequency hopping parameters) */
-	if (ispresent(g_pars.maio_hsn)) {
-		sw_req.chan_desc := valueof(ts_ChanDescH1(g_pars.chan_nr, g_pars.maio_hsn));
+	if (g_pars.fhp.enabled) {
+		sw_req.chan_desc := valueof(ts_ChanDescH1(g_pars.chan_nr, g_pars.fhp.maio_hsn));
+		sw_req.ma := g_pars.fhp.ma;
 	} else {
 		sw_req.chan_desc := valueof(ts_ChanDescH0(g_pars.chan_nr, mp_trx0_arfcn));
+		sw_req.ma := omit;
 	}
 
 	LAPDM.send(tune_req);
@@ -239,7 +241,7 @@
 
 	/* Obtain frequency hopping parameters for a given timeslot */
 	if (mp_freq_hop_enabled and mp_transceiver_num > 1) {
-		f_resolve_fh_params(g_pars);
+		f_resolve_fh_params(g_pars.fhp, g_pars.chan_nr.tn);
 	}
 
 	/* activate the channel on the BTS side */
diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn
index 77f0452..d0ad24b 100644
--- a/library/LAPDm_RAW_PT.ttcn
+++ b/library/LAPDm_RAW_PT.ttcn
@@ -39,7 +39,7 @@
 	/* directly switch to a dedicated channel (without RACH/IMM.ASS */
 	type record DCCH_switch_req {
 		ChannelDescription chan_desc,
-		L1ctlMA ma
+		L1ctlMA ma optional
 	}
 
 	type record DCCH_switch_res {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20101
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: Iedb5d858a2d4f5d5a45e7465ae6586b3ae4bbb72
Gerrit-Change-Number: 20101
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200912/093661a9/attachment.htm>


More information about the gerrit-log mailing list