From d6d0d8b86fb16fd5a8d6090d26b6b7848a8281ce Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Mon, 15 Feb 2016 11:55:47 +0100 Subject: WIP: Wait for radio bearer before sending pdp context accept --- openbsc/src/gprs/sgsn_libgtp.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'openbsc/src/gprs') diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index b84d4ba40..4b98fbbcc 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -91,7 +91,7 @@ const struct value_string gtp_cause_strs[] = { { 0, NULL } }; -int gprs_iu_rab_act(struct sgsn_mm_ctx *mm, uint32_t gtp_ip, uint32_t gtp_tei); +int gprs_iu_rab_act(struct sgsn_pdp_ctx *mm, uint32_t gtp_ip, uint32_t gtp_tei); /* Generate the GTP IMSI IE according to 09.60 Section 7.9.2 */ static uint64_t imsi_str2gtp(char *str) @@ -352,20 +352,16 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) if (pctx->mm->ran_type == MM_CTX_T_GERAN_Gb) { /* Activate the SNDCP layer */ sndcp_sm_activate_ind(&pctx->mm->gb.llme->lle[pctx->sapi], pctx->nsapi); + + + return send_act_pdp_cont_acc(pctx); } else { /* Activate a radio bearer */ uint32_t ggsn_ip = 0xc0a80033; /* 192.168.0.51 */ - iu_rab_act_ps(pctx->mm->iu.ue_ctx, ggsn_ip, pdp->teid_own); + iu_rab_act_ps(pctx, ggsn_ip, pdp->teid_own); + return 0; } - /* Inform others about it */ - memset(&sig_data, 0, sizeof(sig_data)); - sig_data.pdp = pctx; - osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_ACT, &sig_data); - - /* Send PDP CTX ACT to MS */ - return gsm48_tx_gsm_act_pdp_acc(pctx); - reject: /* * In case of a timeout pdp will be NULL but we have a valid pointer @@ -387,6 +383,19 @@ reject: return EOF; } +int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx) +{ + struct sgsn_signal_data sig_data; + + /* Inform others about it */ + memset(&sig_data, 0, sizeof(sig_data)); + sig_data.pdp = pctx; + osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_ACT, &sig_data); + + /* Send PDP CTX ACT to MS */ + return gsm48_tx_gsm_act_pdp_acc(pctx); +} + /* Confirmation of a PDP Context Delete */ static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { -- cgit v1.2.3