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 };
  50 
  51 /** UWM -- new  MIDI structure here.. **/
  52 
  53 struct generic_midi_info{
  54         char *name;     /* Name of the MIDI device.. */
  55         long (*attach) (long mem_start);
  56 };
  57 
  58 struct audio_operations {
  59         char name[32];
  60         int (*open) (int dev, int mode);
  61         void (*close) (int dev);
  62         void (*output_block) (int dev, unsigned long buf, int count, int intrflag);
  63         void (*start_input) (int dev, unsigned long buf, int count, int intrflag);
  64         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg, int local);
  65         int (*prepare_for_input) (int dev, int bufsize, int nbufs);
  66         int (*prepare_for_output) (int dev, int bufsize, int nbufs);
  67         void (*reset) (int dev);
  68         void (*halt_xfer) (int dev);
  69         int (*has_output_drained)(int dev);
  70         void (*copy_from_user)(int dev, char *localbuf, int localoffs,
  71                                snd_rw_buf *userbuf, int useroffs, int len);
  72 };
  73 
  74 struct mixer_operations {
  75         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
  76 };
  77 
  78 struct synth_operations {
  79         struct synth_info *info;
  80         int synth_type;
  81         int synth_subtype;
  82 
  83         int (*open) (int dev, int mode);
  84         void (*close) (int dev);
  85         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
  86         int (*kill_note) (int dev, int voice, int velocity);
  87         int (*start_note) (int dev, int voice, int note, int velocity);
  88         int (*set_instr) (int dev, int voice, int instr);
  89         void (*reset) (int dev);
  90         void (*hw_control) (int dev, unsigned char *event);
  91         int (*load_patch) (int dev, int format, snd_rw_buf *addr,
  92              int offs, int count, int pmgr_flag);
  93         void (*aftertouch) (int dev, int voice, int pressure);
  94         void (*controller) (int dev, int voice, int ctrl_num, int value);
  95         void (*panning) (int dev, int voice, int value);
  96         int (*pmgr_interface) (int dev, struct patmgr_info *info);
  97 };
  98 
  99 struct midi_operations {
 100         struct midi_info info;
 101         int (*open) (int dev, int mode,
 102                 void (*inputintr)(int dev, unsigned char data),
 103                 void (*outputintr)(int dev)
 104                 );
 105         void (*close) (int dev);
 106         int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
 107         int (*putc) (int dev, unsigned char data);
 108         int (*start_read) (int dev);
 109         int (*end_read) (int dev);
 110         void (*kick)(int dev);
 111         int (*command) (int dev, unsigned char data);
 112         int (*buffer_status) (int dev);
 113 };
 114 
 115 /** UWM -- new structure for MIDI  **/
 116 
 117 struct generic_midi_operations {
 118         struct midi_info info;
 119         int (*open) (int dev, int mode);
 120         void (*close) (int dev);
 121         int (*write) (int dev, snd_rw_buf *data);
 122         int (*read)  (int dev, snd_rw_buf *data);
 123 };      
 124 
 125 #ifndef ALL_EXTERNAL_TO_ME
 126 
 127 #ifdef _MIDI_TABLE_C_
 128 
 129 /** UWM **/
 130        struct generic_midi_operations * generic_midi_devs[MAX_MIDI_DEV] = {NULL}; 
 131        int num_generic_midis = 0, pro_midi_dev = 0; 
 132 
 133       struct generic_midi_info midi_supported[] = {
 134 
 135 #ifndef EXCLUDE_PRO_MIDI
 136         {"ProAudioSpectrum MV101",pro_midi_attach}
 137 #endif
 138         }; 
 139 
 140         int num_midi_drivers = 
 141             sizeof (midi_supported) / sizeof(struct generic_midi_info);
 142 
 143 #endif
 144 
 145 
 146 #ifdef _DEV_TABLE_C_   
 147         struct audio_operations * dsp_devs[MAX_DSP_DEV] = {NULL}; int num_dspdevs = 0;
 148         struct mixer_operations * mixer_devs[MAX_MIXER_DEV] = {NULL}; int num_mixers = 0;
 149         struct synth_operations * synth_devs[MAX_SYNTH_DEV] = {NULL}; int num_synths = 0;
 150         struct midi_operations * midi_devs[MAX_MIDI_DEV] = {NULL}; int num_midis = 0;
 151 
 152 
 153 #   ifndef EXCLUDE_MPU401
 154         int mpu401_dev = 0;
 155 #   endif
 156 
 157 /*
 158  *      Note! The detection order is significant. Don't change it.
 159  */
 160 
 161         struct card_info supported_drivers[] = {
 162 #ifndef EXCLUDE_MPU401
 163                 {SNDCARD_MPU401,"Roland MPU-401",       attach_mpu401, probe_mpu401,
 164                         {MPU_BASE, MPU_IRQ, 0}},
 165 #endif
 166 
 167 #ifndef EXCLUDE_GUS
 168                 {SNDCARD_GUS,   "Gravis Ultrasound",    attach_gus_card, probe_gus,
 169                         {GUS_BASE, GUS_IRQ, GUS_DMA}},
 170 #endif
 171 
 172 #ifndef EXCLUDE_PAS
 173                 {SNDCARD_PAS,   "ProAudioSpectrum",     attach_pas_card, probe_pas,
 174                         {PAS_BASE, PAS_IRQ, PAS_DMA}},
 175 #endif
 176 
 177 #ifndef EXCLUDE_SB
 178                 {SNDCARD_SB,    "SoundBlaster",         attach_sb_card, probe_sb,
 179                         {SBC_BASE, SBC_IRQ, SBC_DMA}},
 180 #endif
 181 
 182 #ifndef EXCLUDE_YM3812
 183                 {SNDCARD_ADLIB, "AdLib",                attach_adlib_card, probe_adlib,
 184                         {FM_MONO, 0, 0}},
 185 #endif
 186                 {0,                     "*?*",                  NULL}
 187         };
 188 
 189         int num_sound_drivers =
 190             sizeof(supported_drivers) / sizeof (struct card_info);
 191 
 192 
 193 # ifndef EXCLUDE_AUDIO 
 194         int sound_buffcounts[MAX_DSP_DEV] = {0};
 195         long sound_buffsizes[MAX_DSP_DEV] = {0};
 196         int sound_dsp_dmachan[MAX_DSP_DEV] = {0};
 197         int sound_dma_automode[MAX_DSP_DEV] = {0};
 198 # endif
 199 #else
 200         extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
 201         extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
 202         extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
 203         extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
 204 #   ifndef EXCLUDE_MPU401
 205         extern int mpu401_dev;
 206 #   endif
 207 
 208         extern struct card_info supported_drivers[];
 209         extern int num_sound_drivers;
 210 
 211 # ifndef EXCLUDE_AUDIO
 212         extern int sound_buffcounts[MAX_DSP_DEV];
 213         extern long sound_buffsizes[MAX_DSP_DEV];
 214         extern int sound_dsp_dmachan[MAX_DSP_DEV];
 215         extern int sound_dma_automode[MAX_DSP_DEV];
 216 # endif
 217 
 218 #endif
 219 
 220 long sndtable_init(long mem_start);
 221 int sndtable_get_cardcount (void);
 222 long CMIDI_init(long mem_start); /* */
 223 #endif
 224 
 225 #endif
 226 
 227 /* If external to me.... :) */
 228 
 229 #ifdef ALL_EXTERNAL_TO_ME
 230 
 231         extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
 232         extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
 233         extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
 234         extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
 235         extern struct generic_midi_operations *generic_midi_devs[]; 
 236         extern int num_generic_midis, pro_midi_dev;
 237  
 238 #ifndef EXCLUDE_MPU401
 239         extern int mpu401_dev;
 240 #endif
 241 
 242         extern struct generic_midi_info midi_supported[];
 243         extern struct card_info supported_drivers[];
 244         extern int num_sound_drivers;
 245         extern int num_midi_drivers;    
 246 #ifndef EXCLUDE_AUDIO
 247         extern int sound_buffcounts[MAX_DSP_DEV];
 248         extern long sound_buffsizes[MAX_DSP_DEV];
 249         extern int sound_dsp_dmachan[MAX_DSP_DEV];
 250         extern int sound_dma_automode[MAX_DSP_DEV];
 251 #endif
 252 
 253 #endif

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