svn commit: r189942 - head/sys/compat/ndis

[ Available lists | Index of svn-src-head | Month of Mar 2009 | Week of 18 Mar 2009 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Weongyo Jeong <weongyo@FreeBSD.org>
Date
18 Mar 2009 01:57:54
Subject
svn commit: r189942 - head/sys/compat/ndis
Message-ID
200903180157.n2I1vs7v011770@svn.freebsd.org


[ Hide this part ]
Author: weongyo
Date: Wed Mar 18 01:57:54 2009
New Revision: 189942
URL: http://svn.freebsd.org/changeset/base/189942

Log:
If the caller sets irp_usriostat or irp_usrevent it try to process it
whatever the IRP flag is because some drivers (eg. RTL8187L NDIS driver)
call IoCompleteRequest() without setting flags. It will prevent waiting
a event forever at attach.

Modified:
head/sys/compat/ndis/subr_ntoskrnl.c

Modified: head/sys/compat/ndis/subr_ntoskrnl.c
==============================================================================
--- head/sys/compat/ndis/subr_ntoskrnl.c Wed Mar 18 01:57:26 2009 (r189941)
+++ head/sys/compat/ndis/subr_ntoskrnl.c Wed Mar 18 01:57:54 2009 (r189942)
@@ -1197,6 +1197,11 @@ IofCompleteRequest(irp *ip, uint8_t prio
sl++;
} while (ip->irp_currentstackloc <= (ip->irp_stackcnt + 1));

+ if (ip->irp_usriostat != NULL)
+ *ip->irp_usriostat = ip->irp_iostat;
+ if (ip->irp_usrevent != NULL)
+ KeSetEvent(ip->irp_usrevent, prioboost, FALSE);
+
/* Handle any associated IRPs. */

if (ip->irp_flags & IRP_ASSOCIATED_IRP) {
@@ -1220,16 +1225,10 @@ IofCompleteRequest(irp *ip, uint8_t prio

/* With any luck, these conditions will never arise. */

- if (ip->irp_flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION)) {
- if (ip->irp_usriostat != NULL)
- *ip->irp_usriostat = ip->irp_iostat;
- if (ip->irp_usrevent != NULL)
- KeSetEvent(ip->irp_usrevent, prioboost, FALSE);
- if (ip->irp_flags & IRP_PAGING_IO) {
- if (ip->irp_mdl != NULL)
- IoFreeMdl(ip->irp_mdl);
- IoFreeIrp(ip);
- }
+ if (ip->irp_flags & IRP_PAGING_IO) {
+ if (ip->irp_mdl != NULL)
+ IoFreeMdl(ip->irp_mdl);
+ IoFreeIrp(ip);
}

return;

Elapsed time: 0.066 seconds