aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2016-12-02 19:04:34 +0100
committerHarald Welte <laforge@gnumonks.org>2017-05-25 14:04:08 +0200
commitf8aeb2cccb767c8823e1c851efd8de86a226033e (patch)
treece1e791393a0bbf7c66c7519d25f4dd40832c33a /openbsc/src
parentf14cb3535cf469632b5da63f35b31aa79fd0c5c3 (diff)
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
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libbsc/abis_rsl.c17
-rw-r--r--openbsc/src/libbsc/pcu_sock.c21
2 files changed, 38 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 62c12a844..d750df449 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1993,6 +1993,7 @@ static int abis_rsl_rx_cchan(struct msgb *msg)
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: ");
@@ -2013,6 +2014,22 @@ static int abis_rsl_rx_cchan(struct msgb *msg)
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 0ae3a03e4..7e7779796 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -286,6 +286,27 @@ int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn,
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 */