summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-06-09 11:22:47 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-09 21:40:45 +0800
commit313cccf733e07c38716ff7f566f91678366fa997 (patch)
treeacd7e7f581da3b738155976ed4c63b7c1784cace /openbsc/src
parent8e2e78ecc22d9fb011f6fd451a089d5d373aa49b (diff)
[GPRS] SGSN: Pass BSSGP SUSPEND/RESUME up to GMM and alter MMCTX state
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/gprs/gprs_bssgp.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gprs_bssgp.c b/openbsc/src/gprs/gprs_bssgp.c
index 89b78662..c7c49d4b 100644
--- a/openbsc/src/gprs/gprs_bssgp.c
+++ b/openbsc/src/gprs/gprs_bssgp.c
@@ -40,6 +40,7 @@
#include <openbsc/gprs_llc.h>
#include <openbsc/gprs_ns.h>
#include <openbsc/gprs_sgsn.h>
+#include <openbsc/gprs_gmm.h>
void *bssgp_tall_ctx = NULL;
@@ -363,6 +364,7 @@ static int bssgp_rx_suspend(struct msgb *msg, struct tlv_parsed *tp,
(struct bssgp_normal_hdr *) msgb_bssgph(msg);
struct gprs_ra_id raid;
uint32_t tlli;
+ int rc;
if (!TLVP_PRESENT(tp, BSSGP_IE_TLLI) ||
!TLVP_PRESENT(tp, BSSGP_IE_ROUTEING_AREA)) {
@@ -378,8 +380,11 @@ static int bssgp_rx_suspend(struct msgb *msg, struct tlv_parsed *tp,
gsm48_parse_ra(&raid, TLVP_VAL(tp, BSSGP_IE_ROUTEING_AREA));
- /* FIXME: pass the SUSPEND request to GMM */
- /* SEND SUSPEND_ACK or SUSPEND_NACK */
+ /* Inform GMM about the SUSPEND request */
+ rc = gprs_gmm_rx_suspend(&raid, tlli);
+ if (rc < 0)
+ return bssgp_tx_suspend_nack(msgb_nsei(msg), tlli, NULL);
+
bssgp_tx_suspend_ack(msgb_nsei(msg), tlli, &raid, 0);
return 0;
@@ -392,6 +397,8 @@ static int bssgp_rx_resume(struct msgb *msg, struct tlv_parsed *tp,
(struct bssgp_normal_hdr *) msgb_bssgph(msg);
struct gprs_ra_id raid;
uint32_t tlli;
+ uint8_t suspend_ref;
+ int rc;
if (!TLVP_PRESENT(tp, BSSGP_IE_TLLI) ||
!TLVP_PRESENT(tp, BSSGP_IE_ROUTEING_AREA) ||
@@ -402,13 +409,18 @@ static int bssgp_rx_resume(struct msgb *msg, struct tlv_parsed *tp,
}
tlli = ntohl(*(uint32_t *)TLVP_VAL(tp, BSSGP_IE_TLLI));
+ suspend_ref = *TLVP_VAL(tp, BSSGP_IE_SUSPEND_REF_NR);
DEBUGP(DBSSGP, "BSSGP BVCI=%u TLLI=0x%08x RESUME\n", ctx->bvci, tlli);
gsm48_parse_ra(&raid, TLVP_VAL(tp, BSSGP_IE_ROUTEING_AREA));
- /* FIXME: pass the RESUME request to GMM */
- /* SEND RESUME_ACK or RESUME_NACK */
+ /* Inform GMM about the RESUME request */
+ rc = gprs_gmm_rx_resume(&raid, tlli, suspend_ref);
+ if (rc < 0)
+ return bssgp_tx_resume_nack(msgb_nsei(msg), tlli, &raid,
+ NULL);
+
bssgp_tx_resume_ack(msgb_nsei(msg), tlli, &raid);
return 0;
}