From owner-p4-projects@FreeBSD.ORG Tue Dec 16 12:37:57 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 11A0B1065673; Tue, 16 Dec 2008 12:37:57 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA1971065670 for ; Tue, 16 Dec 2008 12:37:56 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C08588FC1C for ; Tue, 16 Dec 2008 12:37:56 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBGCbuLP053433 for ; Tue, 16 Dec 2008 12:37:56 GMT (envelope-from weongyo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBGCbuWE053431 for perforce@freebsd.org; Tue, 16 Dec 2008 12:37:56 GMT (envelope-from weongyo@FreeBSD.org) Date: Tue, 16 Dec 2008 12:37:56 GMT Message-Id: <200812161237.mBGCbuWE053431@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to weongyo@FreeBSD.org using -f From: Weongyo Jeong To: Perforce Change Reviews Cc: Subject: PERFORCE change 154786 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 12:37:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=154786 Change 154786 by weongyo@weongyo_ws on 2008/12/16 12:37:32 if the Interrupt IN pipe was already set we don't need to re-initialize it again. In the previous it returned USBD_STATUS_SUCCESS which is bad indicating a transaction had done. While I'm here fix it to USBD_STATUS_PENDING to indicate a transaction is ready. Affected files ... .. //depot/projects/ndisusb/sys/compat/ndis/subr_usbd.c#24 edit Differences ... ==== //depot/projects/ndisusb/sys/compat/ndis/subr_usbd.c#24 (text+ko) ==== @@ -328,6 +328,9 @@ switch (urb->uu_hdr.uuh_func) { case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: status = usbd_func_bulkintr(ip); + if (status != USBD_STATUS_SUCCESS && + status != USBD_STATUS_PENDING) + USBD_URB_STATUS(urb) = status; break; case URB_FUNCTION_VENDOR_DEVICE: case URB_FUNCTION_VENDOR_INTERFACE: @@ -665,17 +668,17 @@ static irp *debug_irp = NULL; #endif + urb = usbd_geturb(ip); + if (sc->ndisusb_ep[NDISUSB_ENDPT_IIN] != NULL) { #ifdef NDISUSB_DEBUG if (debug_irp != NULL && debug_irp != ip) device_printf(dev, "trying to re-initialize IIN with other IRP\n"); #endif - /* - * if we already set the endpoint for Interrupt IN, we doesn't - * set again so just behave like we did good operations. - */ - return usbd_usb2urb(USBD_NORMAL_COMPLETION); + /* don't need to open the NDISUSB_ENDPT_IIN pipe again. */ + USBD_URB_STATUS(urb) = USBD_STATUS_PENDING; + return (USBD_STATUS_PENDING); } status = usbd_device2interface_handle(uaa->device, NDISUSB_IFACE_INDEX, @@ -685,7 +688,6 @@ return usbd_usb2urb(status); } - urb = usbd_geturb(ip); ubi = &urb->uu_bulkintr; ep = ubi->ubi_epdesc;