root/drivers/sound/dev_table.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  *      dev_table.h
   3  *
   4  *      Global definitions for device call tables
   5  * 
   6  * Copyright by Hannu Savolainen 1993
   7  *
   8  * Redistribution and use in source and binary forms, with or without
   9  * modification, are permitted provided that the following conditions
  10  * are met:
  11  * 1. Redistributions of source code must retain the above copyright
  12  *    notice, this list of conditions and the following disclaimer.
  13  * 2. Redistributions in binary form must reproduce the above copyright
  14  *    notice, this list of conditions and the following disclaimer in the
  15  *    documentation and/or other materials provided with the distribution.
  16  *
  17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27  * SUCH DAMAGE.
  28  *
  29 
  30 */
  31 
  32 #ifndef _DEV_TABLE_H_
  33 #define _DEV_TABLE_H_
  34 
  35 /*
  36  *      NOTE!   NOTE!   NOTE!   NOTE!
  37  *
  38  *      If you modify this file, please check the dev_table.c also.
  39  *
  40  *      NOTE!   NOTE!   NOTE!   NOTE!
  41  */
  42 
  43 struct card_info {
  44         int card_type;  /*      From soundcard.c        */
  45         char *name;
  46         long (*attach) (long mem_start, struct address_info *hw_config);
  47         int (*probe) (struct address_info *hw_config);
  48         struct address_info config;
  49         int enabled;
  50 };
  51 
  52 /** UWM -- new  MIDI structure here.. **/
  53 
  54 struct generic_midi_info{
  55         char *name;     /* Name of the MIDI device.. */
  56         long (*attach) (long mem_start);
  57 };
  58 
  59 struct audio_operations {
  60         char name[32];
  61         int flags;
  62 #define NOTHING_SPECIAL         0
  63 #define NEEDS_RESTART           1
  64         int (*open) (int dev, int mode);
  65         void (*close) (int dev);
  66         void (*output_block) (int dev, unsigned long buf, 
  67                               int count, int intrflag, int dma_restart);
  68         void (*start_input) (int dev, unsigned long buf, 
  69                              int count, int intrflag, int dma_restart);
  70         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg, int local);
  71         int (*prepare_for_input) (int dev, int bufsize, int nbufs);
  72         int (*prepare_for_output) (int dev, int bufsize, int nbufs);
  73         void (*reset) (int dev);
  74         void (*halt_xfer) (int dev);
  75         int (*has_output_drained)(int dev);
  76         void (*copy_from_user)(int dev, char *localbuf, int localoffs,
  77                                snd_rw_buf *userbuf, int useroffs, int len);
  78 };
  79 
  80 struct mixer_operations {
  81         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
  82 };
  83 
  84 struct synth_operations {
  85         struct synth_info *info;
  86         int synth_type;
  87         int synth_subtype;
  88 
  89         int (*open) (int dev, int mode);
  90         void (*close) (int dev);
  91         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
  92         int (*kill_note) (int dev, int voice, int velocity);
  93         int (*start_note) (int dev, int voice, int note, int velocity);
  94         int (*set_instr) (int dev, int voice, int instr);
  95         void (*reset) (int dev);
  96         void (*hw_control) (int dev, unsigned char *event);
  97         int (*load_patch) (int dev, int format, snd_rw_buf *addr,
  98              int offs, int count, int pmgr_flag);
  99         void (*aftertouch) (int dev, int voice, int pressure);
 100         void (*controller) (int dev, int voice, int ctrl_num, int value);
 101         void (*panning) (int dev, int voice, int value);
 102         void (*volume_method) (int dev, int mode);
 103         int (*pmgr_interface) (int dev, struct patmgr_info *info);
 104 };
 105 
 106 struct midi_operations {
 107         struct midi_info info;
 108         int (*open) (int dev, int mode,
 109                 void (*inputintr)(int dev, unsigned char data),
 110                 void (*outputintr)(int dev)
 111                 );
 112         void (*close) (int dev);
 113         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
 114         int (*putc) (int dev, unsigned char data);
 115         int (*start_read) (int dev);
 116         int (*end_read) (int dev);
 117         void (*kick)(int dev);
 118         int (*command) (int dev, unsigned char data);
 119         int (*buffer_status) (int dev);
 120 };
 121 
 122 /** UWM -- new structure for MIDI  **/
 123 
 124 struct generic_midi_operations {
 125         struct midi_info info;
 126         int (*open) (int dev, int mode);
 127         void (*close) (int dev);
 128         int (*write) (int dev, snd_rw_buf *data);
 129         int (*read)  (int dev, snd_rw_buf *data);
 130 };      
 131 
 132 #ifndef ALL_EXTERNAL_TO_ME
 133 
 134 #ifdef _MIDI_TABLE_C_
 135 
 136 /** UWM **/
 137        struct generic_midi_operations * generic_midi_devs[MAX_MIDI_DEV] = {NULL}; 
 138        int num_generic_midis = 0, pro_midi_dev = 0; 
 139 
 140       struct generic_midi_info midi_supported[] = {
 141 
 142 #ifndef EXCLUDE_PRO_MIDI
 143         {"ProAudioSpectrum MV101",pro_midi_attach}
 144 #endif
 145         }; 
 146 
 147         int num_midi_drivers = 
 148             sizeof (midi_supported) / sizeof(struct generic_midi_info);
 149 
 150 #endif
 151 
 152 
 153 #ifdef _DEV_TABLE_C_   
 154         struct audio_operations * dsp_devs[MAX_DSP_DEV] = {NULL}; int num_dspdevs = 0;
 155         struct mixer_operations * mixer_devs[MAX_MIXER_DEV] = {NULL}; int num_mixers = 0;
 156         struct synth_operations * synth_devs[MAX_SYNTH_DEV] = {NULL}; int num_synths = 0;
 157         struct midi_operations * midi_devs[MAX_MIDI_DEV] = {NULL}; int num_midis = 0;
 158 
 159 
 160 #   ifndef EXCLUDE_MPU401
 161         int mpu401_dev = 0;
 162 #   endif
 163 
 164 /*
 165  *      Note! The detection order is significant. Don't change it.
 166  */
 167 
 168         struct card_info supported_drivers[] = {
 169 #if !defined(EXCLUDE_MPU401) && !defined(EXCLUDE_MIDI)
 170                 {SNDCARD_MPU401,"Roland MPU-401",       attach_mpu401, probe_mpu401,
 171                         {MPU_BASE, MPU_IRQ, 0}, SND_DEFAULT_ENABLE},
 172 #endif
 173 
 174 #ifndef EXCLUDE_PAS
 175                 {SNDCARD_PAS,   "ProAudioSpectrum",     attach_pas_card, probe_pas,
 176                         {PAS_BASE, PAS_IRQ, PAS_DMA}, SND_DEFAULT_ENABLE},
 177 #endif
 178 
 179 #ifndef EXCLUDE_SB
 180                 {SNDCARD_SB,    "SoundBlaster",         attach_sb_card, probe_sb,
 181                         {SBC_BASE, SBC_IRQ, SBC_DMA}, SND_DEFAULT_ENABLE},
 182 #endif
 183 
 184 #if !defined(EXCLUDE_SB) && !defined(EXCLUDE_SB16) && !defined(EXCLUDE_SBPRO)
 185 #ifndef EXCLUDE_AUDIO
 186                 {SNDCARD_SB16,  "SoundBlaster16",       sb16_dsp_init, sb16_dsp_detect,
 187                         {SBC_BASE, SBC_IRQ, SB16_DMA}, SND_DEFAULT_ENABLE},
 188 #endif
 189 #ifndef EXCLUDE_MIDI
 190                 {SNDCARD_SB16MIDI,"SB16 MPU-401",       attach_sb16midi, probe_sb16midi,
 191                         {SB16MIDI_BASE, SBC_IRQ, 0}, SND_DEFAULT_ENABLE},
 192 #endif
 193 #endif
 194 
 195 #ifndef EXCLUDE_GUS
 196                 {SNDCARD_GUS,   "Gravis Ultrasound",    attach_gus_card, probe_gus,
 197                         {GUS_BASE, GUS_IRQ, GUS_DMA}, SND_DEFAULT_ENABLE},
 198 #endif
 199 
 200 #ifndef EXCLUDE_YM3812
 201                 {SNDCARD_ADLIB, "AdLib",                attach_adlib_card, probe_adlib,
 202                         {FM_MONO, 0, 0}, SND_DEFAULT_ENABLE},
 203 #endif
 204                 {0,                     "*?*",                  NULL, 0}
 205         };
 206 
 207         int num_sound_drivers =
 208             sizeof(supported_drivers) / sizeof (struct card_info);
 209 
 210 
 211 # ifndef EXCLUDE_AUDIO 
 212         int sound_buffcounts[MAX_DSP_DEV] = {0};
 213         long sound_buffsizes[MAX_DSP_DEV] = {0};
 214         int sound_dsp_dmachan[MAX_DSP_DEV] = {0};
 215         int sound_dma_automode[MAX_DSP_DEV] = {0};
 216 # endif
 217 #else
 218         extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
 219         extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
 220         extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
 221         extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
 222 #   ifndef EXCLUDE_MPU401
 223         extern int mpu401_dev;
 224 #   endif
 225 
 226         extern struct card_info supported_drivers[];
 227         extern int num_sound_drivers;
 228 
 229 # ifndef EXCLUDE_AUDIO
 230         extern int sound_buffcounts[MAX_DSP_DEV];
 231         extern long sound_buffsizes[MAX_DSP_DEV];
 232         extern int sound_dsp_dmachan[MAX_DSP_DEV];
 233         extern int sound_dma_automode[MAX_DSP_DEV];
 234 # endif
 235 
 236 #endif
 237 
 238 long sndtable_init(long mem_start);
 239 int sndtable_get_cardcount (void);
 240 long CMIDI_init(long mem_start); /* */
 241 struct address_info *sound_getconf(int card_type);
 242 void sound_chconf(int card_type, int ioaddr, int irq, int dma);
 243 #endif
 244 
 245 #endif
 246 
 247 /* If external to me.... :) */
 248 
 249 #ifdef ALL_EXTERNAL_TO_ME
 250 
 251         extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
 252         extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
 253         extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
 254         extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
 255         extern struct generic_midi_operations *generic_midi_devs[]; 
 256         extern int num_generic_midis, pro_midi_dev;
 257  
 258 #ifndef EXCLUDE_MPU401
 259         extern int mpu401_dev;
 260 #endif
 261 
 262         extern struct generic_midi_info midi_supported[];
 263         extern struct card_info supported_drivers[];
 264         extern int num_sound_drivers;
 265         extern int num_midi_drivers;    
 266 #ifndef EXCLUDE_AUDIO
 267         extern int sound_buffcounts[MAX_DSP_DEV];
 268         extern long sound_buffsizes[MAX_DSP_DEV];
 269         extern int sound_dsp_dmachan[MAX_DSP_DEV];
 270         extern int sound_dma_automode[MAX_DSP_DEV];
 271 #endif
 272 
 273 #endif

/* [previous][next][first][last][top][bottom][index][help] */