aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:04:02 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:17:52 -0500
commitc7e0b5bf9fff1b726495081447c107a2333fb82c (patch)
treef4d9ec9a6446f8e2afde4c94e10a39f2b86a0bc9 /include/sound
parent6ac77bc180fbd985988015020c2e2347e802959d (diff)
[ALSA] Remove xxx_t typedefs: Sequencer
Modules: ALSA sequencer Remove xxx_t typedefs from the core sequencer codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/asequencer.h368
-rw-r--r--include/sound/seq_device.h18
-rw-r--r--include/sound/seq_instr.h64
-rw-r--r--include/sound/seq_kernel.h119
-rw-r--r--include/sound/seq_midi_emul.h44
-rw-r--r--include/sound/seq_midi_event.h22
-rw-r--r--include/sound/seq_virmidi.h22
7 files changed, 294 insertions, 363 deletions
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 562637b4884b..59485be05797 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -35,13 +35,13 @@
35 */ 35 */
36 36
37/** system messages 37/** system messages
38 * event data type = #sndrv_seq_result_t 38 * event data type = #snd_seq_result
39 */ 39 */
40#define SNDRV_SEQ_EVENT_SYSTEM 0 40#define SNDRV_SEQ_EVENT_SYSTEM 0
41#define SNDRV_SEQ_EVENT_RESULT 1 41#define SNDRV_SEQ_EVENT_RESULT 1
42 42
43/** note messages (channel specific) 43/** note messages (channel specific)
44 * event data type = #sndrv_seq_ev_note 44 * event data type = #snd_seq_ev_note
45 */ 45 */
46#define SNDRV_SEQ_EVENT_NOTE 5 46#define SNDRV_SEQ_EVENT_NOTE 5
47#define SNDRV_SEQ_EVENT_NOTEON 6 47#define SNDRV_SEQ_EVENT_NOTEON 6
@@ -49,7 +49,7 @@
49#define SNDRV_SEQ_EVENT_KEYPRESS 8 49#define SNDRV_SEQ_EVENT_KEYPRESS 8
50 50
51/** control messages (channel specific) 51/** control messages (channel specific)
52 * event data type = #sndrv_seq_ev_ctrl 52 * event data type = #snd_seq_ev_ctrl
53 */ 53 */
54#define SNDRV_SEQ_EVENT_CONTROLLER 10 54#define SNDRV_SEQ_EVENT_CONTROLLER 10
55#define SNDRV_SEQ_EVENT_PGMCHANGE 11 55#define SNDRV_SEQ_EVENT_PGMCHANGE 11
@@ -60,7 +60,7 @@
60#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */ 60#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
61 61
62/** synchronisation messages 62/** synchronisation messages
63 * event data type = #sndrv_seq_ev_ctrl 63 * event data type = #snd_seq_ev_ctrl
64 */ 64 */
65#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */ 65#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
66#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */ 66#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
@@ -69,7 +69,7 @@
69#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */ 69#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
70 70
71/** timer messages 71/** timer messages
72 * event data type = sndrv_seq_ev_queue_control_t 72 * event data type = snd_seq_ev_queue_control
73 */ 73 */
74#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */ 74#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
75#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */ 75#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
@@ -95,7 +95,7 @@
95#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */ 95#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
96 96
97/** system status messages (broadcast for subscribers) 97/** system status messages (broadcast for subscribers)
98 * event data type = sndrv_seq_addr_t 98 * event data type = snd_seq_addr
99 */ 99 */
100#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */ 100#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
101#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */ 101#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
@@ -105,13 +105,13 @@
105#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */ 105#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
106 106
107/** port connection changes 107/** port connection changes
108 * event data type = sndrv_seq_connect_t 108 * event data type = snd_seq_connect
109 */ 109 */
110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ 110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ 111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
112 112
113/** synthesizer events 113/** synthesizer events
114 * event data type = sndrv_seq_eve_sample_control_t 114 * event data type = snd_seq_eve_sample_control
115 */ 115 */
116#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */ 116#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */
117#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */ 117#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */
@@ -162,7 +162,7 @@
162/* 119-129: reserved */ 162/* 119-129: reserved */
163 163
164/* 130-139: variable length events 164/* 130-139: variable length events
165 * event data type = sndrv_seq_ev_ext 165 * event data type = snd_seq_ev_ext
166 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set) 166 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
167 */ 167 */
168#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */ 168#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
@@ -186,18 +186,18 @@
186#define SNDRV_SEQ_EVENT_NONE 255 186#define SNDRV_SEQ_EVENT_NONE 255
187 187
188 188
189typedef unsigned char sndrv_seq_event_type_t; 189typedef unsigned char snd_seq_event_type_t;
190 190
191/** event address */ 191/** event address */
192struct sndrv_seq_addr { 192struct snd_seq_addr {
193 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */ 193 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
194 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */ 194 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
195}; 195};
196 196
197/** port connection */ 197/** port connection */
198struct sndrv_seq_connect { 198struct snd_seq_connect {
199 struct sndrv_seq_addr sender; 199 struct snd_seq_addr sender;
200 struct sndrv_seq_addr dest; 200 struct snd_seq_addr dest;
201}; 201};
202 202
203 203
@@ -226,7 +226,7 @@ struct sndrv_seq_connect {
226 226
227 227
228 /* note event */ 228 /* note event */
229struct sndrv_seq_ev_note { 229struct snd_seq_ev_note {
230 unsigned char channel; 230 unsigned char channel;
231 unsigned char note; 231 unsigned char note;
232 unsigned char velocity; 232 unsigned char velocity;
@@ -235,7 +235,7 @@ struct sndrv_seq_ev_note {
235}; 235};
236 236
237 /* controller event */ 237 /* controller event */
238struct sndrv_seq_ev_ctrl { 238struct snd_seq_ev_ctrl {
239 unsigned char channel; 239 unsigned char channel;
240 unsigned char unused1, unused2, unused3; /* pad */ 240 unsigned char unused1, unused2, unused3; /* pad */
241 unsigned int param; 241 unsigned int param;
@@ -243,59 +243,59 @@ struct sndrv_seq_ev_ctrl {
243}; 243};
244 244
245 /* generic set of bytes (12x8 bit) */ 245 /* generic set of bytes (12x8 bit) */
246struct sndrv_seq_ev_raw8 { 246struct snd_seq_ev_raw8 {
247 unsigned char d[12]; /* 8 bit value */ 247 unsigned char d[12]; /* 8 bit value */
248}; 248};
249 249
250 /* generic set of integers (3x32 bit) */ 250 /* generic set of integers (3x32 bit) */
251struct sndrv_seq_ev_raw32 { 251struct snd_seq_ev_raw32 {
252 unsigned int d[3]; /* 32 bit value */ 252 unsigned int d[3]; /* 32 bit value */
253}; 253};
254 254
255 /* external stored data */ 255 /* external stored data */
256struct sndrv_seq_ev_ext { 256struct snd_seq_ev_ext {
257 unsigned int len; /* length of data */ 257 unsigned int len; /* length of data */
258 void *ptr; /* pointer to data (note: maybe 64-bit) */ 258 void *ptr; /* pointer to data (note: maybe 64-bit) */
259} __attribute__((packed)); 259} __attribute__((packed));
260 260
261/* Instrument cluster type */ 261/* Instrument cluster type */
262typedef unsigned int sndrv_seq_instr_cluster_t; 262typedef unsigned int snd_seq_instr_cluster_t;
263 263
264/* Instrument type */ 264/* Instrument type */
265struct sndrv_seq_instr { 265struct snd_seq_instr {
266 sndrv_seq_instr_cluster_t cluster; 266 snd_seq_instr_cluster_t cluster;
267 unsigned int std; /* the upper byte means a private instrument (owner - client #) */ 267 unsigned int std; /* the upper byte means a private instrument (owner - client #) */
268 unsigned short bank; 268 unsigned short bank;
269 unsigned short prg; 269 unsigned short prg;
270}; 270};
271 271
272 /* sample number */ 272 /* sample number */
273struct sndrv_seq_ev_sample { 273struct snd_seq_ev_sample {
274 unsigned int std; 274 unsigned int std;
275 unsigned short bank; 275 unsigned short bank;
276 unsigned short prg; 276 unsigned short prg;
277}; 277};
278 278
279 /* sample cluster */ 279 /* sample cluster */
280struct sndrv_seq_ev_cluster { 280struct snd_seq_ev_cluster {
281 sndrv_seq_instr_cluster_t cluster; 281 snd_seq_instr_cluster_t cluster;
282}; 282};
283 283
284 /* sample position */ 284 /* sample position */
285typedef unsigned int sndrv_seq_position_t; /* playback position (in samples) * 16 */ 285typedef unsigned int snd_seq_position_t; /* playback position (in samples) * 16 */
286 286
287 /* sample stop mode */ 287 /* sample stop mode */
288enum sndrv_seq_stop_mode { 288enum {
289 SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */ 289 SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */
290 SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */ 290 SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */
291 SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */ 291 SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */
292}; 292};
293 293
294 /* sample frequency */ 294 /* sample frequency */
295typedef int sndrv_seq_frequency_t; /* playback frequency in HZ * 16 */ 295typedef int snd_seq_frequency_t; /* playback frequency in HZ * 16 */
296 296
297 /* sample volume control; if any value is set to -1 == do not change */ 297 /* sample volume control; if any value is set to -1 == do not change */
298struct sndrv_seq_ev_volume { 298struct snd_seq_ev_volume {
299 signed short volume; /* range: 0-16383 */ 299 signed short volume; /* range: 0-16383 */
300 signed short lr; /* left-right balance; range: 0-16383 */ 300 signed short lr; /* left-right balance; range: 0-16383 */
301 signed short fr; /* front-rear balance; range: 0-16383 */ 301 signed short fr; /* front-rear balance; range: 0-16383 */
@@ -303,22 +303,22 @@ struct sndrv_seq_ev_volume {
303}; 303};
304 304
305 /* simple loop redefinition */ 305 /* simple loop redefinition */
306struct sndrv_seq_ev_loop { 306struct snd_seq_ev_loop {
307 unsigned int start; /* loop start (in samples) * 16 */ 307 unsigned int start; /* loop start (in samples) * 16 */
308 unsigned int end; /* loop end (in samples) * 16 */ 308 unsigned int end; /* loop end (in samples) * 16 */
309}; 309};
310 310
311struct sndrv_seq_ev_sample_control { 311struct snd_seq_ev_sample_control {
312 unsigned char channel; 312 unsigned char channel;
313 unsigned char unused1, unused2, unused3; /* pad */ 313 unsigned char unused1, unused2, unused3; /* pad */
314 union { 314 union {
315 struct sndrv_seq_ev_sample sample; 315 struct snd_seq_ev_sample sample;
316 struct sndrv_seq_ev_cluster cluster; 316 struct snd_seq_ev_cluster cluster;
317 sndrv_seq_position_t position; 317 snd_seq_position_t position;
318 enum sndrv_seq_stop_mode stop_mode; 318 int stop_mode;
319 sndrv_seq_frequency_t frequency; 319 snd_seq_frequency_t frequency;
320 struct sndrv_seq_ev_volume volume; 320 struct snd_seq_ev_volume volume;
321 struct sndrv_seq_ev_loop loop; 321 struct snd_seq_ev_loop loop;
322 unsigned char raw8[8]; 322 unsigned char raw8[8];
323 } param; 323 } param;
324}; 324};
@@ -326,82 +326,82 @@ struct sndrv_seq_ev_sample_control {
326 326
327 327
328/* INSTR_BEGIN event */ 328/* INSTR_BEGIN event */
329struct sndrv_seq_ev_instr_begin { 329struct snd_seq_ev_instr_begin {
330 int timeout; /* zero = forever, otherwise timeout in ms */ 330 int timeout; /* zero = forever, otherwise timeout in ms */
331}; 331};
332 332
333struct sndrv_seq_result { 333struct snd_seq_result {
334 int event; /* processed event type */ 334 int event; /* processed event type */
335 int result; 335 int result;
336}; 336};
337 337
338 338
339struct sndrv_seq_real_time { 339struct snd_seq_real_time {
340 unsigned int tv_sec; /* seconds */ 340 unsigned int tv_sec; /* seconds */
341 unsigned int tv_nsec; /* nanoseconds */ 341 unsigned int tv_nsec; /* nanoseconds */
342}; 342};
343 343
344typedef unsigned int sndrv_seq_tick_time_t; /* midi ticks */ 344typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
345 345
346union sndrv_seq_timestamp { 346union snd_seq_timestamp {
347 sndrv_seq_tick_time_t tick; 347 snd_seq_tick_time_t tick;
348 struct sndrv_seq_real_time time; 348 struct snd_seq_real_time time;
349}; 349};
350 350
351struct sndrv_seq_queue_skew { 351struct snd_seq_queue_skew {
352 unsigned int value; 352 unsigned int value;
353 unsigned int base; 353 unsigned int base;
354}; 354};
355 355
356 /* queue timer control */ 356 /* queue timer control */
357struct sndrv_seq_ev_queue_control { 357struct snd_seq_ev_queue_control {
358 unsigned char queue; /* affected queue */ 358 unsigned char queue; /* affected queue */
359 unsigned char pad[3]; /* reserved */ 359 unsigned char pad[3]; /* reserved */
360 union { 360 union {
361 signed int value; /* affected value (e.g. tempo) */ 361 signed int value; /* affected value (e.g. tempo) */
362 union sndrv_seq_timestamp time; /* time */ 362 union snd_seq_timestamp time; /* time */
363 unsigned int position; /* sync position */ 363 unsigned int position; /* sync position */
364 struct sndrv_seq_queue_skew skew; 364 struct snd_seq_queue_skew skew;
365 unsigned int d32[2]; 365 unsigned int d32[2];
366 unsigned char d8[8]; 366 unsigned char d8[8];
367 } param; 367 } param;
368}; 368};
369 369
370 /* quoted event - inside the kernel only */ 370 /* quoted event - inside the kernel only */
371struct sndrv_seq_ev_quote { 371struct snd_seq_ev_quote {
372 struct sndrv_seq_addr origin; /* original sender */ 372 struct snd_seq_addr origin; /* original sender */
373 unsigned short value; /* optional data */ 373 unsigned short value; /* optional data */
374 struct sndrv_seq_event *event; /* quoted event */ 374 struct snd_seq_event *event; /* quoted event */
375} __attribute__((packed)); 375} __attribute__((packed));
376 376
377 377
378 /* sequencer event */ 378 /* sequencer event */
379struct sndrv_seq_event { 379struct snd_seq_event {
380 sndrv_seq_event_type_t type; /* event type */ 380 snd_seq_event_type_t type; /* event type */
381 unsigned char flags; /* event flags */ 381 unsigned char flags; /* event flags */
382 char tag; 382 char tag;
383 383
384 unsigned char queue; /* schedule queue */ 384 unsigned char queue; /* schedule queue */
385 union sndrv_seq_timestamp time; /* schedule time */ 385 union snd_seq_timestamp time; /* schedule time */
386 386
387 387
388 struct sndrv_seq_addr source; /* source address */ 388 struct snd_seq_addr source; /* source address */
389 struct sndrv_seq_addr dest; /* destination address */ 389 struct snd_seq_addr dest; /* destination address */
390 390
391 union { /* event data... */ 391 union { /* event data... */
392 struct sndrv_seq_ev_note note; 392 struct snd_seq_ev_note note;
393 struct sndrv_seq_ev_ctrl control; 393 struct snd_seq_ev_ctrl control;
394 struct sndrv_seq_ev_raw8 raw8; 394 struct snd_seq_ev_raw8 raw8;
395 struct sndrv_seq_ev_raw32 raw32; 395 struct snd_seq_ev_raw32 raw32;
396 struct sndrv_seq_ev_ext ext; 396 struct snd_seq_ev_ext ext;
397 struct sndrv_seq_ev_queue_control queue; 397 struct snd_seq_ev_queue_control queue;
398 union sndrv_seq_timestamp time; 398 union snd_seq_timestamp time;
399 struct sndrv_seq_addr addr; 399 struct snd_seq_addr addr;
400 struct sndrv_seq_connect connect; 400 struct snd_seq_connect connect;
401 struct sndrv_seq_result result; 401 struct snd_seq_result result;
402 struct sndrv_seq_ev_instr_begin instr_begin; 402 struct snd_seq_ev_instr_begin instr_begin;
403 struct sndrv_seq_ev_sample_control sample; 403 struct snd_seq_ev_sample_control sample;
404 struct sndrv_seq_ev_quote quote; 404 struct snd_seq_ev_quote quote;
405 } data; 405 } data;
406}; 406};
407 407
@@ -409,72 +409,77 @@ struct sndrv_seq_event {
409/* 409/*
410 * bounce event - stored as variable size data 410 * bounce event - stored as variable size data
411 */ 411 */
412struct sndrv_seq_event_bounce { 412struct snd_seq_event_bounce {
413 int err; 413 int err;
414 struct sndrv_seq_event event; 414 struct snd_seq_event event;
415 /* external data follows here. */ 415 /* external data follows here. */
416}; 416};
417 417
418#define sndrv_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(sndrv_seq_event_bounce_t))) 418#ifdef __KERNEL__
419
420/* helper macro */
421#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
419 422
420/* 423/*
421 * type check macros 424 * type check macros
422 */ 425 */
423/* result events: 0-4 */ 426/* result events: 0-4 */
424#define sndrv_seq_ev_is_result_type(ev) ((ev)->type < 5) 427#define snd_seq_ev_is_result_type(ev) ((ev)->type < 5)
425/* channel specific events: 5-19 */ 428/* channel specific events: 5-19 */
426#define sndrv_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20) 429#define snd_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)
427/* note events: 5-9 */ 430/* note events: 5-9 */
428#define sndrv_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10) 431#define snd_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)
429/* control events: 10-19 */ 432/* control events: 10-19 */
430#define sndrv_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20) 433#define snd_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)
431/* queue control events: 30-39 */ 434/* queue control events: 30-39 */
432#define sndrv_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40) 435#define snd_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)
433/* system status messages */ 436/* system status messages */
434#define sndrv_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69) 437#define snd_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)
435/* sample messages */ 438/* sample messages */
436#define sndrv_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79) 439#define snd_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)
437/* user-defined messages */ 440/* user-defined messages */
438#define sndrv_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99) 441#define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
439/* fixed length events: 0-99 */ 442/* fixed length events: 0-99 */
440#define sndrv_seq_ev_is_fixed_type(ev) ((ev)->type < 100) 443#define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
441/* instrument layer events: 100-129 */ 444/* instrument layer events: 100-129 */
442#define sndrv_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130) 445#define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)
443/* variable length events: 130-139 */ 446/* variable length events: 130-139 */
444#define sndrv_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140) 447#define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
445/* reserved for kernel */ 448/* reserved for kernel */
446#define sndrv_seq_ev_is_reserved(ev) ((ev)->type >= 150) 449#define snd_seq_ev_is_reserved(ev) ((ev)->type >= 150)
447 450
448/* direct dispatched events */ 451/* direct dispatched events */
449#define sndrv_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT) 452#define snd_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)
450 453
451/* 454/*
452 * macros to check event flags 455 * macros to check event flags
453 */ 456 */
454/* prior events */ 457/* prior events */
455#define sndrv_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH) 458#define snd_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)
456 459
457/* event length type */ 460/* event length type */
458#define sndrv_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) 461#define snd_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)
459#define sndrv_seq_ev_is_fixed(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED) 462#define snd_seq_ev_is_fixed(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)
460#define sndrv_seq_ev_is_variable(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE) 463#define snd_seq_ev_is_variable(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
461#define sndrv_seq_ev_is_varusr(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR) 464#define snd_seq_ev_is_varusr(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)
462 465
463/* time-stamp type */ 466/* time-stamp type */
464#define sndrv_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK) 467#define snd_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)
465#define sndrv_seq_ev_is_tick(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK) 468#define snd_seq_ev_is_tick(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)
466#define sndrv_seq_ev_is_real(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL) 469#define snd_seq_ev_is_real(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)
467 470
468/* time-mode type */ 471/* time-mode type */
469#define sndrv_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK) 472#define snd_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)
470#define sndrv_seq_ev_is_abstime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS) 473#define snd_seq_ev_is_abstime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)
471#define sndrv_seq_ev_is_reltime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL) 474#define snd_seq_ev_is_reltime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)
472 475
473/* queue sync port */ 476/* queue sync port */
474#define sndrv_seq_queue_sync_port(q) ((q) + 16) 477#define snd_seq_queue_sync_port(q) ((q) + 16)
478
479#endif /* __KERNEL__ */
475 480
476 /* system information */ 481 /* system information */
477struct sndrv_seq_system_info { 482struct snd_seq_system_info {
478 int queues; /* maximum queues count */ 483 int queues; /* maximum queues count */
479 int clients; /* maximum clients count */ 484 int clients; /* maximum clients count */
480 int ports; /* maximum ports per client */ 485 int ports; /* maximum ports per client */
@@ -486,7 +491,7 @@ struct sndrv_seq_system_info {
486 491
487 492
488 /* system running information */ 493 /* system running information */
489struct sndrv_seq_running_info { 494struct snd_seq_running_info {
490 unsigned char client; /* client id */ 495 unsigned char client; /* client id */
491 unsigned char big_endian; /* 1 = big-endian */ 496 unsigned char big_endian; /* 1 = big-endian */
492 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */ 497 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
@@ -502,11 +507,10 @@ struct sndrv_seq_running_info {
502 507
503 508
504 /* client types */ 509 /* client types */
505enum sndrv_seq_client_type { 510typedef int __bitwise snd_seq_client_type_t;
506 NO_CLIENT = 0, 511#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
507 USER_CLIENT = 1, 512#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
508 KERNEL_CLIENT = 2 513#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
509};
510 514
511 /* event filter flags */ 515 /* event filter flags */
512#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */ 516#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
@@ -514,9 +518,9 @@ enum sndrv_seq_client_type {
514#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */ 518#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
515#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */ 519#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
516 520
517struct sndrv_seq_client_info { 521struct snd_seq_client_info {
518 int client; /* client number to inquire */ 522 int client; /* client number to inquire */
519 enum sndrv_seq_client_type type; /* client type */ 523 snd_seq_client_type_t type; /* client type */
520 char name[64]; /* client name */ 524 char name[64]; /* client name */
521 unsigned int filter; /* filter flags */ 525 unsigned int filter; /* filter flags */
522 unsigned char multicast_filter[8]; /* multicast filter bitmap */ 526 unsigned char multicast_filter[8]; /* multicast filter bitmap */
@@ -528,7 +532,7 @@ struct sndrv_seq_client_info {
528 532
529 533
530/* client pool size */ 534/* client pool size */
531struct sndrv_seq_client_pool { 535struct snd_seq_client_pool {
532 int client; /* client number to inquire */ 536 int client; /* client number to inquire */
533 int output_pool; /* outgoing (write) pool size */ 537 int output_pool; /* outgoing (write) pool size */
534 int input_pool; /* incoming (read) pool size */ 538 int input_pool; /* incoming (read) pool size */
@@ -552,13 +556,13 @@ struct sndrv_seq_client_pool {
552#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */ 556#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
553#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */ 557#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
554 558
555struct sndrv_seq_remove_events { 559struct snd_seq_remove_events {
556 unsigned int remove_mode; /* Flags that determine what gets removed */ 560 unsigned int remove_mode; /* Flags that determine what gets removed */
557 561
558 union sndrv_seq_timestamp time; 562 union snd_seq_timestamp time;
559 563
560 unsigned char queue; /* Queue for REMOVE_DEST */ 564 unsigned char queue; /* Queue for REMOVE_DEST */
561 struct sndrv_seq_addr dest; /* Address for REMOVE_DEST */ 565 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
562 unsigned char channel; /* Channel for REMOVE_DEST */ 566 unsigned char channel; /* Channel for REMOVE_DEST */
563 567
564 int type; /* For REMOVE_EVENT_TYPE */ 568 int type; /* For REMOVE_EVENT_TYPE */
@@ -607,8 +611,8 @@ struct sndrv_seq_remove_events {
607#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1) 611#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
608#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2) 612#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
609 613
610struct sndrv_seq_port_info { 614struct snd_seq_port_info {
611 struct sndrv_seq_addr addr; /* client/port numbers */ 615 struct snd_seq_addr addr; /* client/port numbers */
612 char name[64]; /* port name */ 616 char name[64]; /* port name */
613 617
614 unsigned int capability; /* port capability bits */ 618 unsigned int capability; /* port capability bits */
@@ -631,7 +635,7 @@ struct sndrv_seq_port_info {
631#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */ 635#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
632 636
633/* queue information */ 637/* queue information */
634struct sndrv_seq_queue_info { 638struct snd_seq_queue_info {
635 int queue; /* queue id */ 639 int queue; /* queue id */
636 640
637 /* 641 /*
@@ -647,11 +651,11 @@ struct sndrv_seq_queue_info {
647}; 651};
648 652
649/* queue info/status */ 653/* queue info/status */
650struct sndrv_seq_queue_status { 654struct snd_seq_queue_status {
651 int queue; /* queue id */ 655 int queue; /* queue id */
652 int events; /* read-only - queue size */ 656 int events; /* read-only - queue size */
653 sndrv_seq_tick_time_t tick; /* current tick */ 657 snd_seq_tick_time_t tick; /* current tick */
654 struct sndrv_seq_real_time time; /* current time */ 658 struct snd_seq_real_time time; /* current time */
655 int running; /* running state of queue */ 659 int running; /* running state of queue */
656 int flags; /* various flags */ 660 int flags; /* various flags */
657 char reserved[64]; /* for the future */ 661 char reserved[64]; /* for the future */
@@ -659,7 +663,7 @@ struct sndrv_seq_queue_status {
659 663
660 664
661/* queue tempo */ 665/* queue tempo */
662struct sndrv_seq_queue_tempo { 666struct snd_seq_queue_tempo {
663 int queue; /* sequencer queue */ 667 int queue; /* sequencer queue */
664 unsigned int tempo; /* current tempo, us/tick */ 668 unsigned int tempo; /* current tempo, us/tick */
665 int ppq; /* time resolution, ticks/quarter */ 669 int ppq; /* time resolution, ticks/quarter */
@@ -675,12 +679,12 @@ struct sndrv_seq_queue_tempo {
675#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */ 679#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
676 680
677/* queue timer info */ 681/* queue timer info */
678struct sndrv_seq_queue_timer { 682struct snd_seq_queue_timer {
679 int queue; /* sequencer queue */ 683 int queue; /* sequencer queue */
680 int type; /* source timer type */ 684 int type; /* source timer type */
681 union { 685 union {
682 struct { 686 struct {
683 struct sndrv_timer_id id; /* ALSA's timer ID */ 687 struct snd_timer_id id; /* ALSA's timer ID */
684 unsigned int resolution; /* resolution in Hz */ 688 unsigned int resolution; /* resolution in Hz */
685 } alsa; 689 } alsa;
686 } u; 690 } u;
@@ -688,7 +692,7 @@ struct sndrv_seq_queue_timer {
688}; 692};
689 693
690 694
691struct sndrv_seq_queue_client { 695struct snd_seq_queue_client {
692 int queue; /* sequencer queue */ 696 int queue; /* sequencer queue */
693 int client; /* sequencer client */ 697 int client; /* sequencer client */
694 int used; /* queue is used with this client 698 int used; /* queue is used with this client
@@ -702,9 +706,9 @@ struct sndrv_seq_queue_client {
702#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1) 706#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
703#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2) 707#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
704 708
705struct sndrv_seq_port_subscribe { 709struct snd_seq_port_subscribe {
706 struct sndrv_seq_addr sender; /* sender address */ 710 struct snd_seq_addr sender; /* sender address */
707 struct sndrv_seq_addr dest; /* destination address */ 711 struct snd_seq_addr dest; /* destination address */
708 unsigned int voices; /* number of voices to be allocated (0 = don't care) */ 712 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
709 unsigned int flags; /* modes */ 713 unsigned int flags; /* modes */
710 unsigned char queue; /* input time-stamp queue (optional) */ 714 unsigned char queue; /* input time-stamp queue (optional) */
@@ -716,12 +720,12 @@ struct sndrv_seq_port_subscribe {
716#define SNDRV_SEQ_QUERY_SUBS_READ 0 720#define SNDRV_SEQ_QUERY_SUBS_READ 0
717#define SNDRV_SEQ_QUERY_SUBS_WRITE 1 721#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
718 722
719struct sndrv_seq_query_subs { 723struct snd_seq_query_subs {
720 struct sndrv_seq_addr root; /* client/port id to be searched */ 724 struct snd_seq_addr root; /* client/port id to be searched */
721 int type; /* READ or WRITE */ 725 int type; /* READ or WRITE */
722 int index; /* 0..N-1 */ 726 int index; /* 0..N-1 */
723 int num_subs; /* R/O: number of subscriptions on this port */ 727 int num_subs; /* R/O: number of subscriptions on this port */
724 struct sndrv_seq_addr addr; /* R/O: result */ 728 struct snd_seq_addr addr; /* R/O: result */
725 unsigned char queue; /* R/O: result */ 729 unsigned char queue; /* R/O: result */
726 unsigned int flags; /* R/O: result */ 730 unsigned int flags; /* R/O: result */
727 char reserved[64]; /* for future use */ 731 char reserved[64]; /* for future use */
@@ -778,72 +782,72 @@ struct sndrv_seq_query_subs {
778#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3 782#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3
779 783
780/* size of ROM/RAM */ 784/* size of ROM/RAM */
781typedef unsigned int sndrv_seq_instr_size_t; 785typedef unsigned int snd_seq_instr_size_t;
782 786
783/* INSTR_INFO */ 787/* INSTR_INFO */
784 788
785struct sndrv_seq_instr_info { 789struct snd_seq_instr_info {
786 int result; /* operation result */ 790 int result; /* operation result */
787 unsigned int formats[8]; /* bitmap of supported formats */ 791 unsigned int formats[8]; /* bitmap of supported formats */
788 int ram_count; /* count of RAM banks */ 792 int ram_count; /* count of RAM banks */
789 sndrv_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */ 793 snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */
790 int rom_count; /* count of ROM banks */ 794 int rom_count; /* count of ROM banks */
791 sndrv_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */ 795 snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */
792 char reserved[128]; 796 char reserved[128];
793}; 797};
794 798
795/* INSTR_STATUS */ 799/* INSTR_STATUS */
796 800
797struct sndrv_seq_instr_status { 801struct snd_seq_instr_status {
798 int result; /* operation result */ 802 int result; /* operation result */
799 sndrv_seq_instr_size_t free_ram[16]; /* free RAM in banks */ 803 snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */
800 int instrument_count; /* count of downloaded instruments */ 804 int instrument_count; /* count of downloaded instruments */
801 char reserved[128]; 805 char reserved[128];
802}; 806};
803 807
804/* INSTR_FORMAT_INFO */ 808/* INSTR_FORMAT_INFO */
805 809
806struct sndrv_seq_instr_format_info { 810struct snd_seq_instr_format_info {
807 char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */ 811 char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */
808 unsigned int len; /* max data length (without this structure) */ 812 unsigned int len; /* max data length (without this structure) */
809}; 813};
810 814
811struct sndrv_seq_instr_format_info_result { 815struct snd_seq_instr_format_info_result {
812 int result; /* operation result */ 816 int result; /* operation result */
813 char format[16]; /* format identifier */ 817 char format[16]; /* format identifier */
814 unsigned int len; /* filled data length (without this structure) */ 818 unsigned int len; /* filled data length (without this structure) */
815}; 819};
816 820
817/* instrument data */ 821/* instrument data */
818struct sndrv_seq_instr_data { 822struct snd_seq_instr_data {
819 char name[32]; /* instrument name */ 823 char name[32]; /* instrument name */
820 char reserved[16]; /* for the future use */ 824 char reserved[16]; /* for the future use */
821 int type; /* instrument type */ 825 int type; /* instrument type */
822 union { 826 union {
823 char format[16]; /* format identifier */ 827 char format[16]; /* format identifier */
824 struct sndrv_seq_instr alias; 828 struct snd_seq_instr alias;
825 } data; 829 } data;
826}; 830};
827 831
828/* INSTR_PUT/GET, data are stored in one block (extended), header + data */ 832/* INSTR_PUT/GET, data are stored in one block (extended), header + data */
829 833
830struct sndrv_seq_instr_header { 834struct snd_seq_instr_header {
831 union { 835 union {
832 struct sndrv_seq_instr instr; 836 struct snd_seq_instr instr;
833 sndrv_seq_instr_cluster_t cluster; 837 snd_seq_instr_cluster_t cluster;
834 } id; /* instrument identifier */ 838 } id; /* instrument identifier */
835 unsigned int cmd; /* get/put/free command */ 839 unsigned int cmd; /* get/put/free command */
836 unsigned int flags; /* query flags (only for get) */ 840 unsigned int flags; /* query flags (only for get) */
837 unsigned int len; /* real instrument data length (without header) */ 841 unsigned int len; /* real instrument data length (without header) */
838 int result; /* operation result */ 842 int result; /* operation result */
839 char reserved[16]; /* for the future */ 843 char reserved[16]; /* for the future */
840 struct sndrv_seq_instr_data data; /* instrument data (for put/get result) */ 844 struct snd_seq_instr_data data; /* instrument data (for put/get result) */
841}; 845};
842 846
843/* INSTR_CLUSTER_SET */ 847/* INSTR_CLUSTER_SET */
844 848
845struct sndrv_seq_instr_cluster_set { 849struct snd_seq_instr_cluster_set {
846 sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ 850 snd_seq_instr_cluster_t cluster; /* cluster identifier */
847 char name[32]; /* cluster name */ 851 char name[32]; /* cluster name */
848 int priority; /* cluster priority */ 852 int priority; /* cluster priority */
849 char reserved[64]; /* for the future use */ 853 char reserved[64]; /* for the future use */
@@ -851,8 +855,8 @@ struct sndrv_seq_instr_cluster_set {
851 855
852/* INSTR_CLUSTER_GET */ 856/* INSTR_CLUSTER_GET */
853 857
854struct sndrv_seq_instr_cluster_get { 858struct snd_seq_instr_cluster_get {
855 sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ 859 snd_seq_instr_cluster_t cluster; /* cluster identifier */
856 char name[32]; /* cluster name */ 860 char name[32]; /* cluster name */
857 int priority; /* cluster priority */ 861 int priority; /* cluster priority */
858 char reserved[64]; /* for the future use */ 862 char reserved[64]; /* for the future use */
@@ -864,44 +868,44 @@ struct sndrv_seq_instr_cluster_get {
864 868
865#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int) 869#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
866#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int) 870#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
867#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct sndrv_seq_system_info) 871#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
868#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct sndrv_seq_running_info) 872#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
869 873
870#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct sndrv_seq_client_info) 874#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
871#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct sndrv_seq_client_info) 875#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
872 876
873#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct sndrv_seq_port_info) 877#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
874#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct sndrv_seq_port_info) 878#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
875#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct sndrv_seq_port_info) 879#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
876#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct sndrv_seq_port_info) 880#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
877 881
878#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct sndrv_seq_port_subscribe) 882#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
879#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct sndrv_seq_port_subscribe) 883#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
880 884
881#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct sndrv_seq_queue_info) 885#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
882#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct sndrv_seq_queue_info) 886#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
883#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct sndrv_seq_queue_info) 887#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
884#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct sndrv_seq_queue_info) 888#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
885#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct sndrv_seq_queue_info) 889#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
886#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct sndrv_seq_queue_status) 890#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
887#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct sndrv_seq_queue_tempo) 891#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
888#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct sndrv_seq_queue_tempo) 892#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
889#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct sndrv_seq_queue_owner) 893#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
890#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct sndrv_seq_queue_owner) 894#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
891#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct sndrv_seq_queue_timer) 895#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
892#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct sndrv_seq_queue_timer) 896#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
893/* XXX 897/* XXX
894#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct sndrv_seq_queue_sync) 898#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
895#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct sndrv_seq_queue_sync) 899#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
896*/ 900*/
897#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct sndrv_seq_queue_client) 901#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
898#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct sndrv_seq_queue_client) 902#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
899#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct sndrv_seq_client_pool) 903#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
900#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct sndrv_seq_client_pool) 904#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
901#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct sndrv_seq_remove_events) 905#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
902#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct sndrv_seq_query_subs) 906#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
903#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct sndrv_seq_port_subscribe) 907#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
904#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct sndrv_seq_client_info) 908#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
905#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct sndrv_seq_port_info) 909#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
906 910
907#endif /* __SOUND_ASEQUENCER_H */ 911#endif /* __SOUND_ASEQUENCER_H */
diff --git a/include/sound/seq_device.h b/include/sound/seq_device.h
index 204ca540c28e..2b5f24cc7548 100644
--- a/include/sound/seq_device.h
+++ b/include/sound/seq_device.h
@@ -21,9 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24typedef struct snd_seq_device snd_seq_device_t;
25typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
26
27/* 24/*
28 * registered device information 25 * registered device information
29 */ 26 */
@@ -36,7 +33,7 @@ typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
36 33
37struct snd_seq_device { 34struct snd_seq_device {
38 /* device info */ 35 /* device info */
39 snd_card_t *card; /* sound card */ 36 struct snd_card *card; /* sound card */
40 int device; /* device number */ 37 int device; /* device number */
41 char id[ID_LEN]; /* driver id */ 38 char id[ID_LEN]; /* driver id */
42 char name[80]; /* device name */ 39 char name[80]; /* device name */
@@ -44,7 +41,7 @@ struct snd_seq_device {
44 void *driver_data; /* private data for driver */ 41 void *driver_data; /* private data for driver */
45 int status; /* flag - read only */ 42 int status; /* flag - read only */
46 void *private_data; /* private data for the caller */ 43 void *private_data; /* private data for the caller */
47 void (*private_free)(snd_seq_device_t *device); 44 void (*private_free)(struct snd_seq_device *device);
48 struct list_head list; /* link to next device */ 45 struct list_head list; /* link to next device */
49}; 46};
50 47
@@ -63,19 +60,19 @@ struct snd_seq_device {
63 * Typically, call snd_device_free(dev->card, dev->driver_data) 60 * Typically, call snd_device_free(dev->card, dev->driver_data)
64 */ 61 */
65struct snd_seq_dev_ops { 62struct snd_seq_dev_ops {
66 int (*init_device)(snd_seq_device_t *dev); 63 int (*init_device)(struct snd_seq_device *dev);
67 int (*free_device)(snd_seq_device_t *dev); 64 int (*free_device)(struct snd_seq_device *dev);
68}; 65};
69 66
70/* 67/*
71 * prototypes 68 * prototypes
72 */ 69 */
73void snd_seq_device_load_drivers(void); 70void snd_seq_device_load_drivers(void);
74int snd_seq_device_new(snd_card_t *card, int device, char *id, int argsize, snd_seq_device_t **result); 71int snd_seq_device_new(struct snd_card *card, int device, char *id, int argsize, struct snd_seq_device **result);
75int snd_seq_device_register_driver(char *id, snd_seq_dev_ops_t *entry, int argsize); 72int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, int argsize);
76int snd_seq_device_unregister_driver(char *id); 73int snd_seq_device_unregister_driver(char *id);
77 74
78#define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(snd_seq_device_t)) 75#define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(struct snd_seq_device))
79 76
80 77
81/* 78/*
@@ -84,5 +81,4 @@ int snd_seq_device_unregister_driver(char *id);
84#define SNDRV_SEQ_DEV_ID_MIDISYNTH "seq-midi" 81#define SNDRV_SEQ_DEV_ID_MIDISYNTH "seq-midi"
85#define SNDRV_SEQ_DEV_ID_OPL3 "opl3-synth" 82#define SNDRV_SEQ_DEV_ID_OPL3 "opl3-synth"
86 83
87
88#endif /* __SOUND_SEQ_DEVICE_H */ 84#endif /* __SOUND_SEQ_DEVICE_H */
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h
index 1a654df4aa97..db764f09efb7 100644
--- a/include/sound/seq_instr.h
+++ b/include/sound/seq_instr.h
@@ -24,29 +24,27 @@
24#include "seq_kernel.h" 24#include "seq_kernel.h"
25 25
26/* Instrument cluster */ 26/* Instrument cluster */
27typedef struct _snd_seq_kcluster { 27struct snd_seq_kcluster {
28 snd_seq_instr_cluster_t cluster; 28 snd_seq_instr_cluster_t cluster;
29 char name[32]; 29 char name[32];
30 int priority; 30 int priority;
31 struct _snd_seq_kcluster *next; 31 struct snd_seq_kcluster *next;
32} snd_seq_kcluster_t; 32};
33 33
34/* return pointer to private data */ 34/* return pointer to private data */
35#define KINSTR_DATA(kinstr) (void *)(((char *)kinstr) + sizeof(snd_seq_kinstr_t)) 35#define KINSTR_DATA(kinstr) (void *)(((char *)kinstr) + sizeof(struct snd_seq_kinstr))
36
37typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t;
38 36
39/* Instrument structure */ 37/* Instrument structure */
40typedef struct _snd_seq_kinstr { 38struct snd_seq_kinstr {
41 snd_seq_instr_t instr; 39 struct snd_seq_instr instr;
42 char name[32]; 40 char name[32];
43 int type; /* instrument type */ 41 int type; /* instrument type */
44 int use; /* use count */ 42 int use; /* use count */
45 int busy; /* not useable */ 43 int busy; /* not useable */
46 int add_len; /* additional length */ 44 int add_len; /* additional length */
47 snd_seq_kinstr_ops_t *ops; /* operations */ 45 struct snd_seq_kinstr_ops *ops; /* operations */
48 struct _snd_seq_kinstr *next; 46 struct snd_seq_kinstr *next;
49} snd_seq_kinstr_t; 47};
50 48
51#define SNDRV_SEQ_INSTR_HASH_SIZE 32 49#define SNDRV_SEQ_INSTR_HASH_SIZE 32
52 50
@@ -54,11 +52,11 @@ typedef struct _snd_seq_kinstr {
54#define SNDRV_SEQ_INSTR_FLG_DIRECT (1<<0) /* accept only direct events */ 52#define SNDRV_SEQ_INSTR_FLG_DIRECT (1<<0) /* accept only direct events */
55 53
56/* List of all instruments */ 54/* List of all instruments */
57typedef struct { 55struct snd_seq_kinstr_list {
58 snd_seq_kinstr_t *hash[SNDRV_SEQ_INSTR_HASH_SIZE]; 56 struct snd_seq_kinstr *hash[SNDRV_SEQ_INSTR_HASH_SIZE];
59 int count; /* count of all instruments */ 57 int count; /* count of all instruments */
60 58
61 snd_seq_kcluster_t *chash[SNDRV_SEQ_INSTR_HASH_SIZE]; 59 struct snd_seq_kcluster *chash[SNDRV_SEQ_INSTR_HASH_SIZE];
62 int ccount; /* count of all clusters */ 60 int ccount; /* count of all clusters */
63 61
64 int owner; /* current owner of the instrument list */ 62 int owner; /* current owner of the instrument list */
@@ -68,7 +66,7 @@ typedef struct {
68 spinlock_t ops_lock; 66 spinlock_t ops_lock;
69 struct semaphore ops_mutex; 67 struct semaphore ops_mutex;
70 unsigned long ops_flags; 68 unsigned long ops_flags;
71} snd_seq_kinstr_list_t; 69};
72 70
73#define SNDRV_SEQ_INSTR_NOTIFY_REMOVE 0 71#define SNDRV_SEQ_INSTR_NOTIFY_REMOVE 0
74#define SNDRV_SEQ_INSTR_NOTIFY_CHANGE 1 72#define SNDRV_SEQ_INSTR_NOTIFY_CHANGE 1
@@ -78,33 +76,33 @@ struct snd_seq_kinstr_ops {
78 long add_len; /* additional length */ 76 long add_len; /* additional length */
79 char *instr_type; 77 char *instr_type;
80 int (*info)(void *private_data, char *info_data, long len); 78 int (*info)(void *private_data, char *info_data, long len);
81 int (*put)(void *private_data, snd_seq_kinstr_t *kinstr, 79 int (*put)(void *private_data, struct snd_seq_kinstr *kinstr,
82 char __user *instr_data, long len, int atomic, int cmd); 80 char __user *instr_data, long len, int atomic, int cmd);
83 int (*get)(void *private_data, snd_seq_kinstr_t *kinstr, 81 int (*get)(void *private_data, struct snd_seq_kinstr *kinstr,
84 char __user *instr_data, long len, int atomic, int cmd); 82 char __user *instr_data, long len, int atomic, int cmd);
85 int (*get_size)(void *private_data, snd_seq_kinstr_t *kinstr, long *size); 83 int (*get_size)(void *private_data, struct snd_seq_kinstr *kinstr, long *size);
86 int (*remove)(void *private_data, snd_seq_kinstr_t *kinstr, int atomic); 84 int (*remove)(void *private_data, struct snd_seq_kinstr *kinstr, int atomic);
87 void (*notify)(void *private_data, snd_seq_kinstr_t *kinstr, int what); 85 void (*notify)(void *private_data, struct snd_seq_kinstr *kinstr, int what);
88 struct snd_seq_kinstr_ops *next; 86 struct snd_seq_kinstr_ops *next;
89}; 87};
90 88
91 89
92/* instrument operations */ 90/* instrument operations */
93snd_seq_kinstr_list_t *snd_seq_instr_list_new(void); 91struct snd_seq_kinstr_list *snd_seq_instr_list_new(void);
94void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list); 92void snd_seq_instr_list_free(struct snd_seq_kinstr_list **list);
95int snd_seq_instr_list_free_cond(snd_seq_kinstr_list_t *list, 93int snd_seq_instr_list_free_cond(struct snd_seq_kinstr_list *list,
96 snd_seq_instr_header_t *ifree, 94 struct snd_seq_instr_header *ifree,
97 int client, 95 int client,
98 int atomic); 96 int atomic);
99snd_seq_kinstr_t *snd_seq_instr_find(snd_seq_kinstr_list_t *list, 97struct snd_seq_kinstr *snd_seq_instr_find(struct snd_seq_kinstr_list *list,
100 snd_seq_instr_t *instr, 98 struct snd_seq_instr *instr,
101 int exact, 99 int exact,
102 int follow_alias); 100 int follow_alias);
103void snd_seq_instr_free_use(snd_seq_kinstr_list_t *list, 101void snd_seq_instr_free_use(struct snd_seq_kinstr_list *list,
104 snd_seq_kinstr_t *instr); 102 struct snd_seq_kinstr *instr);
105int snd_seq_instr_event(snd_seq_kinstr_ops_t *ops, 103int snd_seq_instr_event(struct snd_seq_kinstr_ops *ops,
106 snd_seq_kinstr_list_t *list, 104 struct snd_seq_kinstr_list *list,
107 snd_seq_event_t *ev, 105 struct snd_seq_event *ev,
108 int client, 106 int client,
109 int atomic, 107 int atomic,
110 int hop); 108 int hop);
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index 4beca1952c76..1b60890b44cd 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -24,62 +24,8 @@
24#include <linux/time.h> 24#include <linux/time.h>
25#include "asequencer.h" 25#include "asequencer.h"
26 26
27typedef sndrv_seq_tick_time_t snd_seq_tick_time_t; 27typedef struct snd_seq_real_time snd_seq_real_time_t;
28typedef sndrv_seq_position_t snd_seq_position_t; 28typedef union snd_seq_timestamp snd_seq_timestamp_t;
29typedef sndrv_seq_frequency_t snd_seq_frequency_t;
30typedef sndrv_seq_instr_cluster_t snd_seq_instr_cluster_t;
31typedef enum sndrv_seq_client_type snd_seq_client_type_t;
32typedef enum sndrv_seq_stop_mode snd_seq_stop_mode_t;
33typedef struct sndrv_seq_port_info snd_seq_port_info_t;
34typedef struct sndrv_seq_port_subscribe snd_seq_port_subscribe_t;
35typedef struct sndrv_seq_event snd_seq_event_t;
36typedef struct sndrv_seq_addr snd_seq_addr_t;
37typedef struct sndrv_seq_ev_volume snd_seq_ev_volume_t;
38typedef struct sndrv_seq_ev_loop snd_seq_ev_loop_t;
39typedef struct sndrv_seq_remove_events snd_seq_remove_events_t;
40typedef struct sndrv_seq_query_subs snd_seq_query_subs_t;
41typedef struct sndrv_seq_real_time snd_seq_real_time_t;
42typedef struct sndrv_seq_system_info snd_seq_system_info_t;
43typedef struct sndrv_seq_client_info snd_seq_client_info_t;
44typedef struct sndrv_seq_queue_info snd_seq_queue_info_t;
45typedef struct sndrv_seq_queue_status snd_seq_queue_status_t;
46typedef struct sndrv_seq_queue_tempo snd_seq_queue_tempo_t;
47typedef struct sndrv_seq_queue_owner snd_seq_queue_owner_t;
48typedef struct sndrv_seq_queue_timer snd_seq_queue_timer_t;
49typedef struct sndrv_seq_queue_client snd_seq_queue_client_t;
50typedef struct sndrv_seq_client_pool snd_seq_client_pool_t;
51typedef struct sndrv_seq_instr snd_seq_instr_t;
52typedef struct sndrv_seq_instr_data snd_seq_instr_data_t;
53typedef struct sndrv_seq_instr_header snd_seq_instr_header_t;
54typedef union sndrv_seq_timestamp snd_seq_timestamp_t;
55
56#define snd_seq_event_bounce_ext_data sndrv_seq_event_bounce_ext_data
57#define snd_seq_ev_is_result_type sndrv_seq_ev_is_result_type
58#define snd_seq_ev_is_channel_type sndrv_seq_ev_is_channel_type
59#define snd_seq_ev_is_note_type sndrv_seq_ev_is_note_type
60#define snd_seq_ev_is_control_type sndrv_seq_ev_is_control_type
61#define snd_seq_ev_is_queue_type sndrv_seq_ev_is_queue_type
62#define snd_seq_ev_is_message_type sndrv_seq_ev_is_message_type
63#define snd_seq_ev_is_sample_type sndrv_seq_ev_is_sample_type
64#define snd_seq_ev_is_user_type sndrv_seq_ev_is_user_type
65#define snd_seq_ev_is_fixed_type sndrv_seq_ev_is_fixed_type
66#define snd_seq_ev_is_instr_type sndrv_seq_ev_is_instr_type
67#define snd_seq_ev_is_variable_type sndrv_seq_ev_is_variable_type
68#define snd_seq_ev_is_reserved sndrv_seq_ev_is_reserved
69#define snd_seq_ev_is_direct sndrv_seq_ev_is_direct
70#define snd_seq_ev_is_prior sndrv_seq_ev_is_prior
71#define snd_seq_ev_length_type sndrv_seq_ev_length_type
72#define snd_seq_ev_is_fixed sndrv_seq_ev_is_fixed
73#define snd_seq_ev_is_variable sndrv_seq_ev_is_variable
74#define snd_seq_ev_is_varusr sndrv_seq_ev_is_varusr
75#define snd_seq_ev_timestamp_type sndrv_seq_ev_timestamp_type
76#define snd_seq_ev_is_tick sndrv_seq_ev_is_tick
77#define snd_seq_ev_is_real sndrv_seq_ev_is_real
78#define snd_seq_ev_timemode_type sndrv_seq_ev_timemode_type
79#define snd_seq_ev_is_abstime sndrv_seq_ev_is_abstime
80#define snd_seq_ev_is_reltime sndrv_seq_ev_is_reltime
81#define snd_seq_queue_sync_port sndrv_seq_queue_sync_port
82#define snd_seq_queue_owner sndrv_seq_queue_owner
83 29
84/* maximum number of events dequeued per schedule interval */ 30/* maximum number of events dequeued per schedule interval */
85#define SNDRV_SEQ_MAX_DEQUEUE 50 31#define SNDRV_SEQ_MAX_DEQUEUE 50
@@ -114,69 +60,56 @@ typedef union sndrv_seq_timestamp snd_seq_timestamp_t;
114/* max size of event size */ 60/* max size of event size */
115#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff 61#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
116 62
117/* typedefs */
118struct _snd_seq_user_client;
119struct _snd_seq_kernel_client;
120struct _snd_seq_client;
121struct _snd_seq_queue;
122
123typedef struct _snd_seq_user_client user_client_t;
124typedef struct _snd_seq_kernel_client kernel_client_t;
125typedef struct _snd_seq_client client_t;
126typedef struct _snd_seq_queue queue_t;
127
128/* call-backs for kernel client */ 63/* call-backs for kernel client */
129 64
130typedef struct { 65struct snd_seq_client_callback {
131 void *private_data; 66 void *private_data;
132 unsigned allow_input: 1, 67 unsigned allow_input: 1,
133 allow_output: 1; 68 allow_output: 1;
134 /*...*/ 69 /*...*/
135} snd_seq_client_callback_t; 70};
136 71
137/* call-backs for kernel port */ 72/* call-backs for kernel port */
138typedef int (snd_seq_kernel_port_open_t)(void *private_data, snd_seq_port_subscribe_t *info); 73struct snd_seq_port_callback {
139typedef int (snd_seq_kernel_port_close_t)(void *private_data, snd_seq_port_subscribe_t *info);
140typedef int (snd_seq_kernel_port_input_t)(snd_seq_event_t *ev, int direct, void *private_data, int atomic, int hop);
141typedef void (snd_seq_kernel_port_private_free_t)(void *private_data);
142
143typedef struct {
144 struct module *owner; 74 struct module *owner;
145 void *private_data; 75 void *private_data;
146 snd_seq_kernel_port_open_t *subscribe; 76 int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info);
147 snd_seq_kernel_port_close_t *unsubscribe; 77 int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info);
148 snd_seq_kernel_port_open_t *use; 78 int (*use)(void *private_data, struct snd_seq_port_subscribe *info);
149 snd_seq_kernel_port_close_t *unuse; 79 int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info);
150 snd_seq_kernel_port_input_t *event_input; 80 int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
151 snd_seq_kernel_port_private_free_t *private_free; 81 void (*private_free)(void *private_data);
152 unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */ 82 unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */
153 /*...*/ 83 /*...*/
154} snd_seq_port_callback_t; 84};
155 85
156/* interface for kernel client */ 86/* interface for kernel client */
157extern int snd_seq_create_kernel_client(snd_card_t *card, int client_index, snd_seq_client_callback_t *callback); 87int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
158extern int snd_seq_delete_kernel_client(int client); 88 struct snd_seq_client_callback *callback);
159extern int snd_seq_kernel_client_enqueue(int client, snd_seq_event_t *ev, int atomic, int hop); 89int snd_seq_delete_kernel_client(int client);
160extern int snd_seq_kernel_client_dispatch(int client, snd_seq_event_t *ev, int atomic, int hop); 90int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
161extern int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg); 91int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
92int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
162 93
163#define SNDRV_SEQ_EXT_MASK 0xc0000000 94#define SNDRV_SEQ_EXT_MASK 0xc0000000
164#define SNDRV_SEQ_EXT_USRPTR 0x80000000 95#define SNDRV_SEQ_EXT_USRPTR 0x80000000
165#define SNDRV_SEQ_EXT_CHAINED 0x40000000 96#define SNDRV_SEQ_EXT_CHAINED 0x40000000
166 97
167typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count); 98typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
168int snd_seq_expand_var_event(const snd_seq_event_t *event, int count, char *buf, int in_kernel, int size_aligned); 99int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
169int snd_seq_dump_var_event(const snd_seq_event_t *event, snd_seq_dump_func_t func, void *private_data); 100 int in_kernel, int size_aligned);
101int snd_seq_dump_var_event(const struct snd_seq_event *event,
102 snd_seq_dump_func_t func, void *private_data);
170 103
171/* interface for OSS emulation */ 104/* interface for OSS emulation */
172int snd_seq_set_queue_tempo(int client, snd_seq_queue_tempo_t *tempo); 105int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
173 106
174/* port callback routines */ 107/* port callback routines */
175void snd_port_init_callback(snd_seq_port_callback_t *p); 108void snd_port_init_callback(struct snd_seq_port_callback *p);
176snd_seq_port_callback_t *snd_port_alloc_callback(void); 109struct snd_seq_port_callback *snd_port_alloc_callback(void);
177 110
178/* port attach/detach */ 111/* port attach/detach */
179int snd_seq_event_port_attach(int client, snd_seq_port_callback_t *pcbp, 112int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
180 int cap, int type, int midi_channels, int midi_voices, char *portname); 113 int cap, int type, int midi_channels, int midi_voices, char *portname);
181int snd_seq_event_port_detach(int client, int port); 114int snd_seq_event_port_detach(int client, int port);
182 115
diff --git a/include/sound/seq_midi_emul.h b/include/sound/seq_midi_emul.h
index e58ca45bc73b..d6c4615901b9 100644
--- a/include/sound/seq_midi_emul.h
+++ b/include/sound/seq_midi_emul.h
@@ -29,7 +29,7 @@
29 * channel. All drivers for hardware that does not understand midi 29 * channel. All drivers for hardware that does not understand midi
30 * directly will probably need to use this structure. 30 * directly will probably need to use this structure.
31 */ 31 */
32typedef struct snd_midi_channel { 32struct snd_midi_channel {
33 void *private; /* A back pointer to driver data */ 33 void *private; /* A back pointer to driver data */
34 int number; /* The channel number */ 34 int number; /* The channel number */
35 int client; /* The client associated with this channel */ 35 int client; /* The client associated with this channel */
@@ -53,41 +53,43 @@ typedef struct snd_midi_channel {
53 short gm_rpn_fine_tuning; /* Master fine tuning */ 53 short gm_rpn_fine_tuning; /* Master fine tuning */
54 short gm_rpn_coarse_tuning; /* Master coarse tuning */ 54 short gm_rpn_coarse_tuning; /* Master coarse tuning */
55 55
56} snd_midi_channel_t; 56};
57 57
58/* 58/*
59 * A structure that represets a set of channels bound to a port. There 59 * A structure that represets a set of channels bound to a port. There
60 * would usually be 16 channels per port. But fewer could be used for 60 * would usually be 16 channels per port. But fewer could be used for
61 * particular cases. 61 * particular cases.
62 * The channel set consists of information describing the client and 62 * The channel set consists of information describing the client and
63 * port for this midi synth and an array of snd_midi_channel_t structures. 63 * port for this midi synth and an array of snd_midi_channel structures.
64 * A driver that had no need for snd_midi_channel_t could still use the 64 * A driver that had no need for snd_midi_channel could still use the
65 * channel set type if it wished with the channel array null. 65 * channel set type if it wished with the channel array null.
66 */ 66 */
67typedef struct snd_midi_channel_set { 67struct snd_midi_channel_set {
68 void *private_data; /* Driver data */ 68 void *private_data; /* Driver data */
69 int client; /* Client for this port */ 69 int client; /* Client for this port */
70 int port; /* The port number */ 70 int port; /* The port number */
71 71
72 int max_channels; /* Size of the channels array */ 72 int max_channels; /* Size of the channels array */
73 snd_midi_channel_t *channels; 73 struct snd_midi_channel *channels;
74 74
75 unsigned char midi_mode; /* MIDI operating mode */ 75 unsigned char midi_mode; /* MIDI operating mode */
76 unsigned char gs_master_volume; /* SYSEX master volume: 0-127 */ 76 unsigned char gs_master_volume; /* SYSEX master volume: 0-127 */
77 unsigned char gs_chorus_mode; 77 unsigned char gs_chorus_mode;
78 unsigned char gs_reverb_mode; 78 unsigned char gs_reverb_mode;
79 79
80} snd_midi_channel_set_t; 80};
81 81
82typedef struct snd_seq_midi_op { 82struct snd_midi_op {
83 void (*note_on)(void *private_data, int note, int vel, snd_midi_channel_t *chan); 83 void (*note_on)(void *private_data, int note, int vel, struct snd_midi_channel *chan);
84 void (*note_off)(void *private_data,int note, int vel, snd_midi_channel_t *chan); /* release note */ 84 void (*note_off)(void *private_data,int note, int vel, struct snd_midi_channel *chan); /* release note */
85 void (*key_press)(void *private_data, int note, int vel, snd_midi_channel_t *chan); 85 void (*key_press)(void *private_data, int note, int vel, struct snd_midi_channel *chan);
86 void (*note_terminate)(void *private_data, int note, snd_midi_channel_t *chan); /* terminate note immediately */ 86 void (*note_terminate)(void *private_data, int note, struct snd_midi_channel *chan); /* terminate note immediately */
87 void (*control)(void *private_data, int type, snd_midi_channel_t *chan); 87 void (*control)(void *private_data, int type, struct snd_midi_channel *chan);
88 void (*nrpn)(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); 88 void (*nrpn)(void *private_data, struct snd_midi_channel *chan,
89 void (*sysex)(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 89 struct snd_midi_channel_set *chset);
90} snd_midi_op_t; 90 void (*sysex)(void *private_data, unsigned char *buf, int len, int parsed,
91 struct snd_midi_channel_set *chset);
92};
91 93
92/* 94/*
93 * These defines are used so that pitchbend, aftertouch etc, can be 95 * These defines are used so that pitchbend, aftertouch etc, can be
@@ -186,10 +188,10 @@ enum {
186}; 188};
187 189
188/* Prototypes for midi_process.c */ 190/* Prototypes for midi_process.c */
189void snd_midi_process_event(snd_midi_op_t *ops, snd_seq_event_t *ev, 191void snd_midi_process_event(struct snd_midi_op *ops, struct snd_seq_event *ev,
190 snd_midi_channel_set_t *chanset); 192 struct snd_midi_channel_set *chanset);
191void snd_midi_channel_set_clear(snd_midi_channel_set_t *chset); 193void snd_midi_channel_set_clear(struct snd_midi_channel_set *chset);
192snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n); 194struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n);
193void snd_midi_channel_free_set(snd_midi_channel_set_t *chset); 195void snd_midi_channel_free_set(struct snd_midi_channel_set *chset);
194 196
195#endif /* __SOUND_SEQ_MIDI_EMUL_H */ 197#endif /* __SOUND_SEQ_MIDI_EMUL_H */
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h
index 8857e2bd31a5..dd789e7cdb20 100644
--- a/include/sound/seq_midi_event.h
+++ b/include/sound/seq_midi_event.h
@@ -26,10 +26,8 @@
26 26
27#define MAX_MIDI_EVENT_BUF 256 27#define MAX_MIDI_EVENT_BUF 256
28 28
29typedef struct snd_midi_event_t snd_midi_event_t;
30
31/* midi status */ 29/* midi status */
32struct snd_midi_event_t { 30struct snd_midi_event {
33 int qlen; /* queue length */ 31 int qlen; /* queue length */
34 int read; /* chars read */ 32 int read; /* chars read */
35 int type; /* current event type */ 33 int type; /* current event type */
@@ -40,15 +38,17 @@ struct snd_midi_event_t {
40 spinlock_t lock; 38 spinlock_t lock;
41}; 39};
42 40
43int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev); 41int snd_midi_event_new(int bufsize, struct snd_midi_event **rdev);
44void snd_midi_event_free(snd_midi_event_t *dev); 42void snd_midi_event_free(struct snd_midi_event *dev);
45void snd_midi_event_reset_encode(snd_midi_event_t *dev); 43void snd_midi_event_reset_encode(struct snd_midi_event *dev);
46void snd_midi_event_reset_decode(snd_midi_event_t *dev); 44void snd_midi_event_reset_decode(struct snd_midi_event *dev);
47void snd_midi_event_no_status(snd_midi_event_t *dev, int on); 45void snd_midi_event_no_status(struct snd_midi_event *dev, int on);
48/* encode from byte stream - return number of written bytes if success */ 46/* encode from byte stream - return number of written bytes if success */
49long snd_midi_event_encode(snd_midi_event_t *dev, unsigned char *buf, long count, snd_seq_event_t *ev); 47long snd_midi_event_encode(struct snd_midi_event *dev, unsigned char *buf, long count,
50int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev); 48 struct snd_seq_event *ev);
49int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c, struct snd_seq_event *ev);
51/* decode from event to bytes - return number of written bytes if success */ 50/* decode from event to bytes - return number of written bytes if success */
52long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, snd_seq_event_t *ev); 51long snd_midi_event_decode(struct snd_midi_event *dev, unsigned char *buf, long count,
52 struct snd_seq_event *ev);
53 53
54#endif /* __SOUND_SEQ_MIDI_EVENT_H */ 54#endif /* __SOUND_SEQ_MIDI_EVENT_H */
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h
index 1ad27e859af3..8d5aea76d7c3 100644
--- a/include/sound/seq_virmidi.h
+++ b/include/sound/seq_virmidi.h
@@ -25,25 +25,23 @@
25#include "rawmidi.h" 25#include "rawmidi.h"
26#include "seq_midi_event.h" 26#include "seq_midi_event.h"
27 27
28typedef struct _snd_virmidi_dev snd_virmidi_dev_t;
29
30/* 28/*
31 * device file instance: 29 * device file instance:
32 * This instance is created at each time the midi device file is 30 * This instance is created at each time the midi device file is
33 * opened. Each instance has its own input buffer and MIDI parser 31 * opened. Each instance has its own input buffer and MIDI parser
34 * (buffer), and is associated with the device instance. 32 * (buffer), and is associated with the device instance.
35 */ 33 */
36typedef struct _snd_virmidi { 34struct snd_virmidi {
37 struct list_head list; 35 struct list_head list;
38 int seq_mode; 36 int seq_mode;
39 int client; 37 int client;
40 int port; 38 int port;
41 unsigned int trigger: 1; 39 unsigned int trigger: 1;
42 snd_midi_event_t *parser; 40 struct snd_midi_event *parser;
43 snd_seq_event_t event; 41 struct snd_seq_event event;
44 snd_virmidi_dev_t *rdev; 42 struct snd_virmidi_dev *rdev;
45 snd_rawmidi_substream_t *substream; 43 struct snd_rawmidi_substream *substream;
46} snd_virmidi_t; 44};
47 45
48#define SNDRV_VIRMIDI_SUBSCRIBE (1<<0) 46#define SNDRV_VIRMIDI_SUBSCRIBE (1<<0)
49#define SNDRV_VIRMIDI_USE (1<<1) 47#define SNDRV_VIRMIDI_USE (1<<1)
@@ -53,9 +51,9 @@ typedef struct _snd_virmidi {
53 * Each virtual midi device has one device instance. It contains 51 * Each virtual midi device has one device instance. It contains
54 * common information and the linked-list of opened files, 52 * common information and the linked-list of opened files,
55 */ 53 */
56struct _snd_virmidi_dev { 54struct snd_virmidi_dev {
57 snd_card_t *card; /* associated card */ 55 struct snd_card *card; /* associated card */
58 snd_rawmidi_t *rmidi; /* rawmidi device */ 56 struct snd_rawmidi *rmidi; /* rawmidi device */
59 int seq_mode; /* SNDRV_VIRMIDI_XXX */ 57 int seq_mode; /* SNDRV_VIRMIDI_XXX */
60 int device; /* sequencer device */ 58 int device; /* sequencer device */
61 int client; /* created/attached client */ 59 int client; /* created/attached client */
@@ -78,6 +76,6 @@ struct _snd_virmidi_dev {
78#define SNDRV_VIRMIDI_SEQ_ATTACH 1 76#define SNDRV_VIRMIDI_SEQ_ATTACH 1
79#define SNDRV_VIRMIDI_SEQ_DISPATCH 2 77#define SNDRV_VIRMIDI_SEQ_DISPATCH 2
80 78
81int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi); 79int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmidi);
82 80
83#endif /* __SOUND_SEQ_VIRMIDI */ 81#endif /* __SOUND_SEQ_VIRMIDI */