From owner-cvs-all@FreeBSD.ORG Tue Mar 9 23:43:11 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCA0716A4CE; Tue, 9 Mar 2004 23:43:11 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B29143D1F; Tue, 9 Mar 2004 23:43:11 -0800 (PST) (envelope-from wpaul@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2A7hBGe069461; Tue, 9 Mar 2004 23:43:11 -0800 (PST) (envelope-from wpaul@repoman.freebsd.org) Received: (from wpaul@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2A7hBi5069460; Tue, 9 Mar 2004 23:43:11 -0800 (PST) (envelope-from wpaul) Message-Id: <200403100743.i2A7hBi5069460@repoman.freebsd.org> From: Bill Paul Date: Tue, 9 Mar 2004 23:43:11 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/compat/ndis subr_ndis.c subr_ntoskrnl.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2004 07:43:11 -0000 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