From 8be21bc8a866aada4b477af34b6d891df07b68c4 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Sun, 16 Sep 2007 14:53:35 +0000 Subject: * Document ztdummy changes. * It's a (ztdummy) clock source, not ztdummy type. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3044 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- README | 13 +++++++++++-- ztdummy.c | 10 +++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README b/README index dfff136..b33f7c1 100644 --- a/README +++ b/README @@ -97,8 +97,11 @@ If you build a custom kernel, note the following configuration items: be selected These can be selected from the "Library Routines" submenu during kernel configuration via "make menuconfig". - If you don't have any zaptel hardware, you need ztdummy. - * ztdummy on i386/amd64 and later kernels (>= 2.6.15) can (and should) - use the system's RTC (Real Time Clock). + * ztdummy on i386/x86_64 with kernels >= 2.6.22 can (and should) use + high resolution times (CONFIG_HIGH_RES_TIMERS), and (if available, + the system HPET. + * ztdummy on i386/x86_64 and later kernels (>= 2.6.15) can use the + system's RTC (Real Time Clock). * Alternatives to that for ztdummy are a UHCI USB controller (USB controllers made by Intel or VIA) or a kernel that has HZ=1000 (default on kernels 2.6.0-2.6.12, optional on newer kernels. Not @@ -333,6 +336,12 @@ first cycle. Eitherwise it will just give you in each cycle the percent of how close it was. Also try running it with the option -v for a verbose output. +To check the clock source that is built into ztdummy, you can either +look at title of its span in /proc/zaptel file for a "source:" in the +description. Or even run: + + strings zaptel.ko | grep source: + Spans and Channels ------------------ diff --git a/ztdummy.c b/ztdummy.c index d83bd1f..1fce4d7 100644 --- a/ztdummy.c +++ b/ztdummy.c @@ -102,17 +102,17 @@ static int debug = 0; #ifdef LINUX26 #ifdef USE_HIGHRESTIMER -#define ZTDUMMY_TYPE "HRtimer" +#define CLOCK_SRC "HRtimer" struct hrtimer zaptimer; #elif defined(USE_RTC) -#define ZTDUMMY_TYPE "RTC" +#define CLOCK_SRC "RTC" static int rtc_rate = 0; static int current_rate = 0; static int taskletpending = 0; static struct tasklet_struct ztd_tlet; static void ztd_tasklet(unsigned long data); #else /* Linux 2.6, but no RTC or HRTIMER used */ -#define ZTDUMMY_TYPE "Linux26" +#define CLOCK_SRC "Linux26" /* 2.6 kernel timer stuff */ static struct timer_list timer; #endif @@ -120,7 +120,7 @@ static struct timer_list timer; #if LINUX_VERSION_CODE < VERSION_CODE(2,4,5) # error "This kernel is too old: not supported by this file" #endif -#define ZTDUMMY_TYPE "UHCI" +#define CLOCK_SRC "UHCI" /* Old UCHI stuff */ static uhci_desc_t *td; static uhci_t *s; @@ -262,7 +262,7 @@ static int ztdummy_initialize(struct ztdummy *ztd) { /* Zapata stuff */ sprintf(ztd->span.name, "ZTDUMMY/1"); - sprintf(ztd->span.desc, "%s (type: " ZTDUMMY_TYPE ") %d", ztd->span.name, 1); + sprintf(ztd->span.desc, "%s (source: " CLOCK_SRC ") %d", ztd->span.name, 1); sprintf(ztd->chan.name, "ZTDUMMY/%d/%d", 1, 0); ztd->chan.chanpos = 1; ztd->span.chans = &ztd->chan; -- cgit v1.2.3