pnpbiosvar.h revision 1.2 1 1.2 thorpej /* $NetBSD: pnpbiosvar.h,v 1.2 1999/11/14 02:15:51 thorpej Exp $ */
2 1.1 drochner /*
3 1.1 drochner * Copyright (c) 1999
4 1.1 drochner * Matthias Drochner. All rights reserved.
5 1.1 drochner *
6 1.1 drochner * Redistribution and use in source and binary forms, with or without
7 1.1 drochner * modification, are permitted provided that the following conditions
8 1.1 drochner * are met:
9 1.1 drochner * 1. Redistributions of source code must retain the above copyright
10 1.1 drochner * notice, this list of conditions, and the following disclaimer.
11 1.1 drochner * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 drochner * notice, this list of conditions and the following disclaimer in the
13 1.1 drochner * documentation and/or other materials provided with the distribution.
14 1.1 drochner *
15 1.1 drochner * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.1 drochner * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.1 drochner * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.1 drochner * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.1 drochner * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.1 drochner * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.1 drochner * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.1 drochner * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.1 drochner * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.1 drochner * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.1 drochner * SUCH DAMAGE.
26 1.1 drochner */
27 1.1 drochner
28 1.1 drochner struct pnpbios_attach_args {
29 1.1 drochner char *paa_busname;
30 1.1 drochner isa_chipset_tag_t paa_ic;
31 1.1 drochner };
32 1.1 drochner
33 1.1 drochner int pnpbios_probe __P((void));
34 1.1 drochner
35 1.1 drochner struct pnp_compatid {
36 1.1 drochner char idstr[8];
37 1.1 drochner struct pnp_compatid *next;
38 1.1 drochner };
39 1.1 drochner
40 1.1 drochner struct pnp_mem {
41 1.1 drochner SIMPLEQ_ENTRY(pnp_mem) next;
42 1.1 drochner u_int32_t minbase, maxbase, align, len;
43 1.1 drochner int flags;
44 1.1 drochner };
45 1.1 drochner struct pnp_io {
46 1.1 drochner SIMPLEQ_ENTRY(pnp_io) next;
47 1.1 drochner u_int16_t minbase, maxbase, align, len;
48 1.1 drochner int flags;
49 1.1 drochner };
50 1.1 drochner struct pnp_irq {
51 1.1 drochner SIMPLEQ_ENTRY(pnp_irq) next;
52 1.1 drochner u_int16_t mask;
53 1.1 drochner int flags;
54 1.1 drochner };
55 1.1 drochner struct pnp_dma {
56 1.1 drochner SIMPLEQ_ENTRY(pnp_dma) next;
57 1.1 drochner u_int8_t mask;
58 1.1 drochner int flags;
59 1.1 drochner };
60 1.1 drochner
61 1.1 drochner #define PNP_MAXMEM 4
62 1.1 drochner #define PNP_MAXIOPORT 8
63 1.1 drochner #define PNP_MAXIRQ 2
64 1.1 drochner #define PNP_MAXDMA 2
65 1.1 drochner
66 1.1 drochner struct pnpresources {
67 1.1 drochner int nummem, numio, numirq, numdma;
68 1.1 drochner SIMPLEQ_HEAD(, pnp_mem) mem;
69 1.1 drochner SIMPLEQ_HEAD(, pnp_io) io;
70 1.1 drochner SIMPLEQ_HEAD(, pnp_irq) irq;
71 1.1 drochner SIMPLEQ_HEAD(, pnp_dma) dma;
72 1.1 drochner struct pnpresources *dependant_link;
73 1.1 drochner struct pnp_compatid *compatids;
74 1.1 drochner char *longname;
75 1.1 drochner };
76 1.1 drochner
77 1.1 drochner typedef void *pnpbios_tag_t; /* driver private */
78 1.1 drochner
79 1.1 drochner struct pnpbiosdev_attach_args {
80 1.1 drochner pnpbios_tag_t pbt;
81 1.1 drochner isa_chipset_tag_t ic;
82 1.2 thorpej int idx;
83 1.1 drochner struct pnpresources *resc;
84 1.1 drochner char *idstr;
85 1.1 drochner char *primid;
86 1.1 drochner };
87 1.1 drochner
88 1.1 drochner int pnpbios_io_map __P((pnpbios_tag_t, struct pnpresources *, int,
89 1.1 drochner bus_space_tag_t *, bus_space_handle_t *));
90 1.1 drochner void *pnpbios_intr_establish __P((pnpbios_tag_t, struct pnpresources *, int,
91 1.1 drochner int, int (*)(void *), void *));
92 1.1 drochner
93 1.1 drochner int pnpbios_getiobase __P((pnpbios_tag_t, struct pnpresources *, int,
94 1.1 drochner bus_space_tag_t *, int *));
95 1.1 drochner int pnpbios_getirqnum __P((pnpbios_tag_t, struct pnpresources *, int, int *));
96 1.1 drochner int pnpbios_getdmachan __P((pnpbios_tag_t, struct pnpresources *, int, int *));
97 1.2 thorpej void pnpbios_print_devres __P((struct device *,
98 1.2 thorpej struct pnpbiosdev_attach_args *));
99