library: L1CTL: rework GPRS related message definitions

The old GPRS related messages are no longer valid.  Use the new message
definitions supported by both trxcon and virtphy since recently.

Comment out lines referencing the old definitions in LAPDm_RAW_PT.ttcn.
This module contains an implementation of the RLC/MAC abstraction
layer, which is currently not used anywhere.

Change-Id: Ib8f4459480bbe12584a6fa71882f745f03c5055d
Related: osmocom-bb.git I9567d64f9d00262e36147e8d7e541e5e246bda5f
Related: OS#5500
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index e08f243..d901664 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5303,6 +5303,14 @@
  * PCU Socket related tests
  ***********************************************************************/
 
+/* Tune the L1 to PDCH on the given timeslot number */
+private function f_TC_pcu_l1ctl_est_pdch(uint3_t tn) runs on test_CT {
+	var ConnHdlrPars pars := valueof(t_Pars(ts_RslChanNr_PDCH(tn), ts_RSL_ChanMode_SIGN));
+	if (mp_freq_hop_enabled and mp_transceiver_num > 1)
+		{ f_resolve_fh_params(pars.fhp, tn); }
+	f_l1ctl_est_dchan(L1CTL, pars);
+}
+
 /* Verify no RTS before ACT_REQ; verify RTS after ACT_REQ */
 friend function f_TC_pcu_act_req(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, boolean exp_success)
 runs on test_CT {
@@ -5499,60 +5507,53 @@
 
 /* Send DATA.req on invalid BTS */
 testcase TC_pcu_data_req_wrong_bts() runs on test_CT {
-	var TfiUsfArr tua := f_TfiUsfArrInit();
 	var octetstring data := '0000'O & f_rnd_octstring(21);
 
 	f_virtphy_common();
 
 	f_TC_pcu_act_req(0, 0, 7, true);
-	f_TfiUsfArrSet(tua, 7, 0);
-	f_L1CTL_TBF_CFG(L1CTL, false, tua);
-	f_sleep(1.0);
+	f_TC_pcu_l1ctl_est_pdch(7);
 
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 	f_pcu_to_l1(23, 0, 7, PCU_IF_SAPI_PDTCH, data, false, false);
 }
 
 /* Send DATA.req on invalid TRX */
 testcase TC_pcu_data_req_wrong_trx() runs on test_CT {
-	var TfiUsfArr tua := f_TfiUsfArrInit();
 	var octetstring data := '0000'O & f_rnd_octstring(21);
 
 	f_virtphy_common();
 
 	f_TC_pcu_act_req(0, 0, 7, true);
-	f_TfiUsfArrSet(tua, 7, 0);
-	f_L1CTL_TBF_CFG(L1CTL, false, tua);
-	f_sleep(1.0);
+	f_TC_pcu_l1ctl_est_pdch(7);
 
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 	f_pcu_to_l1(0, 100, 7, PCU_IF_SAPI_PDTCH, data, false, false);
 }
 
 /* Send DATA.req on invalid timeslot */
 testcase TC_pcu_data_req_wrong_ts() runs on test_CT {
-	var TfiUsfArr tua := f_TfiUsfArrInit();
 	var octetstring data := '0000'O & f_rnd_octstring(21);
 
 	f_virtphy_common();
 
 	f_TC_pcu_act_req(0, 0, 7, true);
-	f_TfiUsfArrSet(tua, 7, 0);
-	f_L1CTL_TBF_CFG(L1CTL, false, tua);
-	f_sleep(1.0);
+	f_TC_pcu_l1ctl_est_pdch(7);
 
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 	f_pcu_to_l1(0, 0, 70, PCU_IF_SAPI_PDTCH, data, false, false);
 }
 
 /* Send DATA.req on timeslot that hasn't been activated */
 testcase TC_pcu_data_req_ts_inactive() runs on test_CT {
-	var TfiUsfArr tua := f_TfiUsfArrInit();
 	var octetstring data := '0000'O & f_rnd_octstring(21);
 
 	f_virtphy_common();
 
-	f_TfiUsfArrSet(tua, 7, 0);
-	f_L1CTL_TBF_CFG(L1CTL, false, tua);
-	f_sleep(1.0);
+	/* intentionally not calling f_TC_pcu_act_req() */
+	f_TC_pcu_l1ctl_est_pdch(7);
 
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 	f_pcu_to_l1(0, 0, 7, PCU_IF_SAPI_PDTCH, data, false, false);
 }
 
@@ -5572,11 +5573,11 @@
 
 	T.start;
 	alt {
-	[expect_data] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_PDCH(ts_nr), ?, data)) {
-		/* FIXME: why is fn of DATA_IND different to fn of RTS / DATA_REQ above? */
+	[expect_data] L1CTL.receive(tr_L1CTL_GPRS_DL_BLOCK_IND(tn := ts_nr, data := data)) {
+		/* FIXME: why is fn of DL BLOCK.ind different to fn of RTS / DATA_REQ above? */
 		setverdict(pass);
 		}
-	[not expect_data] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_PDCH(ts_nr), ?, data)) -> value rx_dl {
+	[not expect_data] L1CTL.receive(tr_L1CTL_GPRS_DL_BLOCK_IND(tn := ts_nr, data := data)) -> value rx_dl {
 		setverdict(fail, "Received unexpected ", rx_dl);
 		}
 	[] L1CTL.receive {
@@ -5608,31 +5609,26 @@
 }
 
 testcase TC_pcu_data_req_pdtch() runs on test_CT {
-	var TfiUsfArr tua := f_TfiUsfArrInit();
 	var octetstring data := '0000'O & f_rnd_octstring(21);
 
 	f_virtphy_common();
 
 	f_TC_pcu_act_req(0, 0, 7, true);
-	f_TfiUsfArrSet(tua, 7, 0);
-	f_L1CTL_TBF_CFG(L1CTL, false, tua);
-	f_sleep(1.0);
+	f_TC_pcu_l1ctl_est_pdch(7);
 
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 	f_pcu_to_l1(0, 0, 7, PCU_IF_SAPI_PDTCH, data); //c_PCU_DATA);
 }
 
-/* FIXME: PTTCH has nothing to do with TBFs */
 testcase TC_pcu_data_req_ptcch() runs on test_CT {
-	var TfiUsfArr tua := f_TfiUsfArrInit();
 	var octetstring data := '0000'O & f_rnd_octstring(21);
 
 	f_virtphy_common();
 
 	f_TC_pcu_act_req(0, 0, 7, true);
-	f_TfiUsfArrSet(tua, 7, 0);
-	f_L1CTL_TBF_CFG(L1CTL, false, tua);
-	f_sleep(1.0);
+	f_TC_pcu_l1ctl_est_pdch(7);
 
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 	f_pcu_to_l1(0, 0, 7, PCU_IF_SAPI_PTCCH, data);
 }
 
@@ -5679,11 +5675,9 @@
 	/* Activate PDCH channel on TS7 */
 	f_TC_pcu_act_req(0, 0, 7, true);
 
-	/* 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.fhp, pars.chan_nr.tn); }
-	f_l1ctl_est_dchan(L1CTL, pars);
+	/* Tune the L1 to that PDCH channel */
+	f_TC_pcu_l1ctl_est_pdch(7);
+	L1CTL.send(ts_L1CTL_GPRS_DL_TBF_CFG_REQ(0, '00000001'B));
 
 	/* Verify PTCCH/U: send several access bursts, make sure they're received */
 	for (var integer i := 0; i < 16; i := i + 1) {
@@ -5702,25 +5696,13 @@
 	 * let's give it more time in case if we miss the beginning. */
 	T.start(2.0 * 2.0 * 52.0 * 4.615 / 1000.0);
 	alt {
-	/* PDCH is considered as traffic in trxcon => expect TRAFFIC.ind */
-	[] L1CTL.receive(tr_L1CTL_TRAFFIC_IND(chan_nr := t_RslChanNr_PDCH(7),
-					      link_id := tr_RslLinkID_OSMO_PTCCH(?),
-					      frame := data)) -> value dl {
-		log("Rx PTCCH/D data (traffic) block on L1CTL: ", dl);
-		setverdict(pass);
-		T.stop;
-		}
-	/* Other PHYs (e.g. virt_phy) may consider PDCH as data => expect DATA.ind */
-	[] L1CTL.receive(tr_L1CTL_DATA_IND(chan_nr := t_RslChanNr_PDCH(7),
-					   link_id := tr_RslLinkID_OSMO_PTCCH(?),
-					   l2_data := data)) -> value dl {
-		log("Rx PTCCH/D data block on L1CTL: ", dl);
+	[] L1CTL.receive(tr_L1CTL_GPRS_DL_BLOCK_IND(fn := ?, tn := 7, data := data)) {
 		setverdict(pass);
 		T.stop;
 		}
 	[] L1CTL.receive { repeat; }
 	[] T.timeout {
-		setverdict(fail, "Timeout waiting for DATA.ind on L1CTL");
+		setverdict(fail, "Timeout waiting DL BLOCK.ind with PTCCH/D");
 		}
 	}
 }
@@ -5895,9 +5877,9 @@
 	/* PCUIF_DATA.ind is encapsulated into a supplementary record */
 	sdt := t_SD_PCUIF_MSGT(g_pcu_conn_id, PCU_IF_MSG_DATA_IND);
 
-	/* Send a random PDTCH frame over Um */
-	L1CTL.send(ts_L1CTL_TRAFFIC_REQ(ts_RslChanNr_PDCH(7), ts_RslLinkID_DCCH(0),
-					'0000'O & f_rnd_octstring(21)));
+	/* Send a random PDTCH frame over Um
+	 * FIXME: we need to wait for a DL block and user Fn from there. */
+	L1CTL.send(ts_L1CTL_GPRS_UL_BLOCK_REQ(0, 7, '0000'O & f_rnd_octstring(21)));
 
 	T.start;
 	alt {
@@ -5944,10 +5926,8 @@
 	f_TC_pcu_act_req(0, 0, 7, true);
 
 	/* 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.fhp, pars.chan_nr.tn); }
-	f_l1ctl_est_dchan(L1CTL, pars);
+	f_TC_pcu_l1ctl_est_pdch(7);
+	L1CTL.send(ts_L1CTL_GPRS_UL_TBF_CFG_REQ(0, '00000001'B));
 
 	/* C/I in centiBels, test range: -256 .. +1280, step 128 */
 	for (var int16_t i := -256; i <= 1280; i := i + 128) {