Deleted Added
full compact
subr_bus.c (58884) subr_bus.c (59093)
1/*-
2 * Copyright (c) 1997,1998 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997,1998 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/kern/subr_bus.c 58884 2000-04-01 06:06:37Z imp $
26 * $FreeBSD: head/sys/kern/subr_bus.c 59093 2000-04-08 14:17:18Z dfr $
27 */
28
29#include "opt_bus.h"
30
31#include <sys/param.h>
32#include <sys/queue.h>
33#include <sys/malloc.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#ifdef DEVICE_SYSCTLS
37#include <sys/sysctl.h>
38#endif
27 */
28
29#include "opt_bus.h"
30
31#include <sys/param.h>
32#include <sys/queue.h>
33#include <sys/malloc.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#ifdef DEVICE_SYSCTLS
37#include <sys/sysctl.h>
38#endif
39#include <sys/kobj.h>
39#include <sys/bus_private.h>
40#include <sys/systm.h>
41#include <machine/bus.h>
42#include <sys/rman.h>
43#include <machine/stdarg.h> /* for device_printf() */
44
45MALLOC_DEFINE(M_BUS, "bus", "Bus data structures");
46

--- 4 unchanged lines hidden (view full) ---

51#define DEVCLANAME(d) ((d)? d->name : "no devclass")
52
53/* Produce the indenting, indent*2 spaces plus a '.' ahead of that to
54 * prevent syslog from deleting initial spaces
55 */
56#define indentprintf(p) do { int iJ; printf("."); for (iJ=0; iJ<indent; iJ++) printf(" "); printf p ; } while(0)
57
58static void print_method_list(device_method_t *m, int indent);
40#include <sys/bus_private.h>
41#include <sys/systm.h>
42#include <machine/bus.h>
43#include <sys/rman.h>
44#include <machine/stdarg.h> /* for device_printf() */
45
46MALLOC_DEFINE(M_BUS, "bus", "Bus data structures");
47

--- 4 unchanged lines hidden (view full) ---

52#define DEVCLANAME(d) ((d)? d->name : "no devclass")
53
54/* Produce the indenting, indent*2 spaces plus a '.' ahead of that to
55 * prevent syslog from deleting initial spaces
56 */
57#define indentprintf(p) do { int iJ; printf("."); for (iJ=0; iJ<indent; iJ++) printf(" "); printf p ; } while(0)
58
59static void print_method_list(device_method_t *m, int indent);
59static void print_device_ops(device_ops_t ops, int indent);
60static void print_device_short(device_t dev, int indent);
61static void print_device(device_t dev, int indent);
62void print_device_tree_short(device_t dev, int indent);
63void print_device_tree(device_t dev, int indent);
64static void print_driver_short(driver_t *driver, int indent);
65static void print_driver(driver_t *driver, int indent);
66static void print_driver_list(driver_list_t drivers, int indent);
67static void print_devclass_short(devclass_t dc, int indent);

--- 4 unchanged lines hidden (view full) ---

72#else
73/* Make the compiler ignore the function calls */
74#define PDEBUG(a) /* nop */
75#define DEVICENAME(d) /* nop */
76#define DRIVERNAME(d) /* nop */
77#define DEVCLANAME(d) /* nop */
78
79#define print_method_list(m,i) /* nop */
60static void print_device_short(device_t dev, int indent);
61static void print_device(device_t dev, int indent);
62void print_device_tree_short(device_t dev, int indent);
63void print_device_tree(device_t dev, int indent);
64static void print_driver_short(driver_t *driver, int indent);
65static void print_driver(driver_t *driver, int indent);
66static void print_driver_list(driver_list_t drivers, int indent);
67static void print_devclass_short(devclass_t dc, int indent);

--- 4 unchanged lines hidden (view full) ---

