/*
* Copyright (c) 1997, 1999, 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Author: Kari Mettinen
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
int vers;
int revision;
int sc_fullduplex;
int sc_irate;
int sc_orate;
u_long sc_dma_flags;
int sc_irq;
int sc_midi_irq;
void (*sc_recintr)(void *);
void *sc_recarg;
void *sc_recdma_bp;
int sc_playdrq;
bus_size_t sc_play_maxsize;
int sc_recdrq;
bus_size_t sc_rec_maxsize;
int sc_recdma_cnt;
int sc_playing;
int sc_maxdma;
u_long outfifo;
u_long infifo;
int fifosize;
u_short silence;
u_long sc_last_dmasize;
u_long sc_last_playsize;
u_long sc_last_played;
u_long sc_play_pos; /* position of next free byte in buffer */
u_long sc_play_start; /* address of start of the buffer */
u_long sc_play_end; /* end */
void (*sc_playintr)(void *);
void *sc_playarg;
void *sc_playdma_bp;
int sc_playdma_cnt;
int play_encoding;
int play_channels;
int play_precision;
int sc_playlastcc;
int sc_fillcount;
int bytesout;
int bytesin;
int sc_playbuf_available;
int sc_recbuf_available;
int rec_encoding;
int rec_channels;
int rec_precision;
int sc_reclastcc;
bus_space_handle_t dir_h; /* dummy handle for direct access*/
int codec_index; /* Base Port for Codec */
bus_space_handle_t codec_index_h;
isa_chipset_tag_t sc_codec_ic;
int pcdrar; /* Base Port for Ext Device */
int p2xr; /* Compatibility Base Port */
bus_space_handle_t p2xr_h;
isa_chipset_tag_t sc_p2xr_ic;
int p3xr; /* MIDI and Synth Base Port */
bus_space_handle_t p3xr_h;
isa_chipset_tag_t sc_p3xr_ic;
int p401ar; /* Gen Purpose Reg. 1 address */
int p201ar; /* Game Ctrl normally at 0x201 */
int pataar; /* Base Address for ATAPI I/O Space */
int p388ar; /* Base Port for AdLib. It should bbe 388h */
int pnprdp; /* PNP read data port */
int igidxr; /* Gen Index Reg at P3XR+0x03 */
int i16dp; /* 16-bit data port at P3XR+0x04 */
int i8dp; /* 8-bit data port at P3XR+0x05 */
int svsr; /* Synth Voice Select at P3XR+0x02 */
int cdatap; /* Codec Indexed Data Port at PCODAR+0x01 */
int csr1r; /* Codec Stat Reg 1 at PCODAR+0x02 */
int cxdr; /* Play or Record Data Reg at PCODAR+0x03 */
int gmxr; /* GMCR or GMSR at P3XR+0x00 */
int gmxdr; /* GMTDR or GMRDR at P3XR+0x01 */
int lmbdr; /* LMBDR at P3XR+0x07 */
u_char csn; /* Card Select Number */
u_char cmode; /* Codec Operation Mode */
int dma1_chan; /* DMA channel 1 (local DMA & codec rec) */
int dma2_chan; /* DMA channel 2 (codec play) */
int ext_chan; /* Ext Dev DMA channel */
u_char voices; /* Number of active voices */
u_long vendor; /* Vendor ID and Product Identifier */
long free_mem; /* Address of First Free LM Block */
long reserved_mem; /* Amount of LM reserved by app. */
u_char smode; /* Synth Mode */
long size_mem; /* Total LM in bytes */
struct cfdriver *iw_cd;
const struct audio_hw_if *iw_hw_if;
};
void iwattach(struct iw_softc *);
int iwopen(struct iw_softc *, int); /* open hardware */
void iwclose(void *); /* close hardware */