| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ehci.c,v 1.251 2016/05/06 16:30:01 skrll Exp $ */ | | 1 | /* $NetBSD: ehci.c,v 1.252 2016/05/14 07:14:31 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2004-2012 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2004-2012 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, | | 8 | * by Lennart Augustsson (lennart@augustsson.net), Charles M. Hannum, |
9 | * Jeremy Morse (jeremy.morse@gmail.com), Jared D. McNeill | | 9 | * Jeremy Morse (jeremy.morse@gmail.com), Jared D. McNeill |
10 | * (jmcneill@invisible.ca) and Matthew R. Green (mrg@eterna.com.au). | | 10 | * (jmcneill@invisible.ca) and Matthew R. Green (mrg@eterna.com.au). |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -43,27 +43,27 @@ | | | @@ -43,27 +43,27 @@ |
43 | | | 43 | |
44 | /* | | 44 | /* |
45 | * TODO: | | 45 | * TODO: |
46 | * 1) hold off explorations by companion controllers until ehci has started. | | 46 | * 1) hold off explorations by companion controllers until ehci has started. |
47 | * | | 47 | * |
48 | * 2) The hub driver needs to handle and schedule the transaction translator, | | 48 | * 2) The hub driver needs to handle and schedule the transaction translator, |
49 | * to assign place in frame where different devices get to go. See chapter | | 49 | * to assign place in frame where different devices get to go. See chapter |
50 | * on hubs in USB 2.0 for details. | | 50 | * on hubs in USB 2.0 for details. |
51 | * | | 51 | * |
52 | * 3) Command failures are not recovered correctly. | | 52 | * 3) Command failures are not recovered correctly. |
53 | */ | | 53 | */ |
54 | | | 54 | |
55 | #include <sys/cdefs.h> | | 55 | #include <sys/cdefs.h> |
56 | __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.251 2016/05/06 16:30:01 skrll Exp $"); | | 56 | __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.252 2016/05/14 07:14:31 skrll Exp $"); |
57 | | | 57 | |
58 | #include "ohci.h" | | 58 | #include "ohci.h" |
59 | #include "uhci.h" | | 59 | #include "uhci.h" |
60 | | | 60 | |
61 | #ifdef _KERNEL_OPT | | 61 | #ifdef _KERNEL_OPT |
62 | #include "opt_usb.h" | | 62 | #include "opt_usb.h" |
63 | #endif | | 63 | #endif |
64 | | | 64 | |
65 | #include <sys/param.h> | | 65 | #include <sys/param.h> |
66 | | | 66 | |
67 | #include <sys/bus.h> | | 67 | #include <sys/bus.h> |
68 | #include <sys/cpu.h> | | 68 | #include <sys/cpu.h> |
69 | #include <sys/device.h> | | 69 | #include <sys/device.h> |
| @@ -1943,27 +1943,28 @@ ehci_open(struct usbd_pipe *pipe) | | | @@ -1943,27 +1943,28 @@ ehci_open(struct usbd_pipe *pipe) |
1943 | EHCI_QH_SET_MPL(UGETW(ed->wMaxPacketSize)) | | | 1943 | EHCI_QH_SET_MPL(UGETW(ed->wMaxPacketSize)) | |
1944 | (speed != EHCI_QH_SPEED_HIGH && xfertype == UE_CONTROL ? | | 1944 | (speed != EHCI_QH_SPEED_HIGH && xfertype == UE_CONTROL ? |
1945 | EHCI_QH_CTL : 0) | | | 1945 | EHCI_QH_CTL : 0) | |
1946 | EHCI_QH_SET_NRL(naks) | | 1946 | EHCI_QH_SET_NRL(naks) |
1947 | ); | | 1947 | ); |
1948 | sqh->qh.qh_endphub = htole32( | | 1948 | sqh->qh.qh_endphub = htole32( |
1949 | EHCI_QH_SET_MULT(1) | | | 1949 | EHCI_QH_SET_MULT(1) | |
1950 | EHCI_QH_SET_SMASK(xfertype == UE_INTERRUPT ? 0x02 : 0) | | 1950 | EHCI_QH_SET_SMASK(xfertype == UE_INTERRUPT ? 0x02 : 0) |
1951 | ); | | 1951 | ); |
1952 | if (speed != EHCI_QH_SPEED_HIGH) | | 1952 | if (speed != EHCI_QH_SPEED_HIGH) |
1953 | sqh->qh.qh_endphub |= htole32( | | 1953 | sqh->qh.qh_endphub |= htole32( |
1954 | EHCI_QH_SET_PORT(hshubport) | | | 1954 | EHCI_QH_SET_PORT(hshubport) | |
1955 | EHCI_QH_SET_HUBA(hshubaddr) | | | 1955 | EHCI_QH_SET_HUBA(hshubaddr) | |
1956 | EHCI_QH_SET_CMASK(0x08) /* XXX */ | | 1956 | (xfertype == UE_INTERRUPT ? |
| | | 1957 | EHCI_QH_SET_CMASK(0x08) : 0) |
1957 | ); | | 1958 | ); |
1958 | sqh->qh.qh_curqtd = EHCI_NULL; | | 1959 | sqh->qh.qh_curqtd = EHCI_NULL; |
1959 | /* Fill the overlay qTD */ | | 1960 | /* Fill the overlay qTD */ |
1960 | sqh->qh.qh_qtd.qtd_next = EHCI_NULL; | | 1961 | sqh->qh.qh_qtd.qtd_next = EHCI_NULL; |
1961 | sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; | | 1962 | sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; |
1962 | sqh->qh.qh_qtd.qtd_status = htole32(0); | | 1963 | sqh->qh.qh_qtd.qtd_status = htole32(0); |
1963 | | | 1964 | |
1964 | usb_syncmem(&sqh->dma, sqh->offs, sizeof(sqh->qh), | | 1965 | usb_syncmem(&sqh->dma, sqh->offs, sizeof(sqh->qh), |
1965 | BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); | | 1966 | BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); |
1966 | epipe->sqh = sqh; | | 1967 | epipe->sqh = sqh; |
1967 | } else { | | 1968 | } else { |
1968 | sqh = NULL; | | 1969 | sqh = NULL; |
1969 | } /*xfertype == UE_ISOC*/ | | 1970 | } /*xfertype == UE_ISOC*/ |