2 * Copyright 1998 Massachusetts Institute of Technology
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all
9 * supporting documentation, and that the name of M.I.T. not be used
10 * in advertising or publicity pertaining to distribution of the
11 * software without specific, written prior permission. M.I.T. makes
12 * no representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied
16 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
17 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * Copyright 2001 by Thomas Moestl <tmm@FreeBSD.org>. All rights reserved.
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
41 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09
56 #include <sys/cdefs.h>
57 __FBSDID("$FreeBSD$");
59 #include <sys/param.h>
60 #include <sys/systm.h>
61 #include <sys/module.h>
64 #include <sys/kernel.h>
65 #include <sys/malloc.h>
71 static int nexus_probe(device_t);
72 static int nexus_attach(device_t);
73 static int nexus_activate_resource(device_t, device_t, int, int,
75 static int nexus_deactivate_resource(device_t, device_t, int, int,
78 static device_method_t nexus_methods[] = {
79 /* Device interface */
80 DEVMETHOD(device_probe, nexus_probe),
81 DEVMETHOD(device_attach, nexus_attach),
82 DEVMETHOD(device_detach, bus_generic_detach),
83 DEVMETHOD(device_shutdown, bus_generic_shutdown),
84 DEVMETHOD(device_suspend, bus_generic_suspend),
85 DEVMETHOD(device_resume, bus_generic_resume),
87 /* Bus interface. Resource management is business of the children... */
88 DEVMETHOD(bus_add_child, bus_generic_add_child),
89 DEVMETHOD(bus_probe_nomatch, NULL),
90 DEVMETHOD(bus_read_ivar, NULL),
91 DEVMETHOD(bus_write_ivar, NULL),
92 DEVMETHOD(bus_setup_intr, NULL),
93 DEVMETHOD(bus_teardown_intr, NULL),
94 DEVMETHOD(bus_alloc_resource, NULL),
95 DEVMETHOD(bus_activate_resource, nexus_activate_resource),
96 DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
97 DEVMETHOD(bus_release_resource, NULL),
102 static driver_t nexus_driver = {
107 static devclass_t nexus_devclass;
109 DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
112 nexus_probe(device_t dev)
117 return (BUS_PROBE_DEFAULT);
121 nexus_attach(device_t dev)
124 bus_generic_probe(dev);
125 bus_generic_attach(dev);
130 nexus_activate_resource(device_t bus, device_t child, int type, int rid,
131 struct resource *res)
134 /* Not much to be done yet... */
135 return (rman_activate_resource(res));
139 nexus_deactivate_resource(device_t bus, device_t child, int type, int rid,
140 struct resource *res)
143 /* Not much to be done yet... */
144 return (rman_deactivate_resource(res));