pcu_l1_if.cpp: handle TLLI based IMMEDIATE ASSIGNMENT confirmation

The IMMEDIATE ASSIGNMENT for downlink TBFs must be confirmed by the
receiving end (BSC/BTS) in order to set the timers in the PCU correctly.

When the PCU is used in a BSC co-located scheme (Ericsson RBS). The TLLI
is used as an identifier to confirm a specific IMMEDIATE ASSIGNMENT.

Change-Id: Icf7ca34500984239ee877ee71fd9c126b5eb3480
Related: OS#5198
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 69629db..02f56ac 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -512,7 +512,7 @@
 	switch (data_cnf->sapi) {
 	case PCU_IF_SAPI_PCH:
 		if (data_cnf->data[2] == GSM48_MT_RR_IMM_ASS)
-			bts_rcv_imm_ass_cnf(bts, data_cnf->data, data_cnf->fn);
+			bts_rcv_imm_ass_cnf(bts, data_cnf->data, GSM_RESERVED_TMSI, data_cnf->fn);
 		break;
 	default:
 		LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with "
@@ -523,6 +523,26 @@
 	return rc;
 }
 
+static int pcu_rx_data_cnf_dt(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data_cnf_dt *data_cnf_dt)
+{
+	int rc = 0;
+	int current_fn = bts_current_frame_number(bts);
+
+	LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d fn=%d cur_fn=%d\n",
+	     data_cnf_dt->sapi, data_cnf_dt->fn, current_fn);
+
+	switch (data_cnf_dt->sapi) {
+	case PCU_IF_SAPI_PCH:
+		bts_rcv_imm_ass_cnf(bts, NULL, data_cnf_dt->tlli, data_cnf_dt->fn);
+		break;
+	default:
+		LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with unsupported sapi %d\n", data_cnf_dt->sapi);
+		rc = -EINVAL;
+	}
+
+	return rc;
+}
+
 // FIXME: remove this, when changed from c++ to c.
 int pcu_rx_rts_req_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts,
 	uint32_t fn, uint8_t block_nr)
@@ -1133,6 +1153,10 @@
 		CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf);
 		rc = pcu_rx_data_cnf(bts, &pcu_prim->u.data_cnf);
 		break;
+	case PCU_IF_MSG_DATA_CNF_DT:
+		CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf_dt);
+		rc = pcu_rx_data_cnf_dt(bts, &pcu_prim->u.data_cnf_dt);
+		break;
 	case PCU_IF_MSG_RTS_REQ:
 		CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.rts_req);
 		rc = pcu_rx_rts_req(bts, &pcu_prim->u.rts_req);