2 * Copyright (c) 1999 Doug Rabson
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
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
27 * Modifications for Intel architecture by Garrett A. Wollman.
28 * Copyright 1998 Massachusetts Institute of Technology
30 * Permission to use, copy, modify, and distribute this software and
31 * its documentation for any purpose and without fee is hereby
32 * granted, provided that both the above copyright notice and this
33 * permission notice appear in all copies, that both the above
34 * copyright notice and this permission notice appear in all
35 * supporting documentation, and that the name of M.I.T. not be used
36 * in advertising or publicity pertaining to distribution of the
37 * software without specific, written prior permission. M.I.T. makes
38 * no representations about the suitability of this software for any
39 * purpose. It is provided "as is" without express or implied
42 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
43 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
44 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
45 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
46 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
49 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
50 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
51 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
52 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57 * Parts of the ISA bus implementation common to all architectures.
60 #include <sys/cdefs.h>
61 __FBSDID("$FreeBSD$");
63 #include <sys/param.h>
64 #include <sys/systm.h>
65 #include <sys/kernel.h>
67 #include <sys/malloc.h>
68 #include <sys/module.h>
69 #include <machine/bus.h>
72 #include <machine/resource.h>
74 #include <isa/isavar.h>
75 #include <isa/isa_common.h>
76 #ifdef __alpha__ /* XXX workaround a stupid warning */
77 #include <alpha/isa/isavar.h>
80 static int isa_print_child(device_t bus, device_t dev);
82 static MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device");
84 static int isa_running;
87 * At 'probe' time, we add all the devices which we know about to the
88 * bus. The generic attach routine will probe and attach them if they
92 isa_probe(device_t dev)
94 device_set_desc(dev, "ISA bus");
95 isa_init(dev); /* Allow machdep code to initialise */
99 extern device_t isa_bus_device;
102 isa_attach(device_t dev)
105 * Arrange for isa_probe_children(dev) to be called later. XXX
107 isa_bus_device = dev;
112 * Find a working set of memory regions for a child using the ranges
113 * in *config and return the regions in *result. Returns non-zero if
114 * a set of ranges was found.
117 isa_find_memory(device_t child, struct isa_config *config,
118 struct isa_config *result)
121 struct resource *res[ISA_NMEM];
124 * First clear out any existing resource definitions.
126 for (i = 0; i < ISA_NMEM; i++) {
127 bus_delete_resource(child, SYS_RES_MEMORY, i);
132 result->ic_nmem = config->ic_nmem;
133 for (i = 0; i < config->ic_nmem; i++) {
134 uint32_t start, end, size, align;
136 size = config->ic_mem[i].ir_size;
138 /* the PnP device may have a null resource as filler */
140 result->ic_mem[i].ir_start = 0;
141 result->ic_mem[i].ir_end = 0;
142 result->ic_mem[i].ir_size = 0;
143 result->ic_mem[i].ir_align = 0;
147 for (start = config->ic_mem[i].ir_start,
148 end = config->ic_mem[i].ir_end,
149 align = config->ic_mem[i].ir_align;
150 start + size - 1 <= end && start + size > start;
152 bus_set_resource(child, SYS_RES_MEMORY, i,
154 res[i] = bus_alloc_resource(child,
155 SYS_RES_MEMORY, &i, 0, ~0, 1,
156 rman_make_alignment_flags(align) /* !RF_ACTIVE */);
158 result->ic_mem[i].ir_start = start;
159 result->ic_mem[i].ir_end = start + size - 1;
160 result->ic_mem[i].ir_size = size;
161 result->ic_mem[i].ir_align = align;
167 * If we didn't find a place for memory range i, then
176 for (i = 0; i < ISA_NMEM; i++) {
178 bus_release_resource(child, SYS_RES_MEMORY,
186 * Find a working set of port regions for a child using the ranges
187 * in *config and return the regions in *result. Returns non-zero if
188 * a set of ranges was found.
191 isa_find_port(device_t child, struct isa_config *config,
192 struct isa_config *result)
195 struct resource *res[ISA_NPORT];
198 * First clear out any existing resource definitions.
200 for (i = 0; i < ISA_NPORT; i++) {
201 bus_delete_resource(child, SYS_RES_IOPORT, i);
206 result->ic_nport = config->ic_nport;
207 for (i = 0; i < config->ic_nport; i++) {
208 uint32_t start, end, size, align;
210 size = config->ic_port[i].ir_size;
212 /* the PnP device may have a null resource as filler */
214 result->ic_port[i].ir_start = 0;
215 result->ic_port[i].ir_end = 0;
216 result->ic_port[i].ir_size = 0;
217 result->ic_port[i].ir_align = 0;
221 for (start = config->ic_port[i].ir_start,
222 end = config->ic_port[i].ir_end,
223 align = config->ic_port[i].ir_align;
224 start + size - 1 <= end;
226 bus_set_resource(child, SYS_RES_IOPORT, i,
228 res[i] = bus_alloc_resource(child,
229 SYS_RES_IOPORT, &i, 0, ~0, 1,
230 rman_make_alignment_flags(align) /* !RF_ACTIVE */);
232 result->ic_port[i].ir_start = start;
233 result->ic_port[i].ir_end = start + size - 1;
234 result->ic_port[i].ir_size = size;
235 result->ic_port[i].ir_align = align;
241 * If we didn't find a place for port range i, then
250 for (i = 0; i < ISA_NPORT; i++) {
252 bus_release_resource(child, SYS_RES_IOPORT,
260 * Return the index of the first bit in the mask (or -1 if mask is empty.
263 find_first_bit(uint32_t mask)
265 return (ffs(mask) - 1);
269 * Return the index of the next bit in the mask, or -1 if there are no more.
272 find_next_bit(uint32_t mask, int bit)
275 while (bit < 32 && !(mask & (1 << bit)))
283 * Find a working set of irqs for a child using the masks in *config
284 * and return the regions in *result. Returns non-zero if a set of
288 isa_find_irq(device_t child, struct isa_config *config,
289 struct isa_config *result)
292 struct resource *res[ISA_NIRQ];
295 * First clear out any existing resource definitions.
297 for (i = 0; i < ISA_NIRQ; i++) {
298 bus_delete_resource(child, SYS_RES_IRQ, i);
303 result->ic_nirq = config->ic_nirq;
304 for (i = 0; i < config->ic_nirq; i++) {
305 uint32_t mask = config->ic_irqmask[i];
308 /* the PnP device may have a null resource as filler */
310 result->ic_irqmask[i] = 0;
314 for (irq = find_first_bit(mask);
316 irq = find_next_bit(mask, irq)) {
317 bus_set_resource(child, SYS_RES_IRQ, i,
319 res[i] = bus_alloc_resource_any(child,
321 0 /* !RF_ACTIVE */ );
323 result->ic_irqmask[i] = (1 << irq);
329 * If we didn't find a place for irq range i, then
338 for (i = 0; i < ISA_NIRQ; i++) {
340 bus_release_resource(child, SYS_RES_IRQ,
348 * Find a working set of drqs for a child using the masks in *config
349 * and return the regions in *result. Returns non-zero if a set of
353 isa_find_drq(device_t child, struct isa_config *config,
354 struct isa_config *result)
357 struct resource *res[ISA_NDRQ];
360 * First clear out any existing resource definitions.
362 for (i = 0; i < ISA_NDRQ; i++) {
363 bus_delete_resource(child, SYS_RES_DRQ, i);
368 result->ic_ndrq = config->ic_ndrq;
369 for (i = 0; i < config->ic_ndrq; i++) {
370 uint32_t mask = config->ic_drqmask[i];
373 /* the PnP device may have a null resource as filler */
375 result->ic_drqmask[i] = 0;
379 for (drq = find_first_bit(mask);
381 drq = find_next_bit(mask, drq)) {
382 bus_set_resource(child, SYS_RES_DRQ, i,
384 res[i] = bus_alloc_resource_any(child,
388 result->ic_drqmask[i] = (1 << drq);
394 * If we didn't find a place for drq range i, then
403 for (i = 0; i < ISA_NDRQ; i++) {
405 bus_release_resource(child, SYS_RES_DRQ,
413 * Attempt to find a working set of resources for a device. Return
414 * non-zero if a working configuration is found.
417 isa_assign_resources(device_t child)
419 struct isa_device *idev = DEVTOISA(child);
420 struct isa_config_entry *ice;
421 struct isa_config *cfg;
424 reason = "Empty ISA id_configs";
425 cfg = malloc(sizeof(struct isa_config), M_TEMP, M_NOWAIT|M_ZERO);
428 TAILQ_FOREACH(ice, &idev->id_configs, ice_link) {
430 if (!isa_find_memory(child, &ice->ice_config, cfg))
433 if (!isa_find_port(child, &ice->ice_config, cfg))
436 if (!isa_find_irq(child, &ice->ice_config, cfg))
439 if (!isa_find_drq(child, &ice->ice_config, cfg))
443 * A working configuration was found enable the device
444 * with this configuration.
446 reason = "no callback";
447 if (idev->id_config_cb) {
448 idev->id_config_cb(idev->id_config_arg,
456 * Disable the device.
458 bus_print_child_header(device_get_parent(child), child);
459 printf(" can't assign resources (%s)\n", reason);
461 isa_print_child(device_get_parent(child), child);
462 bzero(cfg, sizeof (*cfg));
463 if (idev->id_config_cb)
464 idev->id_config_cb(idev->id_config_arg, cfg, 0);
465 device_disable(child);
472 * Return non-zero if the device has a single configuration, that is,
473 * a fixed set of resoruces.
476 isa_has_single_config(device_t dev)
478 struct isa_device *idev = DEVTOISA(dev);
479 struct isa_config_entry *ice;
483 ice = TAILQ_FIRST(&idev->id_configs);
484 if (TAILQ_NEXT(ice, ice_link))
487 for (i = 0; i < ice->ice_config.ic_nmem; ++i) {
488 if (ice->ice_config.ic_mem[i].ir_size == 0)
490 if (ice->ice_config.ic_mem[i].ir_end !=
491 ice->ice_config.ic_mem[i].ir_start +
492 ice->ice_config.ic_mem[i].ir_size - 1)
495 for (i = 0; i < ice->ice_config.ic_nport; ++i) {
496 if (ice->ice_config.ic_port[i].ir_size == 0)
498 if (ice->ice_config.ic_port[i].ir_end !=
499 ice->ice_config.ic_port[i].ir_start +
500 ice->ice_config.ic_port[i].ir_size - 1)
503 for (i = 0; i < ice->ice_config.ic_nirq; ++i) {
504 mask = ice->ice_config.ic_irqmask[i];
507 if (find_next_bit(mask, find_first_bit(mask)) != -1)
510 for (i = 0; i < ice->ice_config.ic_ndrq; ++i) {
511 mask = ice->ice_config.ic_drqmask[i];
514 if (find_next_bit(mask, find_first_bit(mask)) != -1)
521 * Called after other devices have initialised to probe for isa devices.
524 isa_probe_children(device_t dev)
527 struct isa_config *cfg;
531 * Create all the children by calling driver's identify methods.
533 bus_generic_probe(dev);
535 if (device_get_children(dev, &children, &nchildren))
539 * First disable all pnp devices so that they don't get
540 * matched by legacy probes.
543 printf("isa_probe_children: disabling PnP devices\n");
545 cfg = malloc(sizeof(*cfg), M_TEMP, M_NOWAIT|M_ZERO);
547 free(children, M_TEMP);
551 for (i = 0; i < nchildren; i++) {
552 device_t child = children[i];
553 struct isa_device *idev = DEVTOISA(child);
555 bzero(cfg, sizeof(*cfg));
556 if (idev->id_config_cb)
557 idev->id_config_cb(idev->id_config_arg, cfg, 0);
563 * Next probe all non-pnp devices so that they claim their
567 printf("isa_probe_children: probing non-PnP devices\n");
568 for (i = 0; i < nchildren; i++) {
569 device_t child = children[i];
570 struct isa_device *idev = DEVTOISA(child);
572 if (TAILQ_FIRST(&idev->id_configs))
575 device_probe_and_attach(child);
579 * Finally assign resource to pnp devices and probe them.
582 printf("isa_probe_children: probing PnP devices\n");
583 for (i = 0; i < nchildren; i++) {
584 device_t child = children[i];
585 struct isa_device* idev = DEVTOISA(child);
587 if (!TAILQ_FIRST(&idev->id_configs))
590 if (isa_assign_resources(child)) {
591 struct resource_list *rl = &idev->id_resources;
592 struct resource_list_entry *rle;
594 device_probe_and_attach(child);
597 * Claim any unallocated resources to keep other
598 * devices from using them.
600 STAILQ_FOREACH(rle, rl, link) {
603 resource_list_alloc(rl, dev, child,
612 free(children, M_TEMP);
618 * Add a new child with default ivars.
621 isa_add_child(device_t dev, int order, const char *name, int unit)
624 struct isa_device *idev;
626 child = device_add_child_ordered(dev, order, name, unit);
630 idev = malloc(sizeof(struct isa_device), M_ISADEV, M_NOWAIT | M_ZERO);
634 resource_list_init(&idev->id_resources);
635 TAILQ_INIT(&idev->id_configs);
637 device_set_ivars(child, idev);
643 isa_print_all_resources(device_t dev)
645 struct isa_device *idev = DEVTOISA(dev);
646 struct resource_list *rl = &idev->id_resources;
649 if (STAILQ_FIRST(rl) || device_get_flags(dev))
650 retval += printf(" at");
652 retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");
653 retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");
654 retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");
655 retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld");
656 if (device_get_flags(dev))
657 retval += printf(" flags %#x", device_get_flags(dev));
663 isa_print_child(device_t bus, device_t dev)
667 retval += bus_print_child_header(bus, dev);
668 retval += isa_print_all_resources(dev);
669 retval += bus_print_child_footer(bus, dev);
675 isa_probe_nomatch(device_t dev, device_t child)
678 bus_print_child_header(dev, child);
679 printf(" failed to probe");
680 isa_print_all_resources(child);
681 bus_print_child_footer(dev, child);
688 isa_read_ivar(device_t bus, device_t dev, int index, uintptr_t * result)
690 struct isa_device* idev = DEVTOISA(dev);
691 struct resource_list *rl = &idev->id_resources;
692 struct resource_list_entry *rle;
695 case ISA_IVAR_PORT_0:
696 rle = resource_list_find(rl, SYS_RES_IOPORT, 0);
698 *result = rle->start;
703 case ISA_IVAR_PORT_1:
704 rle = resource_list_find(rl, SYS_RES_IOPORT, 1);
706 *result = rle->start;
711 case ISA_IVAR_PORTSIZE_0:
712 rle = resource_list_find(rl, SYS_RES_IOPORT, 0);
714 *result = rle->count;
719 case ISA_IVAR_PORTSIZE_1:
720 rle = resource_list_find(rl, SYS_RES_IOPORT, 1);
722 *result = rle->count;
727 case ISA_IVAR_MADDR_0:
728 rle = resource_list_find(rl, SYS_RES_MEMORY, 0);
730 *result = rle->start;
735 case ISA_IVAR_MADDR_1:
736 rle = resource_list_find(rl, SYS_RES_MEMORY, 1);
738 *result = rle->start;
743 case ISA_IVAR_MEMSIZE_0:
744 rle = resource_list_find(rl, SYS_RES_MEMORY, 0);
746 *result = rle->count;
751 case ISA_IVAR_MEMSIZE_1:
752 rle = resource_list_find(rl, SYS_RES_MEMORY, 1);
754 *result = rle->count;
760 rle = resource_list_find(rl, SYS_RES_IRQ, 0);
762 *result = rle->start;
768 rle = resource_list_find(rl, SYS_RES_IRQ, 1);
770 *result = rle->start;
776 rle = resource_list_find(rl, SYS_RES_DRQ, 0);
778 *result = rle->start;
784 rle = resource_list_find(rl, SYS_RES_DRQ, 1);
786 *result = rle->start;
791 case ISA_IVAR_VENDORID:
792 *result = idev->id_vendorid;
795 case ISA_IVAR_SERIAL:
796 *result = idev->id_serial;
799 case ISA_IVAR_LOGICALID:
800 *result = idev->id_logicalid;
803 case ISA_IVAR_COMPATID:
804 *result = idev->id_compatid;
807 case ISA_IVAR_CONFIGATTR:
808 *result = idev->id_config_attr;
819 isa_write_ivar(device_t bus, device_t dev, int index, uintptr_t value)
821 struct isa_device* idev = DEVTOISA(dev);
824 case ISA_IVAR_PORT_0:
825 case ISA_IVAR_PORT_1:
826 case ISA_IVAR_PORTSIZE_0:
827 case ISA_IVAR_PORTSIZE_1:
828 case ISA_IVAR_MADDR_0:
829 case ISA_IVAR_MADDR_1:
830 case ISA_IVAR_MEMSIZE_0:
831 case ISA_IVAR_MEMSIZE_1:
838 case ISA_IVAR_VENDORID:
839 idev->id_vendorid = value;
842 case ISA_IVAR_SERIAL:
843 idev->id_serial = value;
846 case ISA_IVAR_LOGICALID:
847 idev->id_logicalid = value;
850 case ISA_IVAR_COMPATID:
851 idev->id_compatid = value;
854 case ISA_IVAR_CONFIGATTR:
855 idev->id_config_attr = value;
866 * Free any resources which the driver missed or which we were holding for
867 * it (see isa_probe_children).
870 isa_child_detached(device_t dev, device_t child)
872 struct isa_device* idev = DEVTOISA(child);
873 struct resource_list *rl = &idev->id_resources;
874 struct resource_list_entry *rle;
876 if (TAILQ_FIRST(&idev->id_configs)) {
878 * Claim any unallocated resources to keep other
879 * devices from using them.
881 STAILQ_FOREACH(rle, rl, link) {
884 resource_list_alloc(rl, dev, child,
893 isa_driver_added(device_t dev, driver_t *driver)
899 * Don't do anything if drivers are dynamically
900 * added during autoconfiguration (cf. ymf724).
901 * since that would end up calling identify
907 DEVICE_IDENTIFY(driver, dev);
908 if (device_get_children(dev, &children, &nchildren))
911 for (i = 0; i < nchildren; i++) {
912 device_t child = children[i];
913 struct isa_device *idev = DEVTOISA(child);
914 struct resource_list *rl = &idev->id_resources;
915 struct resource_list_entry *rle;
917 if (device_get_state(child) != DS_NOTPRESENT)
919 if (!device_is_enabled(child))
923 * Free resources which we were holding on behalf of
926 STAILQ_FOREACH(rle, &idev->id_resources, link) {
928 resource_list_release(rl, dev, child,
934 if (TAILQ_FIRST(&idev->id_configs))
935 if (!isa_assign_resources(child))
938 device_probe_and_attach(child);
940 if (TAILQ_FIRST(&idev->id_configs)) {
942 * Claim any unallocated resources to keep other
943 * devices from using them.
945 STAILQ_FOREACH(rle, rl, link) {
948 resource_list_alloc(rl, dev, child,
956 free(children, M_TEMP);
960 isa_set_resource(device_t dev, device_t child, int type, int rid,
961 u_long start, u_long count)
963 struct isa_device* idev = DEVTOISA(child);
964 struct resource_list *rl = &idev->id_resources;
966 if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY
967 && type != SYS_RES_IRQ && type != SYS_RES_DRQ)
971 if (type == SYS_RES_IOPORT && rid >= ISA_NPORT)
973 if (type == SYS_RES_MEMORY && rid >= ISA_NMEM)
975 if (type == SYS_RES_IRQ && rid >= ISA_NIRQ)
977 if (type == SYS_RES_DRQ && rid >= ISA_NDRQ)
980 resource_list_add(rl, type, rid, start, start + count - 1, count);
985 static struct resource_list *
986 isa_get_resource_list (device_t dev, device_t child)
988 struct isa_device* idev = DEVTOISA(child);
989 struct resource_list *rl = &idev->id_resources;
998 isa_add_config(device_t dev, device_t child, int priority,
999 struct isa_config *config)
1001 struct isa_device* idev = DEVTOISA(child);
1002 struct isa_config_entry *newice, *ice;
1004 newice = malloc(sizeof *ice, M_DEVBUF, M_NOWAIT);
1008 newice->ice_priority = priority;
1009 newice->ice_config = *config;
1011 TAILQ_FOREACH(ice, &idev->id_configs, ice_link) {
1012 if (ice->ice_priority > priority)
1016 TAILQ_INSERT_BEFORE(ice, newice, ice_link);
1018 TAILQ_INSERT_TAIL(&idev->id_configs, newice, ice_link);
1020 if (isa_has_single_config(child))
1021 idev->id_config_attr &= ~ISACFGATTR_MULTI;
1023 idev->id_config_attr |= ISACFGATTR_MULTI;
1029 isa_set_config_callback(device_t dev, device_t child, isa_config_cb *fn,
1032 struct isa_device* idev = DEVTOISA(child);
1034 idev->id_config_cb = fn;
1035 idev->id_config_arg = arg;
1039 isa_pnp_probe(device_t dev, device_t child, struct isa_pnp_id *ids)
1041 struct isa_device* idev = DEVTOISA(child);
1043 if (!idev->id_vendorid)
1046 while (ids && ids->ip_id) {
1048 * Really ought to support >1 compat id per device.
1050 if (idev->id_logicalid == ids->ip_id
1051 || idev->id_compatid == ids->ip_id) {
1053 device_set_desc(child, ids->ip_desc);
1062 static device_method_t isa_methods[] = {
1063 /* Device interface */
1064 DEVMETHOD(device_probe, isa_probe),
1065 DEVMETHOD(device_attach, isa_attach),
1066 DEVMETHOD(device_detach, bus_generic_detach),
1067 DEVMETHOD(device_shutdown, bus_generic_shutdown),
1068 DEVMETHOD(device_suspend, bus_generic_suspend),
1069 DEVMETHOD(device_resume, bus_generic_resume),
1072 DEVMETHOD(bus_add_child, isa_add_child),
1073 DEVMETHOD(bus_print_child, isa_print_child),
1074 DEVMETHOD(bus_probe_nomatch, isa_probe_nomatch),
1075 DEVMETHOD(bus_read_ivar, isa_read_ivar),
1076 DEVMETHOD(bus_write_ivar, isa_write_ivar),
1077 DEVMETHOD(bus_child_detached, isa_child_detached),
1078 DEVMETHOD(bus_driver_added, isa_driver_added),
1079 DEVMETHOD(bus_setup_intr, isa_setup_intr),
1080 DEVMETHOD(bus_teardown_intr, isa_teardown_intr),
1082 DEVMETHOD(bus_get_resource_list,isa_get_resource_list),
1083 DEVMETHOD(bus_alloc_resource, isa_alloc_resource),
1084 DEVMETHOD(bus_release_resource, isa_release_resource),
1085 DEVMETHOD(bus_set_resource, isa_set_resource),
1086 DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
1087 DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource),
1088 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
1089 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
1092 DEVMETHOD(isa_add_config, isa_add_config),
1093 DEVMETHOD(isa_set_config_callback, isa_set_config_callback),
1094 DEVMETHOD(isa_pnp_probe, isa_pnp_probe),
1099 driver_t isa_driver = {
1105 devclass_t isa_devclass;
1108 * ISA can be attached to a PCI-ISA bridge, or other locations on some
1111 DRIVER_MODULE(isa, isab, isa_driver, isa_devclass, 0, 0);
1112 DRIVER_MODULE(isa, eisab, isa_driver, isa_devclass, 0, 0);
1113 MODULE_VERSION(isa, 1);
1116 * Code common to ISA bridges.
1119 devclass_t isab_devclass;
1122 isab_attach(device_t dev)
1126 child = device_add_child(dev, "isa", 0);
1128 return (bus_generic_attach(dev));