Date: Tue, 16 Dec 2008 12:37:56 GMT From: Weongyo Jeong <weongyo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 154786 for review Message-ID: <200812161237.mBGCbuWE053431@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812161237.mBGCbuWE053431>