| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: sl811hs.c,v 1.96 2016/09/24 15:06:29 skrll Exp $ */ | | 1 | /* $NetBSD: sl811hs.c,v 1.97 2016/10/01 13:46:52 christos 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.96 2016/09/24 15:06:29 skrll Exp $"); | | 71 | __KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.97 2016/10/01 13:46:52 christos Exp $"); |
72 | | | 72 | |
73 | #ifdef _KERNEL_OPT | | 73 | #ifdef _KERNEL_OPT |
74 | #include "opt_slhci.h" | | 74 | #include "opt_slhci.h" |
75 | #include "opt_usb.h" | | 75 | #include "opt_usb.h" |
76 | #endif | | 76 | #endif |
77 | | | 77 | |
78 | #include <sys/param.h> | | 78 | #include <sys/param.h> |
79 | | | 79 | |
80 | #include <sys/bus.h> | | 80 | #include <sys/bus.h> |
81 | #include <sys/cpu.h> | | 81 | #include <sys/cpu.h> |
82 | #include <sys/device.h> | | 82 | #include <sys/device.h> |
83 | #include <sys/gcq.h> | | 83 | #include <sys/gcq.h> |
84 | #include <sys/intr.h> | | 84 | #include <sys/intr.h> |
| @@ -175,32 +175,26 @@ static const uint8_t slhci_tregs[2][4] = | | | @@ -175,32 +175,26 @@ static const uint8_t slhci_tregs[2][4] = |
175 | #define SLHCI_RESERVED_BUSTIME 5000 | | 175 | #define SLHCI_RESERVED_BUSTIME 5000 |
176 | #endif | | 176 | #endif |
177 | | | 177 | |
178 | /* | | 178 | /* |
179 | * Rate for "exceeds reserved bus time" warnings (default) or errors. | | 179 | * Rate for "exceeds reserved bus time" warnings (default) or errors. |
180 | * Warnings only happen when an endpoint open causes the time to go above | | 180 | * Warnings only happen when an endpoint open causes the time to go above |
181 | * SLHCI_RESERVED_BUSTIME, not if it is already above. | | 181 | * SLHCI_RESERVED_BUSTIME, not if it is already above. |
182 | */ | | 182 | */ |
183 | #ifndef SLHCI_OVERTIME_WARNING_RATE | | 183 | #ifndef SLHCI_OVERTIME_WARNING_RATE |
184 | #define SLHCI_OVERTIME_WARNING_RATE { 60, 0 } /* 60 seconds */ | | 184 | #define SLHCI_OVERTIME_WARNING_RATE { 60, 0 } /* 60 seconds */ |
185 | #endif | | 185 | #endif |
186 | static const struct timeval reserved_warn_rate = SLHCI_OVERTIME_WARNING_RATE; | | 186 | static const struct timeval reserved_warn_rate = SLHCI_OVERTIME_WARNING_RATE; |
187 | | | 187 | |
188 | /* Rate for overflow warnings */ | | | |
189 | #ifndef SLHCI_OVERFLOW_WARNING_RATE | | | |
190 | #define SLHCI_OVERFLOW_WARNING_RATE { 60, 0 } /* 60 seconds */ | | | |
191 | #endif | | | |
192 | static const struct timeval overflow_warn_rate = SLHCI_OVERFLOW_WARNING_RATE; | | | |
193 | | | | |
194 | /* | | 188 | /* |
195 | * For EOF, the spec says 42 bit times, plus (I think) a possible hub skew of | | 189 | * For EOF, the spec says 42 bit times, plus (I think) a possible hub skew of |
196 | * 20 bit times. By default leave 66 bit times to start the transfer beyond | | 190 | * 20 bit times. By default leave 66 bit times to start the transfer beyond |
197 | * the required time. Units are full-speed bit times (a bit over 5us per 64). | | 191 | * the required time. Units are full-speed bit times (a bit over 5us per 64). |
198 | * Only multiples of 64 are significant. | | 192 | * Only multiples of 64 are significant. |
199 | */ | | 193 | */ |
200 | #define SLHCI_STANDARD_END_BUSTIME 128 | | 194 | #define SLHCI_STANDARD_END_BUSTIME 128 |
201 | #ifndef SLHCI_EXTRA_END_BUSTIME | | 195 | #ifndef SLHCI_EXTRA_END_BUSTIME |
202 | #define SLHCI_EXTRA_END_BUSTIME 0 | | 196 | #define SLHCI_EXTRA_END_BUSTIME 0 |
203 | #endif | | 197 | #endif |
204 | | | 198 | |
205 | #define SLHCI_END_BUSTIME (SLHCI_STANDARD_END_BUSTIME+SLHCI_EXTRA_END_BUSTIME) | | 199 | #define SLHCI_END_BUSTIME (SLHCI_STANDARD_END_BUSTIME+SLHCI_EXTRA_END_BUSTIME) |
206 | | | 200 | |