39 #include <linux/wait.h>
40 #include <linux/module.h>
41 #include <linux/slab.h>
58 static void snd_virmidi_init_event(
struct snd_virmidi *vmidi,
61 memset(ev, 0,
sizeof(*ev));
118 return snd_virmidi_dev_receive_event(rdev, ev);
133 return snd_virmidi_dev_receive_event(rdev, ev);
157 unsigned char buf[32], *pbuf;
246 snd_virmidi_init_event(vmidi, &vmidi->
event);
280 static int snd_virmidi_subscribe(
void *private_data,
286 if (!try_module_get(rdev->
card->module))
295 static int snd_virmidi_unsubscribe(
void *private_data,
302 module_put(rdev->
card->module);
310 static int snd_virmidi_use(
void *private_data,
316 if (!try_module_get(rdev->
card->module))
325 static int snd_virmidi_unuse(
void *private_data,
332 module_put(rdev->
card->module);
342 .open = snd_virmidi_input_open,
343 .close = snd_virmidi_input_close,
344 .trigger = snd_virmidi_input_trigger,
348 .open = snd_virmidi_output_open,
349 .close = snd_virmidi_output_close,
350 .trigger = snd_virmidi_output_trigger,
373 "%s %d-%d", rdev->
rmidi->name,
393 memset(&pcallbacks, 0,
sizeof(pcallbacks));
395 pcallbacks.private_data =
rdev;
396 pcallbacks.subscribe = snd_virmidi_subscribe;
397 pcallbacks.unsubscribe = snd_virmidi_unsubscribe;
398 pcallbacks.use = snd_virmidi_use;
399 pcallbacks.unuse = snd_virmidi_unuse;
400 pcallbacks.event_input = snd_virmidi_event_input;
401 pinfo->
kernel = &pcallbacks;
432 static int snd_virmidi_dev_register(
struct snd_rawmidi *rmidi)
439 err = snd_virmidi_dev_attach_seq(rdev);
459 static int snd_virmidi_dev_unregister(
struct snd_rawmidi *rmidi)
464 snd_virmidi_dev_detach_seq(rdev);
472 .dev_register = snd_virmidi_dev_register,
473 .dev_unregister = snd_virmidi_dev_unregister,
479 static void snd_virmidi_free(
struct snd_rawmidi *rmidi)
517 rmidi->
ops = &snd_virmidi_global_ops;
531 static int __init alsa_virmidi_init(
void)
536 static void __exit alsa_virmidi_exit(
void)