pnpbiosvar.h revision 1.10 1 1.10 perry /* $NetBSD: pnpbiosvar.h,v 1.10 2005/12/26 19:24:00 perry 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 isa_chipset_tag_t paa_ic;
30 1.1 drochner };
31 1.1 drochner
32 1.6 perry int pnpbios_probe(void);
33 1.1 drochner
34 1.1 drochner struct pnp_compatid {
35 1.1 drochner char idstr[8];
36 1.1 drochner struct pnp_compatid *next;
37 1.1 drochner };
38 1.1 drochner
39 1.1 drochner struct pnp_mem {
40 1.1 drochner SIMPLEQ_ENTRY(pnp_mem) next;
41 1.10 perry uint32_t minbase, maxbase, align, len;
42 1.1 drochner int flags;
43 1.1 drochner };
44 1.1 drochner struct pnp_io {
45 1.1 drochner SIMPLEQ_ENTRY(pnp_io) next;
46 1.10 perry uint16_t minbase, maxbase, align, len;
47 1.1 drochner int flags;
48 1.1 drochner };
49 1.1 drochner struct pnp_irq {
50 1.1 drochner SIMPLEQ_ENTRY(pnp_irq) next;
51 1.10 perry uint16_t mask;
52 1.1 drochner int flags;
53 1.1 drochner };
54 1.1 drochner struct pnp_dma {
55 1.1 drochner SIMPLEQ_ENTRY(pnp_dma) next;
56 1.10 perry uint8_t mask;
57 1.1 drochner int flags;
58 1.1 drochner };
59 1.1 drochner
60 1.1 drochner #define PNP_MAXMEM 4
61 1.1 drochner #define PNP_MAXIOPORT 8
62 1.1 drochner #define PNP_MAXIRQ 2
63 1.1 drochner #define PNP_MAXDMA 2
64 1.1 drochner
65 1.1 drochner struct pnpresources {
66 1.1 drochner int nummem, numio, numirq, numdma;
67 1.1 drochner SIMPLEQ_HEAD(, pnp_mem) mem;
68 1.1 drochner SIMPLEQ_HEAD(, pnp_io) io;
69 1.1 drochner SIMPLEQ_HEAD(, pnp_irq) irq;
70 1.1 drochner SIMPLEQ_HEAD(, pnp_dma) dma;
71 1.1 drochner struct pnpresources *dependant_link;
72 1.1 drochner struct pnp_compatid *compatids;
73 1.1 drochner char *longname;
74 1.1 drochner };
75 1.1 drochner
76 1.1 drochner typedef void *pnpbios_tag_t; /* driver private */
77 1.1 drochner
78 1.1 drochner struct pnpbiosdev_attach_args {
79 1.1 drochner pnpbios_tag_t pbt;
80 1.1 drochner isa_chipset_tag_t ic;
81 1.2 thorpej int idx;
82 1.1 drochner struct pnpresources *resc;
83 1.1 drochner char *idstr;
84 1.1 drochner char *primid;
85 1.1 drochner };
86 1.1 drochner
87 1.6 perry int pnpbios_io_map(pnpbios_tag_t, struct pnpresources *, int,
88 1.6 perry bus_space_tag_t *, bus_space_handle_t *);
89 1.6 perry void pnpbios_io_unmap(pnpbios_tag_t, struct pnpresources *, int,
90 1.6 perry bus_space_tag_t, bus_space_handle_t);
91 1.6 perry void *pnpbios_intr_establish(pnpbios_tag_t, struct pnpresources *, int,
92 1.6 perry int, int (*)(void *), void *);
93 1.6 perry
94 1.6 perry int pnpbios_getiobase(pnpbios_tag_t, struct pnpresources *, int,
95 1.6 perry bus_space_tag_t *, int *);
96 1.6 perry int pnpbios_getiosize(pnpbios_tag_t, struct pnpresources *, int, int *);
97 1.6 perry int pnpbios_getirqnum(pnpbios_tag_t, struct pnpresources *, int, int *, int *);
98 1.6 perry int pnpbios_getdmachan(pnpbios_tag_t, struct pnpresources *, int, int *);
99 1.6 perry void pnpbios_print_devres(struct device *, struct pnpbiosdev_attach_args *);
100