pcu_l1_if_phy: add new PHY API function to disconnect PDCH

There is a function l1if_connect_pdch, but no complementary function
like we have it with l1if_open_pdch and l1if_close_pdch. The reason for
this is that the PHY implementations that rely on a femtocell DSP do not
need to disconnect the pdch explcitly. However, the planned support for
the E1 based Ercisson RBS CCU will require an explicit disconnect. So
lets add a function call for this.

Change-Id: Ied88f3289bda87c48f5f9255c4591470633cc805
Related: OS#5198
diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c
index 053844f..580cdf0 100644
--- a/src/osmo-bts-litecell15/lc15_l1_if.c
+++ b/src/osmo-bts-litecell15/lc15_l1_if.c
@@ -145,6 +145,11 @@
 	return l1if_req_pdch(fl1h, msg);
 }
 
+int l1if_disconnect_pdch(void *obj, uint8_t ts)
+{
+	return 0;
+}
+
 static int handle_ph_readytosend_ind(struct lc15l1_hdl *fl1h,
 				     GsmL1_PhReadyToSendInd_t *rts_ind)
 {
diff --git a/src/osmo-bts-oc2g/oc2g_l1_if.c b/src/osmo-bts-oc2g/oc2g_l1_if.c
index 1ea0b26..48005a2 100644
--- a/src/osmo-bts-oc2g/oc2g_l1_if.c
+++ b/src/osmo-bts-oc2g/oc2g_l1_if.c
@@ -146,6 +146,11 @@
 	return l1if_req_pdch(fl1h, msg);
 }
 
+int l1if_disconnect_pdch(void *obj, uint8_t ts)
+{
+	return 0;
+}
+
 static int handle_ph_readytosend_ind(struct oc2gl1_hdl *fl1h,
 				     GsmL1_PhReadyToSendInd_t *rts_ind)
 {
diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c
index 31028f5..18378b6 100644
--- a/src/osmo-bts-sysmo/sysmo_l1_if.c
+++ b/src/osmo-bts-sysmo/sysmo_l1_if.c
@@ -128,6 +128,11 @@
 	return l1if_req_pdch(fl1h, msg);
 }
 
+int l1if_disconnect_pdch(void *obj, uint8_t ts)
+{
+	return 0;
+}
+
 static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1h,
 				     GsmL1_PhReadyToSendInd_t *rts_ind)
 {
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index fdee83d..258a118 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -918,6 +918,10 @@
 				     trx_nr, ts_nr, pdch->tsc, pdch->fh.enabled ? "yes" : "no");
 			} else {
 				if (pdch->is_enabled()) {
+#ifdef ENABLE_DIRECT_PHY
+					if ((info_ind->flags & PCU_IF_FLAG_SYSMO))
+						l1if_disconnect_pdch(bts->trx[trx_nr].fl1h, ts_nr);
+#endif
 					pcu_tx_act_req(bts, pdch, 0);
 					pdch->disable();
 				}
diff --git a/src/pcu_l1_if_phy.h b/src/pcu_l1_if_phy.h
index 73d0b6f..318d0aa 100644
--- a/src/pcu_l1_if_phy.h
+++ b/src/pcu_l1_if_phy.h
@@ -7,4 +7,5 @@
 int l1if_connect_pdch(void *obj, uint8_t ts);
 int l1if_pdch_req(void *obj, uint8_t ts, int is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr, uint8_t *data,
 		  uint8_t len);
+int l1if_disconnect_pdch(void *obj, uint8_t ts);
 int l1if_close_pdch(void *obj);