[PATCH] osmo-bsc[master]: abis-rsl: Send imm.ass messages via PCH

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 Apr 24 09:49:29 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6203

to look at the new patch set (#3).

abis-rsl: Send imm.ass messages via PCH

It is possible to send immidiate assign messages through the
paging channel. This commit adds the required functionality to
the pcu socket interface and to the abis_rsl api

Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5
---
M include/osmocom/bsc/abis_rsl.h
M include/osmocom/bsc/pcuif_proto.h
M src/libbsc/abis_rsl.c
M src/libbsc/pcu_sock.c
4 files changed, 53 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/6203/3

diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index b30702f..ae80879 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -60,7 +60,11 @@
 int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
 
 /* Ericcson vendor specific RSL extensions */
-int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val);
+int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val,
+				uint32_t tlli);
+int rsl_ericsson_imm_assign_via_pch_cmd(struct gsm_bts *bts, uint8_t len,
+					uint8_t *val, uint32_t tlli,
+					uint8_t pag_grp);
 
 /* Siemens vendor-specific RSL extensions */
 int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
diff --git a/include/osmocom/bsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h
index b9f61b6..081a95a 100644
--- a/include/osmocom/bsc/pcuif_proto.h
+++ b/include/osmocom/bsc/pcuif_proto.h
@@ -27,7 +27,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 */
+#define PCU_IF_SAPI_AGCH_DT	0x08	/* assignment on PCH or AGCH but with additional TLLI */
 
 /* flags */
 #define PCU_IF_FLAG_ACTIVE	(1 << 0)/* BTS is active */
@@ -75,6 +75,7 @@
 struct gsm_pcu_if_data_cnf_dt {
 	uint8_t		sapi;
 	uint32_t	tlli;
+	uint8_t		imsi[3];
 	uint32_t	fn;
 	uint16_t	arfcn;
 	uint8_t		trx_nr;
diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c
index 10bef6e..9de91b9 100644
--- a/src/libbsc/abis_rsl.c
+++ b/src/libbsc/abis_rsl.c
@@ -1096,17 +1096,42 @@
 	return abis_rsl_sendmsg(msg);
 }
 
-/* Chapter 8.5.6 */
-int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val)
+/* Append mobile idenitiy (tlli) to message buffer */
+static void rsl_ericsson_put_mi(struct msgb *msg, uint32_t tlli)
+{
+	/* NOTE: ericsson can handle a reference at the end of the message which is used in
+	 * the confirm message. The confirm message is only sent if the trailer is present */
+	msgb_put_u8(msg, RSL_IE_ERIC_MOBILE_ID);
+	msgb_put_u32(msg, tlli);
+}
+
+/* Chapter 8.5.6 (Ericcson vendor specific RSL extension) */
+int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val,
+				uint32_t tlli)
 {
 	struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val);
 	if (!msg)
 		return 1;
 
-	/* ericsson can handle a reference at the end of the message which is used in
-	 * the confirm message. The confirm message is only sent if the trailer is present */
-	msgb_put_u8(msg, RSL_IE_ERIC_MOBILE_ID);
-	msgb_put_u32(msg, tlli);
+	/* Append ericsson propritary mobile identity field */
+	rsl_ericsson_put_mi(msg, tlli);
+
+	return abis_rsl_sendmsg(msg);
+}
+
+/* Chapter 8.5.6 (Ericcson vendor specific RSL extension) */
+int rsl_ericsson_imm_assign_via_pch_cmd(struct gsm_bts *bts, uint8_t len,
+					uint8_t *val, uint32_t tlli,
+					uint8_t pag_grp)
+{
+	struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val);
+
+	/* Append ericsson propritary paging group field */
+	msgb_put_u8(msg, 0x0e);
+	msgb_put_u8(msg, pag_grp);
+
+	/* Append ericsson propritary mobile identity field */
+	rsl_ericsson_put_mi(msg, tlli);
 
 	return abis_rsl_sendmsg(msg);
 }
diff --git a/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c
index f5a82cc..637ba6a 100644
--- a/src/libbsc/pcu_sock.c
+++ b/src/libbsc/pcu_sock.c
@@ -326,9 +326,9 @@
 		mi_len = p1->data[0];
 		mi = p1->data+1;
 		LOGP(DPCU, LOGL_ERROR, "PCU Sends paging "
-		     "request type %02x (chan_needed=%02x, mi_len=%u, mi=%s)\n",
+		     "request type %02x (chan_needed=0x%02x, mi_len=%u, mi=%s, paging_group=0x%02x)\n",
 		     p1->msg_type, chan_needed, mi_len,
-		     osmo_hexdump_nospc(mi,mi_len));
+		     osmo_hexdump_nospc(mi,mi_len), paging_group);
 		/* NOTE: We will have to add 2 to mi_len and subtract 2 from
 		 * the mi pointer because rsl_paging_cmd() will perform the
 		 * reverse operations. This is because rsl_paging_cmd() is
@@ -401,6 +401,7 @@
 		msg->l3h = msgb_put(msg, data_req->len);
 		memcpy(msg->l3h, data_req->data, data_req->len);
 
+		LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via AGCH\n");
 		if (rsl_imm_assign_cmd(bts, msg->len, msg->data)) {
 			msgb_free(msg);
 			rc = -EIO;
@@ -415,19 +416,22 @@
 			break;
 		}
 		memcpy(&tlli, data_req->data, 4);
+		pag_grp = extract_paging_group(bts,data_req->data+4);
 
-		msg = msgb_alloc(data_req->len - 4, "pcu_agch");
+		msg = msgb_alloc(data_req->len - 7, "pcu_pch");
 		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);
+		msg->l3h = msgb_put(msg, data_req->len - 7);
+		memcpy(msg->l3h, data_req->data + 7, data_req->len - 7);
 
-		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);
+		LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (tlli=0x%08x, pag_grp=0x%02x)\n",
+		     tlli, pag_grp);
+		if (bts->type == GSM_BTS_TYPE_RBS2000) {
+			rc = rsl_ericsson_imm_assign_via_pch_cmd(bts, msg->len, msg->data, tlli, pag_grp);
+		} else
+			LOGP(DPCU, LOGL_ERROR, "This BTS does not support immediate via PCH, dropping message!\n");
 
 		if (rc) {
 			msgb_free(msg);
@@ -435,8 +439,8 @@
 		}
 		break;
 	default:
-		LOGP(DPCU, LOGL_ERROR, "Received PCU data request with "
-			"unsupported sapi %d\n", data_req->sapi);
+		LOGP(DPCU, LOGL_ERROR, "Received PCU data request for "
+		     "unsupported channel (sapi=%d)\n", data_req->sapi);
 		rc = -EINVAL;
 	}
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>



More information about the gerrit-log mailing list