72#else
73/* Make the compiler ignore the function calls */
74#define PDEBUG(a) /* nop */
75#define DEVICENAME(d) /* nop */
76#define DRIVERNAME(d) /* nop */
77#define DEVCLANAME(d) /* nop */
78
79#define print_method_list(m,i) /* nop */
80#define print_device_ops(o,i) /* nop */
81#define print_device_short(d,i) /* nop */
82#define print_device(d,i) /* nop */
83#define print_device_tree_short(d,i) /* nop */
84#define print_device_tree(d,i) /* nop */
85#define print_driver_short(d,i) /* nop */
86#define print_driver(d,i) /* nop */
87#define print_driver_list(d,i) /* nop */
88#define print_devclass_short(d,i) /* nop */
89#define print_devclass(d,i) /* nop */
90#define print_devclass_list_short() /* nop */
91#define print_devclass_list() /* nop */
92#endif
93
94#ifdef DEVICE_SYSCTLS
95static void device_register_oids(device_t dev);
96static void device_unregister_oids(device_t dev);
97#endif
98
80#define print_device_short(d,i) /* nop */
81#define print_device(d,i) /* nop */
82#define print_device_tree_short(d,i) /* nop */
83#define print_device_tree(d,i) /* nop */
84#define print_driver_short(d,i) /* nop */
85#define print_driver(d,i) /* nop */
86#define print_driver_list(d,i) /* nop */
87#define print_devclass_short(d,i) /* nop */
88#define print_devclass(d,i) /* nop */
89#define print_devclass_list_short() /* nop */
90#define print_devclass_list() /* nop */
91#endif
92
93#ifdef DEVICE_SYSCTLS
94static void device_register_oids(device_t dev);
95static void device_unregister_oids(device_t dev);
96#endif
97
99/*
100 * Method table handling
101 */
102static int error_method(void);
103static int next_method_offset = 1;
104
105LIST_HEAD(methodlist, method) methods;
106struct method {
107 LIST_ENTRY(method) link; /* linked list of methods */
108 int offset; /* offset in method table */
109 int refs; /* count of device_op_desc users */
110 devop_t deflt; /* default implementation */
111 char* name; /* unique name of method */
98kobj_method_t null_methods[] = {
99 { 0, 0 }
112};
113
100};
101
114static void
115register_method(struct device_op_desc *desc)
116{
117 struct method* m;
102DEFINE_CLASS(null, null_methods, 0);
118
103
119 if (desc->method) {
120 desc->method->refs++;
121 return;
122 }
123
124 /*
125 * Make sure that desc->deflt is always valid to simplify dispatch.
126 */
127 if (!desc->deflt)
128 desc->deflt = error_method;
129
130 for (m = LIST_FIRST(&methods); m; m = LIST_NEXT(m, link)) {
131 if (!strcmp(m->name, desc->name)) {
132 desc->offset = m->offset;
133 desc->method = m;
134 m->refs++;
135 PDEBUG(("method %p has the same name, %s, with offset %d",
136 (void *)m, desc->name, desc->offset));
137 return;
138 }
139 }
140
141 m = (struct method *) malloc(sizeof(struct method)
142 + strlen(desc->name) + 1,
143 M_BUS, M_NOWAIT);
144 if (!m)
145 panic("register_method: out of memory");
146 bzero(m, sizeof(struct method) + strlen(desc->name) + 1);
147 m->offset = next_method_offset++;
148 m->refs = 1;
149 m->deflt = desc->deflt;
150 m->name = (char*) (m + 1);
151 strcpy(m->name, desc->name);
152 LIST_INSERT_HEAD(&methods, m, link);
153
154 desc->offset = m->offset;
155 desc->method = m;
156}
157
158static void
159unregister_method(struct device_op_desc *desc)
160{
161 struct method *m = desc->method;
162 m->refs--;
163 if (m->refs == 0) {
164 PDEBUG(("method %s, reached refcount 0", desc->name));
165 LIST_REMOVE(m, link);
166 free(m, M_BUS);
167 desc->method = 0;
168 }
169}
170
171static int error_method(void)
172{
173 return ENXIO;
174}
175
176static struct device_ops null_ops = {
177 1,
178 { error_method }
179};
180
181static void
182compile_methods(driver_t *driver)
183{
184 device_ops_t ops;
185 struct device_method *m;
186 struct method *cm;
187 int i;
188
189 /*
190 * First register any methods which need it.
191 */
192 for (i = 0, m = driver->methods; m->desc; i++, m++)
193 register_method(m->desc);
194
195 /*
196 * Then allocate the compiled op table.
197 */
198 ops = malloc(sizeof(struct device_ops) + (next_method_offset-1) * sizeof(devop_t),
199 M_BUS, M_NOWAIT);
200 if (!ops)
201 panic("compile_methods: out of memory");
202 bzero(ops, sizeof(struct device_ops) + (next_method_offset-1) * sizeof(devop_t));
203
204 ops->maxoffset = next_method_offset;
205 /* Fill in default methods and then overwrite with driver methods */
206 for (i = 0; i < next_method_offset; i++)
207 ops->methods[i] = error_method;
208 for (cm = LIST_FIRST(&methods); cm; cm = LIST_NEXT(cm, link)) {
209 if (cm->deflt)
210 ops->methods[cm->offset] = cm->deflt;
211 }
212 for (i = 0, m = driver->methods; m->desc; i++, m++)
213 ops->methods[m->desc->offset] = m->func;
214 PDEBUG(("%s has %d method%s, wasting %d bytes",
215 DRIVERNAME(driver), i, (i==1?"":"s"),
216 (next_method_offset-i)*sizeof(devop_t)));
217
218 driver->ops = ops;
219}
220
221static void
222free_methods(driver_t *driver)
223{
224 int i;
225 struct device_method *m;
226
227 /*
228 * Unregister any methods which are no longer used.
229 */
230 for (i = 0, m = driver->methods; m->desc; i++, m++)
231 unregister_method(m->desc);
232
233 /*
234 * Free memory and clean up.
235 */
236 free(driver->ops, M_BUS);
237 driver->ops = 0;
238}
239
240/*
241 * Devclass implementation
242 */
243
244static devclass_list_t devclasses = TAILQ_HEAD_INITIALIZER(devclasses);
245
246static devclass_t
247devclass_find_internal(const char *classname, int create)

