Change in osmo-ttcn3-hacks[master]: BTS_Tests: re-organize configuration of TRX/TS params

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 Nov 14 18:37:47 UTC 2020


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


Change subject: BTS_Tests: re-organize configuration of TRX/TS params
......................................................................

BTS_Tests: re-organize configuration of TRX/TS params

Change-Id: I021994001b0e819fd63364bb267950e0c9ff7695
---
M bts/BTS_Tests.default
M bts/BTS_Tests.ttcn
M bts/BTS_Tests_LAPDm.ttcn
M bts/BTS_Tests_SMSCB.ttcn
M library/GSM_Types.ttcn
5 files changed, 104 insertions(+), 22 deletions(-)



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

diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default
index 89b04e8..e187357 100644
--- a/bts/BTS_Tests.default
+++ b/bts/BTS_Tests.default
@@ -31,4 +31,60 @@
 Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBTS";
 PCUIF_Types.mp_pcuif_version := 10;
 
+# Configuration for each individual transceiver
+BTS_Tests.mp_trx_pars := {
+	{ # TRX0
+		arfcn := 871,
+		ts := {
+			{ tsc := 7, config := GSM_PCHAN_CCCH_SDCCH4 },
+			{ tsc := 7, config := GSM_PCHAN_TCHF },
+			{ tsc := 7, config := GSM_PCHAN_TCHF },
+			{ tsc := 7, config := GSM_PCHAN_TCHF_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_TCHH_TCHF_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_TCHH },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 },
+			{ tsc := 7, config := GSM_PCHAN_PDCH }
+		}
+	},
+	{ # TRX1
+		arfcn := 873,
+		ts := {
+			{ tsc := 7, config := GSM_PCHAN_TCHF },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 },
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_TCHH_TCHF_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_TCHF_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 },
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_PDCH }
+		}
+	},
+	{ # TRX2
+		arfcn := 875,
+		ts := {
+			{ tsc := 7, config := GSM_PCHAN_TCHH },
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 },
+			{ tsc := 7, config := GSM_PCHAN_TCHF },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 },
+			{ tsc := 7, config := GSM_PCHAN_TCHF },
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_PDCH }
+		}
+	},
+	{ # TRX3
+		arfcn := 877,
+		ts := {
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_TCHH },
+			{ tsc := 7, config := GSM_PCHAN_TCHH },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 },
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_TCHF },
+			{ tsc := 7, config := GSM_PCHAN_PDCH },
+			{ tsc := 7, config := GSM_PCHAN_SDCCH8 }
+		}
+	}
+};
+
 [EXECUTE]
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index cf468cf..a749d90 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -84,10 +84,6 @@
 modulepar {
 	charstring mp_rsl_ip := "127.0.0.2";
 	integer mp_rsl_port := 3003;
-	integer mp_trx0_arfcn := 871;
-	integer mp_trx1_arfcn := 873;
-	integer mp_trx2_arfcn := 875;
-	integer mp_trx3_arfcn := 877;
 	charstring mp_bts_trxc_ip := "127.0.0.1";
 	integer mp_bts_trxc_port := 5701;
 	charstring mp_pcu_socket := PCU_SOCK_DEFAULT;
@@ -118,6 +114,8 @@
 	boolean mp_freq_hop_enabled := false;
 	/* frequency hopping parameters */
 	FreqHopConfig mp_fh_config;
+	/* configuration for each individual transceiver */
+	TrxPars mp_trx_pars; /* see BTS_Tests.default */
 }
 
 type record of RslChannelNr ChannelNrs;
@@ -256,6 +254,18 @@
 	}
 }
 
+friend type record length(1 .. 256) of TrxParsItem TrxPars;
+friend type record TrxParsItem {
+	GsmArfcn arfcn,
+	TrxTsPars ts
+};
+
+friend type record length(8) of TrxTsParsItem TrxTsPars;
+friend type record TrxTsParsItem {
+	PchanConfig config,
+	GsmTsc tsc
+};
+
 friend type record FreqHopPars {
 	/* Whether frequency hopping is in use */
 	boolean enabled,
@@ -584,7 +594,7 @@
 			/* 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];
-				var GsmArfcn arfcn := c_arfcn_list[gi.trx_nr];
+				var GsmArfcn arfcn := mp_trx_pars[gi.trx_nr].arfcn;
 				fhp.ma := fhp.ma & { valueof(ts_GsmBandArfcn(arfcn)) };
 				fhp.ma_map.ma[gi.trx_nr] := '1'B;
 			}
@@ -636,7 +646,7 @@
 }
 
 friend function f_l1_tune(L1CTL_PT L1CTL, L1ctlCcchMode ccch_mode := CCCH_MODE_COMBINED) {
-	var GsmBandArfcn arfcn := valueof(ts_GsmBandArfcn(mp_trx0_arfcn));
+	var GsmBandArfcn arfcn := valueof(ts_GsmBandArfcn(mp_trx_pars[0].arfcn));
 	f_L1CTL_FBSB(L1CTL, arfcn, ccch_mode, mp_rxlev_exp);
 }
 
@@ -727,12 +737,6 @@
 			"RF CHAN REL", true);
 }
 
-/* TODO: move this to module parameters */
-private const GsmArfcn c_arfcn_list[4] := {
-	mp_trx0_arfcn, mp_trx1_arfcn,
-	mp_trx2_arfcn, mp_trx3_arfcn
-};
-
 friend template ConnHdlrPars t_Pars(template RslChannelNr chan_nr,
 					template RSL_IE_ChannelMode chan_mode,
 					float t_guard := 20.0) := {
@@ -2142,13 +2146,15 @@
 
 /* Tune to a dedicated channel: L1CTL only */
 private function f_l1ctl_est_dchan(L1CTL_PT pt, ConnHdlrPars pars) {
+	var uint8_t tn := pars.chan_nr.tn;
+
 	if (not pars.fhp.enabled) {
 		pt.send(ts_L1CTL_DM_EST_REQ_H0(pars.chan_nr,
-						7 /* TODO: mp_tsc */,
-						mp_trx0_arfcn));
+						mp_trx_pars[0].ts[tn].tsc,
+						mp_trx_pars[0].arfcn));
 	} else {
 		pt.send(ts_L1CTL_DM_EST_REQ_H1(pars.chan_nr,
-						7 /* TODO: mp_tsc */,
+						mp_trx_pars[0].ts[tn].tsc,
 						pars.fhp.maio_hsn.hsn,
 						pars.fhp.maio_hsn.maio,
 						pars.fhp.ma));
@@ -2172,7 +2178,7 @@
 	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));
