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