FreeBSD kernel usb device Code
ehci_pci.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-NetBSD
3 *
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (augustss@carlstedt.se) at
9 * Carlstedt Research & Technology.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD$");
35
36/*
37 * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
38 *
39 * The EHCI 1.0 spec can be found at
40 * http://developer.intel.com/technology/usb/download/ehci-r10.pdf
41 * and the USB 2.0 spec at
42 * http://www.usb.org/developers/docs/usb_20.zip
43 */
44
45/* The low level controller code for EHCI has been split into
46 * PCI probes and EHCI specific code. This was done to facilitate the
47 * sharing of code between *BSD's
48 */
49
50#include <sys/stdint.h>
51#include <sys/stddef.h>
52#include <sys/param.h>
53#include <sys/queue.h>
54#include <sys/types.h>
55#include <sys/systm.h>
56#include <sys/kernel.h>
57#include <sys/bus.h>
58#include <sys/module.h>
59#include <sys/lock.h>
60#include <sys/mutex.h>
61#include <sys/condvar.h>
62#include <sys/sysctl.h>
63#include <sys/sx.h>
64#include <sys/unistd.h>
65#include <sys/callout.h>
66#include <sys/malloc.h>
67#include <sys/priv.h>
68
69#include <dev/usb/usb.h>
70#include <dev/usb/usbdi.h>
71
72#include <dev/usb/usb_core.h>
73#include <dev/usb/usb_busdma.h>
74#include <dev/usb/usb_process.h>
75#include <dev/usb/usb_util.h>
76
78#include <dev/usb/usb_bus.h>
79#include <dev/usb/usb_pci.h>
82#include "usb_if.h"
83
84#define PCI_EHCI_VENDORID_ACERLABS 0x10b9
85#define PCI_EHCI_VENDORID_AMD 0x1022
86#define PCI_EHCI_VENDORID_APPLE 0x106b
87#define PCI_EHCI_VENDORID_ATI 0x1002
88#define PCI_EHCI_VENDORID_CMDTECH 0x1095
89#define PCI_EHCI_VENDORID_HYGON 0x1d94
90#define PCI_EHCI_VENDORID_INTEL 0x8086
91#define PCI_EHCI_VENDORID_NEC 0x1033
92#define PCI_EHCI_VENDORID_OPTI 0x1045
93#define PCI_EHCI_VENDORID_PHILIPS 0x1131
94#define PCI_EHCI_VENDORID_SIS 0x1039
95#define PCI_EHCI_VENDORID_NVIDIA 0x12D2
96#define PCI_EHCI_VENDORID_NVIDIA2 0x10DE
97#define PCI_EHCI_VENDORID_VIA 0x1106
98
99static device_probe_t ehci_pci_probe;
100static device_attach_t ehci_pci_attach;
101static device_detach_t ehci_pci_detach;
102static usb_take_controller_t ehci_pci_take_controller;
103
104static const char *
105ehci_pci_match(device_t self)
106{
107 uint32_t device_id = pci_get_devid(self);
108
109 switch (device_id) {
110 case 0x523910b9:
111 return "ALi M5239 USB 2.0 controller";
112
113 case 0x10227463:
114 return "AMD 8111 USB 2.0 controller";
115
116 case 0x20951022:
117 return ("AMD CS5536 (Geode) USB 2.0 controller");
118 case 0x78081022:
119 return ("AMD FCH USB 2.0 controller");
120 case 0x79081022:
121 return ("AMD FCH USB 2.0 controller");
122
123 case 0x43451002:
124 return "ATI SB200 USB 2.0 controller";
125 case 0x43731002:
126 return "ATI SB400 USB 2.0 controller";
127 case 0x43961002:
128 return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller");
129
130 case 0x0f348086:
131 return ("Intel BayTrail USB 2.0 controller");
132 case 0x1c268086:
133 return ("Intel Cougar Point USB 2.0 controller");
134 case 0x1c2d8086:
135 return ("Intel Cougar Point USB 2.0 controller");
136 case 0x1d268086:
137 return ("Intel Patsburg USB 2.0 controller");
138 case 0x1d2d8086:
139 return ("Intel Patsburg USB 2.0 controller");
140 case 0x1e268086:
141 return ("Intel Panther Point USB 2.0 controller");
142 case 0x1e2d8086:
143 return ("Intel Panther Point USB 2.0 controller");
144 case 0x1f2c8086:
145 return ("Intel Avoton USB 2.0 controller");
146 case 0x25ad8086:
147 return "Intel 6300ESB USB 2.0 controller";
148 case 0x24cd8086:
149 return "Intel 82801DB/L/M (ICH4) USB 2.0 controller";
150 case 0x24dd8086:
151 return "Intel 82801EB/R (ICH5) USB 2.0 controller";
152 case 0x265c8086:
153 return "Intel 82801FB (ICH6) USB 2.0 controller";
154 case 0x268c8086:
155 return ("Intel 63XXESB USB 2.0 controller");
156 case 0x27cc8086:
157 return "Intel 82801GB/R (ICH7) USB 2.0 controller";
158 case 0x28368086:
159 return "Intel 82801H (ICH8) USB 2.0 controller USB2-A";
160 case 0x283a8086:
161 return "Intel 82801H (ICH8) USB 2.0 controller USB2-B";
162 case 0x293a8086:
163 return "Intel 82801I (ICH9) USB 2.0 controller";
164 case 0x293c8086:
165 return "Intel 82801I (ICH9) USB 2.0 controller";
166 case 0x3a3a8086:
167 return "Intel 82801JI (ICH10) USB 2.0 controller USB-A";
168 case 0x3a3c8086:
169 return "Intel 82801JI (ICH10) USB 2.0 controller USB-B";
170 case 0x3b348086:
171 return ("Intel PCH USB 2.0 controller USB-A");
172 case 0x3b3c8086:
173 return ("Intel PCH USB 2.0 controller USB-B");
174 case 0x8c268086:
175 return ("Intel Lynx Point USB 2.0 controller USB-A");
176 case 0x8c2d8086:
177 return ("Intel Lynx Point USB 2.0 controller USB-B");
178 case 0x8ca68086:
179 return ("Intel Wildcat Point USB 2.0 controller USB-A");
180 case 0x8cad8086:
181 return ("Intel Wildcat Point USB 2.0 controller USB-B");
182 case 0x8d268086:
183 return ("Intel Wellsburg USB 2.0 controller");
184 case 0x8d2d8086:
185 return ("Intel Wellsburg USB 2.0 controller");
186 case 0x9c268086:
187 return ("Intel Lynx Point-LP USB 2.0 controller");
188 case 0x9ca68086:
189 return ("Intel Wildcat Point-LP USB 2.0 controller");
190
191 case 0x00e01033:
192 return ("NEC uPD 72010x USB 2.0 controller");
193
194 case 0x006810de:
195 return "NVIDIA nForce2 USB 2.0 controller";
196 case 0x008810de:
197 return "NVIDIA nForce2 Ultra 400 USB 2.0 controller";
198 case 0x00d810de:
199 return "NVIDIA nForce3 USB 2.0 controller";
200 case 0x00e810de:
201 return "NVIDIA nForce3 250 USB 2.0 controller";
202 case 0x005b10de:
203 return "NVIDIA nForce CK804 USB 2.0 controller";
204 case 0x036d10de:
205 return "NVIDIA nForce MCP55 USB 2.0 controller";
206 case 0x03f210de:
207 return "NVIDIA nForce MCP61 USB 2.0 controller";
208 case 0x0aa610de:
209 return "NVIDIA nForce MCP79 USB 2.0 controller";
210 case 0x0aa910de:
211 return "NVIDIA nForce MCP79 USB 2.0 controller";
212 case 0x0aaa10de:
213 return "NVIDIA nForce MCP79 USB 2.0 controller";
214
215 case 0x15621131:
216 return "Philips ISP156x USB 2.0 controller";
217
218 case 0x70021039:
219 return "SiS 968 USB 2.0 controller";
220
221 case 0x31041106:
222 return ("VIA VT6202 USB 2.0 controller");
223
224 default:
225 break;
226 }
227
228 if ((pci_get_class(self) == PCIC_SERIALBUS)
229 && (pci_get_subclass(self) == PCIS_SERIALBUS_USB)
230 && (pci_get_progif(self) == PCI_INTERFACE_EHCI)) {
231 return ("EHCI (generic) USB 2.0 controller");
232 }
233 return (NULL); /* dunno */
234}
235
236static int
237ehci_pci_probe(device_t self)
238{
239 const char *desc = ehci_pci_match(self);
240
241 if (desc) {
242 device_set_desc(self, desc);
243 return (BUS_PROBE_DEFAULT);
244 } else {
245 return (ENXIO);
246 }
247}
248
249static void
250ehci_pci_ati_quirk(device_t self, uint8_t is_sb700)
251{
252 device_t smbdev;
253 uint32_t val;
254
255 if (is_sb700) {
256 /* Lookup SMBUS PCI device */
257 smbdev = pci_find_device(PCI_EHCI_VENDORID_ATI, 0x4385);
258 if (smbdev == NULL)
259 return;
260 val = pci_get_revid(smbdev);
261 if (val != 0x3a && val != 0x3b)
262 return;
263 }
264
265 /*
266 * Note: this bit is described as reserved in SB700
267 * Register Reference Guide.
268 */
269 val = pci_read_config(self, 0x53, 1);
270 if (!(val & 0x8)) {
271 val |= 0x8;
272 pci_write_config(self, 0x53, val, 1);
273 device_printf(self, "AMD SB600/700 quirk applied\n");
274 }
275}
276
277static void
278ehci_pci_via_quirk(device_t self)
279{
280 uint32_t val;
281
282 if ((pci_get_device(self) == 0x3104) &&
283 ((pci_get_revid(self) & 0xf0) == 0x60)) {
284 /* Correct schedule sleep time to 10us */
285 val = pci_read_config(self, 0x4b, 1);
286 if (val & 0x20)
287 return;
288 val |= 0x20;
289 pci_write_config(self, 0x4b, val, 1);
290 device_printf(self, "VIA-quirk applied\n");
291 }
292}
293
294static int
295ehci_pci_attach(device_t self)
296{
297 ehci_softc_t *sc = device_get_softc(self);
298 int err;
299 int rid;
300
301 /* initialise some bus fields */
302 sc->sc_bus.parent = self;
303 sc->sc_bus.devices = sc->sc_devices;
305 sc->sc_bus.dma_bits = 32;
306
307 /* get all DMA memory */
310 return (ENOMEM);
311 }
312
313 pci_enable_busmaster(self);
314
315 switch (pci_read_config(self, PCI_USBREV, 1) & PCI_USB_REV_MASK) {
317 case PCI_USB_REV_1_0:
318 case PCI_USB_REV_1_1:
319 /*
320 * NOTE: some EHCI USB controllers have the wrong USB
321 * revision number. It appears those controllers are
322 * fully compliant so we just ignore this value in
323 * some common cases.
324 */
325 device_printf(self, "pre-2.0 USB revision (ignored)\n");
326 /* fallthrough */
327 case PCI_USB_REV_2_0:
328 break;
329 default:
330 /* Quirk for Parallels Desktop 4.0 */
331 device_printf(self, "USB revision is unknown. Assuming v2.0.\n");
332 break;
333 }
334
335 rid = PCI_CBMEM;
336 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid,
337 RF_ACTIVE);
338 if (!sc->sc_io_res) {
339 device_printf(self, "Could not map memory\n");
340 goto error;
341 }
342 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res);
343 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
344 sc->sc_io_size = rman_get_size(sc->sc_io_res);
345
346 rid = 0;
347 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid,
348 RF_SHAREABLE | RF_ACTIVE);
349 if (sc->sc_irq_res == NULL) {
350 device_printf(self, "Could not allocate irq\n");
351 goto error;
352 }
353 sc->sc_bus.bdev = device_add_child(self, "usbus", -1);
354 if (!sc->sc_bus.bdev) {
355 device_printf(self, "Could not add USB device\n");
356 goto error;
357 }
358 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus);
359
360 /*
361 * ehci_pci_match will never return NULL if ehci_pci_probe
362 * succeeded
363 */
364 device_set_desc(sc->sc_bus.bdev, ehci_pci_match(self));
365 switch (pci_get_vendor(self)) {
367 sprintf(sc->sc_vendor, "AcerLabs");
368 break;
370 sprintf(sc->sc_vendor, "AMD");
371 break;
373 sprintf(sc->sc_vendor, "Apple");
374 break;
376 sprintf(sc->sc_vendor, "ATI");
377 break;
379 sprintf(sc->sc_vendor, "CMDTECH");
380 break;
382 sprintf(sc->sc_vendor, "Hygon");
383 break;
385 sprintf(sc->sc_vendor, "Intel");
386 break;
388 sprintf(sc->sc_vendor, "NEC");
389 break;
391 sprintf(sc->sc_vendor, "OPTi");
392 break;
394 sprintf(sc->sc_vendor, "Philips");
395 break;
397 sprintf(sc->sc_vendor, "SiS");
398 break;
401 sprintf(sc->sc_vendor, "nVidia");
402 break;
404 sprintf(sc->sc_vendor, "VIA");
405 break;
406 default:
407 if (bootverbose)
408 device_printf(self, "(New EHCI DeviceId=0x%08x)\n",
409 pci_get_devid(self));
410 sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
411 }
412
413#if (__FreeBSD_version >= 700031)
414 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
415 NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
416#else
417 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
418 (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
419#endif
420 if (err) {
421 device_printf(self, "Could not setup irq, %d\n", err);
422 sc->sc_intr_hdl = NULL;
423 goto error;
424 }
426
427 /* Undocumented quirks taken from Linux */
428
429 switch (pci_get_vendor(self)) {
431 /* SB600 and SB700 EHCI quirk */
432 switch (pci_get_device(self)) {
433 case 0x4386:
434 ehci_pci_ati_quirk(self, 0);
435 break;
436 case 0x4396:
437 ehci_pci_ati_quirk(self, 1);
438 break;
439 default:
440 break;
441 }
442 break;
443
445 ehci_pci_via_quirk(self);
446 break;
447
448 default:
449 break;
450 }
451
452 /* Dropped interrupts workaround */
453 switch (pci_get_vendor(self)) {
457 if (bootverbose)
458 device_printf(self,
459 "Dropped interrupts workaround enabled\n");
460 break;
461 default:
462 break;
463 }
464
465 /* Doorbell feature workaround */
466 switch (pci_get_vendor(self)) {
470 if (bootverbose)
471 device_printf(self,
472 "Doorbell workaround enabled\n");
473 break;
474 default:
475 break;
476 }
477
478 err = ehci_init(sc);
479 if (!err) {
480 err = device_probe_and_attach(sc->sc_bus.bdev);
481 }
482 if (err) {
483 device_printf(self, "USB init failed err=%d\n", err);
484 goto error;
485 }
486 return (0);
487
488error:
489 ehci_pci_detach(self);
490 return (ENXIO);
491}
492
493static int
494ehci_pci_detach(device_t self)
495{
496 ehci_softc_t *sc = device_get_softc(self);
497
498 /* during module unload there are lots of children leftover */
499 device_delete_children(self);
500
501 pci_disable_busmaster(self);
502
503 if (sc->sc_irq_res && sc->sc_intr_hdl) {
504 /*
505 * only call ehci_detach() after ehci_init()
506 */
507 ehci_detach(sc);
508
509 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl);
510
511 if (err)
512 /* XXX or should we panic? */
513 device_printf(self, "Could not tear down irq, %d\n",
514 err);
515 sc->sc_intr_hdl = NULL;
516 }
517 if (sc->sc_irq_res) {
518 bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res);
519 sc->sc_irq_res = NULL;
520 }
521 if (sc->sc_io_res) {
522 bus_release_resource(self, SYS_RES_MEMORY, PCI_CBMEM,
523 sc->sc_io_res);
524 sc->sc_io_res = NULL;
525 }
527
528 return (0);
529}
530
531static int
533{
534 ehci_softc_t *sc = device_get_softc(self);
535 uint32_t cparams;
536 uint32_t eec;
537 uint16_t to;
538 uint8_t eecp;
539 uint8_t bios_sem;
540
541 cparams = EREAD4(sc, EHCI_HCCPARAMS);
542
543 /* Synchronise with the BIOS if it owns the controller. */
544 for (eecp = EHCI_HCC_EECP(cparams); eecp != 0;
545 eecp = EHCI_EECP_NEXT(eec)) {
546 eec = pci_read_config(self, eecp, 4);
547 if (EHCI_EECP_ID(eec) != EHCI_EC_LEGSUP) {
548 continue;
549 }
550 bios_sem = pci_read_config(self, eecp +
552 if (bios_sem == 0) {
553 continue;
554 }
555 device_printf(sc->sc_bus.bdev, "waiting for BIOS "
556 "to give up control\n");
557 pci_write_config(self, eecp +
558 EHCI_LEGSUP_OS_SEM, 1, 1);
559 to = 500;
560 while (1) {
561 bios_sem = pci_read_config(self, eecp +
563 if (bios_sem == 0)
564 break;
565
566 if (--to == 0) {
567 device_printf(sc->sc_bus.bdev,
568 "timed out waiting for BIOS\n");
569 break;
570 }
571 usb_pause_mtx(NULL, hz / 100); /* wait 10ms */
572 }
573 }
574 return (0);
575}
576
577static device_method_t ehci_pci_methods[] = {
578 /* Device interface */
579 DEVMETHOD(device_probe, ehci_pci_probe),
580 DEVMETHOD(device_attach, ehci_pci_attach),
581 DEVMETHOD(device_detach, ehci_pci_detach),
582 DEVMETHOD(device_suspend, bus_generic_suspend),
583 DEVMETHOD(device_resume, bus_generic_resume),
584 DEVMETHOD(device_shutdown, bus_generic_shutdown),
585 DEVMETHOD(usb_take_controller, ehci_pci_take_controller),
586
587 DEVMETHOD_END
588};
589
590static driver_t ehci_driver = {
591 .name = "ehci",
592 .methods = ehci_pci_methods,
593 .size = sizeof(struct ehci_softc),
594};
595
596static devclass_t ehci_devclass;
597
599MODULE_DEPEND(ehci, usb, 1, 1, 1);
void ehci_interrupt(ehci_softc_t *sc)
Definition: ehci.c:1451
void ehci_detach(ehci_softc_t *sc)
Definition: ehci.c:553
usb_error_t ehci_init(ehci_softc_t *sc)
Definition: ehci.c:281
#define EHCI_SCFLG_IAADBUG
Definition: ehci.h:345
usb_bus_mem_cb_t ehci_iterate_hw_softc
Definition: ehci.h:445
#define EREAD4(sc, a)
Definition: ehci.h:367
#define EHCI_MAX_DEVICES
Definition: ehci.h:36
#define EHCI_SCFLG_LOSTINTRBUG
Definition: ehci.h:344
#define PCI_EHCI_VENDORID_INTEL
Definition: ehci_pci.c:90
#define PCI_EHCI_VENDORID_APPLE
Definition: ehci_pci.c:86
static device_method_t ehci_pci_methods[]
Definition: ehci_pci.c:577
#define PCI_EHCI_VENDORID_CMDTECH
Definition: ehci_pci.c:88
#define PCI_EHCI_VENDORID_SIS
Definition: ehci_pci.c:94
DRIVER_MODULE(ehci, pci, ehci_driver, ehci_devclass, 0, 0)
#define PCI_EHCI_VENDORID_HYGON
Definition: ehci_pci.c:89
static device_attach_t ehci_pci_attach
Definition: ehci_pci.c:100
#define PCI_EHCI_VENDORID_NVIDIA2
Definition: ehci_pci.c:96
#define PCI_EHCI_VENDORID_AMD
Definition: ehci_pci.c:85
#define PCI_EHCI_VENDORID_NVIDIA
Definition: ehci_pci.c:95
#define PCI_EHCI_VENDORID_PHILIPS
Definition: ehci_pci.c:93
MODULE_DEPEND(ehci, usb, 1, 1, 1)
#define PCI_EHCI_VENDORID_NEC
Definition: ehci_pci.c:91
static device_detach_t ehci_pci_detach
Definition: ehci_pci.c:101
__FBSDID("$FreeBSD$")
static void ehci_pci_via_quirk(device_t self)
Definition: ehci_pci.c:278
static device_probe_t ehci_pci_probe
Definition: ehci_pci.c:99
static devclass_t ehci_devclass
Definition: ehci_pci.c:596
static usb_take_controller_t ehci_pci_take_controller
Definition: ehci_pci.c:102
#define PCI_EHCI_VENDORID_ACERLABS
Definition: ehci_pci.c:84
static void ehci_pci_ati_quirk(device_t self, uint8_t is_sb700)
Definition: ehci_pci.c:250
#define PCI_EHCI_VENDORID_ATI
Definition: ehci_pci.c:87
#define PCI_EHCI_VENDORID_OPTI
Definition: ehci_pci.c:92
#define PCI_EHCI_VENDORID_VIA
Definition: ehci_pci.c:97
static const char * ehci_pci_match(device_t self)
Definition: ehci_pci.c:105
static driver_t ehci_driver
Definition: ehci_pci.c:590
#define EHCI_HCCPARAMS
Definition: ehcireg.h:69
#define EHCI_HCC_EECP(x)
Definition: ehcireg.h:70
#define PCI_INTERFACE_EHCI
Definition: ehcireg.h:38
#define EHCI_EECP_NEXT(x)
Definition: ehcireg.h:50
#define PCI_USB_REV_1_1
Definition: ehcireg.h:43
#define PCI_USB_REV_2_0
Definition: ehcireg.h:44
#define EHCI_EECP_ID(x)
Definition: ehcireg.h:51
#define EHCI_LEGSUP_OS_SEM
Definition: ehcireg.h:55
#define PCI_USB_REV_PRE_1_0
Definition: ehcireg.h:41
#define PCI_USBREV
Definition: ehcireg.h:39
#define PCI_USB_REV_MASK
Definition: ehcireg.h:40
#define PCI_CBMEM
Definition: ehcireg.h:37
#define PCI_USB_REV_1_0
Definition: ehcireg.h:42
#define EHCI_LEGSUP_BIOS_SEM
Definition: ehcireg.h:54
#define EHCI_EC_LEGSUP
Definition: ehcireg.h:49
uint32_t val
Definition: if_rum.c:284
struct @109 error
device_t pci_find_device(uint16_t vendor, uint16_t device)
uint16_t rid
#define PCIS_SERIALBUS_USB
#define PCIC_SERIALBUS
struct usb_device * sc_devices[EHCI_MAX_DEVICES]
Definition: ehci.h:323
char sc_vendor[16]
Definition: ehci.h:357
bus_size_t sc_io_size
Definition: ehci.h:331
struct resource * sc_irq_res
Definition: ehci.h:325
void * sc_intr_hdl
Definition: ehci.h:330
bus_space_handle_t sc_io_hdl
Definition: ehci.h:333
struct resource * sc_io_res
Definition: ehci.h:324
bus_space_tag_t sc_io_tag
Definition: ehci.h:332
uint16_t sc_flags
Definition: ehci.h:340
struct usb_bus sc_bus
Definition: ehci.h:318
device_t bdev
Definition: usb_bus.h:101
device_t parent
Definition: usb_bus.h:100
struct usb_device ** devices
Definition: usb_bus.h:108
uint8_t devices_max
Definition: usb_bus.h:121
uint8_t dma_bits
Definition: usb_bus.h:124
#define USB_GET_DMA_TAG(dev)
Definition: usb_busdma.h:46
void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb)
struct usb_endpoint_descriptor desc
Definition: usb_device.h:0
INTERFACE usb
Definition: usb_if.m:35
void usb_pause_mtx(struct mtx *mtx, int timo)
Definition: usb_util.c:135