Skip to content

Commit

Permalink
[ALSA] Remove xxx_t typedefs: Sequencer OSS-emulation
Browse files Browse the repository at this point in the history
Modules: ALSA<-OSS sequencer,ALSA sequencer

Remove xxx_t typedefs from the core sequencer OSS-emulation codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 19ac31e commit 080dece
Show file tree
Hide file tree
Showing 18 changed files with 352 additions and 365 deletions.
30 changes: 12 additions & 18 deletions include/sound/seq_oss.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,17 @@
#include "asequencer.h"
#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,
Expand All @@ -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 */
Expand Down Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions sound/core/seq/oss/seq_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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,
};
Expand All @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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,
};
Expand Down Expand Up @@ -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(&register_mutex);
snd_iprintf(buf, "OSS sequencer emulation version %s\n", SNDRV_SEQ_OSS_VERSION_STR);
Expand All @@ -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)
Expand Down
60 changes: 26 additions & 34 deletions sound/core/seq/oss/seq_oss_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand All @@ -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;
};


Expand All @@ -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)
Expand All @@ -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;
Expand Down
Loading

0 comments on commit 080dece

Please sign in to comment.