aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/pcu_sock.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-11 09:50:29 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-11 12:57:17 +0200
commitb900a4c412318cdd3447840884d5f9403a9e4575 (patch)
tree57b8e51876dc53a4a23efc17d23aca45def1e618 /openbsc/src/libbsc/pcu_sock.c
parent63c780c51e13394756338394bee3852dbc2c33ed (diff)
pcu_sock: Forward incoming RR GPRS SUSPEND REQ to PCU socketlaforge/gprs-suspend
s specified in 3GPP TS 03.60 Section 16.2.1 and 44.018 Section 3.4.15, a Class B MS is sending a "RR GPRS SUSPEND REQ" via a DCCH to the BTS if it wants to suspend GPRS services. The BSS is now responsible to somehow forward this to the SGSN. As the Gs interface between BSC and SGSN is both optional and doesn't have any provision to forward this message, we have to send it over to the PCU so it can use regular BSSGP signaling to inform the SGSN of the SUSPEND REQUEST. This patch requires libosmocore Change-Id I90113044460a6c511ced14f588876c4280d1cac7 for the related definition of struct gsm48_gprs_susp_req. This patch follows the same logic of whatwas introdiced in osmo-bts as Change-Id I3c1af662c8f0d3d22da200638480f6ef05c3ed1f. Change-Id: I05ac5de16c9d5122c179b3f9b273a0c9c7661e29 Closes: OS#2249
Diffstat (limited to 'openbsc/src/libbsc/pcu_sock.c')
-rw-r--r--openbsc/src/libbsc/pcu_sock.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c
index 98e12fad4..637e4c6a3 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -1,6 +1,6 @@
/* pcu_sock.c: Connect from PCU via unix domain socket */
-/* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org>
+/* (C) 2008-2017 by Harald Welte <laforge@gnumonks.org>
* (C) 2009-2012 by Andreas Eversberg <jolly@eversberg.eu>
* (C) 2012 by Holger Hans Peter Freyther
* All Rights Reserved
@@ -307,6 +307,24 @@ int pcu_tx_imm_ass_sent(struct gsm_bts *bts, uint32_t tlli)
return pcu_sock_send(bts, msg);
}
+/* forward data from a RR GPRS SUSPEND REQ towards PCU */
+int pcu_tx_susp_req(struct gsm_lchan *lchan, uint32_t tlli, const uint8_t *ra_id, uint8_t cause)
+{
+ struct gsm_bts *bts = lchan->ts->trx->bts;
+ struct msgb *msg;
+ struct gsm_pcu_if *pcu_prim;
+
+ msg = pcu_msgb_alloc(PCU_IF_MSG_SUSP_REQ, bts->nr);
+ if (!msg)
+ return -ENOMEM;
+ pcu_prim = (struct gsm_pcu_if *) msg->data;
+ pcu_prim->u.susp_req.tlli = tlli;
+ memcpy(pcu_prim->u.susp_req.ra_id, ra_id, sizeof(pcu_prim->u.susp_req.ra_id));
+ pcu_prim->u.susp_req.cause = cause;
+
+ 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 */