--- 49 unchanged lines hidden (view full) ---

297 dl = malloc(sizeof *dl, M_BUS, M_NOWAIT);
298 if (!dl)
299 return ENOMEM;
300 bzero(dl, sizeof *dl);
301
302 /*
303 * Compile the driver's methods.
304 */
104/*
105 * Devclass implementation
106 */
107
108static devclass_list_t devclasses = TAILQ_HEAD_INITIALIZER(devclasses);
109
110static devclass_t
111devclass_find_internal(const char *classname, int create)

--- 49 unchanged lines hidden (view full) ---

161 dl = malloc(sizeof *dl, M_BUS, M_NOWAIT);
162 if (!dl)
163 return ENOMEM;
164 bzero(dl, sizeof *dl);
165
166 /*
167 * Compile the driver's methods.
168 */
305 if (!driver->ops)
306 compile_methods(driver);
169 kobj_class_compile((kobj_class_t) driver);
307
308 /*
309 * Make sure the devclass which the driver is implementing exists.
310 */
311 devclass_find_internal(driver->name, TRUE);
312
313 dl->driver = driver;
314 TAILQ_INSERT_TAIL(&dc->drivers, dl, link);

--- 59 unchanged lines hidden (view full) ---

374 }
375 }
376
377 TAILQ_REMOVE(&busclass->drivers, dl, link);
378 free(dl, M_BUS);
379
380 driver->refs--;
381 if (driver->refs == 0)
170
171 /*
172 * Make sure the devclass which the driver is implementing exists.
173 */
174 devclass_find_internal(driver->name, TRUE);
175
176 dl->driver = driver;
177 TAILQ_INSERT_TAIL(&dc->drivers, dl, link);

--- 59 unchanged lines hidden (view full) ---

