]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix several issues related to the KeInitializeTimer() etc... API stuff
authorwpaul <wpaul@FreeBSD.org>
Wed, 10 Mar 2004 07:43:11 +0000 (07:43 +0000)
committerwpaul <wpaul@FreeBSD.org>
Wed, 10 Mar 2004 07:43:11 +0000 (07:43 +0000)
commitdab75fac6b16faec6e60df4a6fcd6a2e2cdd4515
tree6b864ba874e12e8ab8127bbc74071c49356f74c3
parentcd800560cfd64f550b1a4e6b03b9441aba0b4d24
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.
sys/compat/ndis/subr_ndis.c
sys/compat/ndis/subr_ntoskrnl.c