The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/pci/esavar.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* $NetBSD: esavar.h,v 1.4 2002/03/16 14:34:01 jmcneill Exp $ */
    2 
    3 /*
    4  * Copyright (c) 2001, 2002 Jared D. McNeill <jmcneill@invisible.yi.org>
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. The name of the author may not be used to endorse or promote products
   13  *    derived from this software without specific prior written permission.
   14  *
   15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   20  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
   22  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   23  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   25  * SUCH DAMAGE.
   26  */
   27 
   28 /*
   29  * ESS Allegro-1 / Maestro3 Audio Driver
   30  * 
   31  * Based on the FreeBSD maestro3 driver
   32  *
   33  */
   34 
   35 /*
   36  * Number of simultaneous voices
   37  *
   38  * NOTE: The current code attaches audio0 thru audioESA_NUM_VOICES-1
   39  *       to this driver, and a lot of people probably don't want that.
   40  *       So, we'll default to 1 but we'll allow for the possibility of
   41  *       more.
   42  *
   43  * The current MINISRC image limits us to a maximum of 4 simultaneous voices.
   44  */
   45 #ifndef ESA_NUM_VOICES
   46 #define ESA_NUM_VOICES          1
   47 #endif
   48 
   49 #define KERNADDR(p)     ((void *)((p)->addr))
   50 #define DMAADDR(p)      ((p)->map->dm_segs[0].ds_addr)
   51 
   52 #define ESA_MINRATE     8000
   53 #define ESA_MAXRATE     48000
   54 
   55 struct esa_list {
   56         int                     currlen;
   57         int                     mem_addr;
   58         int                     max;
   59         int                     indexmap[ESA_NUM_VOICES * 2];
   60 };
   61 
   62 struct esa_dma {
   63         bus_dmamap_t            map;
   64         caddr_t                 addr;
   65         bus_dma_segment_t       segs[1];
   66         int                     nsegs;
   67         size_t                  size;
   68         struct esa_dma          *next;
   69 };
   70 
   71 struct esa_channel {
   72         int                     active;
   73         int                     data_offset;
   74         int                     index;
   75         size_t                  bufsize;
   76         int                     blksize;
   77         int                     pos;
   78         void                    *buf;
   79         u_int32_t               start;
   80         u_int32_t               count;
   81 
   82         /* mode settings */
   83         struct audio_params     mode;
   84         
   85         void                    (*intr)(void *);
   86         void                    *arg;
   87 };
   88 
   89 struct esa_voice {
   90         struct device           *parent;        /* pointer to our parent */
   91         struct esa_channel      play;
   92         struct esa_channel      rec;
   93         struct esa_dma          *dma;
   94         int                     inlist;
   95         int                     index;  /* 0: play, 1: record */
   96 };
   97 
   98 struct esa_softc
   99 {
  100         struct device           sc_dev;
  101         bus_space_tag_t         sc_iot;
  102         bus_space_handle_t      sc_ioh;
  103         bus_addr_t              sc_iob;
  104         bus_size_t              sc_ios;
  105 
  106         pcitag_t                sc_tag;
  107         pci_chipset_tag_t       sc_pct;
  108         bus_dma_tag_t           sc_dmat;
  109         pcireg_t                sc_pcireg;
  110 
  111         void                    *sc_ih;
  112 
  113         struct ac97_codec_if    *codec_if;
  114         struct ac97_host_if     host_if;
  115         enum ac97_host_flags    codec_flags;
  116 
  117         struct device           *sc_audiodev[ESA_NUM_VOICES];
  118 
  119         struct esa_voice        voice[ESA_NUM_VOICES];
  120         struct esa_dma          *sc_dmas;
  121         int                     count;
  122 
  123         /* timer management */
  124         int                     sc_ntimers;
  125 
  126         /* packed list structures */
  127         struct esa_list         mixer_list;
  128         struct esa_list         adc1_list;
  129         struct esa_list         dma_list;
  130         struct esa_list         msrc_list;
  131 
  132         int                     type;           /* Allegro-1 or Maestro 3? */
  133         int                     delay1, delay2;
  134 
  135         void                    *powerhook;
  136         u_int16_t               *savemem;
  137 };

Cache object: 29ce686129f29b67bc860e012a3da3a8


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.