Deleted Added
sdiff udiff text old ( 227849 ) new ( 228483 )
full compact
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 $");
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
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;
86static device_suspend_t uhci_pci_suspend;
87static device_resume_t uhci_pci_resume;
88
89static int
90uhci_pci_suspend(device_t self)
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
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
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),
457
458 DEVMETHOD(device_suspend, uhci_pci_suspend),
459 DEVMETHOD(device_resume, uhci_pci_resume),
460 DEVMETHOD(device_shutdown, bus_generic_shutdown),
461
462 DEVMETHOD_END
463 },
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);