From 2c24e607308ac56269be9d48e04bb4215fbe733b Mon Sep 17 00:00:00 2001 From: tzafrir Date: Tue, 20 Jan 2009 10:33:57 +0000 Subject: Adjust ztdummy to the new timers interface of kernel 2.6.28 (From DAHDI rev. 5211) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4617 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- kernel/ztdummy.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/ztdummy.c b/kernel/ztdummy.c index e2f45da..fda7340 100644 --- a/kernel/ztdummy.c +++ b/kernel/ztdummy.c @@ -90,6 +90,18 @@ #endif #include "ztdummy.h" +#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) ) +/* compatibility with new hrtimer interface */ +static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) +{ + return timer->expires; +} + +static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) +{ + timer->expires = time; +} +#endif static struct ztdummy *ztd; @@ -199,7 +211,7 @@ static enum hrtimer_restart ztdummy_hr_int(struct hrtimer *htmr) * expired. * We should worry if overrun is 2 or more; then we really missed * a tick */ - overrun = hrtimer_forward(&zaptimer, htmr->expires, + overrun = hrtimer_forward(&zaptimer, hrtimer_get_expires(htmr), ktime_set(0, ZAPTEL_TIME_NS)); if(overrun > 1) { if(printk_ratelimit()) @@ -222,7 +234,7 @@ static enum hrtimer_restart ztdummy_hr_int(struct hrtimer *htmr) /* use kernel system tick timer if PC architecture RTC is not available */ static void ztdummy_timer(unsigned long param) { - timer.expires = jiffies + 1; + hrtimer_set_expires(timer, jiffies + 1); add_timer(&timer); ztd->counter += ZAPTEL_TIME; -- cgit v1.2.3