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 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>
77#include "usb_if.h"
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;
87static usb_take_controller_t uhci_pci_take_controller;
88
89static int
90uhci_pci_take_controller(device_t self)
91{
92 pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2);
93
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
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),
439
440 DEVMETHOD_END
441};
442
443static driver_t uhci_driver = {
444 .name = "uhci",
445 .methods = uhci_pci_methods,
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);