From d78ee736239414021fde8010179f42b86464a238 Mon Sep 17 00:00:00 2001 From: Ivan Kluchnikov Date: Tue, 26 Jun 2012 19:33:44 +0400 Subject: [PATCH] Fixed Downlink TBF Establishment on CCCH. UL TBF should be released before DL TBF establishment on CCCH. Added delay after transmitting Immediate Assignment. --- src/gprs_rlcmac.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index f482653e..4dc1fd1e 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -327,9 +327,8 @@ int tbf_dl_establish(struct gprs_rlcmac_tbf *tbf, uint8_t *imsi) else { // Downlink TBF Establishment on CCCH ( Immediate Assignment ) - gprs_rlcmac_downlink_assignment(tbf); + tbf_gsm_timer_start(tbf, 1, 0); } - tbf->state = FINISH_ESTABLISH; break; case PACCH_ESTABLISH: // Downlink TBF Establishment on PACCH ( Packet Immediate Assignment ) @@ -537,7 +536,22 @@ static void tbf_gsm_timer_cb(void *_tbf) tbf->num_fT_exp++; switch (tbf->fT) { + case 1: + if (tbf_by_tlli(tbf->tlli, GPRS_RLCMAC_UL_TBF)) + { + // Wait release of UL TBF + tbf_gsm_timer_start(tbf, 1, 10); + } + else + { + gprs_rlcmac_downlink_assignment(tbf); + // FIXME: Remove magic delay! + int delay = 50; + tbf_gsm_timer_start(tbf, 2, delay); + } + break; case 2: + tbf->state = FINISH_ESTABLISH; tbf_dl_data_transfer(tbf); break; default: