ehci_pci.c revision 184824
1184610Salfred/*- 2184610Salfred * Copyright (c) 1998 The NetBSD Foundation, Inc. 3184610Salfred * All rights reserved. 4184610Salfred * 5184610Salfred * This code is derived from software contributed to The NetBSD Foundation 6184610Salfred * by Lennart Augustsson (augustss@carlstedt.se) at 7184610Salfred * Carlstedt Research & Technology. 8184610Salfred * 9184610Salfred * Redistribution and use in source and binary forms, with or without 10184610Salfred * modification, are permitted provided that the following conditions 11184610Salfred * are met: 12184610Salfred * 1. Redistributions of source code must retain the above copyright 13184610Salfred * notice, this list of conditions and the following disclaimer. 14184610Salfred * 2. Redistributions in binary form must reproduce the above copyright 15184610Salfred * notice, this list of conditions and the following disclaimer in the 16184610Salfred * documentation and/or other materials provided with the distribution. 17184610Salfred * 3. All advertising materials mentioning features or use of this software 18184610Salfred * must display the following acknowledgement: 19184610Salfred * This product includes software developed by the NetBSD 20184610Salfred * Foundation, Inc. and its contributors. 21184610Salfred * 4. Neither the name of The NetBSD Foundation nor the names of its 22184610Salfred * contributors may be used to endorse or promote products derived 23184610Salfred * from this software without specific prior written permission. 24184610Salfred * 25184610Salfred * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26184610Salfred * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27184610Salfred * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28184610Salfred * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29184610Salfred * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30184610Salfred * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31184610Salfred * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32184610Salfred * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33184610Salfred * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34184610Salfred * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35184610Salfred * POSSIBILITY OF SUCH DAMAGE. 36184610Salfred */ 37184610Salfred 38184610Salfred#include <sys/cdefs.h> 39184610Salfred__FBSDID("$FreeBSD: head/sys/dev/usb2/controller/ehci2_pci.c 184824 2008-11-10 20:54:31Z thompsa $"); 40184610Salfred 41184610Salfred/* 42184610Salfred * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller. 43184610Salfred * 44184610Salfred * The EHCI 1.0 spec can be found at 45184610Salfred * http://developer.intel.com/technology/usb/download/ehci-r10.pdf 46184610Salfred * and the USB 2.0 spec at 47184610Salfred * http://www.usb.org/developers/docs/usb_20.zip 48184610Salfred */ 49184610Salfred 50184610Salfred/* The low level controller code for EHCI has been split into 51184610Salfred * PCI probes and EHCI specific code. This was done to facilitate the 52184610Salfred * sharing of code between *BSD's 53184610Salfred */ 54184610Salfred 55184610Salfred#include <dev/usb2/include/usb2_mfunc.h> 56184610Salfred#include <dev/usb2/include/usb2_defs.h> 57184610Salfred#include <dev/usb2/include/usb2_standard.h> 58184610Salfred 59184610Salfred#include <dev/usb2/core/usb2_core.h> 60184610Salfred#include <dev/usb2/core/usb2_busdma.h> 61184610Salfred#include <dev/usb2/core/usb2_process.h> 62184610Salfred#include <dev/usb2/core/usb2_config_td.h> 63184610Salfred#include <dev/usb2/core/usb2_sw_transfer.h> 64184610Salfred#include <dev/usb2/core/usb2_util.h> 65184610Salfred 66184610Salfred#include <dev/usb2/controller/usb2_controller.h> 67184610Salfred#include <dev/usb2/controller/usb2_bus.h> 68184610Salfred#include <dev/usb2/controller/usb2_pci.h> 69184610Salfred#include <dev/usb2/controller/ehci2.h> 70184610Salfred 71184610Salfred#define PCI_EHCI_VENDORID_ACERLABS 0x10b9 72184610Salfred#define PCI_EHCI_VENDORID_AMD 0x1022 73184610Salfred#define PCI_EHCI_VENDORID_APPLE 0x106b 74184610Salfred#define PCI_EHCI_VENDORID_ATI 0x1002 75184610Salfred#define PCI_EHCI_VENDORID_CMDTECH 0x1095 76184610Salfred#define PCI_EHCI_VENDORID_INTEL 0x8086 77184610Salfred#define PCI_EHCI_VENDORID_NEC 0x1033 78184610Salfred#define PCI_EHCI_VENDORID_OPTI 0x1045 79184610Salfred#define PCI_EHCI_VENDORID_PHILIPS 0x1131 80184610Salfred#define PCI_EHCI_VENDORID_SIS 0x1039 81184610Salfred#define PCI_EHCI_VENDORID_NVIDIA 0x12D2 82184610Salfred#define PCI_EHCI_VENDORID_NVIDIA2 0x10DE 83184610Salfred#define PCI_EHCI_VENDORID_VIA 0x1106 84184610Salfred 85184610Salfred#define PCI_EHCI_BASE_REG 0x10 86184610Salfred 87184610Salfredstatic void ehci_pci_takecontroller(device_t self); 88184610Salfred 89184610Salfredstatic device_probe_t ehci_pci_probe; 90184610Salfredstatic device_attach_t ehci_pci_attach; 91184610Salfredstatic device_detach_t ehci_pci_detach; 92184610Salfredstatic device_suspend_t ehci_pci_suspend; 93184610Salfredstatic device_resume_t ehci_pci_resume; 94184610Salfredstatic device_shutdown_t ehci_pci_shutdown; 95184610Salfred 96184610Salfredstatic int 97184610Salfredehci_pci_suspend(device_t self) 98184610Salfred{ 99184610Salfred ehci_softc_t *sc = device_get_softc(self); 100184610Salfred int err; 101184610Salfred 102184610Salfred err = bus_generic_suspend(self); 103184610Salfred if (err) 104184610Salfred return (err); 105184610Salfred ehci_suspend(sc); 106184610Salfred return (0); 107184610Salfred} 108184610Salfred 109184610Salfredstatic int 110184610Salfredehci_pci_resume(device_t self) 111184610Salfred{ 112184610Salfred ehci_softc_t *sc = device_get_softc(self); 113184610Salfred 114184610Salfred ehci_pci_takecontroller(self); 115184610Salfred ehci_resume(sc); 116184610Salfred 117184610Salfred bus_generic_resume(self); 118184610Salfred 119184610Salfred return (0); 120184610Salfred} 121184610Salfred 122184610Salfredstatic int 123184610Salfredehci_pci_shutdown(device_t self) 124184610Salfred{ 125184610Salfred ehci_softc_t *sc = device_get_softc(self); 126184610Salfred int err; 127184610Salfred 128184610Salfred err = bus_generic_shutdown(self); 129184610Salfred if (err) 130184610Salfred return (err); 131184610Salfred ehci_shutdown(sc); 132184610Salfred 133184610Salfred return (0); 134184610Salfred} 135184610Salfred 136184610Salfredstatic const char * 137184610Salfredehci_pci_match(device_t self) 138184610Salfred{ 139184610Salfred uint32_t device_id = pci_get_devid(self); 140184610Salfred 141184610Salfred switch (device_id) { 142184610Salfred case 0x268c8086: 143184610Salfred return ("Intel 63XXESB USB 2.0 controller"); 144184610Salfred 145184610Salfred case 0x523910b9: 146184610Salfred return "ALi M5239 USB 2.0 controller"; 147184610Salfred 148184610Salfred case 0x10227463: 149184610Salfred return "AMD 8111 USB 2.0 controller"; 150184610Salfred 151184610Salfred case 0x20951022: 152184610Salfred return ("AMD CS5536 (Geode) USB 2.0 controller"); 153184610Salfred 154184610Salfred case 0x43451002: 155184610Salfred return "ATI SB200 USB 2.0 controller"; 156184610Salfred case 0x43731002: 157184610Salfred return "ATI SB400 USB 2.0 controller"; 158184610Salfred 159184610Salfred case 0x25ad8086: 160184610Salfred return "Intel 6300ESB USB 2.0 controller"; 161184610Salfred case 0x24cd8086: 162184610Salfred return "Intel 82801DB/L/M (ICH4) USB 2.0 controller"; 163184610Salfred case 0x24dd8086: 164184610Salfred return "Intel 82801EB/R (ICH5) USB 2.0 controller"; 165184610Salfred case 0x265c8086: 166184610Salfred return "Intel 82801FB (ICH6) USB 2.0 controller"; 167184610Salfred case 0x27cc8086: 168184610Salfred return "Intel 82801GB/R (ICH7) USB 2.0 controller"; 169184610Salfred 170184610Salfred case 0x28368086: 171184610Salfred return "Intel 82801H (ICH8) USB 2.0 controller USB2-A"; 172184610Salfred case 0x283a8086: 173184610Salfred return "Intel 82801H (ICH8) USB 2.0 controller USB2-B"; 174184610Salfred case 0x293a8086: 175184610Salfred return "Intel 82801I (ICH9) USB 2.0 controller"; 176184610Salfred case 0x293c8086: 177184610Salfred return "Intel 82801I (ICH9) USB 2.0 controller"; 178184610Salfred 179184610Salfred case 0x00e01033: 180184610Salfred return ("NEC uPD 720100 USB 2.0 controller"); 181184610Salfred 182184610Salfred case 0x006810de: 183184610Salfred return "NVIDIA nForce2 USB 2.0 controller"; 184184610Salfred case 0x008810de: 185184610Salfred return "NVIDIA nForce2 Ultra 400 USB 2.0 controller"; 186184610Salfred case 0x00d810de: 187184610Salfred return "NVIDIA nForce3 USB 2.0 controller"; 188184610Salfred case 0x00e810de: 189184610Salfred return "NVIDIA nForce3 250 USB 2.0 controller"; 190184610Salfred case 0x005b10de: 191184610Salfred return "NVIDIA nForce4 USB 2.0 controller"; 192184610Salfred 193184610Salfred case 0x15621131: 194184610Salfred return "Philips ISP156x USB 2.0 controller"; 195184610Salfred 196184610Salfred case 0x31041106: 197184610Salfred return ("VIA VT6202 USB 2.0 controller"); 198184610Salfred 199184610Salfred default: 200184610Salfred break; 201184610Salfred } 202184610Salfred 203184610Salfred if ((pci_get_class(self) == PCIC_SERIALBUS) 204184610Salfred && (pci_get_subclass(self) == PCIS_SERIALBUS_USB) 205184610Salfred && (pci_get_progif(self) == PCI_INTERFACE_EHCI)) { 206184610Salfred return ("EHCI (generic) USB 2.0 controller"); 207184610Salfred } 208184610Salfred return (NULL); /* dunno */ 209184610Salfred} 210184610Salfred 211184610Salfredstatic int 212184610Salfredehci_pci_probe(device_t self) 213184610Salfred{ 214184610Salfred const char *desc = ehci_pci_match(self); 215184610Salfred 216184610Salfred if (desc) { 217184610Salfred device_set_desc(self, desc); 218184610Salfred return (0); 219184610Salfred } else { 220184610Salfred return (ENXIO); 221184610Salfred } 222184610Salfred} 223184610Salfred 224184610Salfredstatic int 225184610Salfredehci_pci_attach(device_t self) 226184610Salfred{ 227184610Salfred ehci_softc_t *sc = device_get_softc(self); 228184610Salfred int err; 229184610Salfred int rid; 230184610Salfred 231184610Salfred if (sc == NULL) { 232184610Salfred device_printf(self, "Could not allocate sc\n"); 233184610Salfred return (ENXIO); 234184610Salfred } 235184610Salfred /* get all DMA memory */ 236184610Salfred 237184610Salfred if (usb2_bus_mem_alloc_all(&sc->sc_bus, 238184610Salfred USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { 239184610Salfred return ENOMEM; 240184610Salfred } 241184610Salfred sc->sc_dev = self; 242184610Salfred 243184610Salfred pci_enable_busmaster(self); 244184610Salfred 245184610Salfred switch (pci_read_config(self, PCI_USBREV, 1) & PCI_USB_REV_MASK) { 246184610Salfred case PCI_USB_REV_PRE_1_0: 247184610Salfred case PCI_USB_REV_1_0: 248184610Salfred case PCI_USB_REV_1_1: 249184610Salfred /* 250184610Salfred * NOTE: some EHCI USB controllers have the wrong USB 251184610Salfred * revision number. It appears those controllers are 252184610Salfred * fully compliant so we just ignore this value in 253184610Salfred * some common cases. 254184610Salfred */ 255184610Salfred device_printf(self, "pre-2.0 USB revision (ignored)\n"); 256184610Salfred /* fallthrough */ 257184610Salfred case PCI_USB_REV_2_0: 258184610Salfred sc->sc_bus.usbrev = USB_REV_2_0; 259184610Salfred break; 260184610Salfred default: 261184610Salfred sc->sc_bus.usbrev = USB_REV_UNKNOWN; 262184610Salfred break; 263184610Salfred } 264184610Salfred 265184610Salfred rid = PCI_CBMEM; 266184610Salfred sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, 267184610Salfred RF_ACTIVE); 268184610Salfred if (!sc->sc_io_res) { 269184610Salfred device_printf(self, "Could not map memory\n"); 270184610Salfred goto error; 271184610Salfred } 272184610Salfred sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); 273184610Salfred sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); 274184610Salfred sc->sc_io_size = rman_get_size(sc->sc_io_res); 275184610Salfred 276184610Salfred rid = 0; 277184610Salfred sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, 278184610Salfred RF_SHAREABLE | RF_ACTIVE); 279184610Salfred if (sc->sc_irq_res == NULL) { 280184610Salfred device_printf(self, "Could not allocate irq\n"); 281184610Salfred goto error; 282184610Salfred } 283184610Salfred sc->sc_bus.bdev = device_add_child(self, "usbus", -1); 284184610Salfred if (!sc->sc_bus.bdev) { 285184610Salfred device_printf(self, "Could not add USB device\n"); 286184610Salfred goto error; 287184610Salfred } 288184610Salfred device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); 289184610Salfred 290184610Salfred /* 291184610Salfred * ehci_pci_match will never return NULL if ehci_pci_probe 292184610Salfred * succeeded 293184610Salfred */ 294184610Salfred device_set_desc(sc->sc_bus.bdev, ehci_pci_match(self)); 295184610Salfred switch (pci_get_vendor(self)) { 296184610Salfred case PCI_EHCI_VENDORID_ACERLABS: 297184610Salfred sprintf(sc->sc_vendor, "AcerLabs"); 298184610Salfred break; 299184610Salfred case PCI_EHCI_VENDORID_AMD: 300184610Salfred sprintf(sc->sc_vendor, "AMD"); 301184610Salfred break; 302184610Salfred case PCI_EHCI_VENDORID_APPLE: 303184610Salfred sprintf(sc->sc_vendor, "Apple"); 304184610Salfred break; 305184610Salfred case PCI_EHCI_VENDORID_ATI: 306184610Salfred sprintf(sc->sc_vendor, "ATI"); 307184610Salfred break; 308184610Salfred case PCI_EHCI_VENDORID_CMDTECH: 309184610Salfred sprintf(sc->sc_vendor, "CMDTECH"); 310184610Salfred break; 311184610Salfred case PCI_EHCI_VENDORID_INTEL: 312184610Salfred sprintf(sc->sc_vendor, "Intel"); 313184610Salfred break; 314184610Salfred case PCI_EHCI_VENDORID_NEC: 315184610Salfred sprintf(sc->sc_vendor, "NEC"); 316184610Salfred break; 317184610Salfred case PCI_EHCI_VENDORID_OPTI: 318184610Salfred sprintf(sc->sc_vendor, "OPTi"); 319184610Salfred break; 320184610Salfred case PCI_EHCI_VENDORID_PHILIPS: 321184610Salfred sprintf(sc->sc_vendor, "Philips"); 322184610Salfred break; 323184610Salfred case PCI_EHCI_VENDORID_SIS: 324184610Salfred sprintf(sc->sc_vendor, "SiS"); 325184610Salfred break; 326184610Salfred case PCI_EHCI_VENDORID_NVIDIA: 327184610Salfred case PCI_EHCI_VENDORID_NVIDIA2: 328184610Salfred sprintf(sc->sc_vendor, "nVidia"); 329184610Salfred break; 330184610Salfred case PCI_EHCI_VENDORID_VIA: 331184610Salfred sprintf(sc->sc_vendor, "VIA"); 332184610Salfred break; 333184610Salfred default: 334184610Salfred if (bootverbose) 335184610Salfred device_printf(self, "(New EHCI DeviceId=0x%08x)\n", 336184610Salfred pci_get_devid(self)); 337184610Salfred sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); 338184610Salfred } 339184610Salfred 340184824Sthompsa err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, 341184610Salfred NULL, 0, 4); 342184610Salfred if (err) { 343184610Salfred device_printf(self, "could not setup config thread!\n"); 344184610Salfred goto error; 345184610Salfred } 346184610Salfred#if (__FreeBSD_version >= 700031) 347184610Salfred err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, 348184610Salfred NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); 349184610Salfred#else 350184610Salfred err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, 351184610Salfred (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); 352184610Salfred#endif 353184610Salfred if (err) { 354184610Salfred device_printf(self, "Could not setup irq, %d\n", err); 355184610Salfred sc->sc_intr_hdl = NULL; 356184610Salfred goto error; 357184610Salfred } 358184610Salfred ehci_pci_takecontroller(self); 359184610Salfred err = ehci_init(sc); 360184610Salfred if (!err) { 361184610Salfred err = device_probe_and_attach(sc->sc_bus.bdev); 362184610Salfred } 363184610Salfred if (err) { 364184610Salfred device_printf(self, "USB init failed err=%d\n", err); 365184610Salfred goto error; 366184610Salfred } 367184610Salfred return (0); 368184610Salfred 369184610Salfrederror: 370184610Salfred ehci_pci_detach(self); 371184610Salfred return (ENXIO); 372184610Salfred} 373184610Salfred 374184610Salfredstatic int 375184610Salfredehci_pci_detach(device_t self) 376184610Salfred{ 377184610Salfred ehci_softc_t *sc = device_get_softc(self); 378184610Salfred device_t bdev; 379184610Salfred 380184610Salfred usb2_config_td_drain(&sc->sc_config_td); 381184610Salfred 382184610Salfred if (sc->sc_bus.bdev) { 383184610Salfred bdev = sc->sc_bus.bdev; 384184610Salfred device_detach(bdev); 385184610Salfred device_delete_child(self, bdev); 386184610Salfred } 387184610Salfred /* during module unload there are lots of children leftover */ 388184610Salfred device_delete_all_children(self); 389184610Salfred 390184610Salfred pci_disable_busmaster(self); 391184610Salfred 392184610Salfred /* 393184610Salfred * disable interrupts that might have been switched on in ehci_init 394184610Salfred */ 395184610Salfred if (sc->sc_io_res) { 396184610Salfred EWRITE4(sc, EHCI_USBINTR, 0); 397184610Salfred } 398184610Salfred if (sc->sc_irq_res && sc->sc_intr_hdl) { 399184610Salfred /* 400184610Salfred * only call ehci_detach() after ehci_init() 401184610Salfred */ 402184610Salfred ehci_detach(sc); 403184610Salfred 404184610Salfred int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); 405184610Salfred 406184610Salfred if (err) 407184610Salfred /* XXX or should we panic? */ 408184610Salfred device_printf(self, "Could not tear down irq, %d\n", 409184610Salfred err); 410184610Salfred sc->sc_intr_hdl = NULL; 411184610Salfred } 412184610Salfred if (sc->sc_irq_res) { 413184610Salfred bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); 414184610Salfred sc->sc_irq_res = NULL; 415184610Salfred } 416184610Salfred if (sc->sc_io_res) { 417184610Salfred bus_release_resource(self, SYS_RES_MEMORY, PCI_CBMEM, 418184610Salfred sc->sc_io_res); 419184610Salfred sc->sc_io_res = NULL; 420184610Salfred } 421184610Salfred usb2_config_td_unsetup(&sc->sc_config_td); 422184610Salfred 423184610Salfred usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); 424184610Salfred 425184610Salfred return (0); 426184610Salfred} 427184610Salfred 428184610Salfredstatic void 429184610Salfredehci_pci_takecontroller(device_t self) 430184610Salfred{ 431184610Salfred ehci_softc_t *sc = device_get_softc(self); 432184610Salfred uint32_t cparams; 433184610Salfred uint32_t eec; 434184610Salfred uint16_t to; 435184610Salfred uint8_t eecp; 436184610Salfred uint8_t bios_sem; 437184610Salfred 438184610Salfred cparams = EREAD4(sc, EHCI_HCCPARAMS); 439184610Salfred 440184610Salfred /* Synchronise with the BIOS if it owns the controller. */ 441184610Salfred for (eecp = EHCI_HCC_EECP(cparams); eecp != 0; 442184610Salfred eecp = EHCI_EECP_NEXT(eec)) { 443184610Salfred eec = pci_read_config(self, eecp, 4); 444184610Salfred if (EHCI_EECP_ID(eec) != EHCI_EC_LEGSUP) { 445184610Salfred continue; 446184610Salfred } 447184610Salfred bios_sem = pci_read_config(self, eecp + 448184610Salfred EHCI_LEGSUP_BIOS_SEM, 1); 449184610Salfred if (bios_sem == 0) { 450184610Salfred continue; 451184610Salfred } 452184610Salfred device_printf(sc->sc_bus.bdev, "waiting for BIOS " 453184610Salfred "to give up control\n"); 454184610Salfred pci_write_config(self, eecp + 455184610Salfred EHCI_LEGSUP_OS_SEM, 1, 1); 456184610Salfred to = 500; 457184610Salfred while (1) { 458184610Salfred bios_sem = pci_read_config(self, eecp + 459184610Salfred EHCI_LEGSUP_BIOS_SEM, 1); 460184610Salfred if (bios_sem == 0) 461184610Salfred break; 462184610Salfred 463184610Salfred if (--to == 0) { 464184610Salfred device_printf(sc->sc_bus.bdev, 465184610Salfred "timed out waiting for BIOS\n"); 466184610Salfred break; 467184610Salfred } 468184610Salfred usb2_pause_mtx(NULL, 10); /* wait 10ms */ 469184610Salfred } 470184610Salfred } 471184610Salfred return; 472184610Salfred} 473184610Salfred 474184610Salfredstatic driver_t ehci_driver = 475184610Salfred{ 476184610Salfred .name = "ehci", 477184610Salfred .methods = (device_method_t[]){ 478184610Salfred /* device interface */ 479184610Salfred DEVMETHOD(device_probe, ehci_pci_probe), 480184610Salfred DEVMETHOD(device_attach, ehci_pci_attach), 481184610Salfred DEVMETHOD(device_detach, ehci_pci_detach), 482184610Salfred DEVMETHOD(device_suspend, ehci_pci_suspend), 483184610Salfred DEVMETHOD(device_resume, ehci_pci_resume), 484184610Salfred DEVMETHOD(device_shutdown, ehci_pci_shutdown), 485184610Salfred /* bus interface */ 486184610Salfred DEVMETHOD(bus_print_child, bus_generic_print_child), 487184610Salfred 488184610Salfred {0, 0} 489184610Salfred }, 490184610Salfred .size = sizeof(struct ehci_softc), 491184610Salfred}; 492184610Salfred 493184610Salfredstatic devclass_t ehci_devclass; 494184610Salfred 495184610SalfredDRIVER_MODULE(ehci, pci, ehci_driver, ehci_devclass, 0, 0); 496184610SalfredDRIVER_MODULE(ehci, cardbus, ehci_driver, ehci_devclass, 0, 0); 497184610SalfredMODULE_DEPEND(ehci, usb2_controller, 1, 1, 1); 498184610SalfredMODULE_DEPEND(ehci, usb2_core, 1, 1, 1); 499