diff options
-rw-r--r-- | include/sound/seq_oss.h | 30 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss.c | 24 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_device.h | 60 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_event.c | 60 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_event.h | 50 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_init.c | 52 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_ioctl.c | 12 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_midi.c | 96 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_midi.h | 27 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_readq.c | 32 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_readq.h | 24 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_rw.c | 18 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_synth.c | 92 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_synth.h | 32 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_timer.c | 34 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_timer.h | 22 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_writeq.c | 34 | ||||
-rw-r--r-- | sound/core/seq/oss/seq_oss_writeq.h | 18 |
18 files changed, 352 insertions, 365 deletions
diff --git a/include/sound/seq_oss.h b/include/sound/seq_oss.h index bd7e57322ab..9b060bbd6e0 100644 --- a/include/sound/seq_oss.h +++ b/include/sound/seq_oss.h @@ -25,22 +25,16 @@ #include "seq_kernel.h" /* - * type definitions - */ -typedef struct snd_seq_oss_arg_t snd_seq_oss_arg_t; -typedef struct snd_seq_oss_callback_t snd_seq_oss_callback_t; - -/* * argument structure for synthesizer operations */ -struct snd_seq_oss_arg_t { +struct snd_seq_oss_arg { /* given by OSS sequencer */ int app_index; /* application unique index */ int file_mode; /* file mode - see below */ int seq_mode; /* sequencer mode - see below */ /* following must be initialized in open callback */ - snd_seq_addr_t addr; /* opened port address */ + struct snd_seq_addr addr; /* opened port address */ void *private_data; /* private data for lowlevel drivers */ /* note-on event passing mode: initially given by OSS seq, @@ -53,14 +47,14 @@ struct snd_seq_oss_arg_t { /* * synthesizer operation callbacks */ -struct snd_seq_oss_callback_t { +struct snd_seq_oss_callback { struct module *owner; - int (*open)(snd_seq_oss_arg_t *p, void *closure); - int (*close)(snd_seq_oss_arg_t *p); - int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg); - int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char __user *buf, int offs, int count); - int (*reset)(snd_seq_oss_arg_t *p); - int (*raw_event)(snd_seq_oss_arg_t *p, unsigned char *data); + int (*open)(struct snd_seq_oss_arg *p, void *closure); + int (*close)(struct snd_seq_oss_arg *p); + int (*ioctl)(struct snd_seq_oss_arg *p, unsigned int cmd, unsigned long arg); + int (*load_patch)(struct snd_seq_oss_arg *p, int format, const char __user *buf, int offs, int count); + int (*reset)(struct snd_seq_oss_arg *p); + int (*raw_event)(struct snd_seq_oss_arg *p, unsigned char *data); }; /* flag: file_mode */ @@ -88,13 +82,13 @@ struct snd_seq_oss_callback_t { /* * data pointer to snd_seq_register_device */ -typedef struct snd_seq_oss_reg { +struct snd_seq_oss_reg { int type; int subtype; int nvoices; - snd_seq_oss_callback_t oper; + struct snd_seq_oss_callback oper; void *private_data; -} snd_seq_oss_reg_t; +}; /* device id */ #define SNDRV_SEQ_DEV_ID_OSS "seq-oss" diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c index 4c0558c0a8b..2371e41b13e 100644 --- a/sound/core/seq/oss/seq_oss.c +++ b/sound/core/seq/oss/seq_oss.c @@ -62,7 +62,7 @@ static ssize_t odev_write(struct file *file, const char __user *buf, size_t coun static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); static unsigned int odev_poll(struct file *file, poll_table * wait); #ifdef CONFIG_PROC_FS -static void info_read(snd_info_entry_t *entry, snd_info_buffer_t *buf); +static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf); #endif @@ -73,7 +73,7 @@ static void info_read(snd_info_entry_t *entry, snd_info_buffer_t *buf); static int __init alsa_seq_oss_init(void) { int rc; - static snd_seq_dev_ops_t ops = { + static struct snd_seq_dev_ops ops = { snd_seq_oss_synth_register, snd_seq_oss_synth_unregister, }; @@ -92,7 +92,7 @@ static int __init alsa_seq_oss_init(void) } if ((rc = snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OSS, &ops, - sizeof(snd_seq_oss_reg_t))) < 0) { + sizeof(struct snd_seq_oss_reg))) < 0) { snd_seq_oss_delete_client(); unregister_proc(); unregister_device(); @@ -144,7 +144,7 @@ odev_open(struct inode *inode, struct file *file) static int odev_release(struct inode *inode, struct file *file) { - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; if ((dp = file->private_data) == NULL) return 0; @@ -161,7 +161,7 @@ odev_release(struct inode *inode, struct file *file) static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset) { - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; dp = file->private_data; snd_assert(dp != NULL, return -EIO); return snd_seq_oss_read(dp, buf, count); @@ -171,7 +171,7 @@ odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset) static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; dp = file->private_data; snd_assert(dp != NULL, return -EIO); return snd_seq_oss_write(dp, buf, count, file); @@ -180,7 +180,7 @@ odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offs static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; dp = file->private_data; snd_assert(dp != NULL, return -EIO); return snd_seq_oss_ioctl(dp, cmd, arg); @@ -195,7 +195,7 @@ odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static unsigned int odev_poll(struct file *file, poll_table * wait) { - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; dp = file->private_data; snd_assert(dp != NULL, return 0); return snd_seq_oss_poll(dp, file, wait); @@ -217,7 +217,7 @@ static struct file_operations seq_oss_f_ops = .compat_ioctl = odev_ioctl_compat, }; -static snd_minor_t seq_oss_reg = { +static struct snd_minor seq_oss_reg = { .comment = "sequencer", .f_ops = &seq_oss_f_ops, }; @@ -268,10 +268,10 @@ unregister_device(void) #ifdef CONFIG_PROC_FS -static snd_info_entry_t *info_entry; +static struct snd_info_entry *info_entry; static void -info_read(snd_info_entry_t *entry, snd_info_buffer_t *buf) +info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf) { down(®ister_mutex); snd_iprintf(buf, "OSS sequencer emulation version %s\n", SNDRV_SEQ_OSS_VERSION_STR); @@ -287,7 +287,7 @@ static int __init register_proc(void) { #ifdef CONFIG_PROC_FS - snd_info_entry_t *entry; + struct snd_info_entry *entry; entry = snd_info_create_module_entry(THIS_MODULE, SNDRV_SEQ_OSS_PROCNAME, snd_seq_root); if (entry == NULL) diff --git a/sound/core/seq/oss/seq_oss_device.h b/sound/core/seq/oss/seq_oss_device.h index 973786758c5..9a8567c928e 100644 --- a/sound/core/seq/oss/seq_oss_device.h +++ b/sound/core/seq/oss/seq_oss_device.h @@ -55,32 +55,24 @@ * type definitions */ -typedef struct seq_oss_devinfo_t seq_oss_devinfo_t; -typedef struct seq_oss_writeq_t seq_oss_writeq_t; -typedef struct seq_oss_readq_t seq_oss_readq_t; -typedef struct seq_oss_timer_t seq_oss_timer_t; -typedef struct seq_oss_synthinfo_t seq_oss_synthinfo_t; -typedef struct seq_oss_synth_sysex_t seq_oss_synth_sysex_t; -typedef struct seq_oss_chinfo_t seq_oss_chinfo_t; typedef unsigned int reltime_t; typedef unsigned int abstime_t; -typedef union evrec_t evrec_t; /* * synthesizer channel information */ -struct seq_oss_chinfo_t { +struct seq_oss_chinfo { int note, vel; }; /* * synthesizer information */ -struct seq_oss_synthinfo_t { - snd_seq_oss_arg_t arg; - seq_oss_chinfo_t *ch; - seq_oss_synth_sysex_t *sysex; +struct seq_oss_synthinfo { + struct snd_seq_oss_arg arg; + struct seq_oss_chinfo *ch; + struct seq_oss_synth_sysex *sysex; int nr_voices; int opened; int is_midi; @@ -92,14 +84,14 @@ struct seq_oss_synthinfo_t { * sequencer client information */ -struct seq_oss_devinfo_t { +struct seq_oss_devinfo { int index; /* application index */ int cseq; /* sequencer client number */ int port; /* sequencer port number */ int queue; /* sequencer queue number */ - snd_seq_addr_t addr; /* address of this device */ + struct snd_seq_addr addr; /* address of this device */ int seq_mode; /* sequencer mode */ int file_mode; /* file access */ @@ -109,17 +101,17 @@ struct seq_oss_devinfo_t { /* synth device table */ int max_synthdev; - seq_oss_synthinfo_t synths[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS]; + struct seq_oss_synthinfo synths[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS]; int synth_opened; /* output queue */ - seq_oss_writeq_t *writeq; + struct seq_oss_writeq *writeq; /* midi input queue */ - seq_oss_readq_t *readq; + struct seq_oss_readq *readq; /* timer */ - seq_oss_timer_t *timer; + struct seq_oss_timer *timer; }; @@ -133,24 +125,24 @@ int snd_seq_oss_delete_client(void); /* device file interface */ int snd_seq_oss_open(struct file *file, int level); -void snd_seq_oss_release(seq_oss_devinfo_t *dp); -int snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long arg); -int snd_seq_oss_read(seq_oss_devinfo_t *dev, char __user *buf, int count); -int snd_seq_oss_write(seq_oss_devinfo_t *dp, const char __user *buf, int count, struct file *opt); -unsigned int snd_seq_oss_poll(seq_oss_devinfo_t *dp, struct file *file, poll_table * wait); +void snd_seq_oss_release(struct seq_oss_devinfo *dp); +int snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long arg); +int snd_seq_oss_read(struct seq_oss_devinfo *dev, char __user *buf, int count); +int snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf, int count, struct file *opt); +unsigned int snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait); -void snd_seq_oss_reset(seq_oss_devinfo_t *dp); -void snd_seq_oss_drain_write(seq_oss_devinfo_t *dp); +void snd_seq_oss_reset(struct seq_oss_devinfo *dp); +void snd_seq_oss_drain_write(struct seq_oss_devinfo *dp); /* */ -void snd_seq_oss_process_queue(seq_oss_devinfo_t *dp, abstime_t time); +void snd_seq_oss_process_queue(struct seq_oss_devinfo *dp, abstime_t time); /* proc interface */ -void snd_seq_oss_system_info_read(snd_info_buffer_t *buf); -void snd_seq_oss_midi_info_read(snd_info_buffer_t *buf); -void snd_seq_oss_synth_info_read(snd_info_buffer_t *buf); -void snd_seq_oss_readq_info_read(seq_oss_readq_t *q, snd_info_buffer_t *buf); +void snd_seq_oss_system_info_read(struct snd_info_buffer *buf); +void snd_seq_oss_midi_info_read(struct snd_info_buffer *buf); +void snd_seq_oss_synth_info_read(struct snd_info_buffer *buf); +void snd_seq_oss_readq_info_read(struct seq_oss_readq *q, struct snd_info_buffer *buf); /* file mode macros */ #define is_read_mode(mode) ((mode) & SNDRV_SEQ_OSS_FILE_READ) @@ -159,21 +151,21 @@ void snd_seq_oss_readq_info_read(seq_oss_readq_t *q, snd_info_buffer_t *buf); /* dispatch event */ static inline int -snd_seq_oss_dispatch(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, int atomic, int hop) +snd_seq_oss_dispatch(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, int atomic, int hop) { return snd_seq_kernel_client_dispatch(dp->cseq, ev, atomic, hop); } /* ioctl */ static inline int -snd_seq_oss_control(seq_oss_devinfo_t *dp, unsigned int type, void *arg) +snd_seq_oss_control(struct seq_oss_devinfo *dp, unsigned int type, void *arg) { return snd_seq_kernel_client_ctl(dp->cseq, type, arg); } /* fill the addresses in header */ static inline void -snd_seq_oss_fill_addr(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, +snd_seq_oss_fill_addr(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, int dest_client, int dest_port) { ev->queue = dp->queue; diff --git a/sound/core/seq/oss/seq_oss_event.c b/sound/core/seq/oss/seq_oss_event.c index 58e52ddd292..066f5f3e3f4 100644 --- a/sound/core/seq/oss/seq_oss_event.c +++ b/sound/core/seq/oss/seq_oss_event.c @@ -31,17 +31,17 @@ /* * prototypes */ -static int extended_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev); -static int chn_voice_event(seq_oss_devinfo_t *dp, evrec_t *event_rec, snd_seq_event_t *ev); -static int chn_common_event(seq_oss_devinfo_t *dp, evrec_t *event_rec, snd_seq_event_t *ev); -static int timing_event(seq_oss_devinfo_t *dp, evrec_t *event_rec, snd_seq_event_t *ev); -static int local_event(seq_oss_devinfo_t *dp, evrec_t *event_rec, snd_seq_event_t *ev); -static int old_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev); -static int note_on_event(seq_oss_devinfo_t *dp, int dev, int ch, int note, int vel, snd_seq_event_t *ev); -static int note_off_event(seq_oss_devinfo_t *dp, int dev, int ch, int note, int vel, snd_seq_event_t *ev); -static int set_note_event(seq_oss_devinfo_t *dp, int dev, int type, int ch, int note, int vel, snd_seq_event_t *ev); -static int set_control_event(seq_oss_devinfo_t *dp, int dev, int type, int ch, int param, int val, snd_seq_event_t *ev); -static int set_echo_event(seq_oss_devinfo_t *dp, evrec_t *rec, snd_seq_event_t *ev); +static int extended_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev); +static int chn_voice_event(struct seq_oss_devinfo *dp, union evrec *event_rec, struct snd_seq_event *ev); +static int chn_common_event(struct seq_oss_devinfo *dp, union evrec *event_rec, struct snd_seq_event *ev); +static int timing_event(struct seq_oss_devinfo *dp, union evrec *event_rec, struct snd_seq_event *ev); +static int local_event(struct seq_oss_devinfo *dp, union evrec *event_rec, struct snd_seq_event *ev); +static int old_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev); +static int note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev); +static int note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev); +static int set_note_event(struct seq_oss_devinfo *dp, int dev, int type, int ch, int note, int vel, struct snd_seq_event *ev); +static int set_control_event(struct seq_oss_devinfo *dp, int dev, int type, int ch, int param, int val, struct snd_seq_event *ev); +static int set_echo_event(struct seq_oss_devinfo *dp, union evrec *rec, struct snd_seq_event *ev); /* @@ -51,7 +51,7 @@ static int set_echo_event(seq_oss_devinfo_t *dp, evrec_t *rec, snd_seq_event_t * */ int -snd_seq_oss_process_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +snd_seq_oss_process_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { switch (q->s.code) { case SEQ_EXTENDED: @@ -104,7 +104,7 @@ snd_seq_oss_process_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev /* old type events: mode1 only */ static int -old_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +old_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { switch (q->s.code) { case SEQ_NOTEOFF: @@ -130,7 +130,7 @@ old_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) /* 8bytes extended event: mode1 only */ static int -extended_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +extended_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { int val; @@ -184,7 +184,7 @@ extended_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) /* channel voice events: mode1 and 2 */ static int -chn_voice_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +chn_voice_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { if (q->v.chn >= 32) return -EINVAL; @@ -205,7 +205,7 @@ chn_voice_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) /* channel common events: mode1 and 2 */ static int -chn_common_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +chn_common_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { if (q->l.chn >= 32) return -EINVAL; @@ -232,14 +232,14 @@ chn_common_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) /* timer events: mode1 and mode2 */ static int -timing_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +timing_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { switch (q->t.cmd) { case TMR_ECHO: if (dp->seq_mode == SNDRV_SEQ_OSS_MODE_MUSIC) return set_echo_event(dp, q, ev); else { - evrec_t tmp; + union evrec tmp; memset(&tmp, 0, sizeof(tmp)); /* XXX: only for little-endian! */ tmp.echo = (q->t.time << 8) | SEQ_ECHO; @@ -267,7 +267,7 @@ timing_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) /* local events: mode1 and 2 */ static int -local_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) +local_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev) { return -EINVAL; } @@ -283,9 +283,9 @@ local_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev) * Use key-pressure if note >= 128 */ static int -note_on_event(seq_oss_devinfo_t *dp, int dev, int ch, int note, int vel, snd_seq_event_t *ev) +note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) { - seq_oss_synthinfo_t *info = &dp->synths[dev]; + struct seq_oss_synthinfo *info = &dp->synths[dev]; switch (info->arg.event_passing) { case SNDRV_SEQ_OSS_PROCESS_EVENTS: if (! info->ch || ch < 0 || ch >= info->nr_voices) { @@ -338,9 +338,9 @@ note_on_event(seq_oss_devinfo_t *dp, int dev, int ch, int note, int vel, snd_seq * process note-off event for OSS synth */ static int -note_off_event(seq_oss_devinfo_t *dp, int dev, int ch, int note, int vel, snd_seq_event_t *ev) +note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) { - seq_oss_synthinfo_t *info = &dp->synths[dev]; + struct seq_oss_synthinfo *info = &dp->synths[dev]; switch (info->arg.event_passing) { case SNDRV_SEQ_OSS_PROCESS_EVENTS: if (! info->ch || ch < 0 || ch >= info->nr_voices) { @@ -369,7 +369,7 @@ note_off_event(seq_oss_devinfo_t *dp, int dev, int ch, int note, int vel, snd_se * create a note event */ static int -set_note_event(seq_oss_devinfo_t *dp, int dev, int type, int ch, int note, int vel, snd_seq_event_t *ev) +set_note_event(struct seq_oss_devinfo *dp, int dev, int type, int ch, int note, int vel, struct snd_seq_event *ev) { if (! snd_seq_oss_synth_is_valid(dp, dev)) return -ENXIO; @@ -387,7 +387,7 @@ set_note_event(seq_oss_devinfo_t *dp, int dev, int type, int ch, int note, int v * create a control event */ static int -set_control_event(seq_oss_devinfo_t *dp, int dev, int type, int ch, int param, int val, snd_seq_event_t *ev) +set_control_event(struct seq_oss_devinfo *dp, int dev, int type, int ch, int param, int val, struct snd_seq_event *ev) { if (! snd_seq_oss_synth_is_valid(dp, dev)) return -ENXIO; @@ -405,7 +405,7 @@ set_control_event(seq_oss_devinfo_t *dp, int dev, int type, int ch, int param, i * create an echo event */ static int -set_echo_event(seq_oss_devinfo_t *dp, evrec_t *rec, snd_seq_event_t *ev) +set_echo_event(struct seq_oss_devinfo *dp, union evrec *rec, struct snd_seq_event *ev) { ev->type = SNDRV_SEQ_EVENT_ECHO; /* echo back to itself */ @@ -419,11 +419,11 @@ set_echo_event(seq_oss_devinfo_t *dp, evrec_t *rec, snd_seq_event_t *ev) * the echo event is processed here. */ int -snd_seq_oss_event_input(snd_seq_event_t *ev, int direct, void *private_data, +snd_seq_oss_event_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop) { - seq_oss_devinfo_t *dp = (seq_oss_devinfo_t *)private_data; - evrec_t *rec; + struct seq_oss_devinfo *dp = (struct seq_oss_devinfo *)private_data; + union evrec *rec; if (ev->type != SNDRV_SEQ_EVENT_ECHO) return snd_seq_oss_midi_input(ev, direct, private_data); @@ -431,7 +431,7 @@ snd_seq_oss_event_input(snd_seq_event_t *ev, int direct, void *private_data, if (ev->source.client != dp->cseq) return 0; /* ignored */ - rec = (evrec_t*)&ev->data; + rec = (union evrec*)&ev->data; if (rec->s.code == SEQ_SYNCTIMER) { /* sync echo back */ snd_seq_oss_writeq_wakeup(dp->writeq, rec->t.time); diff --git a/sound/core/seq/oss/seq_oss_event.h b/sound/core/seq/oss/seq_oss_event.h index bf1d4d3f53c..9a4d9adb7b8 100644 --- a/sound/core/seq/oss/seq_oss_event.h +++ b/sound/core/seq/oss/seq_oss_event.h @@ -29,74 +29,74 @@ #define LONG_EVENT_SIZE 8 /* short event (4bytes) */ -typedef struct evrec_short_t { +struct evrec_short { unsigned char code; unsigned char parm1; unsigned char dev; unsigned char parm2; -} evrec_short_t; +}; /* short note events (4bytes) */ -typedef struct evrec_note_t { +struct evrec_note { unsigned char code; unsigned char chn; unsigned char note; unsigned char vel; -} evrec_note_t; +}; /* long timer events (8bytes) */ -typedef struct evrec_timer_t { +struct evrec_timer { unsigned char code; unsigned char cmd; unsigned char dummy1, dummy2; unsigned int time; -} evrec_timer_t; +}; /* long extended events (8bytes) */ -typedef struct evrec_extended_t { +struct evrec_extended { unsigned char code; unsigned char cmd; unsigned char dev; unsigned char chn; unsigned char p1, p2, p3, p4; -} evrec_extended_t; +}; /* long channel events (8bytes) */ -typedef struct evrec_long_t { +struct evrec_long { unsigned char code; unsigned char dev; unsigned char cmd; unsigned char chn; unsigned char p1, p2; unsigned short val; -} evrec_long_t; +}; /* channel voice events (8bytes) */ -typedef struct evrec_voice_t { +struct evrec_voice { unsigned char code; unsigned char dev; unsigned char cmd; unsigned char chn; unsigned char note, parm; unsigned short dummy; -} evrec_voice_t; +}; /* sysex events (8bytes) */ -typedef struct evrec_sysex_t { +struct evrec_sysex { unsigned char code; unsigned char dev; unsigned char buf[6]; -} evrec_sysex_t; +}; /* event record */ -union evrec_t { - evrec_short_t s; - evrec_note_t n; - evrec_long_t l; - evrec_voice_t v; - evrec_timer_t t; - evrec_extended_t e; - evrec_sysex_t x; +union evrec { + struct evrec_short s; + struct evrec_note n; + struct evrec_long l; + struct evrec_voice v; + struct evrec_timer t; + struct evrec_extended e; + struct evrec_sysex x; unsigned int echo; unsigned char c[LONG_EVENT_SIZE]; }; @@ -104,9 +104,9 @@ union evrec_t { #define ev_is_long(ev) ((ev)->s.code >= 128) #define ev_length(ev) ((ev)->s.code >= 128 ? LONG_EVENT_SIZE : SHORT_EVENT_SIZE) -int snd_seq_oss_process_event(seq_oss_devinfo_t *dp, evrec_t *q, snd_seq_event_t *ev); -int snd_seq_oss_process_timer_event(seq_oss_timer_t *rec, evrec_t *q); -int snd_seq_oss_event_input(snd_seq_event_t *ev, int direct, void *private_data, int atomic, int hop); +int snd_seq_oss_process_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev); +int snd_seq_oss_process_timer_event(struct seq_oss_timer *rec, union evrec *q); +int snd_seq_oss_event_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop); #endif /* __SEQ_OSS_EVENT_H */ diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c index 1ab1cf8158c..1d4473eadcf 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c @@ -41,17 +41,17 @@ static int system_client = -1; /* ALSA sequencer client number */ static int system_port = -1; static int num_clients; -static seq_oss_devinfo_t *client_table[SNDRV_SEQ_OSS_MAX_CLIENTS]; +static struct seq_oss_devinfo *client_table[SNDRV_SEQ_OSS_MAX_CLIENTS]; /* * prototypes */ -static int receive_announce(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop); +static int receive_announce(struct snd_seq_event *ev, int direct, void *private, int atomic, int hop); static int translate_mode(struct file *file); -static int create_port(seq_oss_devinfo_t *dp); -static int delete_port(seq_oss_devinfo_t *dp); -static int alloc_seq_queue(seq_oss_devinfo_t *dp); +static int create_port(struct seq_oss_devinfo *dp); +static int delete_port(struct seq_oss_devinfo *dp); +static int alloc_seq_queue(struct seq_oss_devinfo *dp); static int delete_seq_queue(int queue); static void free_devinfo(void *private); @@ -65,10 +65,10 @@ int __init snd_seq_oss_create_client(void) { int rc; - snd_seq_client_callback_t callback; - snd_seq_client_info_t *info; - snd_seq_port_info_t *port; - snd_seq_port_callback_t port_callback; + struct snd_seq_client_callback callback; + struct snd_seq_client_info *info; + struct snd_seq_port_info *port; + struct snd_seq_port_callback port_callback; info = kmalloc(sizeof(*info), GFP_KERNEL); port = kmalloc(sizeof(*port), GFP_KERNEL); @@ -118,7 +118,7 @@ snd_seq_oss_create_client(void) call_ctl(SNDRV_SEQ_IOCTL_CREATE_PORT, port); if ((system_port = port->addr.port) >= 0) { - snd_seq_port_subscribe_t subs; + struct snd_seq_port_subscribe subs; memset(&subs, 0, sizeof(subs)); subs.sender.client = SNDRV_SEQ_CLIENT_SYSTEM; @@ -140,9 +140,9 @@ snd_seq_oss_create_client(void) * receive annoucement from system port, and check the midi device */ static int -receive_announce(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop) +receive_announce(struct snd_seq_event *ev, int direct, void *private, int atomic, int hop) { - snd_seq_port_info_t pinfo; + struct snd_seq_port_info pinfo; if (atomic) return 0; /* it must not happen */ @@ -191,7 +191,7 @@ int snd_seq_oss_open(struct file *file, int level) { int i, rc; - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; if ((dp = kzalloc(sizeof(*dp), GFP_KERNEL)) == NULL) { snd_printk(KERN_ERR "can't malloc device info\n"); @@ -323,11 +323,11 @@ translate_mode(struct file *file) * create sequencer port */ static int -create_port(seq_oss_devinfo_t *dp) +create_port(struct seq_oss_devinfo *dp) { int rc; - snd_seq_port_info_t port; - snd_seq_port_callback_t callback; + struct snd_seq_port_info port; + struct snd_seq_port_callback callback; memset(&port, 0, sizeof(port)); port.addr.client = dp->cseq; @@ -358,7 +358,7 @@ create_port(seq_oss_devinfo_t *dp) * delete ALSA port */ static int -delete_port(seq_oss_devinfo_t *dp) +delete_port(struct seq_oss_devinfo *dp) { if (dp->port < 0) return 0; @@ -371,9 +371,9 @@ delete_port(seq_oss_devinfo_t *dp) * allocate a queue */ static int -alloc_seq_queue(seq_oss_devinfo_t *dp) +alloc_seq_queue(struct seq_oss_devinfo *dp) { - snd_seq_queue_info_t qinfo; + struct snd_seq_queue_info qinfo; int rc; memset(&qinfo, 0, sizeof(qinfo)); @@ -392,7 +392,7 @@ alloc_seq_queue(seq_oss_devinfo_t *dp) static int delete_seq_queue(int queue) { - snd_seq_queue_info_t qinfo; + struct snd_seq_queue_info qinfo; int rc; if (queue < 0) @@ -412,7 +412,7 @@ delete_seq_queue(int queue) static void free_devinfo(void *private) { - seq_oss_devinfo_t *dp = (seq_oss_devinfo_t *)private; + struct seq_oss_devinfo *dp = (struct seq_oss_devinfo *)private; if (dp->timer) snd_seq_oss_timer_delete(dp->timer); @@ -431,7 +431,7 @@ free_devinfo(void *private) * close sequencer device */ void -snd_seq_oss_release(seq_oss_devinfo_t *dp) +snd_seq_oss_release(struct seq_oss_devinfo *dp) { int queue; @@ -460,7 +460,7 @@ snd_seq_oss_release(seq_oss_devinfo_t *dp) * Wait until the queue is empty (if we don't have nonblock) */ void -snd_seq_oss_drain_write(seq_oss_devinfo_t *dp) +snd_seq_oss_drain_write(struct seq_oss_devinfo *dp) { if (! dp->timer->running) return; @@ -477,7 +477,7 @@ snd_seq_oss_drain_write(seq_oss_devinfo_t *dp) * reset sequencer devices */ void -snd_seq_oss_reset(seq_oss_devinfo_t *dp) +snd_seq_oss_reset(struct seq_oss_devinfo *dp) { int i; @@ -525,10 +525,10 @@ filemode_str(int val) * proc interface */ void -snd_seq_oss_system_info_read(snd_info_buffer_t *buf) +snd_seq_oss_system_info_read(struct snd_info_buffer *buf) { int i; - seq_oss_devinfo_t *dp; + struct seq_oss_devinfo *dp; snd_iprintf(buf, "ALSA client number %d\n", system_client); snd_iprintf(buf, "ALSA receiver port %d\n", system_port); diff --git a/sound/core/seq/oss/seq_oss_ioctl.c b/sound/core/seq/oss/seq_oss_ioctl.c index e86f18d00f3..5ac701c903c 100644 --- a/sound/core/seq/oss/seq_oss_ioctl.c +++ b/sound/core/seq/oss/seq_oss_ioctl.c @@ -28,7 +28,7 @@ #include "seq_oss_midi.h" #include "seq_oss_event.h" -static int snd_seq_oss_synth_info_user(seq_oss_devinfo_t *dp, void __user *arg) +static int snd_seq_oss_synth_info_user(struct seq_oss_devinfo *dp, void __user *arg) { struct synth_info info; @@ -41,7 +41,7 @@ static int snd_seq_oss_synth_info_user(seq_oss_devinfo_t *dp, void __user *arg) return 0; } -static int snd_seq_oss_midi_info_user(seq_oss_devinfo_t *dp, void __user *arg) +static int snd_seq_oss_midi_info_user(struct seq_oss_devinfo *dp, void __user *arg) { struct midi_info info; @@ -54,24 +54,24 @@ static int snd_seq_oss_midi_info_user(seq_oss_devinfo_t *dp, void __user *arg) return 0; } -static int snd_seq_oss_oob_user(seq_oss_devinfo_t *dp, void __user *arg) +static int snd_seq_oss_oob_user(struct seq_oss_devinfo *dp, void __user *arg) { unsigned char ev[8]; - snd_seq_event_t tmpev; + struct snd_seq_event tmpev; if (copy_from_user(ev, arg, 8)) return -EFAULT; memset(&tmpev, 0, sizeof(tmpev)); snd_seq_oss_fill_addr(dp, &tmpev, dp->addr.port, dp->addr.client); tmpev.time.tick = 0; - if (! snd_seq_oss_process_event(dp, (evrec_t*)ev, &tmpev)) { + if (! snd_seq_oss_process_event(dp, (union evrec *)ev, &tmpev)) { snd_seq_oss_dispatch(dp, &tmpev, 0, 0); } return 0; } int -snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long carg) +snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long carg) { int dev, val; void __user *arg = (void __user *)carg; diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c index f0e95c8f2ee..eb7ae990965 100644 --- a/sound/core/seq/oss/seq_oss_midi.c +++ b/sound/core/seq/oss/seq_oss_midi.c @@ -37,15 +37,15 @@ /* * definition of midi device record */ -struct seq_oss_midi_t { +struct seq_oss_midi { int seq_device; /* device number */ int client; /* sequencer client number */ int port; /* sequencer port number */ unsigned int flags; /* port capability */ int opened; /* flag for opening */ unsigned char name[SNDRV_SEQ_OSS_MAX_MIDI_NAME]; - snd_midi_event_t *coder; /* MIDI event coder */ - seq_oss_devinfo_t *devinfo; /* assigned OSSseq device */ + struct snd_midi_event *coder; /* MIDI event coder */ + struct seq_oss_devinfo *devinfo; /* assigned OSSseq device */ snd_use_lock_t use_lock; }; @@ -54,17 +54,17 @@ struct seq_oss_midi_t { * midi device table */ static int max_midi_devs; -static seq_oss_midi_t *midi_devs[SNDRV_SEQ_OSS_MAX_MIDI_DEVS]; +static struct seq_oss_midi *midi_devs[SNDRV_SEQ_OSS_MAX_MIDI_DEVS]; static DEFINE_SPINLOCK(register_lock); /* * prototypes */ -static seq_oss_midi_t *get_mdev(int dev); -static seq_oss_midi_t *get_mididev(seq_oss_devinfo_t *dp, int dev); -static int send_synth_event(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, int dev); -static int send_midi_event(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, seq_oss_midi_t *mdev); +static struct seq_oss_midi *get_mdev(int dev); +static struct seq_oss_midi *get_mididev(struct seq_oss_devinfo *dp, int dev); +static int send_synth_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, int dev); +static int send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq_oss_midi *mdev); /* * look up the existing ports @@ -73,8 +73,8 @@ static int send_midi_event(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, seq_oss_m int __init snd_seq_oss_midi_lookup_ports(int client) { - snd_seq_client_info_t *clinfo; - snd_seq_port_info_t *pinfo; + struct snd_seq_client_info *clinfo; + struct snd_seq_port_info *pinfo; clinfo = kzalloc(sizeof(*clinfo), GFP_KERNEL); pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL); @@ -100,10 +100,10 @@ snd_seq_oss_midi_lookup_ports(int client) /* */ -static seq_oss_midi_t * +static struct seq_oss_midi * get_mdev(int dev) { - seq_oss_midi_t *mdev; + struct seq_oss_midi *mdev; unsigned long flags; spin_lock_irqsave(®ister_lock, flags); @@ -117,11 +117,11 @@ get_mdev(int dev) /* * look for the identical slot */ |