Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Mar 2004 23:43:11 -0800 (PST)
From:      Bill Paul <wpaul@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/compat/ndis subr_ndis.c subr_ntoskrnl.c
Message-ID:  <200403100743.i2A7hBi5069460@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
wpaul       2004/03/09 23:43:11 PST

  FreeBSD src repository

  Modified files:
    sys/compat/ndis      subr_ndis.c subr_ntoskrnl.c 
  Log:
  Fix several issues related to the KeInitializeTimer() etc... API stuff
  that I added recently:
  
  - When a periodic timer fires, it's automatically re-armed. We must
    make sure to re-arm the timer _before_ invoking any caller-supplied
    defered procedure call: the DPC may choose to call KeCancelTimer(),
    and re-arming the timer after the DPC un-does the effect of the
    cancel.
  
  - Fix similar issue with periodic timers in subr_ndis.c.
  
  - When calling KeSetTimer() or KeSetTimerEx(), if the timer is
    already pending, untimeout() it first before timeout()ing
    it again.
  
  - The old Atheros driver for the 5211 seems to use KeSetTimerEx()
    incorrectly, or at the very least in a very strange way that
    doesn't quite follow the Microsoft documentation. In one case,
    it calls KeSetTimerEx() with a duetime of 0 and a period of 5000.
    The Microsoft documentation says that negative duetime values
    are relative to the current time and positive values are absolute.
    But it doesn't say what's supposed to happen with positive values
    that less than the current time, i.e. absolute values that are
    in the past.
  
    Lacking any further information, I have decided that timers with
    positive duetimes that are in the past should fire right away (or
    in our case, after only 1 tick). This also takes care of the other
    strange usage in the Atheros driver, where the duetime is
    specified as 500000 and the period is 50. I think someone may
    have meant to use -500000 and misinterpreted the documentation.
  
  - Also modified KeWaitForSingleObject() and KeWaitForMultipleObjects()
    to make the same duetime adjustment, since they have the same rules
    regarding timeout values.
  
  - Cosmetic: change name of 'timeout' variable in KeWaitForSingleObject()
    and KeWaitForMultipleObjects() to 'duetime' to avoid senseless
    (though harmless) overlap with timeout() function name.
  
  With these fixes, I can get the 5211 card to associate properly with
  my adhoc net using driver AR5211.SYS version 2.4.1.6.
  
  Revision  Changes    Path
  1.50      +4 -4      src/sys/compat/ndis/subr_ndis.c
  1.27      +52 -35    src/sys/compat/ndis/subr_ntoskrnl.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403100743.i2A7hBi5069460>