1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #ifndef _DEV_TABLE_H_
33 #define _DEV_TABLE_H_
34
35
36
37
38
39
40
41
42
43 struct card_info {
44 int card_type;
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
53
54 struct generic_midi_info{
55 char *name;
56 long (*attach) (long mem_start);
57 };
58
59 struct audio_operations {
60 char name[32];
61 int (*open) (int dev, int mode);
62 void (*close) (int dev);
63 void (*output_block) (int dev, unsigned long buf,
64 int count, int intrflag, int dma_restart);
65 void (*start_input) (int dev, unsigned long buf,
66 int count, int intrflag, int dma_restart);
67 int (*ioctl) (int dev, unsigned int cmd, unsigned int arg, int local);
68 int (*prepare_for_input) (int dev, int bufsize, int nbufs);
69 int (*prepare_for_output) (int dev, int bufsize, int nbufs);
70 void (*reset) (int dev);
71 void (*halt_xfer) (int dev);
72 int (*has_output_drained)(int dev);
73 void (*copy_from_user)(int dev, char *localbuf, int localoffs,
74 snd_rw_buf *userbuf, int useroffs, int len);
75 };
76
77 struct mixer_operations {
78 int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
79 };
80
81 struct synth_operations {
82 struct synth_info *info;
83 int synth_type;
84 int synth_subtype;
85
86 int (*open) (int dev, int mode);
87 void (*close) (int dev);
88 int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
89 int (*kill_note) (int dev, int voice, int velocity);
90 int (*start_note) (int dev, int voice, int note, int velocity);
91 int (*set_instr) (int dev, int voice, int instr);
92 void (*reset) (int dev);
93 void (*hw_control) (int dev, unsigned char *event);
94 int (*load_patch) (int dev, int format, snd_rw_buf *addr,
95 int offs, int count, int pmgr_flag);
96 void (*aftertouch) (int dev, int voice, int pressure);
97 void (*controller) (int dev, int voice, int ctrl_num, int value);
98 void (*panning) (int dev, int voice, int value);
99 int (*pmgr_interface) (int dev, struct patmgr_info *info);
100 };
101
102 struct midi_operations {
103 struct midi_info info;
104 int (*open) (int dev, int mode,
105 void (*inputintr)(int dev, unsigned char data),
106 void (*outputintr)(int dev)
107 );
108 void (*close) (int dev);
109 int (*ioctl) (int dev, unsigned int cmd, unsigned int arg);
110 int (*putc) (int dev, unsigned char data);
111 int (*start_read) (int dev);
112 int (*end_read) (int dev);
113 void (*kick)(int dev);
114 int (*command) (int dev, unsigned char data);
115 int (*buffer_status) (int dev);
116 };
117
118
119
120 struct generic_midi_operations {
121 struct midi_info info;
122 int (*open) (int dev, int mode);
123 void (*close) (int dev);
124 int (*write) (int dev, snd_rw_buf *data);
125 int (*read) (int dev, snd_rw_buf *data);
126 };
127
128 #ifndef ALL_EXTERNAL_TO_ME
129
130 #ifdef _MIDI_TABLE_C_
131
132
133 struct generic_midi_operations * generic_midi_devs[MAX_MIDI_DEV] = {NULL};
134 int num_generic_midis = 0, pro_midi_dev = 0;
135
136 struct generic_midi_info midi_supported[] = {
137
138 #ifndef EXCLUDE_PRO_MIDI
139 {"ProAudioSpectrum MV101",pro_midi_attach}
140 #endif
141 };
142
143 int num_midi_drivers =
144 sizeof (midi_supported) / sizeof(struct generic_midi_info);
145
146 #endif
147
148
149 #ifdef _DEV_TABLE_C_
150 struct audio_operations * dsp_devs[MAX_DSP_DEV] = {NULL}; int num_dspdevs = 0;
151 struct mixer_operations * mixer_devs[MAX_MIXER_DEV] = {NULL}; int num_mixers = 0;
152 struct synth_operations * synth_devs[MAX_SYNTH_DEV] = {NULL}; int num_synths = 0;
153 struct midi_operations * midi_devs[MAX_MIDI_DEV] = {NULL}; int num_midis = 0;
154
155
156 # ifndef EXCLUDE_MPU401
157 int mpu401_dev = 0;
158 # endif
159
160
161
162
163
164 struct card_info supported_drivers[] = {
165 #if !defined(EXCLUDE_MPU401) && !defined(EXCLUDE_MIDI)
166 {SNDCARD_MPU401,"Roland MPU-401", attach_mpu401, probe_mpu401,
167 {MPU_BASE, MPU_IRQ, 0}, SND_DEFAULT_ENABLE},
168 #endif
169
170 #ifndef EXCLUDE_GUS
171 {SNDCARD_GUS, "Gravis Ultrasound", attach_gus_card, probe_gus,
172 {GUS_BASE, GUS_IRQ, GUS_DMA}, SND_DEFAULT_ENABLE},
173 #endif
174
175 #ifndef EXCLUDE_PAS
176 {SNDCARD_PAS, "ProAudioSpectrum", attach_pas_card, probe_pas,
177 {PAS_BASE, PAS_IRQ, PAS_DMA}, SND_DEFAULT_ENABLE},
178 #endif
179
180 #ifndef EXCLUDE_SB
181 {SNDCARD_SB, "SoundBlaster", attach_sb_card, probe_sb,
182 {SBC_BASE, SBC_IRQ, SBC_DMA}, SND_DEFAULT_ENABLE},
183 #endif
184
185 #if !defined(EXCLUDE_SB) && !defined(EXCLUDE_SB16)
186 #ifndef EXCLUDE_AUDIO
187 {SNDCARD_SB16, "SoundBlaster16", sb16_dsp_init, sb16_dsp_detect,
188 {SBC_BASE, SBC_IRQ, SB16_DMA}, SND_DEFAULT_ENABLE},
189 #endif
190 #ifndef EXCLUDE_MIDI
191 {SNDCARD_SB16MIDI,"SB16 MPU-401", attach_sb16midi, probe_sb16midi,
192 {SB16MIDI_BASE, SBC_IRQ, 0}, SND_DEFAULT_ENABLE},
193 #endif
194 #endif
195
196 #ifndef EXCLUDE_YM3812
197 {SNDCARD_ADLIB, "AdLib", attach_adlib_card, probe_adlib,
198 {FM_MONO, 0, 0}, SND_DEFAULT_ENABLE},
199 #endif
200 {0, "*?*", NULL, 0}
201 };
202
203 int num_sound_drivers =
204 sizeof(supported_drivers) / sizeof (struct card_info);
205
206
207 # ifndef EXCLUDE_AUDIO
208 int sound_buffcounts[MAX_DSP_DEV] = {0};
209 long sound_buffsizes[MAX_DSP_DEV] = {0};
210 int sound_dsp_dmachan[MAX_DSP_DEV] = {0};
211 int sound_dma_automode[MAX_DSP_DEV] = {0};
212 # endif
213 #else
214 extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
215 extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
216 extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
217 extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
218 # ifndef EXCLUDE_MPU401
219 extern int mpu401_dev;
220 # endif
221
222 extern struct card_info supported_drivers[];
223 extern int num_sound_drivers;
224
225 # ifndef EXCLUDE_AUDIO
226 extern int sound_buffcounts[MAX_DSP_DEV];
227 extern long sound_buffsizes[MAX_DSP_DEV];
228 extern int sound_dsp_dmachan[MAX_DSP_DEV];
229 extern int sound_dma_automode[MAX_DSP_DEV];
230 # endif
231
232 #endif
233
234 long sndtable_init(long mem_start);
235 int sndtable_get_cardcount (void);
236 long CMIDI_init(long mem_start);
237 struct address_info *sound_getconf(int card_type);
238 void sound_chconf(int card_type, int ioaddr, int irq, int dma);
239 #endif
240
241 #endif
242
243
244
245 #ifdef ALL_EXTERNAL_TO_ME
246
247 extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
248 extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
249 extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
250 extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
251 extern struct generic_midi_operations *generic_midi_devs[];
252 extern int num_generic_midis, pro_midi_dev;
253
254 #ifndef EXCLUDE_MPU401
255 extern int mpu401_dev;
256 #endif
257
258 extern struct generic_midi_info midi_supported[];
259 extern struct card_info supported_drivers[];
260 extern int num_sound_drivers;
261 extern int num_midi_drivers;
262 #ifndef EXCLUDE_AUDIO
263 extern int sound_buffcounts[MAX_DSP_DEV];
264 extern long sound_buffsizes[MAX_DSP_DEV];
265 extern int sound_dsp_dmachan[MAX_DSP_DEV];
266 extern int sound_dma_automode[MAX_DSP_DEV];
267 #endif
268
269 #endif