From owner-svn-src-all@FreeBSD.ORG Wed Mar 18 01:57:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 717FB106579A; Wed, 18 Mar 2009 01:57:54 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8838FC22; Wed, 18 Mar 2009 01:57:54 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I1vskk011771; Wed, 18 Mar 2009 01:57:54 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I1vs7v011770; Wed, 18 Mar 2009 01:57:54 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903180157.n2I1vs7v011770@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 18 Mar 2009 01:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189942 - head/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 01:57:55 -0000 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;