From 7c8586d4f14bc0f88a4536acfc24be6c4f78dfee Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Wed, 25 Jan 2012 21:19:45 +0000 Subject: [PATCH] show Master change to/from core timer show Master change to/from core timer if DEBUG_MAIN (GENERAL) flag is on. Signed-off-by: Oron Peled Acked-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10451 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index eb19188..907d0f4 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -190,6 +190,7 @@ static struct core_timer { struct timer_list timer; struct timespec start_interval; unsigned long interval; + int dahdi_receive_used; atomic_t count; atomic_t shutdown; atomic_t last_count; @@ -9620,6 +9621,10 @@ static void coretimer_func(unsigned long param) /* This is the code path if a board driver is not calling * dahdi_receive, and therefore the core of dahdi needs to * perform the master span processing itself. */ + if (core_timer.dahdi_receive_used) { + core_timer.dahdi_receive_used = 0; + dahdi_dbg(GENERAL, "Master changed to core_timer\n"); + } if (!atomic_read(&core_timer.shutdown)) { mod_timer(&core_timer.timer, jiffies + @@ -9665,6 +9670,10 @@ static void coretimer_func(unsigned long param) /* It looks like a board driver is calling dahdi_receive. We * will just check again in a second. */ + if (!core_timer.dahdi_receive_used) { + core_timer.dahdi_receive_used = 1; + dahdi_dbg(GENERAL, "Master is no longer core_timer\n"); + } atomic_set(&core_timer.count, 0); atomic_set(&core_timer.last_count, 0); core_timer.start_interval = now;