| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: sl811hs.c,v 1.47.6.11 2014/12/05 09:37:49 skrll Exp $ */ | | 1 | /* $NetBSD: sl811hs.c,v 1.47.6.12 2015/10/11 08:35:04 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Not (c) 2007 Matthew Orgass | | 4 | * Not (c) 2007 Matthew Orgass |
5 | * This file is public domain, meaning anyone can make any use of part or all | | 5 | * This file is public domain, meaning anyone can make any use of part or all |
6 | * of this file including copying into other works without credit. Any use, | | 6 | * of this file including copying into other works without credit. Any use, |
7 | * modified or not, is solely the responsibility of the user. If this file is | | 7 | * modified or not, is solely the responsibility of the user. If this file is |
8 | * part of a collection then use in the collection is governed by the terms of | | 8 | * part of a collection then use in the collection is governed by the terms of |
9 | * the collection. | | 9 | * the collection. |
10 | */ | | 10 | */ |
11 | | | 11 | |
12 | /* | | 12 | /* |
13 | * Cypress/ScanLogic SL811HS/T USB Host Controller | | 13 | * Cypress/ScanLogic SL811HS/T USB Host Controller |
14 | * Datasheet, Errata, and App Note available at www.cypress.com | | 14 | * Datasheet, Errata, and App Note available at www.cypress.com |
| @@ -58,27 +58,27 @@ | | | @@ -58,27 +58,27 @@ |
58 | */ | | 58 | */ |
59 | | | 59 | |
60 | /* | | 60 | /* |
61 | * XXX TODO: | | 61 | * XXX TODO: |
62 | * copy next output packet while transfering | | 62 | * copy next output packet while transfering |
63 | * usb suspend | | 63 | * usb suspend |
64 | * could keep track of known values of all buffer space? | | 64 | * could keep track of known values of all buffer space? |
65 | * combined print/log function for errors | | 65 | * combined print/log function for errors |
66 | * | | 66 | * |
67 | * ub_usepolling support is untested and may not work | | 67 | * ub_usepolling support is untested and may not work |
68 | */ | | 68 | */ |
69 | | | 69 | |
70 | #include <sys/cdefs.h> | | 70 | #include <sys/cdefs.h> |
71 | __KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.47.6.11 2014/12/05 09:37:49 skrll Exp $"); | | 71 | __KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.47.6.12 2015/10/11 08:35:04 skrll Exp $"); |
72 | | | 72 | |
73 | #include "opt_slhci.h" | | 73 | #include "opt_slhci.h" |
74 | | | 74 | |
75 | #include <sys/cdefs.h> | | 75 | #include <sys/cdefs.h> |
76 | #include <sys/param.h> | | 76 | #include <sys/param.h> |
77 | #include <sys/systm.h> | | 77 | #include <sys/systm.h> |
78 | #include <sys/kernel.h> | | 78 | #include <sys/kernel.h> |
79 | #include <sys/proc.h> | | 79 | #include <sys/proc.h> |
80 | #include <sys/device.h> | | 80 | #include <sys/device.h> |
81 | #include <sys/kmem.h> | | 81 | #include <sys/kmem.h> |
82 | #include <sys/queue.h> | | 82 | #include <sys/queue.h> |
83 | #include <sys/gcq.h> | | 83 | #include <sys/gcq.h> |
84 | #include <sys/intr.h> | | 84 | #include <sys/intr.h> |
| @@ -921,27 +921,27 @@ slhci_start(struct usbd_xfer *xfer) | | | @@ -921,27 +921,27 @@ slhci_start(struct usbd_xfer *xfer) |
921 | else | | 921 | else |
922 | spipe->wantshort = 0; | | 922 | spipe->wantshort = 0; |
923 | | | 923 | |
924 | /* | | 924 | /* |
925 | * The goal of newbustime and newlen is to avoid bustime calculation | | 925 | * The goal of newbustime and newlen is to avoid bustime calculation |
926 | * in the interrupt. The calculations are not too complex, but they | | 926 | * in the interrupt. The calculations are not too complex, but they |
927 | * complicate the conditional logic somewhat and doing them all in the | | 927 | * complicate the conditional logic somewhat and doing them all in the |
928 | * same place shares constants. Index 0 is "short length" for bulk and | | 928 | * same place shares constants. Index 0 is "short length" for bulk and |
929 | * ctrl data and 1 is "full length" for ctrl data (bulk/intr are | | 929 | * ctrl data and 1 is "full length" for ctrl data (bulk/intr are |
930 | * already set to full length). | | 930 | * already set to full length). |
931 | */ | | 931 | */ |
932 | if (spipe->pflags & PF_LS) { | | 932 | if (spipe->pflags & PF_LS) { |
933 | /* | | 933 | /* |
934 | * Setting PREAMBLE for directly connnected LS devices will | | 934 | * Setting PREAMBLE for directly connected LS devices will |
935 | * lock up the chip. | | 935 | * lock up the chip. |
936 | */ | | 936 | */ |
937 | if (spipe->pflags & PF_PREAMBLE) | | 937 | if (spipe->pflags & PF_PREAMBLE) |
938 | spipe->control |= SL11_EPCTRL_PREAMBLE; | | 938 | spipe->control |= SL11_EPCTRL_PREAMBLE; |
939 | if (max_packet <= 8) { | | 939 | if (max_packet <= 8) { |
940 | spipe->bustime = SLHCI_LS_CONST + | | 940 | spipe->bustime = SLHCI_LS_CONST + |
941 | SLHCI_LS_DATA_TIME(spipe->tregs[LEN]); | | 941 | SLHCI_LS_DATA_TIME(spipe->tregs[LEN]); |
942 | spipe->newbustime[0] = SLHCI_LS_CONST + | | 942 | spipe->newbustime[0] = SLHCI_LS_CONST + |
943 | SLHCI_LS_DATA_TIME(spipe->newlen[0]); | | 943 | SLHCI_LS_DATA_TIME(spipe->newlen[0]); |
944 | spipe->newbustime[1] = SLHCI_LS_CONST + | | 944 | spipe->newbustime[1] = SLHCI_LS_CONST + |
945 | SLHCI_LS_DATA_TIME(spipe->newlen[1]); | | 945 | SLHCI_LS_DATA_TIME(spipe->newlen[1]); |
946 | } else | | 946 | } else |
947 | xfer->ux_status = USBD_INVAL; | | 947 | xfer->ux_status = USBD_INVAL; |