237 }
238 }
239
240 TAILQ_REMOVE(&busclass->drivers, dl, link);
241 free(dl, M_BUS);
242
243 driver->refs--;
244 if (driver->refs == 0)
382 free_methods(driver);
245 kobj_class_free((kobj_class_t) driver);
383
384 return 0;
385}
386
387static driverlink_t
388devclass_find_driver_internal(devclass_t dc, const char *classname)
389{
390 driverlink_t dl;

--- 213 unchanged lines hidden (view full) ---

604
605 dev = malloc(sizeof(struct device), M_BUS, M_NOWAIT);
606 if (!dev)
607 return 0;
608 bzero(dev, sizeof(struct device));
609
610 dev->parent = parent;
611 TAILQ_INIT(&dev->children);
246
247 return 0;
248}
249
250static driverlink_t
251devclass_find_driver_internal(devclass_t dc, const char *classname)
252{
253 driverlink_t dl;

--- 213 unchanged lines hidden (view full) ---

467
468 dev = malloc(sizeof(struct device), M_BUS, M_NOWAIT);
469 if (!dev)
470 return 0;
471 bzero(dev, sizeof(struct device));
472
473 dev->parent = parent;
474 TAILQ_INIT(&dev->children);
612 dev->ops = &null_ops;
475 kobj_init((kobj_t) dev, &null_class);
613 dev->driver = NULL;
614 dev->devclass = NULL;
615 dev->unit = unit;
616 dev->nameunit = NULL;
617 dev->desc = NULL;
618 dev->busy = 0;
619 dev->devflags = 0;
620 dev->flags = DF_ENABLED;

--- 4 unchanged lines hidden (view full) ---

625 dev->flags |= DF_FIXEDCLASS;
626 devclass_add_device(dc, dev);
627 }
628 dev->ivars = NULL;
629 dev->softc = NULL;
630
631 dev->state = DS_NOTPRESENT;
632
476 dev->driver = NULL;
477 dev->devclass = NULL;
478 dev->unit = unit;
479 dev->nameunit = NULL;
480 dev->desc = NULL;
481 dev->busy = 0;
482 dev->devflags = 0;
483 dev->flags = DF_ENABLED;

--- 4 unchanged lines hidden (view full) ---

