library: L1CTL: merge L1ctl{Ul,Dl}Message into L1ctlMessage

Currently we have two variants of the L1CTL PDU:

* L1ctlUlMessage: L23 -> L1 requests (*_REQ),
* L1ctlDlMessage: L1 -> L23 responses (*_IND, *_CONF).

The L1CTL_PT port is defined in a way that one can:

* Tx L1ctl{Ul,Dl}Message PDUs,
* Rx L1ctlDlMessage PDUs.

This means that the testsuite can act as the L23 talking to the L1
(e.g. trxcon or virtphy), but not vice-versa.  Adding an additional
Rx `UD_send_data -> L1ctlUlMessage` mapping is not an option,
because such a mapping would be ambiguous and would cause errors.

By merging the two L1CTL PDU variants into the one, we can achieve
the testsuite acting as the L1.  This will be useful for testing
the L23 applications in osmocom-bb.git, like the modem app.

Take a chance to reorder fields to match the order in L1ctlMsgType.

Change-Id: I1313068c5f02b65d3dbb05a1341a9d7286225f0c
Related: OS#5500
diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn
index c44b2ae..d84cee4 100644
--- a/library/L1CTL_PortType.ttcn
+++ b/library/L1CTL_PortType.ttcn
@@ -46,8 +46,8 @@
 	function f_L1CTL_rx_data(L1CTL_PT pt,
 				 template (present) RslChannelNr chan_nr := ?,
 				 template (present) RslLinkId link_id := ?)
-	return L1ctlDlMessage {
-		var L1ctlDlMessage dl;
+	return L1ctlMessage {
+		var L1ctlMessage dl;
 		timer T := 2.0;
 
 		T.start;
@@ -72,7 +72,7 @@
 	{
 		timer T := 15.0;
 		for (var integer i := 0; i < 10; i := i+1) {
-			var L1ctlDlMessage dl;
+			var L1ctlMessage dl;
 			pt.send(ts_L1CTL_FBSB_REQ(arfcn, valueof(t_L1CTL_FBSB_F_ALL), 0, ccch_mode, rxlev_exp));
 			T.start
 			alt {
@@ -108,7 +108,7 @@
 	}
 
 	function f_L1CTL_TCH_MODE(L1CTL_PT pt,
-				  template (value) L1ctlUlMessage tch_mode_req_tmpl := ts_L1CTL_TCH_MODE_REQ) {
+				  template (value) L1ctlMessage tch_mode_req_tmpl := ts_L1CTL_TCH_MODE_REQ) {
 		timer T := 2.0;
 		pt.send(tch_mode_req_tmpl);
 		T.start;
@@ -126,7 +126,7 @@
 			      template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
 			      template (value) RslLinkId link_id := ts_RslLinkID_DCCH(0))
 	return GsmFrameNumber {
-		var L1ctlDlMessage rc;
+		var L1ctlMessage rc;
 		var GsmFrameNumber fn;
 		timer T := 2.0;
 		T.start
@@ -146,7 +146,7 @@
 		L1CTL_PT pt, uint16_t ra11, L1ctlRachSynchSeq seq,
 		uint8_t combined := 1, uint16_t offset := 0
 	) return GsmFrameNumber {
-		var L1ctlDlMessage rc;
+		var L1ctlMessage rc;
 		var GsmFrameNumber fn;
 		timer T := 2.0;
 
@@ -170,7 +170,7 @@
 
 	function f_L1CTL_WAIT_IMM_ASS(L1CTL_PT pt, uint8_t ra, GsmFrameNumber rach_fn) return ImmediateAssignment {
 		var template GsmRrMessage rr_imm_ass;
-		var L1ctlDlMessage dl;
+		var L1ctlMessage dl;
 		var GsmRrMessage rr;
 		timer T := 10.0;
 
@@ -204,7 +204,7 @@
 	function f_L1CTL_WAIT_IMM_ASS_TBF_DL(L1CTL_PT pt, GprsTlli tlli) return ImmediateAssignment {
 		var template PacketDlAssign dl_ass := tr_PacketDlAssign(tlli);
 		var template IaRestOctets rest := tr_IaRestOctets_DLAss(dl_ass);
-		var L1ctlDlMessage dl;
+		var L1ctlMessage dl;
 		var GsmRrMessage rr;
 		timer T := 10.0;
 		T.start;
@@ -310,36 +310,28 @@
 		pout.err := pin.result.err;
 	} with { extension "prototype(fast)" }
 
-	private function L1CTL_to_UD_ul(in L1ctlUlMessage pin, out UD_send_data pout) {
-		var L1ctlUlMessageLV msg_lv := { msg := pin };
-		pout.data := enc_L1ctlUlMessageLV(msg_lv);
+	private function L1CTL_to_UD(in L1ctlMessage pin, out UD_send_data pout) {
+		var L1ctlMessageLV msg_lv := { msg := pin };
+		pout.data := enc_L1ctlMessageLV(msg_lv);
 		pout.id := 0;
 	} with { extension "prototype(fast)" }
 
-	private function L1CTL_to_UD_dl(in L1ctlDlMessage pin, out UD_send_data pout) {
-		var L1ctlDlMessageLV msg_lv := { msg := pin };
-		pout.data := enc_L1ctlDlMessageLV(msg_lv);
-		pout.id := 0;
-	} with { extension "prototype(fast)" }
-
-	private function UD_to_L1CTL_dl(in UD_send_data pin, out L1ctlDlMessage pout) {
-		var L1ctlDlMessageLV msg_lv := dec_L1ctlDlMessageLV(pin.data);
+	private function UD_to_L1CTL(in UD_send_data pin, out L1ctlMessage pout) {
+		var L1ctlMessageLV msg_lv := dec_L1ctlMessageLV(pin.data);
 		pout:= msg_lv.msg;
 	} with { extension "prototype(fast)" }
 
 	type port L1CTL_PT message {
-		out L1ctlUlMessage
-		out L1ctlDlMessage
+		out L1ctlMessage
 		out L1CTL_connect
-		in L1ctlDlMessage
+		in L1ctlMessage
 		in L1CTL_connect_result
 		in UD_listen_result
 		in UD_connected
 	} with { extension "user UD_PT
-		out(L1ctlUlMessage -> UD_send_data: function(L1CTL_to_UD_ul);
-		    L1ctlDlMessage -> UD_send_data: function(L1CTL_to_UD_dl);
+		out(L1ctlMessage -> UD_send_data: function(L1CTL_to_UD);
 		    L1CTL_connect -> UD_connect: function(L1CTL_to_UD_connect))
-		in(UD_send_data -> L1ctlDlMessage: function(UD_to_L1CTL_dl);
+		in(UD_send_data -> L1ctlMessage: function(UD_to_L1CTL);
 		   UD_connect_result -> L1CTL_connect_result: function(UD_to_L1CTL_connect_result);
 		   UD_listen_result -> UD_listen_result: simple;
 		   UD_connected -> UD_connected: simple