Home | History | Annotate | Line # | Download | only in pci
      1  1.6    martin /*	$NetBSD: autrivar.h,v 1.6 2012/03/17 20:29:59 martin 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.3  christos 	void *			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 autri_softc	*sc;
     45  1.1    someya 	int			id;
     46  1.1    someya 	int			status_data;
     47  1.1    someya 	int			status_addr;
     48  1.1    someya 	struct ac97_host_if	host_if;
     49  1.1    someya 	struct ac97_codec_if	*codec_if;
     50  1.1    someya };
     51  1.1    someya 
     52  1.1    someya struct autri_chstatus {
     53  1.1    someya 	void		(*intr)(void *); /* rint/pint */
     54  1.1    someya 	void		*intr_arg;	/* arg for intr */
     55  1.1    someya 	u_int	 	offset;		/* filled up to here */
     56  1.1    someya 	u_int	 	blksize;
     57  1.1    someya 	u_int	 	factor;		/* byte per sample */
     58  1.1    someya 	u_int		length;		/* ring buffer length */
     59  1.1    someya 	struct autri_dma *dma;		/* DMA handle for ring buf */
     60  1.1    someya 
     61  1.1    someya 	int		ch;
     62  1.1    someya 	int		ch_intr;
     63  1.1    someya #if 0
     64  1.1    someya 	u_int		csoint;
     65  1.1    someya 	u_int		count;
     66  1.1    someya #endif
     67  1.1    someya };
     68  1.1    someya 
     69  1.1    someya struct autri_softc {
     70  1.6    martin 	device_t		sc_dev;
     71  1.5  jmcneill 	kmutex_t		sc_lock;
     72  1.5  jmcneill 	kmutex_t		sc_intr_lock;
     73  1.1    someya 	pci_chipset_tag_t	sc_pc;
     74  1.1    someya 	pcitag_t		sc_pt;
     75  1.1    someya 	pcireg_t		sc_devid;
     76  1.1    someya 	void			*sc_ih;		/* interrupt vectoring */
     77  1.1    someya 	bus_space_tag_t		memt;
     78  1.1    someya 	bus_space_handle_t	memh;
     79  1.1    someya 	bus_space_tag_t		iot;
     80  1.1    someya 	bus_space_handle_t	ioh;
     81  1.1    someya 	bus_dma_tag_t		sc_dmatag;	/* DMA tag */
     82  1.1    someya 	u_int			sc_flags;
     83  1.1    someya 
     84  1.1    someya 	struct autri_codec_softc sc_codec;
     85  1.1    someya 	struct autri_dma	*sc_dmas;	/* List of DMA handles */
     86  1.1    someya 
     87  1.1    someya 	u_int32_t		sc_class;
     88  1.1    someya 	int			sc_revision;
     89  1.2  augustss 
     90  1.1    someya 	/*
     91  1.1    someya 	 * Play/record status
     92  1.1    someya 	 */
     93  1.1    someya 	struct autri_chstatus	sc_play, sc_rec;
     94  1.1    someya 
     95  1.1    someya #if NMIDI > 0
     96  1.1    someya 	void	(*sc_iintr)(void *, int);	/* midi input ready handler */
     97  1.1    someya 	void	(*sc_ointr)(void *);		/* midi output ready handler */
     98  1.1    someya 	void	*sc_arg;
     99  1.1    someya #endif
    100  1.1    someya 
    101  1.1    someya };
    102  1.1    someya 
    103  1.1    someya #endif /* _DEV_PCI_AUTRIVAR_H_ */
    104  1.1    someya 
    105