Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ALSA] Remove xxx_t typedefs: Raw MIDI

Modules: RawMidi Midlevel

Remove xxx_t typedefs from the core raw MIDI codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Iwai and committed by
Jaroslav Kysela
48c9d417 53d2f744

+220 -205
+63 -60
include/sound/rawmidi.h
··· 36 36 * Raw MIDI interface 37 37 */ 38 38 39 - typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t; 40 - typedef struct sndrv_rawmidi_info snd_rawmidi_info_t; 41 - typedef struct sndrv_rawmidi_params snd_rawmidi_params_t; 42 - typedef struct sndrv_rawmidi_status snd_rawmidi_status_t; 43 - 44 39 #define SNDRV_RAWMIDI_DEVICES 8 45 40 46 41 #define SNDRV_RAWMIDI_LFLG_OUTPUT (1<<0) ··· 44 49 #define SNDRV_RAWMIDI_LFLG_APPEND (1<<2) 45 50 #define SNDRV_RAWMIDI_LFLG_NOOPENLOCK (1<<3) 46 51 47 - typedef struct _snd_rawmidi_runtime snd_rawmidi_runtime_t; 48 - typedef struct _snd_rawmidi_substream snd_rawmidi_substream_t; 49 - typedef struct _snd_rawmidi_str snd_rawmidi_str_t; 52 + struct snd_rawmidi; 53 + struct snd_rawmidi_substream; 50 54 51 - typedef struct _snd_rawmidi_ops { 52 - int (*open) (snd_rawmidi_substream_t * substream); 53 - int (*close) (snd_rawmidi_substream_t * substream); 54 - void (*trigger) (snd_rawmidi_substream_t * substream, int up); 55 - void (*drain) (snd_rawmidi_substream_t * substream); 56 - } snd_rawmidi_ops_t; 55 + struct snd_rawmidi_ops { 56 + int (*open) (struct snd_rawmidi_substream * substream); 57 + int (*close) (struct snd_rawmidi_substream * substream); 58 + void (*trigger) (struct snd_rawmidi_substream * substream, int up); 59 + void (*drain) (struct snd_rawmidi_substream * substream); 60 + }; 57 61 58 - typedef struct _snd_rawmidi_global_ops { 59 - int (*dev_register) (snd_rawmidi_t * rmidi); 60 - int (*dev_unregister) (snd_rawmidi_t * rmidi); 61 - } snd_rawmidi_global_ops_t; 62 + struct snd_rawmidi_global_ops { 63 + int (*dev_register) (struct snd_rawmidi * rmidi); 64 + int (*dev_unregister) (struct snd_rawmidi * rmidi); 65 + }; 62 66 63 - struct _snd_rawmidi_runtime { 67 + struct snd_rawmidi_runtime { 64 68 unsigned int drain: 1, /* drain stage */ 65 69 oss: 1; /* OSS compatible mode */ 66 70 /* midi stream buffer */ ··· 74 80 spinlock_t lock; 75 81 wait_queue_head_t sleep; 76 82 /* event handler (new bytes, input only) */ 77 - void (*event)(snd_rawmidi_substream_t *substream); 83 + void (*event)(struct snd_rawmidi_substream *substream); 78 84 /* defers calls to event [input] or ops->trigger [output] */ 79 85 struct tasklet_struct tasklet; 80 86 /* private data */ 81 87 void *private_data; 82 - void (*private_free)(snd_rawmidi_substream_t *substream); 88 + void (*private_free)(struct snd_rawmidi_substream *substream); 83 89 }; 84 90 85 - struct _snd_rawmidi_substream { 91 + struct snd_rawmidi_substream { 86 92 struct list_head list; /* list of all substream for given stream */ 87 93 int stream; /* direction */ 88 94 int number; /* substream number */ ··· 91 97 active_sensing: 1; /* send active sensing when close */ 92 98 int use_count; /* use counter (for output) */ 93 99 size_t bytes; 94 - snd_rawmidi_t *rmidi; 95 - snd_rawmidi_str_t *pstr; 100 + struct snd_rawmidi *rmidi; 101 + struct snd_rawmidi_str *pstr; 96 102 char name[32]; 97 - snd_rawmidi_runtime_t *runtime; 103 + struct snd_rawmidi_runtime *runtime; 98 104 /* hardware layer */ 99 - snd_rawmidi_ops_t *ops; 105 + struct snd_rawmidi_ops *ops; 100 106 }; 101 107 102 - typedef struct _snd_rawmidi_file { 103 - snd_rawmidi_t *rmidi; 104 - snd_rawmidi_substream_t *input; 105 - snd_rawmidi_substream_t *output; 106 - } snd_rawmidi_file_t; 108 + struct snd_rawmidi_file { 109 + struct snd_rawmidi *rmidi; 110 + struct snd_rawmidi_substream *input; 111 + struct snd_rawmidi_substream *output; 112 + }; 107 113 108 - struct _snd_rawmidi_str { 114 + struct snd_rawmidi_str { 109 115 unsigned int substream_count; 110 116 unsigned int substream_opened; 111 117 struct list_head substreams; 112 118 }; 113 119 114 - struct _snd_rawmidi { 115 - snd_card_t *card; 120 + struct snd_rawmidi { 121 + struct snd_card *card; 116 122 117 123 unsigned int device; /* device number */ 118 124 unsigned int info_flags; /* SNDRV_RAWMIDI_INFO_XXXX */ ··· 123 129 int ossreg; 124 130 #endif 125 131 126 - snd_rawmidi_global_ops_t *ops; 132 + struct snd_rawmidi_global_ops *ops; 127 133 128 - snd_rawmidi_str_t streams[2]; 134 + struct snd_rawmidi_str streams[2]; 129 135 130 136 void *private_data; 131 - void (*private_free) (snd_rawmidi_t *rmidi); 137 + void (*private_free) (struct snd_rawmidi *rmidi); 132 138 133 139 struct semaphore open_mutex; 134 140 wait_queue_head_t open_wait; 135 141 136 - snd_info_entry_t *dev; 137 - snd_info_entry_t *proc_entry; 142 + struct snd_info_entry *dev; 143 + struct snd_info_entry *proc_entry; 138 144 139 145 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 140 - snd_seq_device_t *seq_dev; 146 + struct snd_seq_device *seq_dev; 141 147 #endif 142 148 }; 143 149 144 150 /* main rawmidi functions */ 145 151 146 - int snd_rawmidi_new(snd_card_t * card, char *id, int device, 152 + int snd_rawmidi_new(struct snd_card *card, char *id, int device, 147 153 int output_count, int input_count, 148 - snd_rawmidi_t ** rmidi); 149 - void snd_rawmidi_set_ops(snd_rawmidi_t * rmidi, int stream, snd_rawmidi_ops_t * ops); 154 + struct snd_rawmidi **rmidi); 155 + void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream, 156 + struct snd_rawmidi_ops *ops); 150 157 151 158 /* callbacks */ 152 159 153 - void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream); 154 - int snd_rawmidi_receive(snd_rawmidi_substream_t * substream, const unsigned char *buffer, int count); 155 - void snd_rawmidi_transmit_reset(snd_rawmidi_substream_t * substream); 156 - int snd_rawmidi_transmit_empty(snd_rawmidi_substream_t * substream); 157 - int snd_rawmidi_transmit_peek(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count); 158 - int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count); 159 - int snd_rawmidi_transmit(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count); 160 + void snd_rawmidi_receive_reset(struct snd_rawmidi_substream *substream); 161 + int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, 162 + const unsigned char *buffer, int count); 163 + void snd_rawmidi_transmit_reset(struct snd_rawmidi_substream *substream); 164 + int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream); 165 + int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, 166 + unsigned char *buffer, int count); 167 + int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count); 168 + int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, 169 + unsigned char *buffer, int count); 160 170 161 171 /* main midi functions */ 162 172 163 - int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info); 164 - int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode, snd_rawmidi_file_t * rfile); 165 - int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile); 166 - int snd_rawmidi_output_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params); 167 - int snd_rawmidi_input_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params); 168 - int snd_rawmidi_drop_output(snd_rawmidi_substream_t * substream); 169 - int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream); 170 - int snd_rawmidi_drain_input(snd_rawmidi_substream_t * substream); 171 - long snd_rawmidi_kernel_read(snd_rawmidi_substream_t * substream, unsigned char *buf, long count); 172 - long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count); 173 + int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info); 174 + int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode, 175 + struct snd_rawmidi_file *rfile); 176 + int snd_rawmidi_kernel_release(struct snd_rawmidi_file *rfile); 177 + int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, 178 + struct snd_rawmidi_params *params); 179 + int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, 180 + struct snd_rawmidi_params *params); 181 + int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream); 182 + int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream); 183 + int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream); 184 + long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream, 185 + unsigned char *buf, long count); 186 + long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream, 187 + const unsigned char *buf, long count); 173 188 174 189 #endif /* __SOUND_RAWMIDI_H */
+146 -134
sound/core/rawmidi.c
··· 50 50 MODULE_PARM_DESC(amidi_map, "Raw MIDI device number assigned to 2nd OSS device."); 51 51 #endif /* CONFIG_SND_OSSEMUL */ 52 52 53 - static int snd_rawmidi_free(snd_rawmidi_t *rawmidi); 54 - static int snd_rawmidi_dev_free(snd_device_t *device); 55 - static int snd_rawmidi_dev_register(snd_device_t *device); 56 - static int snd_rawmidi_dev_disconnect(snd_device_t *device); 57 - static int snd_rawmidi_dev_unregister(snd_device_t *device); 53 + static int snd_rawmidi_free(struct snd_rawmidi *rawmidi); 54 + static int snd_rawmidi_dev_free(struct snd_device *device); 55 + static int snd_rawmidi_dev_register(struct snd_device *device); 56 + static int snd_rawmidi_dev_disconnect(struct snd_device *device); 57 + static int snd_rawmidi_dev_unregister(struct snd_device *device); 58 58 59 - static snd_rawmidi_t *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES]; 59 + static struct snd_rawmidi *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES]; 60 60 61 61 static DECLARE_MUTEX(register_mutex); 62 62 ··· 72 72 } 73 73 } 74 74 75 - static inline int snd_rawmidi_ready(snd_rawmidi_substream_t * substream) 75 + static inline int snd_rawmidi_ready(struct snd_rawmidi_substream *substream) 76 76 { 77 - snd_rawmidi_runtime_t *runtime = substream->runtime; 77 + struct snd_rawmidi_runtime *runtime = substream->runtime; 78 78 return runtime->avail >= runtime->avail_min; 79 79 } 80 80 81 - static inline int snd_rawmidi_ready_append(snd_rawmidi_substream_t * substream, size_t count) 81 + static inline int snd_rawmidi_ready_append(struct snd_rawmidi_substream *substream, 82 + size_t count) 82 83 { 83 - snd_rawmidi_runtime_t *runtime = substream->runtime; 84 + struct snd_rawmidi_runtime *runtime = substream->runtime; 84 85 return runtime->avail >= runtime->avail_min && 85 86 (!substream->append || runtime->avail >= count); 86 87 } 87 88 88 89 static void snd_rawmidi_input_event_tasklet(unsigned long data) 89 90 { 90 - snd_rawmidi_substream_t *substream = (snd_rawmidi_substream_t *)data; 91 + struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data; 91 92 substream->runtime->event(substream); 92 93 } 93 94 94 95 static void snd_rawmidi_output_trigger_tasklet(unsigned long data) 95 96 { 96 - snd_rawmidi_substream_t *substream = (snd_rawmidi_substream_t *)data; 97 + struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data; 97 98 substream->ops->trigger(substream, 1); 98 99 } 99 100 100 - static int snd_rawmidi_runtime_create(snd_rawmidi_substream_t * substream) 101 + static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) 101 102 { 102 - snd_rawmidi_runtime_t *runtime; 103 + struct snd_rawmidi_runtime *runtime; 103 104 104 105 if ((runtime = kzalloc(sizeof(*runtime), GFP_KERNEL)) == NULL) 105 106 return -ENOMEM; ··· 130 129 return 0; 131 130 } 132 131 133 - static int snd_rawmidi_runtime_free(snd_rawmidi_substream_t * substream) 132 + static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream) 134 133 { 135 - snd_rawmidi_runtime_t *runtime = substream->runtime; 134 + struct snd_rawmidi_runtime *runtime = substream->runtime; 136 135 137 136 kfree(runtime->buffer); 138 137 kfree(runtime); ··· 140 139 return 0; 141 140 } 142 141 143 - static inline void snd_rawmidi_output_trigger(snd_rawmidi_substream_t * substream, int up) 142 + static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) 144 143 { 145 144 if (up) { 146 145 tasklet_hi_schedule(&substream->runtime->tasklet); ··· 150 149 } 151 150 } 152 151 153 - static void snd_rawmidi_input_trigger(snd_rawmidi_substream_t * substream, int up) 152 + static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) 154 153 { 155 154 substream->ops->trigger(substream, up); 156 155 if (!up && substream->runtime->event) 157 156 tasklet_kill(&substream->runtime->tasklet); 158 157 } 159 158 160 - int snd_rawmidi_drop_output(snd_rawmidi_substream_t * substream) 159 + int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream) 161 160 { 162 161 unsigned long flags; 163 - snd_rawmidi_runtime_t *runtime = substream->runtime; 162 + struct snd_rawmidi_runtime *runtime = substream->runtime; 164 163 165 164 snd_rawmidi_output_trigger(substream, 0); 166 165 runtime->drain = 0; ··· 171 170 return 0; 172 171 } 173 172 174 - int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream) 173 + int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream) 175 174 { 176 175 int err; 177 176 long timeout; 178 - snd_rawmidi_runtime_t *runtime = substream->runtime; 177 + struct snd_rawmidi_runtime *runtime = substream->runtime; 179 178 180 179 err = 0; 181 180 runtime->drain = 1; ··· 200 199 return err; 201 200 } 202 201 203 - int snd_rawmidi_drain_input(snd_rawmidi_substream_t * substream) 202 + int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream) 204 203 { 205 204 unsigned long flags; 206 - snd_rawmidi_runtime_t *runtime = substream->runtime; 205 + struct snd_rawmidi_runtime *runtime = substream->runtime; 207 206 208 207 snd_rawmidi_input_trigger(substream, 0); 209 208 runtime->drain = 0; ··· 215 214 } 216 215 217 216 int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, 218 - int mode, snd_rawmidi_file_t * rfile) 217 + int mode, struct snd_rawmidi_file * rfile) 219 218 { 220 - snd_rawmidi_t *rmidi; 219 + struct snd_rawmidi *rmidi; 221 220 struct list_head *list1, *list2; 222 - snd_rawmidi_substream_t *sinput = NULL, *soutput = NULL; 223 - snd_rawmidi_runtime_t *input = NULL, *output = NULL; 221 + struct snd_rawmidi_substream *sinput = NULL, *soutput = NULL; 222 + struct snd_rawmidi_runtime *input = NULL, *output = NULL; 224 223 int err; 225 224 226 225 if (rfile) ··· 276 275 } 277 276 break; 278 277 } 279 - sinput = list_entry(list1, snd_rawmidi_substream_t, list); 278 + sinput = list_entry(list1, struct snd_rawmidi_substream, list); 280 279 if ((mode & SNDRV_RAWMIDI_LFLG_INPUT) && sinput->opened) 281 280 goto __nexti; 282 281 if (subdevice < 0 || (subdevice >= 0 && subdevice == sinput->number)) ··· 294 293 } 295 294 break; 296 295 } 297 - soutput = list_entry(list2, snd_rawmidi_substream_t, list); 296 + soutput = list_entry(list2, struct snd_rawmidi_substream, list); 298 297 if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) { 299 298 if (mode & SNDRV_RAWMIDI_LFLG_APPEND) { 300 299 if (soutput->opened && !soutput->append) ··· 369 368 { 370 369 int maj = imajor(inode); 371 370 int cardnum; 372 - snd_card_t *card; 371 + struct snd_card *card; 373 372 int device, subdevice; 374 373 unsigned short fflags; 375 374 int err; 376 - snd_rawmidi_t *rmidi; 377 - snd_rawmidi_file_t *rawmidi_file; 375 + struct snd_rawmidi *rmidi; 376 + struct snd_rawmidi_file *rawmidi_file; 378 377 wait_queue_t wait; 379 378 struct list_head *list; 380 - snd_ctl_file_t *kctl; 379 + struct snd_ctl_file *kctl; 381 380 382 381 if (maj == snd_major) { 383 382 cardnum = SNDRV_MINOR_CARD(iminor(inode)); ··· 466 465 return err; 467 466 } 468 467 469 - int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile) 468 + int snd_rawmidi_kernel_release(struct snd_rawmidi_file * rfile) 470 469 { 471 - snd_rawmidi_t *rmidi; 472 - snd_rawmidi_substream_t *substream; 473 - snd_rawmidi_runtime_t *runtime; 470 + struct snd_rawmidi *rmidi; 471 + struct snd_rawmidi_substream *substream; 472 + struct snd_rawmidi_runtime *runtime; 474 473 475 474 snd_assert(rfile != NULL, return -ENXIO); 476 475 snd_assert(rfile->input != NULL || rfile->output != NULL, return -ENXIO); ··· 516 515 517 516 static int snd_rawmidi_release(struct inode *inode, struct file *file) 518 517 { 519 - snd_rawmidi_file_t *rfile; 520 - snd_rawmidi_t *rmidi; 518 + struct snd_rawmidi_file *rfile; 519 + struct snd_rawmidi *rmidi; 521 520 int err; 522 521 523 522 rfile = file->private_data; ··· 529 528 return err; 530 529 } 531 530 532 - int snd_rawmidi_info(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t *info) 531 + int snd_rawmidi_info(struct snd_rawmidi_substream *substream, 532 + struct snd_rawmidi_info *info) 533 533 { 534 - snd_rawmidi_t *rmidi; 534 + struct snd_rawmidi *rmidi; 535 535 536 536 if (substream == NULL) 537 537 return -ENODEV; ··· 552 550 return 0; 553 551 } 554 552 555 - static int snd_rawmidi_info_user(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t __user * _info) 553 + static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream, 554 + struct snd_rawmidi_info __user * _info) 556 555 { 557 - snd_rawmidi_info_t info; 556 + struct snd_rawmidi_info info; 558 557 int err; 559 558 if ((err = snd_rawmidi_info(substream, &info)) < 0) 560 559 return err; 561 - if (copy_to_user(_info, &info, sizeof(snd_rawmidi_info_t))) 560 + if (copy_to_user(_info, &info, sizeof(struct snd_rawmidi_info))) 562 561 return -EFAULT; 563 562 return 0; 564 563 } 565 564 566 - int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info) 565 + int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info) 567 566 { 568 - snd_rawmidi_t *rmidi; 569 - snd_rawmidi_str_t *pstr; 570 - snd_rawmidi_substream_t *substream; 567 + struct snd_rawmidi *rmidi; 568 + struct snd_rawmidi_str *pstr; 569 + struct snd_rawmidi_substream *substream; 571 570 struct list_head *list; 572 571 if (info->device >= SNDRV_RAWMIDI_DEVICES) 573 572 return -ENXIO; ··· 581 578 if (info->subdevice >= pstr->substream_count) 582 579 return -ENXIO; 583 580 list_for_each(list, &pstr->substreams) { 584 - substream = list_entry(list, snd_rawmidi_substream_t, list); 581 + substream = list_entry(list, struct snd_rawmidi_substream, list); 585 582 if ((unsigned int)substream->number == info->subdevice) 586 583 return snd_rawmidi_info(substream, info); 587 584 } 588 585 return -ENXIO; 589 586 } 590 587 591 - static int snd_rawmidi_info_select_user(snd_card_t *card, 592 - snd_rawmidi_info_t __user *_info) 588 + static int snd_rawmidi_info_select_user(struct snd_card *card, 589 + struct snd_rawmidi_info __user *_info) 593 590 { 594 591 int err; 595 - snd_rawmidi_info_t info; 592 + struct snd_rawmidi_info info; 596 593 if (get_user(info.device, &_info->device)) 597 594 return -EFAULT; 598 595 if (get_user(info.stream, &_info->stream)) ··· 601 598 return -EFAULT; 602 599 if ((err = snd_rawmidi_info_select(card, &info)) < 0) 603 600 return err; 604 - if (copy_to_user(_info, &info, sizeof(snd_rawmidi_info_t))) 601 + if (copy_to_user(_info, &info, sizeof(struct snd_rawmidi_info))) 605 602 return -EFAULT; 606 603 return 0; 607 604 } 608 605 609 - int snd_rawmidi_output_params(snd_rawmidi_substream_t * substream, 610 - snd_rawmidi_params_t * params) 606 + int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, 607 + struct snd_rawmidi_params * params) 611 608 { 612 609 char *newbuf; 613 - snd_rawmidi_runtime_t *runtime = substream->runtime; 610 + struct snd_rawmidi_runtime *runtime = substream->runtime; 614 611 615 612 if (substream->append && substream->use_count > 1) 616 613 return -EBUSY; ··· 633 630 return 0; 634 631 } 635 632 636 - int snd_rawmidi_input_params(snd_rawmidi_substream_t * substream, 637 - snd_rawmidi_params_t * params) 633 + int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, 634 + struct snd_rawmidi_params * params) 638 635 { 639 636 char *newbuf; 640 - snd_rawmidi_runtime_t *runtime = substream->runtime; 637 + struct snd_rawmidi_runtime *runtime = substream->runtime; 641 638 642 639 snd_rawmidi_drain_input(substream); 643 640 if (params->buffer_size < 32 || params->buffer_size > 1024L * 1024L) { ··· 657 654 return 0; 658 655 } 659 656 660 - static int snd_rawmidi_output_status(snd_rawmidi_substream_t * substream, 661 - snd_rawmidi_status_t * status) 657 + static int snd_rawmidi_output_status(struct snd_rawmidi_substream *substream, 658 + struct snd_rawmidi_status * status) 662 659 { 663 - snd_rawmidi_runtime_t *runtime = substream->runtime; 660 + struct snd_rawmidi_runtime *runtime = substream->runtime; 664 661 665 662 memset(status, 0, sizeof(*status)); 666 663 status->stream = SNDRV_RAWMIDI_STREAM_OUTPUT; ··· 670 667 return 0; 671 668 } 672 669 673 - static int snd_rawmidi_input_status(snd_rawmidi_substream_t * substream, 674 - snd_rawmidi_status_t * status) 670 + static int snd_rawmidi_input_status(struct snd_rawmidi_substream *substream, 671 + struct snd_rawmidi_status * status) 675 672 { 676 - snd_rawmidi_runtime_t *runtime = substream->runtime; 673 + struct snd_rawmidi_runtime *runtime = substream->runtime; 677 674 678 675 memset(status, 0, sizeof(*status)); 679 676 status->stream = SNDRV_RAWMIDI_STREAM_INPUT; ··· 687 684 688 685 static long snd_rawmidi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 689 686 { 690 - snd_rawmidi_file_t *rfile; 687 + struct snd_rawmidi_file *rfile; 691 688 void __user *argp = (void __user *)arg; 692 689 693 690 rfile = file->private_data; ··· 698 695 return put_user(SNDRV_RAWMIDI_VERSION, (int __user *)argp) ? -EFAULT : 0; 699 696 case SNDRV_RAWMIDI_IOCTL_INFO: 700 697 { 701 - snd_rawmidi_stream_t stream; 702 - snd_rawmidi_info_t __user *info = argp; 698 + int stream; 699 + struct snd_rawmidi_info __user *info = argp; 703 700 if (get_user(stream, &info->stream)) 704 701 return -EFAULT; 705 702 switch (stream) { ··· 713 710 } 714 711 case SNDRV_RAWMIDI_IOCTL_PARAMS: 715 712 { 716 - snd_rawmidi_params_t params; 717 - if (copy_from_user(&params, argp, sizeof(snd_rawmidi_params_t))) 713 + struct snd_rawmidi_params params; 714 + if (copy_from_user(&params, argp, sizeof(struct snd_rawmidi_params))) 718 715 return -EFAULT; 719 716 switch (params.stream) { 720 717 case SNDRV_RAWMIDI_STREAM_OUTPUT: ··· 732 729 case SNDRV_RAWMIDI_IOCTL_STATUS: 733 730 { 734 731 int err = 0; 735 - snd_rawmidi_status_t status; 736 - if (copy_from_user(&status, argp, sizeof(snd_rawmidi_status_t))) 732 + struct snd_rawmidi_status status; 733 + if (copy_from_user(&status, argp, sizeof(struct snd_rawmidi_status))) 737 734 return -EFAULT; 738 735 switch (status.stream) { 739 736 case SNDRV_RAWMIDI_STREAM_OUTPUT: ··· 751 748 } 752 749 if (err < 0) 753 750 return err; 754 - if (copy_to_user(argp, &status, sizeof(snd_rawmidi_status_t))) 751 + if (copy_to_user(argp, &status, sizeof(struct snd_rawmidi_status))) 755 752 return -EFAULT; 756 753 return 0; 757 754 } ··· 795 792 return -ENOTTY; 796 793 } 797 794 798 - static int snd_rawmidi_control_ioctl(snd_card_t * card, 799 - snd_ctl_file_t * control, 795 + static int snd_rawmidi_control_ioctl(struct snd_card *card, 796 + struct snd_ctl_file *control, 800 797 unsigned int cmd, 801 798 unsigned long arg) 802 799 { ··· 848 845 * 849 846 * Returns the size of read data, or a negative error code on failure. 850 847 */ 851 - int snd_rawmidi_receive(snd_rawmidi_substream_t * substream, const unsigned char *buffer, int count) 848 + int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, 849 + const unsigned char *buffer, int count) 852 850 { 853 851 unsigned long flags; 854 852 int result = 0, count1; 855 - snd_rawmidi_runtime_t *runtime = substream->runtime; 853 + struct snd_rawmidi_runtime *runtime = substream->runtime; 856 854 857 855 if (runtime->buffer == NULL) { 858 856 snd_printd("snd_rawmidi_receive: input is not active!!!\n"); ··· 908 904 return result; 909 905 } 910 906 911 - static long snd_rawmidi_kernel_read1(snd_rawmidi_substream_t *substream, 907 + static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream, 912 908 unsigned char *buf, long count, int kernel) 913 909 { 914 910 unsigned long flags; 915 911 long result = 0, count1; 916 - snd_rawmidi_runtime_t *runtime = substream->runtime; 912 + struct snd_rawmidi_runtime *runtime = substream->runtime; 917 913 918 914 while (count > 0 && runtime->avail) { 919 915 count1 = runtime->buffer_size - runtime->appl_ptr; ··· 942 938 return result; 943 939 } 944 940 945 - long snd_rawmidi_kernel_read(snd_rawmidi_substream_t *substream, unsigned char *buf, long count) 941 + long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream, 942 + unsigned char *buf, long count) 946 943 { 947 944 snd_rawmidi_input_trigger(substream, 1); 948 945 return snd_rawmidi_kernel_read1(substream, buf, count, 1); 949 946 } 950 947 951 - static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t count, loff_t *offset) 948 + static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t count, 949 + loff_t *offset) 952 950 { 953 951 long result; 954 952 int count1; 955 - snd_rawmidi_file_t *rfile; 956 - snd_rawmidi_substream_t *substream; 957 - snd_rawmidi_runtime_t *runtime; 953 + struct snd_rawmidi_file *rfile; 954 + struct snd_rawmidi_substream *substream; 955 + struct snd_rawmidi_runtime *runtime; 958 956 959 957 rfile = file->private_data; 960 958 substream = rfile->input; ··· 1004 998 * 1005 999 * Returns 1 if the internal output buffer is empty, 0 if not. 1006 1000 */ 1007 - int snd_rawmidi_transmit_empty(snd_rawmidi_substream_t * substream) 1001 + int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream) 1008 1002 { 1009 - snd_rawmidi_runtime_t *runtime = substream->runtime; 1003 + struct snd_rawmidi_runtime *runtime = substream->runtime; 1010 1004 int result; 1011 1005 unsigned long flags; 1012 1006 ··· 1034 1028 * 1035 1029 * Returns the size of copied data, or a negative error code on failure. 1036 1030 */ 1037 - int snd_rawmidi_transmit_peek(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count) 1031 + int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream, 1032 + unsigned char *buffer, int count) 1038 1033 { 1039 1034 unsigned long flags; 1040 1035 int result, count1; 1041 - snd_rawmidi_runtime_t *runtime = substream->runtime; 1036 + struct snd_rawmidi_runtime *runtime = substream->runtime; 1042 1037 1043 1038 if (runtime->buffer == NULL) { 1044 1039 snd_printd("snd_rawmidi_transmit_peek: output is not active!!!\n"); ··· 1086 1079 * 1087 1080 * Returns the advanced size if successful, or a negative error code on failure. 1088 1081 */ 1089 - int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count) 1082 + int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) 1090 1083 { 1091 1084 unsigned long flags; 1092 - snd_rawmidi_runtime_t *runtime = substream->runtime; 1085 + struct snd_rawmidi_runtime *runtime = substream->runtime; 1093 1086 1094 1087 if (runtime->buffer == NULL) { 1095 1088 snd_printd("snd_rawmidi_transmit_ack: output is not active!!!\n"); ··· 1119 1112 * 1120 1113 * Returns the copied size if successful, or a negative error code on failure. 1121 1114 */ 1122 - int snd_rawmidi_transmit(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count) 1115 + int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, 1116 + unsigned char *buffer, int count) 1123 1117 { 1124 1118 count = snd_rawmidi_transmit_peek(substream, buffer, count); 1125 1119 if (count < 0) ··· 1128 1120 return snd_rawmidi_transmit_ack(substream, count); 1129 1121 } 1130 1122 1131 - static long snd_rawmidi_kernel_write1(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count, int kernel) 1123 + static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream, 1124 + const unsigned char *buf, long count, int kernel) 1132 1125 { 1133 1126 unsigned long flags; 1134 1127 long count1, result; 1135 - snd_rawmidi_runtime_t *runtime = substream->runtime; 1128 + struct snd_rawmidi_runtime *runtime = substream->runtime; 1136 1129 1137 1130 snd_assert(buf != NULL, return -EINVAL); 1138 1131 snd_assert(runtime->buffer != NULL, return -EINVAL); ··· 1179 1170 return result; 1180 1171 } 1181 1172 1182 - long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count) 1173 + long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream, 1174 + const unsigned char *buf, long count) 1183 1175 { 1184 1176 return snd_rawmidi_kernel_write1(substream, buf, count, 1); 1185 1177 } 1186 1178 1187 - static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) 1179 + static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, 1180 + size_t count, loff_t *offset) 1188 1181 { 1189 1182 long result, timeout; 1190 1183 int count1; 1191 - snd_rawmidi_file_t *rfile; 1192 - snd_rawmidi_runtime_t *runtime; 1193 - snd_rawmidi_substream_t *substream; 1184 + struct snd_rawmidi_file *rfile; 1185 + struct snd_rawmidi_runtime *runtime; 1186 + struct snd_rawmidi_substream *substream; 1194 1187 1195 1188 rfile = file->private_data; 1196 1189 substream = rfile->output; ··· 1257 1246 1258 1247 static unsigned int snd_rawmidi_poll(struct file *file, poll_table * wait) 1259 1248 { 1260 - snd_rawmidi_file_t *rfile; 1261 - snd_rawmidi_runtime_t *runtime; 1249 + struct snd_rawmidi_file *rfile; 1250 + struct snd_rawmidi_runtime *runtime; 1262 1251 unsigned int mask; 1263 1252 1264 1253 rfile = file->private_data; ··· 1295 1284 1296 1285 */ 1297 1286 1298 - static void snd_rawmidi_proc_info_read(snd_info_entry_t *entry, 1299 - snd_info_buffer_t * buffer) 1287 + static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry, 1288 + struct snd_info_buffer *buffer) 1300 1289 { 1301 - snd_rawmidi_t *rmidi; 1302 - snd_rawmidi_substream_t *substream; 1303 - snd_rawmidi_runtime_t *runtime; 1290 + struct snd_rawmidi *rmidi; 1291 + struct snd_rawmidi_substream *substream; 1292 + struct snd_rawmidi_runtime *runtime; 1304 1293 struct list_head *list; 1305 1294 1306 1295 rmidi = entry->private_data; ··· 1308 1297 down(&rmidi->open_mutex); 1309 1298 if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_OUTPUT) { 1310 1299 list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) { 1311 - substream = list_entry(list, snd_rawmidi_substream_t, list); 1300 + substream = list_entry(list, struct snd_rawmidi_substream, list); 1312 1301 snd_iprintf(buffer, 1313 1302 "Output %d\n" 1314 1303 " Tx bytes : %lu\n", ··· 1328 1317 } 1329 1318 if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_INPUT) { 1330 1319 list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) { 1331 - substream = list_entry(list, snd_rawmidi_substream_t, list); 1320 + substream = list_entry(list, struct snd_rawmidi_substream, list); 1332 1321 snd_iprintf(buffer, 1333 1322 "Input %d\n" 1334 1323 " Rx bytes : %lu\n", ··· 1365 1354 .compat_ioctl = snd_rawmidi_ioctl_compat, 1366 1355 }; 1367 1356 1368 - static snd_minor_t snd_rawmidi_reg = 1357 + static struct snd_minor snd_rawmidi_reg = 1369 1358 { 1370 1359 .comment = "raw midi", 1371 1360 .f_ops = &snd_rawmidi_f_ops, 1372 1361 }; 1373 1362 1374 - static int snd_rawmidi_alloc_substreams(snd_rawmidi_t *rmidi, 1375 - snd_rawmidi_str_t *stream, 1363 + static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, 1364 + struct snd_rawmidi_str *stream, 1376 1365 int direction, 1377 1366 int count) 1378 1367 { 1379 - snd_rawmidi_substream_t *substream; 1368 + struct snd_rawmidi_substream *substream; 1380 1369 int idx; 1381 1370 1382 1371 INIT_LIST_HEAD(&stream->substreams); ··· 1408 1397 * 1409 1398 * Returns zero if successful, or a negative error code on failure. 1410 1399 */ 1411 - int snd_rawmidi_new(snd_card_t * card, char *id, int device, 1400 + int snd_rawmidi_new(struct snd_card *card, char *id, int device, 1412 1401 int output_count, int input_count, 1413 - snd_rawmidi_t ** rrawmidi) 1402 + struct snd_rawmidi ** rrawmidi) 1414 1403 { 1415 - snd_rawmidi_t *rmidi; 1404 + struct snd_rawmidi *rmidi; 1416 1405 int err; 1417 - static snd_device_ops_t ops = { 1406 + static struct snd_device_ops ops = { 1418 1407 .dev_free = snd_rawmidi_dev_free, 1419 1408 .dev_register = snd_rawmidi_dev_register, 1420 1409 .dev_disconnect = snd_rawmidi_dev_disconnect, ··· 1449 1438 return 0; 1450 1439 } 1451 1440 1452 - static void snd_rawmidi_free_substreams(snd_rawmidi_str_t *stream) 1441 + static void snd_rawmidi_free_substreams(struct snd_rawmidi_str *stream) 1453 1442 { 1454 - snd_rawmidi_substream_t *substream; 1443 + struct snd_rawmidi_substream *substream; 1455 1444 1456 1445 while (!list_empty(&stream->substreams)) { 1457 - substream = list_entry(stream->substreams.next, snd_rawmidi_substream_t, list); 1446 + substream = list_entry(stream->substreams.next, struct snd_rawmidi_substream, list); 1458 1447 list_del(&substream->list); 1459 1448 kfree(substream); 1460 1449 } 1461 1450 } 1462 1451 1463 - static int snd_rawmidi_free(snd_rawmidi_t *rmidi) 1452 + static int snd_rawmidi_free(struct snd_rawmidi *rmidi) 1464 1453 { 1465 1454 snd_assert(rmidi != NULL, return -ENXIO); 1466 1455 snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]); ··· 1471 1460 return 0; 1472 1461 } 1473 1462 1474 - static int snd_rawmidi_dev_free(snd_device_t *device) 1463 + static int snd_rawmidi_dev_free(struct snd_device *device) 1475 1464 { 1476 - snd_rawmidi_t *rmidi = device->device_data; 1465 + struct snd_rawmidi *rmidi = device->device_data; 1477 1466 return snd_rawmidi_free(rmidi); 1478 1467 } 1479 1468 1480 1469 #if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) 1481 - static void snd_rawmidi_dev_seq_free(snd_seq_device_t *device) 1470 + static void snd_rawmidi_dev_seq_free(struct snd_seq_device *device) 1482 1471 { 1483 - snd_rawmidi_t *rmidi = device->private_data; 1472 + struct snd_rawmidi *rmidi = device->private_data; 1484 1473 rmidi->seq_dev = NULL; 1485 1474 } 1486 1475 #endif 1487 1476 1488 - static int snd_rawmidi_dev_register(snd_device_t *device) 1477 + static int snd_rawmidi_dev_register(struct snd_device *device) 1489 1478 { 1490 1479 int idx, err; 1491 - snd_info_entry_t *entry; 1480 + struct snd_info_entry *entry; 1492 1481 char name[16]; 1493 - snd_rawmidi_t *rmidi = device->device_data; 1482 + struct snd_rawmidi *rmidi = device->device_data; 1494 1483 1495 1484 if (rmidi->device >= SNDRV_RAWMIDI_DEVICES) 1496 1485 return -ENOMEM; ··· 1565 1554 return 0; 1566 1555 } 1567 1556 1568 - static int snd_rawmidi_dev_disconnect(snd_device_t *device) 1557 + static int snd_rawmidi_dev_disconnect(struct snd_device *device) 1569 1558 { 1570 - snd_rawmidi_t *rmidi = device->device_data; 1559 + struct snd_rawmidi *rmidi = device->device_data; 1571 1560 int idx; 1572 1561 1573 1562 down(&register_mutex); ··· 1577 1566 return 0; 1578 1567 } 1579 1568 1580 - static int snd_rawmidi_dev_unregister(snd_device_t *device) 1569 + static int snd_rawmidi_dev_unregister(struct snd_device *device) 1581 1570 { 1582 1571 int idx; 1583 - snd_rawmidi_t *rmidi = device->device_data; 1572 + struct snd_rawmidi *rmidi = device->device_data; 1584 1573 1585 1574 snd_assert(rmidi != NULL, return -ENXIO); 1586 1575 down(&register_mutex); ··· 1624 1613 * 1625 1614 * Sets the rawmidi operators for the given stream direction. 1626 1615 */ 1627 - void snd_rawmidi_set_ops(snd_rawmidi_t *rmidi, int stream, snd_rawmidi_ops_t *ops) 1616 + void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream, 1617 + struct snd_rawmidi_ops *ops) 1628 1618 { 1629 1619 struct list_head *list; 1630 - snd_rawmidi_substream_t *substream; 1620 + struct snd_rawmidi_substream *substream; 1631 1621 1632 1622 list_for_each(list, &rmidi->streams[stream].substreams) { 1633 - substream = list_entry(list, snd_rawmidi_substream_t, list); 1623 + substream = list_entry(list, struct snd_rawmidi_substream, list); 1634 1624 substream->ops = ops; 1635 1625 } 1636 1626 }
+11 -11
sound/core/rawmidi_compat.c
··· 22 22 23 23 #include <linux/compat.h> 24 24 25 - struct sndrv_rawmidi_params32 { 25 + struct snd_rawmidi_params32 { 26 26 s32 stream; 27 27 u32 buffer_size; 28 28 u32 avail_min; ··· 30 30 unsigned char reserved[16]; 31 31 } __attribute__((packed)); 32 32 33 - static int snd_rawmidi_ioctl_params_compat(snd_rawmidi_file_t *rfile, 34 - struct sndrv_rawmidi_params32 __user *src) 33 + static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile, 34 + struct snd_rawmidi_params32 __user *src) 35 35 { 36 - snd_rawmidi_params_t params; 36 + struct snd_rawmidi_params params; 37 37 unsigned int val; 38 38 39 39 if (rfile->output == NULL) ··· 53 53 return -EINVAL; 54 54 } 55 55 56 - struct sndrv_rawmidi_status32 { 56 + struct snd_rawmidi_status32 { 57 57 s32 stream; 58 58 struct compat_timespec tstamp; 59 59 u32 avail; ··· 61 61 unsigned char reserved[16]; 62 62 } __attribute__((packed)); 63 63 64 - static int snd_rawmidi_ioctl_status_compat(snd_rawmidi_file_t *rfile, 65 - struct sndrv_rawmidi_status32 __user *src) 64 + static int snd_rawmidi_ioctl_status_compat(struct snd_rawmidi_file *rfile, 65 + struct snd_rawmidi_status32 __user *src) 66 66 { 67 67 int err; 68 - snd_rawmidi_status_t status; 68 + struct snd_rawmidi_status status; 69 69 70 70 if (rfile->output == NULL) 71 71 return -EINVAL; ··· 95 95 } 96 96 97 97 enum { 98 - SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct sndrv_rawmidi_params32), 99 - SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct sndrv_rawmidi_status32), 98 + SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct snd_rawmidi_params32), 99 + SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct snd_rawmidi_status32), 100 100 }; 101 101 102 102 static long snd_rawmidi_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) 103 103 { 104 - snd_rawmidi_file_t *rfile; 104 + struct snd_rawmidi_file *rfile; 105 105 void __user *argp = compat_ptr(arg); 106 106 107 107 rfile = file->private_data;