diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-12 12:21:52 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-12 18:28:00 +0200 |
commit | 7c24b9edbc784a225ed0ce8e688f2c1e8511c5da (patch) | |
tree | c3aaccca2ddfa02295b6c3544930b4c215876c3d /openbsc | |
parent | b983c3104dd3e187a9d7a424b1f70ef6ef8f615e (diff) |
NS: Debug NS timer expiry
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/gprs/gprs_ns.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_ns.c b/openbsc/src/gprs/gprs_ns.c index 19653f6a..0ef0c3fc 100644 --- a/openbsc/src/gprs/gprs_ns.c +++ b/openbsc/src/gprs/gprs_ns.c @@ -323,10 +323,19 @@ static const uint8_t timer_mode_tout[_NSVC_TIMER_NR] = { [NSVC_TIMER_TNS_TEST] = 30, }; +static const struct value_string timer_mode_strs[] = { + { NSVC_TIMER_TNS_RESET, "tns-reset" }, + { NSVC_TIMER_TNS_ALIVE, "tns-alive" }, + { NSVC_TIMER_TNS_TEST, "tns-test" }, + { 0, NULL } +}; + static void nsvc_start_timer(struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode) { - nsvc->alive_retries = 0; - + DEBUGP(DNS, "NSVC=%u Starting timer in mode %s (%u seconds)\n", + nsvc->nsvci, get_value_string(timer_mode_strs, mode), + timer_mode_tout[mode]); + if (bsc_timer_pending(&nsvc->timer)) bsc_del_timer(&nsvc->timer); @@ -338,6 +347,10 @@ static void gprs_ns_timer_cb(void *data) { struct gprs_nsvc *nsvc = data; + DEBUGP(DNS, "NSVC=%u Timer expired in mode %s (%u seconds)\n", + nsvc->nsvci, get_value_string(timer_mode_strs, nsvc->timer_mode), + timer_mode_tout[nsvc->timer_mode]); + switch (nsvc->timer_mode) { case NSVC_TIMER_TNS_ALIVE: /* Tns-alive case: we expired without response ! */ @@ -362,6 +375,7 @@ static void gprs_ns_timer_cb(void *data) gprs_ns_tx_alive(nsvc); /* start Tns-alive timer (transition into faster * alive retransmissions) */ + nsvc->alive_retries = 0; nsvc_start_timer(nsvc, NSVC_TIMER_TNS_ALIVE); break; case NSVC_TIMER_TNS_RESET: |