Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 2009 01:57:54 +0000 (UTC)
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189942 - head/sys/compat/ndis
Message-ID:  <200903180157.n2I1vs7v011770@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903180157.n2I1vs7v011770>