| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ehci.c,v 1.148 2008/09/10 06:08:27 cegger Exp $ */ | | 1 | /* $NetBSD: ehci.c,v 1.149 2008/10/05 21:31:39 jmcneill Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2004-2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2004-2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Lennart Augustsson (lennart@augustsson.net), Charles M. Hannum and | | 8 | * by Lennart Augustsson (lennart@augustsson.net), Charles M. Hannum and |
9 | * Jeremy Morse (jeremy.morse@gmail.com). | | 9 | * Jeremy Morse (jeremy.morse@gmail.com). |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -42,27 +42,27 @@ | | | @@ -42,27 +42,27 @@ |
42 | | | 42 | |
43 | /* | | 43 | /* |
44 | * TODO: | | 44 | * TODO: |
45 | * 1) hold off explorations by companion controllers until ehci has started. | | 45 | * 1) hold off explorations by companion controllers until ehci has started. |
46 | * | | 46 | * |
47 | * 2) The hub driver needs to handle and schedule the transaction translator, | | 47 | * 2) The hub driver needs to handle and schedule the transaction translator, |
48 | * to assign place in frame where different devices get to go. See chapter | | 48 | * to assign place in frame where different devices get to go. See chapter |
49 | * on hubs in USB 2.0 for details. | | 49 | * on hubs in USB 2.0 for details. |
50 | * | | 50 | * |
51 | * 3) command failures are not recovered correctly | | 51 | * 3) command failures are not recovered correctly |
52 | */ | | 52 | */ |
53 | | | 53 | |
54 | #include <sys/cdefs.h> | | 54 | #include <sys/cdefs.h> |
55 | __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.148 2008/09/10 06:08:27 cegger Exp $"); | | 55 | __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.149 2008/10/05 21:31:39 jmcneill Exp $"); |
56 | | | 56 | |
57 | #include "ohci.h" | | 57 | #include "ohci.h" |
58 | #include "uhci.h" | | 58 | #include "uhci.h" |
59 | | | 59 | |
60 | #include <sys/param.h> | | 60 | #include <sys/param.h> |
61 | #include <sys/systm.h> | | 61 | #include <sys/systm.h> |
62 | #include <sys/kernel.h> | | 62 | #include <sys/kernel.h> |
63 | #include <sys/malloc.h> | | 63 | #include <sys/malloc.h> |
64 | #include <sys/device.h> | | 64 | #include <sys/device.h> |
65 | #include <sys/select.h> | | 65 | #include <sys/select.h> |
66 | #include <sys/proc.h> | | 66 | #include <sys/proc.h> |
67 | #include <sys/queue.h> | | 67 | #include <sys/queue.h> |
68 | #include <sys/mutex.h> | | 68 | #include <sys/mutex.h> |
| @@ -3964,27 +3964,27 @@ ehci_device_isoc_start(usbd_xfer_handle | | | @@ -3964,27 +3964,27 @@ ehci_device_isoc_start(usbd_xfer_handle |
3964 | EHCI_LINK_ITD); | | 3964 | EHCI_LINK_ITD); |
3965 | } | | 3965 | } |
3966 | | | 3966 | |
3967 | /* | | 3967 | /* |
3968 | * Other special values | | 3968 | * Other special values |
3969 | */ | | 3969 | */ |
3970 | | | 3970 | |
3971 | k = epipe->pipe.endpoint->edesc->bEndpointAddress; | | 3971 | k = epipe->pipe.endpoint->edesc->bEndpointAddress; |
3972 | itd->itd.itd_bufr[0] |= htole32(EHCI_ITD_SET_EP(UE_GET_ADDR(k)) | | | 3972 | itd->itd.itd_bufr[0] |= htole32(EHCI_ITD_SET_EP(UE_GET_ADDR(k)) | |
3973 | EHCI_ITD_SET_DADDR(epipe->pipe.device->address)); | | 3973 | EHCI_ITD_SET_DADDR(epipe->pipe.device->address)); |
3974 | | | 3974 | |
3975 | k = (UE_GET_DIR(epipe->pipe.endpoint->edesc->bEndpointAddress)) | | 3975 | k = (UE_GET_DIR(epipe->pipe.endpoint->edesc->bEndpointAddress)) |
3976 | ? 1 : 0; | | 3976 | ? 1 : 0; |
3977 | j = UE_GET_SIZE(UGETW(epipe->pipe.endpoint->edesc->wMaxPacketSize)); | | 3977 | j = UGETW(epipe->pipe.endpoint->edesc->wMaxPacketSize); |
3978 | itd->itd.itd_bufr[1] |= htole32(EHCI_ITD_SET_DIR(k) | | | 3978 | itd->itd.itd_bufr[1] |= htole32(EHCI_ITD_SET_DIR(k) | |
3979 | EHCI_ITD_SET_MAXPKT(UE_GET_SIZE(j))); | | 3979 | EHCI_ITD_SET_MAXPKT(UE_GET_SIZE(j))); |
3980 | | | 3980 | |
3981 | /* FIXME: handle invalid trans */ | | 3981 | /* FIXME: handle invalid trans */ |
3982 | itd->itd.itd_bufr[2] |= | | 3982 | itd->itd.itd_bufr[2] |= |
3983 | htole32(EHCI_ITD_SET_MULTI(UE_GET_TRANS(j)+1)); | | 3983 | htole32(EHCI_ITD_SET_MULTI(UE_GET_TRANS(j)+1)); |
3984 | | | 3984 | |
3985 | usb_syncmem(&itd->dma, | | 3985 | usb_syncmem(&itd->dma, |
3986 | itd->offs + offsetof(ehci_itd_t, itd_next), | | 3986 | itd->offs + offsetof(ehci_itd_t, itd_next), |
3987 | sizeof(ehci_itd_t), | | 3987 | sizeof(ehci_itd_t), |
3988 | BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); | | 3988 | BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); |
3989 | | | 3989 | |
3990 | prev = itd; | | 3990 | prev = itd; |