Commit 48c9d417 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Raw MIDI

Modules: RawMidi Midlevel

Remove xxx_t typedefs from the core raw MIDI codes.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 53d2f744
......@@ -36,11 +36,6 @@
* Raw MIDI interface
*/
typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t;
typedef struct sndrv_rawmidi_info snd_rawmidi_info_t;
typedef struct sndrv_rawmidi_params snd_rawmidi_params_t;
typedef struct sndrv_rawmidi_status snd_rawmidi_status_t;
#define SNDRV_RAWMIDI_DEVICES 8
#define SNDRV_RAWMIDI_LFLG_OUTPUT (1<<0)
......@@ -49,23 +44,22 @@ typedef struct sndrv_rawmidi_status snd_rawmidi_status_t;
#define SNDRV_RAWMIDI_LFLG_APPEND (1<<2)
#define SNDRV_RAWMIDI_LFLG_NOOPENLOCK (1<<3)
typedef struct _snd_rawmidi_runtime snd_rawmidi_runtime_t;
typedef struct _snd_rawmidi_substream snd_rawmidi_substream_t;
typedef struct _snd_rawmidi_str snd_rawmidi_str_t;
struct snd_rawmidi;
struct snd_rawmidi_substream;
typedef struct _snd_rawmidi_ops {
int (*open) (snd_rawmidi_substream_t * substream);
int (*close) (snd_rawmidi_substream_t * substream);
void (*trigger) (snd_rawmidi_substream_t * substream, int up);
void (*drain) (snd_rawmidi_substream_t * substream);
} snd_rawmidi_ops_t;
struct snd_rawmidi_ops {
int (*open) (struct snd_rawmidi_substream * substream);
int (*close) (struct snd_rawmidi_substream * substream);
void (*trigger) (struct snd_rawmidi_substream * substream, int up);
void (*drain) (struct snd_rawmidi_substream * substream);
};
typedef struct _snd_rawmidi_global_ops {
int (*dev_register) (snd_rawmidi_t * rmidi);
int (*dev_unregister) (snd_rawmidi_t * rmidi);
} snd_rawmidi_global_ops_t;
struct snd_rawmidi_global_ops {
int (*dev_register) (struct snd_rawmidi * rmidi);
int (*dev_unregister) (struct snd_rawmidi * rmidi);
};
struct _snd_rawmidi_runtime {
struct snd_rawmidi_runtime {
unsigned int drain: 1, /* drain stage */
oss: 1; /* OSS compatible mode */
/* midi stream buffer */
......@@ -80,15 +74,15 @@ struct _snd_rawmidi_runtime {
spinlock_t lock;
wait_queue_head_t sleep;
/* event handler (new bytes, input only) */
void (*event)(snd_rawmidi_substream_t *substream);
void (*event)(struct snd_rawmidi_substream *substream);
/* defers calls to event [input] or ops->trigger [output] */
struct tasklet_struct tasklet;
/* private data */
void *private_data;
void (*private_free)(snd_rawmidi_substream_t *substream);
void (*private_free)(struct snd_rawmidi_substream *substream);
};
struct _snd_rawmidi_substream {
struct snd_rawmidi_substream {
struct list_head list; /* list of all substream for given stream */
int stream; /* direction */
int number; /* substream number */
......@@ -97,28 +91,28 @@ struct _snd_rawmidi_substream {
active_sensing: 1; /* send active sensing when close */
int use_count; /* use counter (for output) */
size_t bytes;
snd_rawmidi_t *rmidi;
snd_rawmidi_str_t *pstr;
struct snd_rawmidi *rmidi;
struct snd_rawmidi_str *pstr;
char name[32];
snd_rawmidi_runtime_t *runtime;
struct snd_rawmidi_runtime *runtime;
/* hardware layer */
snd_rawmidi_ops_t *ops;
struct snd_rawmidi_ops *ops;
};
typedef struct _snd_rawmidi_file {
snd_rawmidi_t *rmidi;
snd_rawmidi_substream_t *input;
snd_rawmidi_substream_t *output;
} snd_rawmidi_file_t;
struct snd_rawmidi_file {
struct snd_rawmidi *rmidi;
struct snd_rawmidi_substream *input;
struct snd_rawmidi_substream *output;
};
struct _snd_rawmidi_str {
struct snd_rawmidi_str {
unsigned int substream_count;
unsigned int substream_opened;
struct list_head substreams;
};
struct _snd_rawmidi {
snd_card_t *card;
struct snd_rawmidi {
struct snd_card *card;
unsigned int device; /* device number */
unsigned int info_flags; /* SNDRV_RAWMIDI_INFO_XXXX */
......@@ -129,52 +123,61 @@ struct _snd_rawmidi {
int ossreg;
#endif
snd_rawmidi_global_ops_t *ops;
struct snd_rawmidi_global_ops *ops;
snd_rawmidi_str_t streams[2];
struct snd_rawmidi_str streams[2];
void *private_data;
void (*private_free) (snd_rawmidi_t *rmidi);
void (*private_free) (struct snd_rawmidi *rmidi);
struct semaphore open_mutex;
wait_queue_head_t open_wait;
snd_info_entry_t *dev;
snd_info_entry_t *proc_entry;
struct snd_info_entry *dev;
struct snd_info_entry *proc_entry;
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
snd_seq_device_t *seq_dev;
struct snd_seq_device *seq_dev;
#endif
};
/* main rawmidi functions */
int snd_rawmidi_new(snd_card_t * card, char *id, int device,
int snd_rawmidi_new(struct snd_card *card, char *id, int device,
int output_count, int input_count,
snd_rawmidi_t ** rmidi);
void snd_rawmidi_set_ops(snd_rawmidi_t * rmidi, int stream, snd_rawmidi_ops_t * ops);
struct snd_rawmidi **rmidi);
void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
struct snd_rawmidi_ops *ops);
/* callbacks */
void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream);
int snd_rawmidi_receive(snd_rawmidi_substream_t * substream, const unsigned char *buffer, int count);
void snd_rawmidi_transmit_reset(snd_rawmidi_substream_t * substream);
int snd_rawmidi_transmit_empty(snd_rawmidi_substream_t * substream);
int snd_rawmidi_transmit_peek(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count);
int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count);
int snd_rawmidi_transmit(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count);
void snd_rawmidi_receive_reset(struct snd_rawmidi_substream *substream);
int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
const unsigned char *buffer, int count);
void snd_rawmidi_transmit_reset(struct snd_rawmidi_substream *substream);
int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
unsigned char *buffer, int count);
int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count);
int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
unsigned char *buffer, int count);
/* main midi functions */
int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info);
int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode, snd_rawmidi_file_t * rfile);
int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile);
int snd_rawmidi_output_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params);
int snd_rawmidi_input_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params);
int snd_rawmidi_drop_output(snd_rawmidi_substream_t * substream);
int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream);
int snd_rawmidi_drain_input(snd_rawmidi_substream_t * substream);
long snd_rawmidi_kernel_read(snd_rawmidi_substream_t * substream, unsigned char *buf, long count);
long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count);
int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info);
int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode,
struct snd_rawmidi_file *rfile);
int snd_rawmidi_kernel_release(struct snd_rawmidi_file *rfile);
int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
struct snd_rawmidi_params *params);
int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
struct snd_rawmidi_params *params);
int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream);
int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream);
int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream);
long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
unsigned char *buf, long count);
long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
const unsigned char *buf, long count);
#endif /* __SOUND_RAWMIDI_H */
This diff is collapsed.
......@@ -22,7 +22,7 @@
#include <linux/compat.h>
struct sndrv_rawmidi_params32 {
struct snd_rawmidi_params32 {
s32 stream;
u32 buffer_size;
u32 avail_min;
......@@ -30,10 +30,10 @@ struct sndrv_rawmidi_params32 {
unsigned char reserved[16];
} __attribute__((packed));
static int snd_rawmidi_ioctl_params_compat(snd_rawmidi_file_t *rfile,
struct sndrv_rawmidi_params32 __user *src)
static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
struct snd_rawmidi_params32 __user *src)
{
snd_rawmidi_params_t params;
struct snd_rawmidi_params params;
unsigned int val;
if (rfile->output == NULL)
......@@ -53,7 +53,7 @@ static int snd_rawmidi_ioctl_params_compat(snd_rawmidi_file_t *rfile,
return -EINVAL;
}
struct sndrv_rawmidi_status32 {
struct snd_rawmidi_status32 {
s32 stream;
struct compat_timespec tstamp;
u32 avail;
......@@ -61,11 +61,11 @@ struct sndrv_rawmidi_status32 {
unsigned char reserved[16];
} __attribute__((packed));
static int snd_rawmidi_ioctl_status_compat(snd_rawmidi_file_t *rfile,
struct sndrv_rawmidi_status32 __user *src)
static int snd_rawmidi_ioctl_status_compat(struct snd_rawmidi_file *rfile,
struct snd_rawmidi_status32 __user *src)
{
int err;
snd_rawmidi_status_t status;
struct snd_rawmidi_status status;
if (rfile->output == NULL)
return -EINVAL;
......@@ -95,13 +95,13 @@ static int snd_rawmidi_ioctl_status_compat(snd_rawmidi_file_t *rfile,
}
enum {
SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct sndrv_rawmidi_params32),
SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct sndrv_rawmidi_status32),
SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct snd_rawmidi_params32),
SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct snd_rawmidi_status32),
};
static long snd_rawmidi_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
{
snd_rawmidi_file_t *rfile;
struct snd_rawmidi_file *rfile;
void __user *argp = compat_ptr(arg);
rfile = file->private_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment