1 /* $NetBSD: pnpbiosvar.h,v 1.10 2005/12/26 19:24:00 perry Exp $ */
4 * Matthias Drochner. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <sys/device.h> /* for device_t */
30 struct pnpbios_attach_args
{
31 isa_chipset_tag_t paa_ic
;
34 int pnpbios_probe(void);
38 struct pnp_compatid
*next
;
42 SIMPLEQ_ENTRY(pnp_mem
) next
;
43 uint32_t minbase
, maxbase
, align
, len
;
47 SIMPLEQ_ENTRY(pnp_io
) next
;
48 uint16_t minbase
, maxbase
, align
, len
;
52 SIMPLEQ_ENTRY(pnp_irq
) next
;
57 SIMPLEQ_ENTRY(pnp_dma
) next
;
63 #define PNP_MAXIOPORT 8
68 int nummem
, numio
, numirq
, numdma
;
69 SIMPLEQ_HEAD(, pnp_mem
) mem
;
70 SIMPLEQ_HEAD(, pnp_io
) io
;
71 SIMPLEQ_HEAD(, pnp_irq
) irq
;
72 SIMPLEQ_HEAD(, pnp_dma
) dma
;
73 struct pnpresources
*dependant_link
;
74 struct pnp_compatid
*compatids
;
78 typedef void *pnpbios_tag_t
; /* driver private */
80 struct pnpbiosdev_attach_args
{
84 struct pnpresources
*resc
;
89 int pnpbios_io_map(pnpbios_tag_t
, struct pnpresources
*, int,
90 bus_space_tag_t
*, bus_space_handle_t
*);
91 void pnpbios_io_unmap(pnpbios_tag_t
, struct pnpresources
*, int,
92 bus_space_tag_t
, bus_space_handle_t
);
93 void *pnpbios_intr_establish(pnpbios_tag_t
, struct pnpresources
*, int,
94 int, int (*)(void *), void *);
96 int pnpbios_getiobase(pnpbios_tag_t
, struct pnpresources
*, int,
97 bus_space_tag_t
*, int *);
98 int pnpbios_getiosize(pnpbios_tag_t
, struct pnpresources
*, int, int *);
99 int pnpbios_getirqnum(pnpbios_tag_t
, struct pnpresources
*, int, int *, int *);
100 int pnpbios_getdmachan(pnpbios_tag_t
, struct pnpresources
*, int, int *);
101 void pnpbios_print_devres(device_t
, struct pnpbiosdev_attach_args
*);