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

Weongyo Jeong weongyo at FreeBSD.org
Tue Mar 17 18:57:55 PDT 2009


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;


More information about the svn-src-all mailing list