aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/pcu_sock.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-01-31 16:16:01 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2023-02-13 12:39:22 +0100
commit7a346a547e3ac62480109fb8ea6c696f0154f51a (patch)
tree876f98fc3eb98fece5c3df62c371ddea48ffd948 /src/osmo-bsc/pcu_sock.c
parent84811c901eac01ce81c52c038f34e91c98526e40 (diff)
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
Diffstat (limited to 'src/osmo-bsc/pcu_sock.c')
-rw-r--r--src/osmo-bsc/pcu_sock.c55
1 files changed, 45 insertions, 10 deletions
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index bb6dfaf94..78eb3f21b 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -402,6 +402,27 @@ static int pcu_rx_rr_paging(struct gsm_bts *bts, uint8_t paging_group,
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 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
}
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);
-
- 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);
+ msg->l3h = msgb_put(msg, data_req->len - 7);
+ memcpy(msg->l3h, data_req->data + 7, data_req->len - 7);
+
+ /* 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);