+		ch_desc := valueof(ts_ChanDescH0(g_pars.chan_nr, mp_trx_pars[0].arfcn));
 	}
 
 	/* Send IMM.ASS via CCHAN */
@@ -3729,7 +3735,8 @@
 	f_l1_tune(L1CTL);
 
 	for (var integer i := 0; i < num_total; i := i+1) {
-		var ChannelDescription ch_desc := valueof(ts_ChanDescH0(ts_RslChanNr_SDCCH4(0, 0), mp_trx0_arfcn));
+		var ChannelDescription ch_desc := valueof(ts_ChanDescH0(ts_RslChanNr_SDCCH4(0, 0),
+									mp_trx_pars[0].arfcn));
 		var GsmRrMessage ia := valueof(ts_IMM_ASS(42, i, 5, ch_desc, c_MA_null));
 		var octetstring ia_enc := enc_GsmRrMessage(ia);
 		RSL_CCHAN.send(ts_ASP_RSL_UD(ts_RSL_IMM_ASSIGN(ia_enc, 0)));
diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn
index 0c032bb..439fab6 100644
--- a/bts/BTS_Tests_LAPDm.ttcn
+++ b/bts/BTS_Tests_LAPDm.ttcn
@@ -43,7 +43,7 @@
 
 /* master function switching to a dedicated radio channel */
 function f_switch_dcch() runs on ConnHdlr {
-	var GsmBandArfcn arfcn := valueof(ts_GsmBandArfcn(mp_trx0_arfcn));
+	var GsmBandArfcn arfcn := valueof(ts_GsmBandArfcn(mp_trx_pars[0].arfcn));
 	var BCCH_tune_req tune_req := { arfcn := arfcn, combined_ccch := true };
 	var DCCH_switch_req sw_req;
 
@@ -52,7 +52,7 @@
 		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.chan_desc := valueof(ts_ChanDescH0(g_pars.chan_nr, arfcn.arfcn));
 		sw_req.ma := omit;
 	}
 
diff --git a/bts/BTS_Tests_SMSCB.ttcn b/bts/BTS_Tests_SMSCB.ttcn
index 6d080f2..680c19a 100644
--- a/bts/BTS_Tests_SMSCB.ttcn
+++ b/bts/BTS_Tests_SMSCB.ttcn
@@ -256,18 +256,20 @@
 	if (match(pars.chan_nr, t_RslChanNr_CBCH4(0))) {
 		f_l1_tune(L1CTL, ccch_mode := CCCH_MODE_COMBINED_CBCH);
 	} else {
+		var uint8_t tn := pars.chan_nr.tn;
+
 		f_l1_tune(L1CTL, ccch_mode := CCCH_MODE_COMBINED);
 
 		if (pars.fhp.enabled) {
 			L1CTL.send(ts_L1CTL_DM_EST_REQ_H1(pars.chan_nr,
-							  7 /* TODO: mp_tsc */,
+							  mp_trx_pars[0].ts[tn].tsc,
 							  pars.fhp.maio_hsn.hsn,
 							  pars.fhp.maio_hsn.maio,
 							  pars.fhp.ma));
 		} else {
 			L1CTL.send(ts_L1CTL_DM_EST_REQ_H0(pars.chan_nr,
-							  7 /* TODO: mp_tsc */,
-							  mp_trx0_arfcn));
+							  mp_trx_pars[0].ts[tn].tsc,
+							  mp_trx_pars[0].arfcn));
 		}
 	}
 
diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index e7d8a7c..34b6517 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -59,6 +59,23 @@
 	arfcn := arfcn
 };
 
+/* see enum 'gsm_phys_chan_config' in libosmocore */
+type enumerated PchanConfig {
+	GSM_PCHAN_NONE,
+	GSM_PCHAN_CCCH,
+	GSM_PCHAN_CCCH_SDCCH4,
+	GSM_PCHAN_CCCH_SDCCH4_CBCH,
+	GSM_PCHAN_SDCCH8,
+	GSM_PCHAN_SDCCH8_CBCH,
+	GSM_PCHAN_TCHF,
+	GSM_PCHAN_TCHH,
+	GSM_PCHAN_PDCH,
+	/* IPA style dynamic TCH/F+PDCH */
+	GSM_PCHAN_TCHF_PDCH,
+	/* Osmocom style dynamic TCH/H+TCH/F+PDCH */
+	GSM_PCHAN_TCHH_TCHF_PDCH
+};
+
 type enumerated GprsCodingScheme {
 	CS1, CS2, CS3, CS4
 };

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21151
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: I021994001b0e819fd63364bb267950e0c9ff7695
Gerrit-Change-Number: 21151
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/20201114/e5eb873e/attachment.htm>


More information about the gerrit-log mailing list