mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
- Simplify timer implementation (done by me)
- Fix timer implementation (thanks to janderwald) - The Intel PRO/1000 driver loads but crashes later now - The Linksys Wireless-G driver MAY work now (untested) svn path=/trunk/; revision=40550
This commit is contained in:
parent
5e9875c679
commit
e3598783d0
1 changed files with 5 additions and 34 deletions
|
@ -19,33 +19,6 @@
|
|||
|
||||
#include "ndissys.h"
|
||||
|
||||
|
||||
VOID NTAPI
|
||||
MiniportTimerDpc(
|
||||
PKDPC Dpc,
|
||||
PVOID DeferredContext,
|
||||
PVOID SystemArgument1,
|
||||
PVOID SystemArgument2)
|
||||
/*
|
||||
* FUNCTION: Scheduled by the SetTimer family of functions
|
||||
* ARGUMENTS:
|
||||
* Dpc: Pointer to the DPC Object being executed
|
||||
* DeferredContext: Pointer to a NDIS_MINIPORT_TIMER object
|
||||
* SystemArgument1: Unused.
|
||||
* SystemArgument2: Unused.
|
||||
* NOTES:
|
||||
* - runs at IRQL = DISPATCH_LEVEL
|
||||
*/
|
||||
{
|
||||
PNDIS_MINIPORT_TIMER Timer;
|
||||
|
||||
Timer = (PNDIS_MINIPORT_TIMER)DeferredContext;
|
||||
|
||||
ASSERT(Timer->MiniportTimerFunction);
|
||||
|
||||
Timer->MiniportTimerFunction (NULL, Timer->MiniportTimerContext, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
|
@ -174,11 +147,7 @@ NdisMInitializeTimer(
|
|||
ASSERT(Timer);
|
||||
KeInitializeTimer (&Timer->Timer);
|
||||
|
||||
KeInitializeDpc (&Timer->Dpc, MiniportTimerDpc, (PVOID) Timer);
|
||||
|
||||
Timer->MiniportTimerFunction = TimerFunction;
|
||||
Timer->MiniportTimerContext = FunctionContext;
|
||||
Timer->Miniport = MiniportAdapterHandle;
|
||||
KeInitializeDpc (&Timer->Dpc, (PKDEFERRED_ROUTINE)TimerFunction, FunctionContext);
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,7 +206,7 @@ NdisMSetTimer(
|
|||
ASSERT(Timer);
|
||||
|
||||
/* relative delays are negative, absolute are positive; resolution is 100ns */
|
||||
Timeout.QuadPart = MillisecondsToDelay * -10000;
|
||||
Timeout.QuadPart = Int32x32To64(MillisecondsToDelay, -10000);
|
||||
|
||||
KeSetTimer (&Timer->Timer, Timeout, &Timer->Dpc);
|
||||
}
|
||||
|
@ -266,8 +235,10 @@ NdisSetTimer(
|
|||
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||
ASSERT(Timer);
|
||||
|
||||
NDIS_DbgPrint(MAX_TRACE, ("Called. Timer is: 0x%x, Timeout is: %ld\n", Timer, MillisecondsToDelay));
|
||||
|
||||
/* relative delays are negative, absolute are positive; resolution is 100ns */
|
||||
Timeout.QuadPart = MillisecondsToDelay * -10000;
|
||||
Timeout.QuadPart = Int32x32To64(MillisecondsToDelay, -10000);
|
||||
|
||||
KeSetTimer (&Timer->Timer, Timeout, &Timer->Dpc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue