Change the way the HC done method is invoked a little.

This commit is contained in:
augustss 2000-01-31 20:13:07 +00:00
parent 09dd6fc81d
commit c9aa323521
1 changed files with 20 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi.c,v 1.60 2000/01/19 00:23:58 augustss Exp $ */ /* $NetBSD: usbdi.c,v 1.61 2000/01/31 20:13:07 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
/* /*
@ -607,6 +607,14 @@ usbd_clear_endpoint_stall_async(pipe)
return (err); return (err);
} }
void usbd_clear_endpoint_toggle(usbd_pipe_handle pipe); /* XXXXX */
void
usbd_clear_endpoint_toggle(pipe)
usbd_pipe_handle pipe;
{
pipe->methods->cleartoggle(pipe);
}
usbd_status usbd_status
usbd_endpoint_count(iface, count) usbd_endpoint_count(iface, count)
usbd_interface_handle iface; usbd_interface_handle iface;
@ -802,9 +810,6 @@ usb_transfer_complete(xfer)
} }
} }
if (pipe->methods->done != NULL)
pipe->methods->done(xfer);
if (!repeat) { if (!repeat) {
/* Remove request from queue. */ /* Remove request from queue. */
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
@ -814,6 +819,8 @@ usb_transfer_complete(xfer)
#endif #endif
SIMPLEQ_REMOVE_HEAD(&pipe->queue, xfer, next); SIMPLEQ_REMOVE_HEAD(&pipe->queue, xfer, next);
} }
DPRINTFN(5,("usb_transfer_complete: repeat=%d new head=%p\n",
repeat, SIMPLEQ_FIRST(&pipe->queue)));
/* Count completed transfers. */ /* Count completed transfers. */
++pipe->device->bus->stats.requests ++pipe->device->bus->stats.requests
@ -830,6 +837,15 @@ usb_transfer_complete(xfer)
if (xfer->callback) if (xfer->callback)
xfer->callback(xfer, xfer->priv, xfer->status); xfer->callback(xfer, xfer->priv, xfer->status);
#ifdef DIAGNOSTIC
if (pipe->methods->done != NULL)
pipe->methods->done(xfer);
else
printf("usb_transfer_complete: pipe->methods->done == NULL\n");
#else
pipe->methods->done(xfer);
#endif
if ((xfer->flags & USBD_SYNCHRONOUS) && !polling) if ((xfer->flags & USBD_SYNCHRONOUS) && !polling)
wakeup(xfer); wakeup(xfer);