uhci_pci.c (227849) | uhci_pci.c (228483) |
---|---|
1/*- 2 * Copyright (c) 1998 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Lennart Augustsson (augustss@carlstedt.se) at 7 * Carlstedt Research & Technology. 8 * --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by Lennart Augustsson (augustss@carlstedt.se) at 7 * Carlstedt Research & Technology. 8 * --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/usb/controller/uhci_pci.c 227849 2011-11-22 21:56:55Z hselasky $"); | 32__FBSDID("$FreeBSD: head/sys/dev/usb/controller/uhci_pci.c 228483 2011-12-14 00:28:54Z hselasky $"); |
33 34/* Universal Host Controller Interface 35 * 36 * UHCI spec: http://www.intel.com/ 37 */ 38 39/* The low level controller code for UHCI has been split into 40 * PCI probes and UHCI specific code. This was done to facilitate the --- 28 unchanged lines hidden (view full) --- 69#include <dev/usb/usb_util.h> 70#include <dev/usb/usb_debug.h> 71 72#include <dev/usb/usb_controller.h> 73#include <dev/usb/usb_bus.h> 74#include <dev/usb/usb_pci.h> 75#include <dev/usb/controller/uhci.h> 76#include <dev/usb/controller/uhcireg.h> | 33 34/* Universal Host Controller Interface 35 * 36 * UHCI spec: http://www.intel.com/ 37 */ 38 39/* The low level controller code for UHCI has been split into 40 * PCI probes and UHCI specific code. This was done to facilitate the --- 28 unchanged lines hidden (view full) --- 69#include <dev/usb/usb_util.h> 70#include <dev/usb/usb_debug.h> 71 72#include <dev/usb/usb_controller.h> 73#include <dev/usb/usb_bus.h> 74#include <dev/usb/usb_pci.h> 75#include <dev/usb/controller/uhci.h> 76#include <dev/usb/controller/uhcireg.h> |
77#include "usb_if.h" |
|
77 78#define PCI_UHCI_VENDORID_INTEL 0x8086 79#define PCI_UHCI_VENDORID_VIA 0x1106 80 81/* PIIX4E has no separate stepping */ 82 83static device_probe_t uhci_pci_probe; 84static device_attach_t uhci_pci_attach; 85static device_detach_t uhci_pci_detach; | 78 79#define PCI_UHCI_VENDORID_INTEL 0x8086 80#define PCI_UHCI_VENDORID_VIA 0x1106 81 82/* PIIX4E has no separate stepping */ 83 84static device_probe_t uhci_pci_probe; 85static device_attach_t uhci_pci_attach; 86static device_detach_t uhci_pci_detach; |
86static device_suspend_t uhci_pci_suspend; 87static device_resume_t uhci_pci_resume; | 87static usb_take_controller_t uhci_pci_take_controller; |
88 89static int | 88 89static int |
90uhci_pci_suspend(device_t self) | 90uhci_pci_take_controller(device_t self) |
91{ | 91{ |
92 uhci_softc_t *sc = device_get_softc(self); 93 int err; 94 95 err = bus_generic_suspend(self); 96 if (err) { 97 return (err); 98 } 99 uhci_suspend(sc); 100 return (0); 101} 102 103static int 104uhci_pci_resume(device_t self) 105{ 106 uhci_softc_t *sc = device_get_softc(self); 107 | |
108 pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); 109 | 92 pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); 93 |
110 uhci_resume(sc); 111 112 bus_generic_resume(self); | |
113 return (0); 114} 115 116static const char * 117uhci_pci_match(device_t self) 118{ 119 uint32_t device_id = pci_get_devid(self); 120 --- 320 unchanged lines hidden (view full) --- 441 sc->sc_io_res); 442 sc->sc_io_res = NULL; 443 } 444 usb_bus_mem_free_all(&sc->sc_bus, &uhci_iterate_hw_softc); 445 446 return (0); 447} 448 | 94 return (0); 95} 96 97static const char * 98uhci_pci_match(device_t self) 99{ 100 uint32_t device_id = pci_get_devid(self); 101 --- 320 unchanged lines hidden (view full) --- 422 sc->sc_io_res); 423 sc->sc_io_res = NULL; 424 } 425 usb_bus_mem_free_all(&sc->sc_bus, &uhci_iterate_hw_softc); 426 427 return (0); 428} 429 |
449static driver_t uhci_driver = 450{ 451 .name = "uhci", 452 .methods = (device_method_t[]){ 453 /* device interface */ 454 DEVMETHOD(device_probe, uhci_pci_probe), 455 DEVMETHOD(device_attach, uhci_pci_attach), 456 DEVMETHOD(device_detach, uhci_pci_detach), | 430static device_method_t uhci_pci_methods[] = { 431 /* Device interface */ 432 DEVMETHOD(device_probe, uhci_pci_probe), 433 DEVMETHOD(device_attach, uhci_pci_attach), 434 DEVMETHOD(device_detach, uhci_pci_detach), 435 DEVMETHOD(device_suspend, bus_generic_suspend), 436 DEVMETHOD(device_resume, bus_generic_resume), 437 DEVMETHOD(device_shutdown, bus_generic_shutdown), 438 DEVMETHOD(usb_take_controller, uhci_pci_take_controller), |
457 | 439 |
458 DEVMETHOD(device_suspend, uhci_pci_suspend), 459 DEVMETHOD(device_resume, uhci_pci_resume), 460 DEVMETHOD(device_shutdown, bus_generic_shutdown), | 440 DEVMETHOD_END 441}; |
461 | 442 |
462 DEVMETHOD_END 463 }, | 443static driver_t uhci_driver = { 444 .name = "uhci", 445 .methods = uhci_pci_methods, |
464 .size = sizeof(struct uhci_softc), 465}; 466 467static devclass_t uhci_devclass; 468 469DRIVER_MODULE(uhci, pci, uhci_driver, uhci_devclass, 0, 0); 470MODULE_DEPEND(uhci, usb, 1, 1, 1); | 446 .size = sizeof(struct uhci_softc), 447}; 448 449static devclass_t uhci_devclass; 450 451DRIVER_MODULE(uhci, pci, uhci_driver, uhci_devclass, 0, 0); 452MODULE_DEPEND(uhci, usb, 1, 1, 1); |