xref: /dragonfly/sys/bus/isa/x86_64/isa_device.h (revision 5d302545)
1b2b3ffcdSSimon Schubert /*-
2b2b3ffcdSSimon Schubert  * Copyright (c) 1991 The Regents of the University of California.
3b2b3ffcdSSimon Schubert  * All rights reserved.
4b2b3ffcdSSimon Schubert  *
5b2b3ffcdSSimon Schubert  * Redistribution and use in source and binary forms, with or without
6b2b3ffcdSSimon Schubert  * modification, are permitted provided that the following conditions
7b2b3ffcdSSimon Schubert  * are met:
8b2b3ffcdSSimon Schubert  * 1. Redistributions of source code must retain the above copyright
9b2b3ffcdSSimon Schubert  *    notice, this list of conditions and the following disclaimer.
10b2b3ffcdSSimon Schubert  * 2. Redistributions in binary form must reproduce the above copyright
11b2b3ffcdSSimon Schubert  *    notice, this list of conditions and the following disclaimer in the
12b2b3ffcdSSimon Schubert  *    documentation and/or other materials provided with the distribution.
132c64e990Szrj  * 3. Neither the name of the University nor the names of its contributors
14b2b3ffcdSSimon Schubert  *    may be used to endorse or promote products derived from this software
15b2b3ffcdSSimon Schubert  *    without specific prior written permission.
16b2b3ffcdSSimon Schubert  *
17b2b3ffcdSSimon Schubert  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18b2b3ffcdSSimon Schubert  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19b2b3ffcdSSimon Schubert  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20b2b3ffcdSSimon Schubert  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21b2b3ffcdSSimon Schubert  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22b2b3ffcdSSimon Schubert  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23b2b3ffcdSSimon Schubert  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24b2b3ffcdSSimon Schubert  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25b2b3ffcdSSimon Schubert  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26b2b3ffcdSSimon Schubert  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27b2b3ffcdSSimon Schubert  * SUCH DAMAGE.
28b2b3ffcdSSimon Schubert  *
29b2b3ffcdSSimon Schubert  *	from: @(#)isa_device.h	7.1 (Berkeley) 5/9/91
30b2b3ffcdSSimon Schubert  * $FreeBSD: src/sys/i386/isa/isa_device.h,v 1.68 2000/01/29 18:01:10 peter Exp $
31b2b3ffcdSSimon Schubert  */
32b2b3ffcdSSimon Schubert 
33b2b3ffcdSSimon Schubert #ifndef _BUS_ISA_ARCH_ISA_DEVICE_H_
34b2b3ffcdSSimon Schubert #define	_BUS_ISA_ARCH_ISA_DEVICE_H_
35b2b3ffcdSSimon Schubert 
36b2b3ffcdSSimon Schubert #ifndef _SYS_INTERRUPT_H_
37b2b3ffcdSSimon Schubert #include <sys/interrupt.h>
38b2b3ffcdSSimon Schubert #endif
39b2b3ffcdSSimon Schubert 
40b2b3ffcdSSimon Schubert /*
41b2b3ffcdSSimon Schubert  * ISA Bus Autoconfiguration
42b2b3ffcdSSimon Schubert  */
43b2b3ffcdSSimon Schubert 
44b2b3ffcdSSimon Schubert /*
45b2b3ffcdSSimon Schubert  * Per device structure.
46b2b3ffcdSSimon Schubert  */
47b2b3ffcdSSimon Schubert struct isa_device {
48b2b3ffcdSSimon Schubert 	int	id_id;		/* device id */
49b2b3ffcdSSimon Schubert 	struct	isa_driver *id_driver;
50b2b3ffcdSSimon Schubert 	int	id_iobase;	/* base i/o address */
51b2b3ffcdSSimon Schubert 	int	id_iosize;	/* base i/o length */
52b2b3ffcdSSimon Schubert 	u_int	id_irq;		/* interrupt request */
53b2b3ffcdSSimon Schubert 	int	id_drq;		/* DMA request */
54b2b3ffcdSSimon Schubert 	caddr_t id_maddr;	/* physical i/o memory address on bus (if any)*/
55b2b3ffcdSSimon Schubert 	int	id_msize;	/* size of i/o memory */
56b2b3ffcdSSimon Schubert 	inthand2_t *id_intr;
57b2b3ffcdSSimon Schubert 	int	id_unit;	/* unit number */
58b2b3ffcdSSimon Schubert 	int	id_flags;	/* flags */
59b2b3ffcdSSimon Schubert 	int	id_enabled;	/* is device enabled */
60b2b3ffcdSSimon Schubert 	struct isa_device *id_next; /* used in isa_devlist in userconfig() */
61*5d302545SFrançois Tigeot 	device_t id_device; /* new-bus wrapper device */
62b2b3ffcdSSimon Schubert };
63b2b3ffcdSSimon Schubert 
64b2b3ffcdSSimon Schubert /*
65b2b3ffcdSSimon Schubert  * Per-driver structure.
66b2b3ffcdSSimon Schubert  *
67b2b3ffcdSSimon Schubert  * Each device driver defines entries for a set of routines
68b2b3ffcdSSimon Schubert  * as well as an array of types which are acceptable to it.
69b2b3ffcdSSimon Schubert  * These are used at boot time by the configuration program.
70b2b3ffcdSSimon Schubert  */
71b2b3ffcdSSimon Schubert struct isa_driver {
72b2b3ffcdSSimon Schubert 	int	(*probe) (struct isa_device *idp);
73b2b3ffcdSSimon Schubert 					/* test whether device is present */
74b2b3ffcdSSimon Schubert 	int	(*attach) (struct isa_device *idp);
75b2b3ffcdSSimon Schubert 					/* setup driver for a device */
76b2b3ffcdSSimon Schubert 	char	*name;			/* device name */
77b2b3ffcdSSimon Schubert 	int	sensitive_hw;		/* true if other probes confuse us */
78b2b3ffcdSSimon Schubert };
79b2b3ffcdSSimon Schubert 
80b2b3ffcdSSimon Schubert #endif /* !_BUS_ISA_ARCH_ISA_DEVICE_H_ */
81