aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_ns.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-12 12:21:52 +0000
committerHarald Welte <laforge@gnumonks.org>2010-05-12 18:28:00 +0200
commit811c4979e6af534248d91d8c79a22cdcd7d36431 (patch)
tree2c3b562d2fedf611c01d7f0a5419801c92c10b66 /openbsc/src/gprs/gprs_ns.c
parentbca900dab2b02d96c22c20db4e05c90b45a0d30e (diff)
NS: Debug NS timer expiry
Diffstat (limited to 'openbsc/src/gprs/gprs_ns.c')
-rw-r--r--openbsc/src/gprs/gprs_ns.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_ns.c b/openbsc/src/gprs/gprs_ns.c
index 19653f6a6..0ef0c3fcb 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: