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
26 * $FreeBSD: src/sys/isa/isa_common.c,v 1.16.2.1 2000/09/16 15:49:52 roger Exp $
29 * Modifications for Intel architecture by Garrett A. Wollman.
30 * Copyright 1998 Massachusetts Institute of Technology
32 * Permission to use, copy, modify, and distribute this software and
33 * its documentation for any purpose and without fee is hereby
34 * granted, provided that both the above copyright notice and this
35 * permission notice appear in all copies, that both the above
36 * copyright notice and this permission notice appear in all
37 * supporting documentation, and that the name of M.I.T. not be used
38 * in advertising or publicity pertaining to distribution of the
39 * software without specific, written prior permission. M.I.T. makes
40 * no representations about the suitability of this software for any
41 * purpose. It is provided "as is" without express or implied
44 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
45 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
46 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
47 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
48 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
50 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
51 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
52 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
53 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
54 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 * Parts of the ISA bus implementation common to all architectures.
62 #include <sys/param.h>
63 #include <sys/systm.h>
64 #include <sys/kernel.h>
66 #include <sys/malloc.h>
67 #include <sys/module.h>
68 #include <machine/bus.h>
71 #include <machine/resource.h>
73 #include <isa/isavar.h>
74 #include <isa/isa_common.h>
75 #ifdef __alpha__ /* XXX workaround a stupid warning */
76 #include <alpha/isa/isavar.h>
79 static int isa_print_child __P((device_t, device_t));
81 MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device");
83 static devclass_t isa_devclass;
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(); /* 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,
118 struct isa_config *config,
119 struct isa_config *result)
122 struct resource *res[ISA_NMEM];
125 * First clear out any existing resource definitions.
127 for (i = 0; i < ISA_NMEM; i++) {
128 bus_delete_resource(child, SYS_RES_MEMORY, i);
133 result->ic_nmem = config->ic_nmem;
134 for (i = 0; i < config->ic_nmem; i++) {
135 u_int32_t start, end, size, align;
136 for (start = config->ic_mem[i].ir_start,
137 end = config->ic_mem[i].ir_end,
138 size = config->ic_mem[i].ir_size,
139 align = config->ic_mem[i].ir_align;
140 start + size - 1 <= end;
142 bus_set_resource(child, SYS_RES_MEMORY, i,
144 res[i] = bus_alloc_resource(child,
146 0, ~0, 1, 0 /* !RF_ACTIVE */);
148 result->ic_mem[i].ir_start = start;
149 result->ic_mem[i].ir_end = start + size - 1;
150 result->ic_mem[i].ir_size = size;
151 result->ic_mem[i].ir_align = align;
157 * If we didn't find a place for memory range i, then
166 for (i = 0; i < ISA_NMEM; i++) {
168 bus_release_resource(child, SYS_RES_MEMORY,
176 * Find a working set of port regions for a child using the ranges
177 * in *config and return the regions in *result. Returns non-zero if
178 * a set of ranges was found.
181 isa_find_port(device_t child,
182 struct isa_config *config,
183 struct isa_config *result)
186 struct resource *res[ISA_NPORT];
189 * First clear out any existing resource definitions.
191 for (i = 0; i < ISA_NPORT; i++) {
192 bus_delete_resource(child, SYS_RES_IOPORT, i);
197 result->ic_nport = config->ic_nport;
198 for (i = 0; i < config->ic_nport; i++) {
199 u_int32_t start, end, size, align;
200 for (start = config->ic_port[i].ir_start,
201 end = config->ic_port[i].ir_end,
202 size = config->ic_port[i].ir_size,
203 align = config->ic_port[i].ir_align;
204 start + size - 1 <= end;
206 bus_set_resource(child, SYS_RES_IOPORT, i,
208 res[i] = bus_alloc_resource(child,
210 0, ~0, 1, 0 /* !RF_ACTIVE */);
212 result->ic_port[i].ir_start = start;
213 result->ic_port[i].ir_end = start + size - 1;
214 result->ic_port[i].ir_size = size;
215 result->ic_port[i].ir_align = align;
221 * If we didn't find a place for port range i, then
230 for (i = 0; i < ISA_NPORT; i++) {
232 bus_release_resource(child, SYS_RES_IOPORT,
240 * Return the index of the first bit in the mask (or -1 if mask is empty.
243 find_first_bit(u_int32_t mask)
245 return ffs(mask) - 1;
249 * Return the index of the next bit in the mask, or -1 if there are no more.
252 find_next_bit(u_int32_t mask, int bit)
255 while (bit < 32 && !(mask & (1 << bit)))
263 * Find a working set of irqs for a child using the masks in *config
264 * and return the regions in *result. Returns non-zero if a set of
268 isa_find_irq(device_t child,
269 struct isa_config *config,
270 struct isa_config *result)
273 struct resource *res[ISA_NIRQ];
276 * First clear out any existing resource definitions.
278 for (i = 0; i < ISA_NIRQ; i++) {
279 bus_delete_resource(child, SYS_RES_IRQ, i);
284 result->ic_nirq = config->ic_nirq;
285 for (i = 0; i < config->ic_nirq; i++) {
286 u_int32_t mask = config->ic_irqmask[i];
288 for (irq = find_first_bit(mask);
290 irq = find_next_bit(mask, irq)) {
291 bus_set_resource(child, SYS_RES_IRQ, i,
293 res[i] = bus_alloc_resource(child,
295 0, ~0, 1, 0 /* !RF_ACTIVE */ );
297 result->ic_irqmask[i] = (1 << irq);
303 * If we didn't find a place for irq range i, then
312 for (i = 0; i < ISA_NIRQ; i++) {
314 bus_release_resource(child, SYS_RES_IRQ,
322 * Find a working set of drqs for a child using the masks in *config
323 * and return the regions in *result. Returns non-zero if a set of
327 isa_find_drq(device_t child,
328 struct isa_config *config,
329 struct isa_config *result)
332 struct resource *res[ISA_NDRQ];
335 * First clear out any existing resource definitions.
337 for (i = 0; i < ISA_NDRQ; i++) {
338 bus_delete_resource(child, SYS_RES_DRQ, i);
343 result->ic_ndrq = config->ic_ndrq;
344 for (i = 0; i < config->ic_ndrq; i++) {
345 u_int32_t mask = config->ic_drqmask[i];
347 for (drq = find_first_bit(mask);
349 drq = find_next_bit(mask, drq)) {
350 bus_set_resource(child, SYS_RES_DRQ, i,
352 res[i] = bus_alloc_resource(child,
354 0, ~0, 1, 0 /* !RF_ACTIVE */);
356 result->ic_drqmask[i] = (1 << drq);
362 * If we didn't find a place for drq range i, then
371 for (i = 0; i < ISA_NDRQ; i++) {
373 bus_release_resource(child, SYS_RES_DRQ,
381 * Attempt to find a working set of resources for a device. Return
382 * non-zero if a working configuration is found.
385 isa_assign_resources(device_t child)
387 struct isa_device *idev = DEVTOISA(child);
388 struct isa_config_entry *ice;
389 struct isa_config config;
391 bzero(&config, sizeof config);
392 TAILQ_FOREACH(ice, &idev->id_configs, ice_link) {
393 if (!isa_find_memory(child, &ice->ice_config, &config))
395 if (!isa_find_port(child, &ice->ice_config, &config))
397 if (!isa_find_irq(child, &ice->ice_config, &config))
399 if (!isa_find_drq(child, &ice->ice_config, &config))
403 * A working configuration was found enable the device
404 * with this configuration.
406 if (idev->id_config_cb) {
407 idev->id_config_cb(idev->id_config_arg,
414 * Disable the device.
416 bus_print_child_header(device_get_parent(child), child);
417 printf(" can't assign resources\n");
419 isa_print_child(device_get_parent(child), child);
420 bzero(&config, sizeof config);
421 if (idev->id_config_cb)
422 idev->id_config_cb(idev->id_config_arg, &config, 0);
423 device_disable(child);
429 * Called after other devices have initialised to probe for isa devices.
432 isa_probe_children(device_t dev)
438 * Create all the children by calling driver's identify methods.
440 bus_generic_probe(dev);
442 if (device_get_children(dev, &children, &nchildren))
446 * First disable all pnp devices so that they don't get
447 * matched by legacy probes.
450 printf("isa_probe_children: disabling PnP devices\n");
451 for (i = 0; i < nchildren; i++) {
452 device_t child = children[i];
453 struct isa_device *idev = DEVTOISA(child);
454 struct isa_config config;
456 bzero(&config, sizeof config);
457 if (idev->id_config_cb)
458 idev->id_config_cb(idev->id_config_arg, &config, 0);
462 * Next probe all non-pnp devices so that they claim their
466 printf("isa_probe_children: probing non-PnP devices\n");
467 for (i = 0; i < nchildren; i++) {
468 device_t child = children[i];
469 struct isa_device *idev = DEVTOISA(child);
471 if (TAILQ_FIRST(&idev->id_configs))
474 device_probe_and_attach(child);
478 * Finally assign resource to pnp devices and probe them.
481 printf("isa_probe_children: probing PnP devices\n");
482 for (i = 0; i < nchildren; i++) {
483 device_t child = children[i];
484 struct isa_device* idev = DEVTOISA(child);
486 if (!TAILQ_FIRST(&idev->id_configs))
489 if (isa_assign_resources(child)) {
490 struct resource_list *rl = &idev->id_resources;
491 struct resource_list_entry *rle;
493 device_probe_and_attach(child);
496 * Claim any unallocated resources to keep other
497 * devices from using them.
499 SLIST_FOREACH(rle, rl, link) {
502 resource_list_alloc(rl, dev, child,
512 free(children, M_TEMP);
518 * Add a new child with default ivars.
521 isa_add_child(device_t dev, int order, const char *name, int unit)
524 struct isa_device *idev;
526 idev = malloc(sizeof(struct isa_device), M_ISADEV, M_NOWAIT);
529 bzero(idev, sizeof *idev);
531 resource_list_init(&idev->id_resources);
532 TAILQ_INIT(&idev->id_configs);
534 child = device_add_child_ordered(dev, order, name, unit);
535 device_set_ivars(child, idev);
541 isa_print_resources(struct resource_list *rl, const char *name, int type,
542 int count, const char *format)
544 struct resource_list_entry *rle;
549 for (i = 0; i < count; i++) {
550 rle = resource_list_find(rl, type, i);
553 retval += printf(" %s ", name);
554 else if (printed > 0)
555 retval += printf(",");
557 retval += printf(format, rle->start);
558 if (rle->count > 1) {
559 retval += printf("-");
560 retval += printf(format,
561 rle->start + rle->count - 1);
564 /* check the first few regardless */
572 isa_print_all_resources(device_t dev)
574 struct isa_device *idev = DEVTOISA(dev);
575 struct resource_list *rl = &idev->id_resources;
578 if (SLIST_FIRST(rl) || device_get_flags(dev))
579 retval += printf(" at");
581 retval += isa_print_resources(rl, "port", SYS_RES_IOPORT,
583 retval += isa_print_resources(rl, "iomem", SYS_RES_MEMORY,
585 retval += isa_print_resources(rl, "irq", SYS_RES_IRQ,
587 retval += isa_print_resources(rl, "drq", SYS_RES_DRQ,
589 if (device_get_flags(dev))
590 retval += printf(" flags %#x", device_get_flags(dev));
596 isa_print_child(device_t bus, device_t dev)
600 retval += bus_print_child_header(bus, dev);
601 retval += isa_print_all_resources(dev);
602 retval += bus_print_child_footer(bus, dev);
608 isa_probe_nomatch(device_t dev, device_t child)
611 bus_print_child_header(dev, child);
612 printf(" failed to probe");
613 isa_print_all_resources(child);
614 bus_print_child_footer(dev, child);
621 isa_read_ivar(device_t bus, device_t dev, int index, uintptr_t * result)
623 struct isa_device* idev = DEVTOISA(dev);
624 struct resource_list *rl = &idev->id_resources;
625 struct resource_list_entry *rle;
628 case ISA_IVAR_PORT_0:
629 rle = resource_list_find(rl, SYS_RES_IOPORT, 0);
631 *result = rle->start;
636 case ISA_IVAR_PORT_1:
637 rle = resource_list_find(rl, SYS_RES_IOPORT, 1);
639 *result = rle->start;
644 case ISA_IVAR_PORTSIZE_0:
645 rle = resource_list_find(rl, SYS_RES_IOPORT, 0);
647 *result = rle->count;
652 case ISA_IVAR_PORTSIZE_1:
653 rle = resource_list_find(rl, SYS_RES_IOPORT, 1);
655 *result = rle->count;
660 case ISA_IVAR_MADDR_0:
661 rle = resource_list_find(rl, SYS_RES_MEMORY, 0);
663 *result = rle->start;
668 case ISA_IVAR_MADDR_1:
669 rle = resource_list_find(rl, SYS_RES_MEMORY, 1);
671 *result = rle->start;
676 case ISA_IVAR_MSIZE_0:
677 rle = resource_list_find(rl, SYS_RES_MEMORY, 0);
679 *result = rle->count;
684 case ISA_IVAR_MSIZE_1:
685 rle = resource_list_find(rl, SYS_RES_MEMORY, 1);
687 *result = rle->count;
693 rle = resource_list_find(rl, SYS_RES_IRQ, 0);
695 *result = rle->start;
701 rle = resource_list_find(rl, SYS_RES_IRQ, 1);
703 *result = rle->start;
709 rle = resource_list_find(rl, SYS_RES_DRQ, 0);
711 *result = rle->start;
717 rle = resource_list_find(rl, SYS_RES_DRQ, 1);
719 *result = rle->start;
724 case ISA_IVAR_VENDORID:
725 *result = idev->id_vendorid;
728 case ISA_IVAR_SERIAL:
729 *result = idev->id_serial;
732 case ISA_IVAR_LOGICALID:
733 *result = idev->id_logicalid;
736 case ISA_IVAR_COMPATID:
737 *result = idev->id_compatid;
748 isa_write_ivar(device_t bus, device_t dev,
749 int index, uintptr_t value)
751 struct isa_device* idev = DEVTOISA(dev);
754 case ISA_IVAR_PORT_0:
755 case ISA_IVAR_PORT_1:
756 case ISA_IVAR_PORTSIZE_0:
757 case ISA_IVAR_PORTSIZE_1:
758 case ISA_IVAR_MADDR_0:
759 case ISA_IVAR_MADDR_1:
760 case ISA_IVAR_MSIZE_0:
761 case ISA_IVAR_MSIZE_1:
768 case ISA_IVAR_VENDORID:
769 idev->id_vendorid = value;
772 case ISA_IVAR_SERIAL:
773 idev->id_serial = value;
776 case ISA_IVAR_LOGICALID:
777 idev->id_logicalid = value;
780 case ISA_IVAR_COMPATID:
781 idev->id_compatid = value;
792 * Free any resources which the driver missed or which we were holding for
793 * it (see isa_probe_children).
796 isa_child_detached(device_t dev, device_t child)
798 struct isa_device* idev = DEVTOISA(child);
799 struct resource_list *rl = &idev->id_resources;
800 struct resource_list_entry *rle;
802 if (TAILQ_FIRST(&idev->id_configs)) {
804 * Claim any unallocated resources to keep other
805 * devices from using them.
807 SLIST_FOREACH(rle, rl, link) {
810 resource_list_alloc(rl, dev, child,
819 isa_driver_added(device_t dev, driver_t *driver)
825 * Don't do anything if drivers are dynamically
826 * added during autoconfiguration (cf. ymf724).
827 * since that would end up calling identify
833 DEVICE_IDENTIFY(driver, dev);
834 if (device_get_children(dev, &children, &nchildren))
837 for (i = 0; i < nchildren; i++) {
838 device_t child = children[i];
839 struct isa_device *idev = DEVTOISA(child);
840 struct resource_list *rl = &idev->id_resources;
841 struct resource_list_entry *rle;
843 if (device_get_state(child) != DS_NOTPRESENT)
845 if (!device_is_enabled(child))
849 * Free resources which we were holding on behalf of
852 SLIST_FOREACH(rle, &idev->id_resources, link) {
854 resource_list_release(rl, dev, child,
860 if (TAILQ_FIRST(&idev->id_configs))
861 if (!isa_assign_resources(child))
864 device_probe_and_attach(child);
866 if (TAILQ_FIRST(&idev->id_configs)) {
868 * Claim any unallocated resources to keep other
869 * devices from using them.
871 SLIST_FOREACH(rle, rl, link) {
874 resource_list_alloc(rl, dev, child,
884 free(children, M_TEMP);
888 isa_set_resource(device_t dev, device_t child, int type, int rid,
889 u_long start, u_long count)
891 struct isa_device* idev = DEVTOISA(child);
892 struct resource_list *rl = &idev->id_resources;
894 if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY
895 && type != SYS_RES_IRQ && type != SYS_RES_DRQ)
899 if (type == SYS_RES_IOPORT && rid >= ISA_NPORT)
901 if (type == SYS_RES_MEMORY && rid >= ISA_NMEM)
903 if (type == SYS_RES_IRQ && rid >= ISA_NIRQ)
905 if (type == SYS_RES_DRQ && rid >= ISA_NDRQ)
908 resource_list_add(rl, type, rid, start, start + count - 1, count);
914 isa_get_resource(device_t dev, device_t child, int type, int rid,
915 u_long *startp, u_long *countp)
917 struct isa_device* idev = DEVTOISA(child);
918 struct resource_list *rl = &idev->id_resources;
919 struct resource_list_entry *rle;
921 rle = resource_list_find(rl, type, rid);
926 *startp = rle->start;
928 *countp = rle->count;
934 isa_delete_resource(device_t dev, device_t child, int type, int rid)
936 struct isa_device* idev = DEVTOISA(child);
937 struct resource_list *rl = &idev->id_resources;
938 resource_list_delete(rl, type, rid);
942 isa_add_config(device_t dev, device_t child,
943 int priority, struct isa_config *config)
945 struct isa_device* idev = DEVTOISA(child);
946 struct isa_config_entry *newice, *ice;
948 newice = malloc(sizeof *ice, M_DEVBUF, M_NOWAIT);
952 newice->ice_priority = priority;
953 newice->ice_config = *config;
955 TAILQ_FOREACH(ice, &idev->id_configs, ice_link) {
956 if (ice->ice_priority > priority)
960 TAILQ_INSERT_BEFORE(ice, newice, ice_link);
962 TAILQ_INSERT_TAIL(&idev->id_configs, newice, ice_link);
968 isa_set_config_callback(device_t dev, device_t child,
969 isa_config_cb *fn, void *arg)
971 struct isa_device* idev = DEVTOISA(child);
973 idev->id_config_cb = fn;
974 idev->id_config_arg = arg;
978 isa_pnp_probe(device_t dev, device_t child, struct isa_pnp_id *ids)
980 struct isa_device* idev = DEVTOISA(child);
982 if (!idev->id_vendorid)
987 * Really ought to support >1 compat id per device.
989 if (idev->id_logicalid == ids->ip_id
990 || idev->id_compatid == ids->ip_id) {
992 device_set_desc(child, ids->ip_desc);
1001 static device_method_t isa_methods[] = {
1002 /* Device interface */
1003 DEVMETHOD(device_probe, isa_probe),
1004 DEVMETHOD(device_attach, isa_attach),
1005 DEVMETHOD(device_detach, bus_generic_detach),
1006 DEVMETHOD(device_shutdown, bus_generic_shutdown),
1007 DEVMETHOD(device_suspend, bus_generic_suspend),
1008 DEVMETHOD(device_resume, bus_generic_resume),
1011 DEVMETHOD(bus_add_child, isa_add_child),
1012 DEVMETHOD(bus_print_child, isa_print_child),
1013 DEVMETHOD(bus_probe_nomatch, isa_probe_nomatch),
1014 DEVMETHOD(bus_read_ivar, isa_read_ivar),
1015 DEVMETHOD(bus_write_ivar, isa_write_ivar),
1016 DEVMETHOD(bus_child_detached, isa_child_detached),
1017 DEVMETHOD(bus_driver_added, isa_driver_added),
1018 DEVMETHOD(bus_alloc_resource, isa_alloc_resource),
1019 DEVMETHOD(bus_release_resource, isa_release_resource),
1020 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
1021 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
1022 DEVMETHOD(bus_setup_intr, isa_setup_intr),
1023 DEVMETHOD(bus_teardown_intr, isa_teardown_intr),
1024 DEVMETHOD(bus_set_resource, isa_set_resource),
1025 DEVMETHOD(bus_get_resource, isa_get_resource),
1026 DEVMETHOD(bus_delete_resource, isa_delete_resource),
1029 DEVMETHOD(isa_add_config, isa_add_config),
1030 DEVMETHOD(isa_set_config_callback, isa_set_config_callback),
1031 DEVMETHOD(isa_pnp_probe, isa_pnp_probe),
1036 static driver_t isa_driver = {
1043 * ISA can be attached to a PCI-ISA bridge or directly to the nexus.
1045 DRIVER_MODULE(isa, isab, isa_driver, isa_devclass, 0, 0);
1047 DRIVER_MODULE(isa, nexus, isa_driver, isa_devclass, 0, 0);