| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: dwc_otg.c,v 1.30 2013/01/21 07:39:59 skrll Exp $ */ | | 1 | /* $NetBSD: dwc_otg.c,v 1.31 2013/01/21 08:02:01 skrll Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. | | 4 | * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. |
5 | * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved. | | 5 | * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -50,27 +50,27 @@ | | | @@ -50,27 +50,27 @@ |
50 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 50 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
51 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 51 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
52 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 52 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
53 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 53 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
54 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 54 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
55 | * POSSIBILITY OF SUCH DAMAGE. | | 55 | * POSSIBILITY OF SUCH DAMAGE. |
56 | */ | | 56 | */ |
57 | | | 57 | |
58 | /* | | 58 | /* |
59 | * Designware USB 2.0 OTG | | 59 | * Designware USB 2.0 OTG |
60 | */ | | 60 | */ |
61 | | | 61 | |
62 | #include <sys/cdefs.h> | | 62 | #include <sys/cdefs.h> |
63 | __KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.30 2013/01/21 07:39:59 skrll Exp $"); | | 63 | __KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.31 2013/01/21 08:02:01 skrll Exp $"); |
64 | | | 64 | |
65 | #include <sys/param.h> | | 65 | #include <sys/param.h> |
66 | #include <sys/systm.h> | | 66 | #include <sys/systm.h> |
67 | #include <sys/kmem.h> | | 67 | #include <sys/kmem.h> |
68 | #include <sys/kernel.h> | | 68 | #include <sys/kernel.h> |
69 | #include <sys/device.h> | | 69 | #include <sys/device.h> |
70 | #include <sys/select.h> | | 70 | #include <sys/select.h> |
71 | #include <sys/proc.h> | | 71 | #include <sys/proc.h> |
72 | #include <sys/queue.h> | | 72 | #include <sys/queue.h> |
73 | #include <sys/cpu.h> | | 73 | #include <sys/cpu.h> |
74 | | | 74 | |
75 | #include <machine/endian.h> | | 75 | #include <machine/endian.h> |
76 | | | 76 | |
| @@ -3610,27 +3610,27 @@ dwc_otg_setup_standard_chain_sub(struct | | | @@ -3610,27 +3610,27 @@ dwc_otg_setup_standard_chain_sub(struct |
3610 | td->remainder = temp->len; | | 3610 | td->remainder = temp->len; |
3611 | td->actlen = 0; | | 3611 | td->actlen = 0; |
3612 | td->tx_bytes = 0; | | 3612 | td->tx_bytes = 0; |
3613 | td->error_any = 0; | | 3613 | td->error_any = 0; |
3614 | td->error_stall = 0; | | 3614 | td->error_stall = 0; |
3615 | td->npkt = 0; | | 3615 | td->npkt = 0; |
3616 | td->did_stall = temp->did_stall; | | 3616 | td->did_stall = temp->did_stall; |
3617 | td->short_pkt = temp->short_pkt; | | 3617 | td->short_pkt = temp->short_pkt; |
3618 | td->alt_next = temp->setup_alt_next; | | 3618 | td->alt_next = temp->setup_alt_next; |
3619 | td->set_toggle = 0; | | 3619 | td->set_toggle = 0; |
3620 | td->got_short = 0; | | 3620 | td->got_short = 0; |
3621 | td->did_nak = 0; | | 3621 | td->did_nak = 0; |
3622 | td->channel = DWC_OTG_MAX_CHANNELS; | | 3622 | td->channel = DWC_OTG_MAX_CHANNELS; |
3623 | td->state = 0; | | 3623 | td->state = DWC_CHAN_ST_START; |
3624 | td->errcnt = 0; | | 3624 | td->errcnt = 0; |
3625 | td->retrycnt = 0; | | 3625 | td->retrycnt = 0; |
3626 | td->toggle = 0; | | 3626 | td->toggle = 0; |
3627 | } | | 3627 | } |
3628 | | | 3628 | |
3629 | Static void | | 3629 | Static void |
3630 | dwc_otg_setup_ctrl_chain(usbd_xfer_handle xfer) | | 3630 | dwc_otg_setup_ctrl_chain(usbd_xfer_handle xfer) |
3631 | { | | 3631 | { |
3632 | struct dwc_otg_xfer *dxfer = (struct dwc_otg_xfer *)xfer; | | 3632 | struct dwc_otg_xfer *dxfer = (struct dwc_otg_xfer *)xfer; |
3633 | struct dwc_otg_pipe *dpipe = (struct dwc_otg_pipe *)xfer->pipe; | | 3633 | struct dwc_otg_pipe *dpipe = (struct dwc_otg_pipe *)xfer->pipe; |
3634 | usb_endpoint_descriptor_t *ed = dpipe->pipe.endpoint->edesc; | | 3634 | usb_endpoint_descriptor_t *ed = dpipe->pipe.endpoint->edesc; |
3635 | usb_device_request_t *req = &xfer->request; | | 3635 | usb_device_request_t *req = &xfer->request; |
3636 | #ifdef DWC_OTG_DEBUG | | 3636 | #ifdef DWC_OTG_DEBUG |