summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-12 12:11:45 +0000
committerHarald Welte <laforge@gnumonks.org>2010-05-12 18:28:00 +0200
commitb983c3104dd3e187a9d7a424b1f70ef6ef8f615e (patch)
treebf4459db6aa224dec86a920f0ed664f18325c9d9 /openbsc
parent6ecaa3da2b2ff5dda53840476a792e12ce99d372 (diff)
NS: Add more LOG_DEBGU messages and retransmit NS-ALIVE
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gprs_ns.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gprs_ns.c b/openbsc/src/gprs/gprs_ns.c
index e93bd43f..19653f6a 100644
--- a/openbsc/src/gprs/gprs_ns.c
+++ b/openbsc/src/gprs/gprs_ns.c
@@ -293,13 +293,28 @@ int gprs_ns_tx_block(struct gprs_nsvc *nsvc, uint8_t cause)
int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc)
{
-
LOGP(DNS, LOGL_INFO, "NSEI=%u Tx NS UNBLOCK (NSVCI=%u)\n",
nsvc->nsei, nsvc->nsvci);
return gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK);
}
+int gprs_ns_tx_alive(struct gprs_nsvc *nsvc)
+{
+ LOGP(DNS, LOGL_DEBUG, "NSEI=%u Tx NS ALIVE (NSVCI=%u)\n",
+ nsvc->nsei, nsvc->nsvci);
+
+ return gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE);
+}
+
+int gprs_ns_tx_alive_ack(struct gprs_nsvc *nsvc)
+{
+ LOGP(DNS, LOGL_DEBUG, "NSEI=%u Tx NS ALIVE_ACK (NSVCI=%u)\n",
+ nsvc->nsei, nsvc->nsvci);
+
+ return gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE_ACK);
+}
+
#define NS_ALIVE_RETRIES 10 /* after 3 failed retransmit we declare BTS as dead */
static const uint8_t timer_mode_tout[_NSVC_TIMER_NR] = {
@@ -337,12 +352,16 @@ static void gprs_ns_timer_cb(void *data)
ns_dispatch_signal(nsvc, S_NS_BLOCK, NS_CAUSE_NSVC_BLOCKED);
return;
}
+ /* Tns-test case: send NS-ALIVE PDU */
+ gprs_ns_tx_alive(nsvc);
+ /* start Tns-alive timer */
nsvc_start_timer(nsvc, NSVC_TIMER_TNS_ALIVE);
break;
case NSVC_TIMER_TNS_TEST:
/* Tns-test case: send NS-ALIVE PDU */
- gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE);
- /* start Tns-alive timer */
+ gprs_ns_tx_alive(nsvc);
+ /* start Tns-alive timer (transition into faster
+ * alive retransmissions) */
nsvc_start_timer(nsvc, NSVC_TIMER_TNS_ALIVE);
break;
case NSVC_TIMER_TNS_RESET:
@@ -584,7 +603,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
case NS_PDUT_ALIVE:
/* remote end inquires whether we're still alive,
* we need to respond with ALIVE_ACK */
- rc = gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE_ACK);
+ rc = gprs_ns_tx_alive_ack(nsvc);
break;
case NS_PDUT_ALIVE_ACK:
/* stop Tns-alive */