[MERGED] openbsc[master]: pcu_sock: implement direct tlli on AGCH

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu May 25 14:43:16 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: pcu_sock: implement direct tlli on AGCH
......................................................................


pcu_sock: implement direct tlli on AGCH

Ericsson allows to attach a reference to immediate assignments. A
confirmation of the transmission is then sent back, but only containing
the reference, not the whole RLC packet.

Change-Id: I945f49e62e2a74a7906e2d49940927773edd04a9
---
M openbsc/include/openbsc/pcuif_proto.h
M openbsc/src/libbsc/pcu_sock.c
2 files changed, 33 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/include/openbsc/pcuif_proto.h b/openbsc/include/openbsc/pcuif_proto.h
index a52d896..3fc500b 100644
--- a/openbsc/include/openbsc/pcuif_proto.h
+++ b/openbsc/include/openbsc/pcuif_proto.h
@@ -1,7 +1,7 @@
 #ifndef _PCUIF_PROTO_H
 #define _PCUIF_PROTO_H
 
-#define PCU_IF_VERSION		0x07
+#define PCU_IF_VERSION		0x08
 
 /* msg_type */
 #define PCU_IF_MSG_DATA_REQ	0x00	/* send data to given channel */
@@ -22,6 +22,7 @@
 #define PCU_IF_SAPI_PDTCH	0x05	/* packet data/control/ccch block */
 #define PCU_IF_SAPI_PRACH	0x06	/* packet random access channel */
 #define PCU_IF_SAPI_PTCCH	0x07	/* packet TA control channel */
+#define PCU_IF_SAPI_AGCH_DT	0x08	/* assignment on AGCH but with additional TLLI */
 
 /* flags */
 #define PCU_IF_FLAG_ACTIVE	(1 << 0)/* BTS is active */
diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c
index 7712878..0ae3a03 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -56,6 +56,7 @@
 	[PCU_IF_SAPI_PDTCH] =	"PDTCH",
 	[PCU_IF_SAPI_PRACH] =	"PRACH",
 	[PCU_IF_SAPI_PTCCH] = 	"PTCCH",
+	[PCU_IF_SAPI_AGCH_DT] = 	"AGCH_DT",
 };
 
 /* Check if BTS has a PCU connection */
@@ -326,6 +327,7 @@
 	struct gsm_bts_trx_ts *ts;
 	struct msgb *msg;
 	char imsi_digit_buf[4];
+	uint32_t tlli = -1;
 	uint8_t pag_grp;
 	int rc = 0;
 
@@ -342,6 +344,7 @@
 		imsi_digit_buf[1] = data_req->data[1];
 		imsi_digit_buf[2] = data_req->data[2];
 		imsi_digit_buf[3] = '\0';
+		LOGP(DPCU, LOGL_DEBUG, "SAPI PCH imsi %s", imsi_digit_buf);
 		pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
 						str_to_imsi(imsi_digit_buf));
 		pcu_rx_rr_paging(bts, pag_grp, data_req->data+3);
@@ -360,6 +363,34 @@
 			rc = -EIO;
 		}
 		break;
+	case PCU_IF_SAPI_AGCH_DT:
+		/* DT = direct tlli. A tlli is prefixed */
+
+		if (data_req->len < 5) {
+			LOGP(DPCU, LOGL_ERROR, "Received PCU data request with "
+					"invalid/small length %d\n", data_req->len);
+			break;
+		}
+		tlli = *((uint32_t *)data_req->data);
+
+		msg = msgb_alloc(data_req->len - 4, "pcu_agch");
+		if (!msg) {
+			rc = -ENOMEM;
+			break;
+		}
+		msg->l3h = msgb_put(msg, data_req->len - 4);
+		memcpy(msg->l3h, data_req->data + 4, data_req->len - 4);
+
+		if (bts->type == GSM_BTS_TYPE_RBS2000)
+			rc = rsl_ericsson_imm_assign_cmd(bts, tlli, msg->len, msg->data);
+		else
+			rc = rsl_imm_assign_cmd(bts, msg->len, msg->data);
+
+		if (rc) {
+			msgb_free(msg);
+			rc = -EIO;
+		}
+		break;
 	default:
 		LOGP(DPCU, LOGL_ERROR, "Received PCU data request with "
 			"unsupported sapi %d\n", data_req->sapi);

-- 
To view, visit https://gerrit.osmocom.org/2063
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I945f49e62e2a74a7906e2d49940927773edd04a9
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list