aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/pcuif_proto.h3
-rw-r--r--openbsc/src/libbsc/pcu_sock.c31
2 files changed, 33 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/pcuif_proto.h b/openbsc/include/openbsc/pcuif_proto.h
index a52d8964d..3fc500b5a 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 7712878c6..0ae3a03e4 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -56,6 +56,7 @@ static const char *sapi_string[] = {
[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 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
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 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
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 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
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);