[PATCH] openbsc[master]: pcu_sock: Forward imm.ass PCU originated messages

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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Mar 14 14:41:39 UTC 2017


Review at  https://gerrit.osmocom.org/2064

pcu_sock: Forward imm.ass PCU originated messages

The PCU sends imm.ass messages in response to a rach request. Those
messages need to be forwarded to RSL in order to get them send. This
commit introduces the required functionality for that

Change-Id: Ice099c4ed7008200ed179e581aba1899c6c29455
---
M openbsc/include/openbsc/pcu_if.h
M openbsc/include/openbsc/pcuif_proto.h
M openbsc/src/libbsc/abis_rsl.c
M openbsc/src/libbsc/pcu_sock.c
4 files changed, 59 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/64/2064/1

diff --git a/openbsc/include/openbsc/pcu_if.h b/openbsc/include/openbsc/pcu_if.h
index 68d4174..0c355b7 100644
--- a/openbsc/include/openbsc/pcu_if.h
+++ b/openbsc/include/openbsc/pcu_if.h
@@ -24,6 +24,10 @@
 /* Confirm the sending of an immediate assignment to the pcu */
 int pcu_tx_imm_ass_sent(struct gsm_bts *bts, uint32_t tlli);
 
+
+/* Confirm the sending of an immediate assignment to the pcu */
+int pcu_tx_imm_ass_sent(struct gsm_bts *bts, uint32_t tlli);
+
 /* Open connection to PCU */
 int pcu_sock_init(const char *path, struct gsm_bts *bts);
 
diff --git a/openbsc/include/openbsc/pcuif_proto.h b/openbsc/include/openbsc/pcuif_proto.h
index 3fc500b..eb28d66 100644
--- a/openbsc/include/openbsc/pcuif_proto.h
+++ b/openbsc/include/openbsc/pcuif_proto.h
@@ -7,6 +7,7 @@
 #define PCU_IF_MSG_DATA_REQ	0x00	/* send data to given channel */
 #define PCU_IF_MSG_DATA_CNF	0x01	/* confirm (e.g. transmission on PCH) */
 #define PCU_IF_MSG_DATA_IND	0x02	/* receive data from given channel */
+#define PCU_IF_MSG_DATA_CNF_DT	0x11	/* confirm (with direct tlli) */
 #define PCU_IF_MSG_RTS_REQ	0x10	/* ready to send request */
 #define PCU_IF_MSG_RACH_IND	0x22	/* receive RACH */
 #define PCU_IF_MSG_INFO_IND	0x32	/* retrieve BTS info */
@@ -54,6 +55,21 @@
 	uint16_t	ber10k;		/*!< \brief BER in units of 0.01% */
 	int16_t		ta_offs_qbits;	/* !< \brief Burst TA Offset in quarter bits */
 	int16_t		lqual_cb;	/* !< \brief Link quality in centiBel */
+} __attribute__ ((packed));
+
+/* data confirmation with direct tlli (instead of raw mac block with tlli) */
+struct gsm_pcu_if_data_cnf_dt {
+	uint8_t		sapi;
+	uint32_t	tlli;
+	uint32_t	fn;
+	uint16_t	arfcn;
+	uint8_t		trx_nr;
+	uint8_t		ts_nr;
+	uint8_t		block_nr;
+	int8_t		rssi;
+	uint16_t ber10k;	/*!< \brief BER in units of 0.01% */
+	int16_t ta_offs_qbits;	/* !< \brief Burst TA Offset in quarter bits */
+	int16_t lqual_cb;	/* !< \brief Link quality in centiBel */
 } __attribute__ ((packed));
 
 struct gsm_pcu_if_rts_req {
@@ -146,6 +162,7 @@
 	union {
 		struct gsm_pcu_if_data		data_req;
 		struct gsm_pcu_if_data		data_cnf;
+		struct gsm_pcu_if_data_cnf_dt	data_cnf_dt;
 		struct gsm_pcu_if_data		data_ind;
 		struct gsm_pcu_if_rts_req	rts_req;
 		struct gsm_pcu_if_rach_ind	rach_ind;
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 1ad28cf..72547e9 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1988,6 +1988,7 @@
 	struct e1inp_sign_link *sign_link = msg->dst;
 	struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg);
 	int rc = 0;
+	uint32_t tlli;
 
 	msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
 				  "Abis RSL rx CCHAN: ");
@@ -2008,6 +2009,22 @@
 		LOGP(DRSL, LOGL_NOTICE, "Unimplemented Abis RSL TRX message "
 			"type 0x%02x\n", rslh->c.msg_type);
 		break;
+	case 0x10: /* Ericsson specific: Immediate Assign Sent */
+		/* FIXME: Replace the messy message parsing below
+		 * with proper TV parser */
+		LOGP(DRSL, LOGL_INFO, "IMM.ass sent\n");
+		if(msg->len < 8)
+			LOGP(DRSL, LOGL_ERROR, "short IMM.ass sent message!\n");
+		else if(msg->data[4] != 0xf1)
+			LOGP(DRSL, LOGL_ERROR, "unsupported IMM.ass message format! (please fix)\n");
+		else {
+			tlli =  msg->data[8];
+			tlli |= msg->data[7] << 8;
+			tlli |= msg->data[6] << 16;
+			tlli |= msg->data[5] << 24;
+			pcu_tx_imm_ass_sent(sign_link->trx->bts, tlli);
+		}
+		break;
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "Unknown Abis RSL TRX message type "
 			"0x%02x\n", rslh->c.msg_type);
diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c
index 0ae3a03..7e77797 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -286,6 +286,27 @@
 	return pcu_sock_send(bts, msg);
 }
 
+/* Confirm the sending of an immediate assignment to the pcu */
+int pcu_tx_imm_ass_sent(struct gsm_bts *bts, uint32_t tlli)
+{
+	struct msgb *msg;
+	struct gsm_pcu_if *pcu_prim;
+	struct gsm_pcu_if_data_cnf_dt *data_cnf_dt;
+
+	LOGP(DPCU, LOGL_INFO, "Sending PCH confirm with direct TLLI\n");
+
+	msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_CNF_DT, bts->nr);
+	if (!msg)
+		return -ENOMEM;
+	pcu_prim = (struct gsm_pcu_if *) msg->data;
+	data_cnf_dt = &pcu_prim->u.data_cnf_dt;
+
+	data_cnf_dt->sapi = PCU_IF_SAPI_PCH;
+	data_cnf_dt->tlli = tlli;
+
+	return pcu_sock_send(bts, msg);
+}
+
 /* we need to decode the raw RR paging messsage (see PCU code
  * Encoding::write_paging_request) and extract the mobile identity
  * (P-TMSI) from it */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice099c4ed7008200ed179e581aba1899c6c29455
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list