freebsd-skq/sys/compat/ndis
wpaul dab75fac6b 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.
2004-03-10 07:43:11 +00:00
..
cfg_var.h Deal with the duplicate sysctl leaf problem. A .inf file may contain 2003-12-18 03:51:21 +00:00
hal_var.h The definition for __stdcall logically belongs in pe_var.h, but 2004-01-15 21:31:49 +00:00
kern_ndis.c Add preliminary support for PCMCIA devices in addition to PCI/cardbus. 2004-03-07 02:49:06 +00:00
ndis_var.h Fix a problem with the way we schedule work on the NDIS worker threads. 2004-02-14 20:57:32 +00:00
ntoskrnl_var.h - Some older Atheros drivers want KeInitializeTimer(), so implement it, 2004-03-04 23:04:02 +00:00
pe_var.h The definition for __stdcall logically belongs in pe_var.h, but 2004-01-15 21:31:49 +00:00
resource_var.h
subr_hal.c Add stub implementations of KfLowerIrql() and KfRaiseIrql() (both of 2004-02-09 19:13:58 +00:00
subr_ndis.c Fix several issues related to the KeInitializeTimer() etc... API stuff 2004-03-10 07:43:11 +00:00
subr_ntoskrnl.c Fix several issues related to the KeInitializeTimer() etc... API stuff 2004-03-10 07:43:11 +00:00
subr_pe.c AMD64 has a single MS-Win calling convention, so provide an empty __stdcall. 2004-01-13 22:49:45 +00:00