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) && !defined(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
190 #ifndef EXCLUDE_YM3812
191 {SNDCARD_ADLIB, "AdLib", attach_adlib_card, probe_adlib,
192 {FM_MONO, 0, 0}, SND_DEFAULT_ENABLE},
193 #endif
194 {0, "*?*", NULL, 0}
195 };
196
197 int num_sound_drivers =
198 sizeof(supported_drivers) / sizeof (struct card_info);
199
200
201 # ifndef EXCLUDE_AUDIO
202 int sound_buffcounts[MAX_DSP_DEV] = {0};
203 long sound_buffsizes[MAX_DSP_DEV] = {0};
204 int sound_dsp_dmachan[MAX_DSP_DEV] = {0};
205 int sound_dma_automode[MAX_DSP_DEV] = {0};
206 # endif
207 #else
208 extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
209 extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
210 extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
211 extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
212 # ifndef EXCLUDE_MPU401
213 extern int mpu401_dev;
214 # endif
215
216 extern struct card_info supported_drivers[];
217 extern int num_sound_drivers;
218
219 # ifndef EXCLUDE_AUDIO
220 extern int sound_buffcounts[MAX_DSP_DEV];
221 extern long sound_buffsizes[MAX_DSP_DEV];
222 extern int sound_dsp_dmachan[MAX_DSP_DEV];
223 extern int sound_dma_automode[MAX_DSP_DEV];
224 # endif
225
226 #endif
227
228 long sndtable_init(long mem_start);
229 int sndtable_get_cardcount (void);
230 long CMIDI_init(long mem_start);
231 struct address_info *sound_getconf(int card_type);
232 #endif
233
234 #endif
235
236
237
238 #ifdef ALL_EXTERNAL_TO_ME
239
240 extern struct audio_operations * dsp_devs[MAX_DSP_DEV]; int num_dspdevs;
241 extern struct mixer_operations * mixer_devs[MAX_MIXER_DEV]; extern int num_mixers;
242 extern struct synth_operations * synth_devs[MAX_SYNTH_DEV]; extern int num_synths;
243 extern struct midi_operations * midi_devs[MAX_MIDI_DEV]; extern int num_midis;
244 extern struct generic_midi_operations *generic_midi_devs[];
245 extern int num_generic_midis, pro_midi_dev;
246
247 #ifndef EXCLUDE_MPU401
248 extern int mpu401_dev;
249 #endif
250
251 extern struct generic_midi_info midi_supported[];
252 extern struct card_info supported_drivers[];
253 extern int num_sound_drivers;
254 extern int num_midi_drivers;
255 #ifndef EXCLUDE_AUDIO
256 extern int sound_buffcounts[MAX_DSP_DEV];
257 extern long sound_buffsizes[MAX_DSP_DEV];
258 extern int sound_dsp_dmachan[MAX_DSP_DEV];
259 extern int sound_dma_automode[MAX_DSP_DEV];
260 #endif
261
262 #endif