autrivar.h revision 1.2.2.2 1 1.2.2.2 nathanw /* $NetBSD: autrivar.h,v 1.2.2.2 2002/01/08 00:30:59 nathanw Exp $ */
2 1.2.2.2 nathanw
3 1.2.2.2 nathanw /*
4 1.2.2.2 nathanw * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
5 1.2.2.2 nathanw * All rights reserved.
6 1.2.2.2 nathanw *
7 1.2.2.2 nathanw * Redistribution and use in source and binary forms, with or without
8 1.2.2.2 nathanw * modification, are permitted provided that the following conditions
9 1.2.2.2 nathanw * are met:
10 1.2.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
11 1.2.2.2 nathanw * notice, this list of conditions and the following disclaimer.
12 1.2.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
14 1.2.2.2 nathanw * documentation and/or other materials provided with the distribution.
15 1.2.2.2 nathanw *
16 1.2.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.2.2.2 nathanw * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.2.2.2 nathanw * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.2.2.2 nathanw * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.2.2.2 nathanw * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.2.2.2 nathanw * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.2.2.2 nathanw * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.2.2.2 nathanw * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.2.2.2 nathanw * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.2.2.2 nathanw * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.2.2.2 nathanw */
27 1.2.2.2 nathanw
28 1.2.2.2 nathanw #ifndef _DEV_PCI_AUTRIVAR_H_
29 1.2.2.2 nathanw #define _DEV_PCI_AUTRIVAR_H_
30 1.2.2.2 nathanw
31 1.2.2.2 nathanw /*
32 1.2.2.2 nathanw * softc
33 1.2.2.2 nathanw */
34 1.2.2.2 nathanw struct autri_dma {
35 1.2.2.2 nathanw bus_dmamap_t map;
36 1.2.2.2 nathanw caddr_t addr; /* VA */
37 1.2.2.2 nathanw bus_dma_segment_t segs[1];
38 1.2.2.2 nathanw int nsegs;
39 1.2.2.2 nathanw size_t size;
40 1.2.2.2 nathanw struct autri_dma *next;
41 1.2.2.2 nathanw };
42 1.2.2.2 nathanw
43 1.2.2.2 nathanw struct autri_codec_softc {
44 1.2.2.2 nathanw struct device sc_dev; /* base device */
45 1.2.2.2 nathanw struct autri_softc *sc;
46 1.2.2.2 nathanw int id;
47 1.2.2.2 nathanw int status_data;
48 1.2.2.2 nathanw int status_addr;
49 1.2.2.2 nathanw struct ac97_host_if host_if;
50 1.2.2.2 nathanw struct ac97_codec_if *codec_if;
51 1.2.2.2 nathanw };
52 1.2.2.2 nathanw
53 1.2.2.2 nathanw struct autri_chstatus {
54 1.2.2.2 nathanw void (*intr)(void *); /* rint/pint */
55 1.2.2.2 nathanw void *intr_arg; /* arg for intr */
56 1.2.2.2 nathanw u_int offset; /* filled up to here */
57 1.2.2.2 nathanw u_int blksize;
58 1.2.2.2 nathanw u_int factor; /* byte per sample */
59 1.2.2.2 nathanw u_int length; /* ring buffer length */
60 1.2.2.2 nathanw struct autri_dma *dma; /* DMA handle for ring buf */
61 1.2.2.2 nathanw
62 1.2.2.2 nathanw int ch;
63 1.2.2.2 nathanw int ch_intr;
64 1.2.2.2 nathanw #if 0
65 1.2.2.2 nathanw u_int csoint;
66 1.2.2.2 nathanw u_int count;
67 1.2.2.2 nathanw #endif
68 1.2.2.2 nathanw };
69 1.2.2.2 nathanw
70 1.2.2.2 nathanw struct autri_softc {
71 1.2.2.2 nathanw struct device sc_dev; /* base device */
72 1.2.2.2 nathanw pci_chipset_tag_t sc_pc;
73 1.2.2.2 nathanw pcitag_t sc_pt;
74 1.2.2.2 nathanw pcireg_t sc_devid;
75 1.2.2.2 nathanw void *sc_ih; /* interrupt vectoring */
76 1.2.2.2 nathanw bus_space_tag_t memt;
77 1.2.2.2 nathanw bus_space_handle_t memh;
78 1.2.2.2 nathanw bus_space_tag_t iot;
79 1.2.2.2 nathanw bus_space_handle_t ioh;
80 1.2.2.2 nathanw bus_dma_tag_t sc_dmatag; /* DMA tag */
81 1.2.2.2 nathanw u_int sc_flags;
82 1.2.2.2 nathanw
83 1.2.2.2 nathanw struct autri_codec_softc sc_codec;
84 1.2.2.2 nathanw struct autri_dma *sc_dmas; /* List of DMA handles */
85 1.2.2.2 nathanw
86 1.2.2.2 nathanw u_int32_t sc_class;
87 1.2.2.2 nathanw int sc_revision;
88 1.2.2.2 nathanw
89 1.2.2.2 nathanw int sc_old_power;
90 1.2.2.2 nathanw
91 1.2.2.2 nathanw /*
92 1.2.2.2 nathanw * Play/record status
93 1.2.2.2 nathanw */
94 1.2.2.2 nathanw struct autri_chstatus sc_play, sc_rec;
95 1.2.2.2 nathanw
96 1.2.2.2 nathanw #if NMIDI > 0
97 1.2.2.2 nathanw void (*sc_iintr)(void *, int); /* midi input ready handler */
98 1.2.2.2 nathanw void (*sc_ointr)(void *); /* midi output ready handler */
99 1.2.2.2 nathanw void *sc_arg;
100 1.2.2.2 nathanw #endif
101 1.2.2.2 nathanw
102 1.2.2.2 nathanw };
103 1.2.2.2 nathanw
104 1.2.2.2 nathanw #endif /* _DEV_PCI_AUTRIVAR_H_ */
105 1.2.2.2 nathanw
106