BTS_Tests: re-organize configuration of TRX/TS params

Change-Id: I9b225249d135399f63d3c7e4c567121dfea63f75
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index cf468cf..8895c6b 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,17 @@
 	}
 }
 
+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
+};
+
 friend type record FreqHopPars {
 	/* Whether frequency hopping is in use */
 	boolean enabled,
@@ -584,7 +593,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 +645,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 +736,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) := {
@@ -2145,7 +2148,7 @@
 	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].arfcn));
 	} else {
 		pt.send(ts_L1CTL_DM_EST_REQ_H1(pars.chan_nr,
 						7 /* TODO: mp_tsc */,
@@ -2172,7 +2175,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 +3732,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)));