diff options
-rw-r--r-- | include/openbsc/gprs_llc.h | 1 | ||||
-rw-r--r-- | src/gprs/gprs_gmm.c | 1 | ||||
-rw-r--r-- | src/gprs/gprs_llc.c | 24 |
3 files changed, 26 insertions, 0 deletions
diff --git a/include/openbsc/gprs_llc.h b/include/openbsc/gprs_llc.h index 5949ac3b8..aa3b9ccbf 100644 --- a/include/openbsc/gprs_llc.h +++ b/include/openbsc/gprs_llc.h @@ -160,6 +160,7 @@ int gprs_llgmm_assign(struct gprs_llc_llme *llme, int gprs_llgmm_suspend(struct gprs_llc_llme *llme); int gprs_llgmm_resume(struct gprs_llc_llme *llme); +void gprs_llgmm_reset_state(struct gprs_llc_llme *llme); int gprs_llc_init(const char *cipher_plugin_path); int gprs_llc_vty_init(void); diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index d6cd4125c..f98dcf0d4 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1075,6 +1075,7 @@ static void mmctx_timer_cb(void *_mm) if (mm->num_T_exp >= 5) { LOGP(DMM, LOGL_NOTICE, "T3350 expired >= 5 times\n"); gprs_llgmm_resume(mm->llme); + gprs_llgmm_reset_state(mm->llme); break; } /* re-transmit the respective msg and re-start timer */ diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 07294aadc..c5ff72944 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -868,6 +868,30 @@ int gprs_llgmm_resume(struct gprs_llc_llme* llme) return 0; } +void gprs_llgmm_reset_state(struct gprs_llc_llme *llme) +{ + unsigned int i; + + if (llme == 0) + { + LOGP(DLLC, LOGL_ERROR, "LLC TX: trying to reset LLC states " + "but passed null llme by gmm\n"); + return; + } + + LOGP(DLLC, LOGL_NOTICE, "LLC RX: reset state variable for TLLI 0x%08x", + llme->tlli); + /* 8.5.3.1 For all LLE's */ + for (i = 0; i < ARRAY_SIZE(llme->lle); i++) { + struct gprs_llc_lle *l = &llme->lle[i]; + l->vu_recv = 0; /* lets not mess with send state variable now */ + /* l->vu_send = l->vu_recv = 0; */ + l->retrans_ctr = 0; + l->state = GPRS_LLES_ASSIGNED_ADM; + /* FIXME Set parameters according to table 9 */ + } +} + int gprs_llc_init(const char *cipher_plugin_path) { return gprs_cipher_load(cipher_plugin_path); |