laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
abis_rsl: add support for sending IMMEDIATE ASSIGNMENT through PCH

The IMMEDIATE ASSIGNMENT for downlink TBFs needs to be sent through the
PCH instead of the AGCH. Since this method is not specified in RSL, it
is usually a vendor specific extension.

Change-Id: I4452f4973d1ec69c96aad527b057226e8a6edf99
Related: OS#5198
---
M include/osmocom/bsc/abis_rsl.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/pcu_sock.c
3 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index dcae348..0a9cfdc 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -65,7 +65,7 @@
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, uint32_t tlli, uint8_t len, uint8_t *val, uint8_t pag_grp);

/* Siemens vendor-specific RSL extensions */
int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 6a7a900..a5effb3 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -964,12 +964,16 @@
}

/* Chapter 8.5.6 Immediate Assignment Command (with Ericcson vendor specific RSL extension) */
-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, uint32_t tlli, uint8_t len, uint8_t *val, uint8_t pag_grp)
{
struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val);
if (!msg)
return 1;

+ /* Append ericsson proprietary paging group IE, this will instruct the BTS to
+ * send this immediate assignment through PCH instead of AGCH. */
+ msgb_tv_put(msg, RSL_IE_ERIC_PAGING_GROUP, pag_grp);
+
/* 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);
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index bb6dfaf..78eb3f2 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -402,6 +402,27 @@
return rc;
}

+/* Helper function for pcu_rx_data_req() to extract paging group info (3 byte) */
+static uint8_t extract_paging_group(struct gsm_bts *bts, uint8_t *data)
+{
+ char imsi_digit_buf[4];
+ uint8_t pag_grp;
+
+ /* the first three bytes are the last three digits of the IMSI, which we need to compute the paging group */
+ imsi_digit_buf[0] = data[0];
+ imsi_digit_buf[1] = data[1];
+ imsi_digit_buf[2] = data[2];
+ imsi_digit_buf[3] = '\0';
+
+ pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
+ str_to_imsi(imsi_digit_buf));
+
+ LOGP(DPCU, LOGL_DEBUG, "Calculating paging group: imsi_digit_buf=%s ==> pag_grp=0x%02x\n",
+ imsi_digit_buf, pag_grp);
+
+ return pag_grp;
+}
+
static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
struct gsm_pcu_if_data *data_req)
{
@@ -444,27 +465,41 @@
}
break;
case PCU_IF_SAPI_PCH_DT:
- /* DT = direct tlli. A tlli is prefixed */
+ /* DT = direct TLLI. A tlli is prefixed so that the BSC/BTS can confirm the sending of the downlink
+ * IMMEDIATE ASSIGNMENT towards the PCU using this TLLI as a reference. */

- if (data_req->len < 5) {
+ if (data_req->len < 8) {
LOGP(DPCU, LOGL_ERROR, "Received PCU data request with invalid/small length %d\n",
data_req->len);
break;
}
+
+ /* Extract 4 byte TLLI */
memcpy(&tlli, data_req->data, 4);

- msg = msgb_alloc(data_req->len - 4, "pcu_agch");
+ /* Extract 3 byte paging group */
+ pag_grp = extract_paging_group(bts, data_req->data + 4);
+
+ LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (tlli=0x%08x, pag_grp=0x%02x)\n",
+ tlli, pag_grp);
+ 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);
+ /* NOTE: Sending an IMMEDIATE ASSIGNMENT via PCH became necessary with GPRS in order to be able to
+ * assign downlink TBFs directly through the paging channel. However, this method never became part
+ * of the RSL specs. This means that each BTS vendor has to come up with a proprietary method. At
+ * the moment we only support Ericsson RBS here. */
+ if (bts->type == GSM_BTS_TYPE_RBS2000) {
+ rc = rsl_ericsson_imm_assign_cmd(bts, tlli, msg->len, msg->data, pag_grp);
+ } else {
+ LOGP(DPCU, LOGL_ERROR, "BTS model does not support sending immediate assignment via PCH!\n");
+ rc = -ENOTSUP;
+ }

if (rc) {
msgb_free(msg);

To view, visit change 31126. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I4452f4973d1ec69c96aad527b057226e8a6edf99
Gerrit-Change-Number: 31126
Gerrit-PatchSet: 12
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged