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