diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-03-30 16:19:34 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-03-30 16:19:34 +0000 |
commit | a1987e2c602829ad767a70ace887e30293688fab (patch) | |
tree | aff05488573e83694e0a53fb218b11b8dc0cb029 /sys/dev/usb/usbdi.c | |
parent | 2995dd2fe3905a085c7ea17930a26d47044d9c2f (diff) |
Sync with NetBSD. USB Ethernet drivers should work now.
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r-- | sys/dev/usb/usbdi.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index eddcf375d01..c88d33d87ae 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,5 +1,5 @@ -/* $OpenBSD: usbdi.c,v 1.9 2000/03/28 19:37:52 aaron Exp $ */ -/* $NetBSD: usbdi.c,v 1.68 2000/03/25 18:02:33 augustss Exp $ */ +/* $OpenBSD: usbdi.c,v 1.10 2000/03/30 16:19:33 aaron Exp $ */ +/* $NetBSD: usbdi.c,v 1.71 2000/03/29 01:45:21 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -77,14 +77,14 @@ extern int usbdebug; #define DPRINTFN(n,x) #endif -static usbd_status usbd_ar_pipe __P((usbd_pipe_handle pipe)); -static void usbd_do_request_async_cb +Static usbd_status usbd_ar_pipe __P((usbd_pipe_handle pipe)); +Static void usbd_do_request_async_cb __P((usbd_xfer_handle, usbd_private_handle, usbd_status)); -static void usbd_start_next __P((usbd_pipe_handle pipe)); -static usbd_status usbd_open_pipe_ival +Static void usbd_start_next __P((usbd_pipe_handle pipe)); +Static usbd_status usbd_open_pipe_ival __P((usbd_interface_handle, u_int8_t, u_int8_t, usbd_pipe_handle *, int)); -static int usbd_nbuses = 0; +Static int usbd_nbuses = 0; void usbd_init() @@ -98,8 +98,8 @@ usbd_finish() --usbd_nbuses; } -static __inline int usbd_xfer_isread __P((usbd_xfer_handle xfer)); -static __inline int +Static __inline int usbd_xfer_isread __P((usbd_xfer_handle xfer)); +Static __inline int usbd_xfer_isread(xfer) usbd_xfer_handle xfer; { @@ -269,6 +269,9 @@ usbd_transfer(xfer) #endif xfer->done = 0; + if (pipe->aborting) + return (USBD_CANCELLED); + size = xfer->length; /* If there is no buffer, allocate one. */ if (!(xfer->rqflags & URQ_DEV_DMABUF) && size != 0) { @@ -322,6 +325,7 @@ usbd_transfer(xfer) if (xfer->done) break; } + /* XXX Is this right, what about the HC timeout? */ if (!xfer->done) { pipe->methods->abort(xfer); xfer->status = USBD_TIMEOUT; @@ -755,7 +759,7 @@ usbd_get_interface(iface, aiface) /*** Internal routines ***/ /* Dequeue all pipe operations, called at splusb(). */ -static usbd_status +Static usbd_status usbd_ar_pipe(pipe) usbd_pipe_handle pipe; { @@ -769,6 +773,7 @@ usbd_ar_pipe(pipe) usbd_dump_queue(pipe); #endif pipe->repeat = 0; + pipe->aborting = 1; while ((xfer = SIMPLEQ_FIRST(&pipe->queue)) != NULL) { DPRINTFN(2,("usbd_ar_pipe: pipe=%p xfer=%p (methods=%p)\n", pipe, xfer, pipe->methods)); @@ -776,6 +781,7 @@ usbd_ar_pipe(pipe) pipe->methods->abort(xfer); /* XXX only for non-0 usbd_clear_endpoint_stall(pipe); */ } + pipe->aborting = 0; return (USBD_NORMAL_COMPLETION); } |