488 dev->flags |= DF_FIXEDCLASS;
489 devclass_add_device(dc, dev);
490 }
491 dev->ivars = NULL;
492 dev->softc = NULL;
493
494 dev->state = DS_NOTPRESENT;
495
496 kobj_init((kobj_t) dev, &null_class);
497
633 return dev;
634}
635
636static int
637device_print_child(device_t dev, device_t child)
638{
639 int retval = 0;
640

--- 466 unchanged lines hidden (view full) ---

1107
1108 if (dev->driver == driver)
1109 return 0;
1110
1111 if (dev->softc) {
1112 free(dev->softc, M_BUS);
1113 dev->softc = NULL;
1114 }
498 return dev;
499}
500
501static int
502device_print_child(device_t dev, device_t child)
503{
504 int retval = 0;
505

--- 466 unchanged lines hidden (view full) ---

972
973 if (dev->driver == driver)
974 return 0;
975
976 if (dev->softc) {
977 free(dev->softc, M_BUS);
978 dev->softc = NULL;
979 }
1115 dev->ops = &null_ops;
980 kobj_delete((kobj_t) dev, 0);
1116 dev->driver = driver;
1117 if (driver) {
981 dev->driver = driver;
982 if (driver) {
1118 dev->ops = driver->ops;
1119 dev->softc = malloc(driver->softc, M_BUS, M_NOWAIT);
983 kobj_init((kobj_t) dev, (kobj_class_t) driver);
984 dev->softc = malloc(driver->size, M_BUS, M_NOWAIT);
1120 if (!dev->softc) {
985 if (!dev->softc) {
1121 dev->ops = &null_ops;
986 kobj_init((kobj_t) dev, &null_class);
1122 dev->driver = NULL;
1123 return ENOMEM;
1124 }
987 dev->driver = NULL;
988 return ENOMEM;
989 }
1125 bzero(dev->softc, driver->softc);
1126 }
990 bzero(dev->softc, driver->size);
991 } else
992 kobj_init((kobj_t) dev, &null_class);
1127 return 0;
1128}
1129
1130int
1131device_probe_and_attach(device_t dev)
1132{
1133 device_t bus = dev->parent;
1134 int error = 0;

--- 1040 unchanged lines hidden (view full) ---

2175 void **cookiep)
2176{
2177 /*
2178 * If an interrupt mapping gets to here something bad has happened.
2179 */
2180 panic("root_setup_intr");
2181}
2182
993 return 0;
994}
995
996int
997device_probe_and_attach(device_t dev)
998{
999 device_t bus = dev->parent;
1000 int error = 0;

--- 1040 unchanged lines hidden (view full) ---

2041 void **cookiep)
2042{
2043 /*
2044 * If an interrupt mapping gets to here something bad has happened.
2045 */
2046 panic("root_setup_intr");
2047}
2048
2183static device_method_t root_methods[] = {
2049static kobj_method_t root_methods[] = {
2184 /* Device interface */
2050 /* Device interface */
2185 DEVMETHOD(device_shutdown, bus_generic_shutdown),
2186 DEVMETHOD(device_suspend, bus_generic_suspend),
2187 DEVMETHOD(device_resume, bus_generic_resume),
2051 KOBJMETHOD(device_shutdown, bus_generic_shutdown),
2052 KOBJMETHOD(device_suspend, bus_generic_suspend),
2053 KOBJMETHOD(device_resume, bus_generic_resume),
2188
2189 /* Bus interface */
2054
2055 /* Bus interface */
2190 DEVMETHOD(bus_print_child, root_print_child),
2191 DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
2192 DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
2193 DEVMETHOD(bus_setup_intr, root_setup_intr),
2056 KOBJMETHOD(bus_print_child, root_print_child),
2057 KOBJMETHOD(bus_read_ivar, bus_generic_read_ivar),
2058 KOBJMETHOD(bus_write_ivar, bus_generic_write_ivar),
2059 KOBJMETHOD(bus_setup_intr, root_setup_intr),
2194
2195 { 0, 0 }
2196};
2197
2198static driver_t root_driver = {
2199 "root",
2200 root_methods,
2201 1, /* no softc */
2202};
2203
2204device_t root_bus;
2205devclass_t root_devclass;
2206
2207static int
2208root_bus_module_handler(module_t mod, int what, void* arg)
2209{
2210 switch (what) {
2211 case MOD_LOAD:
2060
2061 { 0, 0 }
2062};
2063
2064static driver_t root_driver = {
2065 "root",
2066 root_methods,
2067 1, /* no softc */
2068};
2069
2070device_t root_bus;
2071devclass_t root_devclass;
2072
2073static int
2074root_bus_module_handler(module_t mod, int what, void* arg)
2075{
2076 switch (what) {
2077 case MOD_LOAD:
2212 compile_methods(&root_driver);
2078 kobj_class_compile((kobj_class_t) &root_driver);
2213 root_bus = make_device(NULL, "root", 0);
2214 root_bus->desc = "System root bus";
2079 root_bus = make_device(NULL, "root", 0);
2080 root_bus->desc = "System root bus";
2215 root_bus->ops = root_driver.ops;
2081 kobj_init((kobj_t) root_bus, (kobj_class_t) &root_driver);
2216 root_bus->driver = &root_driver;
2217 root_bus->state = DS_ATTACHED;
2218 root_devclass = devclass_find_internal("root", FALSE);
2219 return 0;
2220
2221 case MOD_SHUTDOWN:
2222 device_shutdown(root_bus);
2223 return 0;

--- 89 unchanged lines hidden (view full) ---

2313 return;
2314
2315 for (i = 0; m->desc; i++, m++)
2316 indentprintf(("method %d: %s, offset=%d\n",
2317 i, m->desc->name, m->desc->offset));
2318}
2319
2320static void
2082 root_bus->driver = &root_driver;
2083 root_bus->state = DS_ATTACHED;
2084 root_devclass = devclass_find_internal("root", FALSE);
2085 return 0;
2086
2087 case MOD_SHUTDOWN:
2088 device_shutdown(root_bus);
2089 return 0;

--- 89 unchanged lines hidden (view full) ---

2179 return;
2180
2181 for (i = 0; m->desc; i++, m++)
2182 indentprintf(("method %d: %s, offset=%d\n",
2183 i, m->desc->name, m->desc->offset));
2184}
2185
2186static void
2321print_device_ops(device_ops_t ops, int indent)
2322{
2323 int i;
2324 int count = 0;
2325
2326 if (!ops)
2327 return;
2328
2329 /* we present a list of the methods that are pointing to the
2330 * error_method, but ignore the 0'th elements; it is always
2331 * error_method.
2332 */
2333 for (i = 1; i < ops->maxoffset; i++) {
2334 if (ops->methods[i] == error_method) {
2335 if (count == 0)
2336 indentprintf(("error_method:"));
2337 printf(" %d", i);
2338 count++;
2339 }
2340 }
2341 if (count)
2342 printf("\n");
2343
2344 indentprintf(("(%d method%s, %d valid, %d error_method%s)\n",
2345 ops->maxoffset-1, (ops->maxoffset-1 == 1? "":"s"),
2346 ops->maxoffset-1-count,
2347 count, (count == 1? "":"'s")));
2348}
2349
2350static void
2351print_device_short(device_t dev, int indent)
2352{
2353 if (!dev)
2354 return;
2355
2356 indentprintf(("device %d: <%s> %sparent,%schildren,%s%s%s%s,%sivars,%ssoftc,busy=%d\n",
2357 dev->unit, dev->desc,
2358 (dev->parent? "":"no "),

--- 12 unchanged lines hidden (view full) ---

2371{
2372 if (!dev)
2373 return;
2374
2375 print_device_short(dev, indent);
2376
2377 indentprintf(("Parent:\n"));
2378 print_device_short(dev->parent, indent+1);
2187print_device_short(device_t dev, int indent)
2188{
2189 if (!dev)
2190 return;
2191
2192 indentprintf(("device %d: <%s> %sparent,%schildren,%s%s%s%s,%sivars,%ssoftc,busy=%d\n",
2193 dev->unit, dev->desc,
2194 (dev->parent? "":"no "),

--- 12 unchanged lines hidden (view full) ---

2207{
2208 if (!dev)
2209 return;
2210
2211 print_device_short(dev, indent);
2212
2213 indentprintf(("Parent:\n"));
2214 print_device_short(dev->parent, indent+1);
2379 indentprintf(("Methods:\n"));
2380 print_device_ops(dev->ops, indent+1);
2381 indentprintf(("Driver:\n"));
2382 print_driver_short(dev->driver, indent+1);
2383 indentprintf(("Devclass:\n"));
2384 print_devclass_short(dev->devclass, indent+1);
2385}
2386
2387void
2388print_device_tree_short(device_t dev, int indent)

--- 41 unchanged lines hidden (view full) ---

2430print_driver(driver_t *driver, int indent)
2431{
2432 if (!driver)
2433 return;
2434
2435 print_driver_short(driver, indent);
2436 indentprintf(("Methods:\n"));
2437 print_method_list(driver->methods, indent+1);
2215 indentprintf(("Driver:\n"));
2216 print_driver_short(dev->driver, indent+1);
2217 indentprintf(("Devclass:\n"));
2218 print_devclass_short(dev->devclass, indent+1);
2219}
2220
2221void
2222print_device_tree_short(device_t dev, int indent)

--- 41 unchanged lines hidden (view full) ---

2264print_driver(driver_t *driver, int indent)
2265{
2266 if (!driver)
2267 return;
2268
2269 print_driver_short(driver, indent);
2270 indentprintf(("Methods:\n"));
2271 print_method_list(driver->methods, indent+1);
2438 indentprintf(("Operations:\n"));
2439 print_device_ops(driver->ops, indent+1);
2440}
2441
2442
2443static void
2444print_driver_list(driver_list_t drivers, int indent)
2445{
2446 driverlink_t driver;
2447

--- 54 unchanged lines hidden ---
2272}
2273
2274
2275static void
2276print_driver_list(driver_list_t drivers, int indent)
2277{
2278 driverlink_t driver;
2279

--- 54 unchanged lines hidden ---