NdisMSleep causes Assetion Failure

Hi Devs,
DDK Says
“Callers of NdisMSleep run at IRQL < DISPATCH_LEVEL” .

But When NdisMSleep is called at APC_LEVEL in Win2000 Assertion failure (KeCurentIrql == LowLevel ) is caused with checked build of Ndis

Any experienced this before ?

Regards
Anandhi


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I think this is a documentation fault. It seems NdisMSleep() can only
be called at PASSIVE_LEVEL:

“NdisMSleep
[…]
NIC drivers can call NdisMSleep from their MiniportInitialize and,
possibly, MiniportHalt functions when either function must wait for
state changes to occur in the NIC before that function continues its
operations.”

MiniportInitialize() and MiniportHalt() run at PASSIVE_LEVEL.

  • NdisMSleep() calls KeWaitForSingleObject() with a non-zero
    ‘Timeout’. The docs say:

“KeWaitForSingleObject
[…]
Usually, the caller must be running at IRQL = PASSIVE_LEVEL and in a
nonarbitrary thread context. A call while running at IRQL =
DISPATCH_LEVEL is valid if and only if the caller specifies a Timeout
of zero.”

I think this is evidence enough.

Please file a bug against this at the OSR bug bash.

Thanks, Stephan

On 14 Feb 2002 14:54:01 -0000, “Anandhi”
wrote:

>Hi Devs,=0ADDK Says =0A"Callers of NdisMSleep run at IRQL < DISPATCH_LEVEL"=
> .=0A=0ABut When NdisMSleep is called at APC_LEVEL in Win2000 Assertion fai=
>lure (KeCurentIrql =3D=3D LowLevel ) is caused with checked build of Ndis=
>=0A=0AAny experienced this before ?=0A=0ARegards=0AAnandhi=0A =0A


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The documentation for NdisMSleep() is correct. The ASSERT in the code
is not. I verified with the NDIS team and a bug has been filed to
correct the ASSERT to verify that the current IRQL is below DISPATCH
instead of checking that the current IRQL is PASSIVE.

Bryan S. Burgin
xxxxx@microsoft.com

This posting is provided “AS IS” with no warranties, and confers no
rights (c) 2002 Microsoft Corporation. All rights reserved.

-----Original Message-----
From: Anandhi [mailto:xxxxx@rediffmail.com]
Sent: Thursday, February 14, 2002 6:54 AM
To: NT Developers Interest List
Subject: [ntdev] NdisMSleep causes Assetion Failure

Hi Devs,
DDK Says
“Callers of NdisMSleep run at IRQL < DISPATCH_LEVEL” .

But When NdisMSleep is called at APC_LEVEL in Win2000 Assertion failure
(KeCurentIrql == LowLevel ) is caused with checked build of Ndis

Any experienced this before ?

Regards
Anandhi


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Bryan,

When you say “the documentation for NdisMSleep() is correct”, ie. it
may be called at any IRQL < DISPATCH_LEVEL, then what about the
following:

  1. The docs clearly say “NIC drivers can call NdisMSleep from their
    MiniportInitialize and, possibly, MiniportHalt functions […]”. So
    this means NdisMSleep() is *only* to be called from these functions,
    which, by definition, run at PASSIVE_LEVEL.

Now how can NdisMSleep() ever be called at any IRQL > PASSIVE_LEVEL
then?

This is just confusing! Either change the docs to say “Callers of
NdisMSleep run at IRQL PASSIVE_LEVEL” or change the docs to say “NIC
drivers can call NdisMSleep from any MiniportXxx() function running at
IRQL < DISPATCH_LEVEL”. [Note that the latter implicitly means “at
IRQL PASSIVE_LEVEL” for NDIS drivers, since there is no APC_LEVEL in
NDIS.]

Thanks, Stephan

On Fri, 15 Feb 2002 17:03:40 -0800, “Bryan Burgin”
wrote:

>
>The documentation for NdisMSleep() is correct. The ASSERT in the code
>is not. I verified with the NDIS team and a bug has been filed to
>correct the ASSERT to verify that the current IRQL is below DISPATCH
>instead of checking that the current IRQL is PASSIVE.
>
>Bryan S. Burgin
>xxxxx@microsoft.com
>
>This posting is provided “AS IS” with no warranties, and confers no
>rights (c) 2002 Microsoft Corporation. All rights reserved.
>
>-----Original Message-----
>From: Anandhi [mailto:xxxxx@rediffmail.com]=20
>Sent: Thursday, February 14, 2002 6:54 AM
>To: NT Developers Interest List
>Subject: [ntdev] NdisMSleep causes Assetion Failure
>
>
>Hi Devs,
>DDK Says=20
>“Callers of NdisMSleep run at IRQL < DISPATCH_LEVEL” .
>
>But When NdisMSleep is called at APC_LEVEL in Win2000 Assertion failure
>(KeCurentIrql =3D=3D LowLevel ) is caused with checked build of Ndis
>
>Any experienced this before ?
>
>Regards
>Anandhi


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com