[Asterisk-Dev] what's the value of a jiffie in zaptel driver
?
Dinesh Nair
dinesh at alphaque.com
Mon Nov 22 06:50:03 MST 2004
On 22/11/2004 17:25 Derek Smithies said the following:
> What happens if the code below is used on a box with jiffies set to 512?
>
> Which means that the code below has made excesive use of magic numbers.
that code is /stock/ from the linux zaptel drivers, CVS-stable (version
1.0.2) as synced just before the change of name from wcfxs to wctdm. i'm in
the midst of trying to reconcile this code with the freebsd version of the
zaptel drivers.
your observation is exactly what i noticed, hence this line of questioning.
other places within the zaptel drivers make jiffie calculation like so:
/* wait 500ms */
while((vbat = wcfxs_getreg(wc, card, 82)) > 0x6) {
if ((jiffies - origjiffies) >= (HZ/2))
break;;
}
or ((jiffies - origjiffies) * 1000 / HZ)
which would take into account whatever HZ is set to and would be the
correct way to do it. without a clock tick per second reference, it's
difficult trying to second guess how long the time to wait is. from what
was mentioned to me (and i'm not very linux-savvy), HZ=100 in kernel 2.4
while HZ=1000 in kernel 2.6. i dont know how far this is true though.
--
Regards, /\_/\ "All dogs go to heaven."
dinesh at alphaque.com (0 0) http://www.alphaque.com/
+==========================----oOO--(_)--OOo----==========================+
| for a in past present future; do |
| for b in clients employers associates relatives neighbours pets; do |
| echo "The opinions here in no way reflect the opinions of my $a $b." |
| done; done |
+=========================================================================+
More information about the asterisk-dev
mailing list