diff options
Diffstat (limited to 'sound/usb/caiaq/midi.c')
-rw-r--r-- | sound/usb/caiaq/midi.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c index a1a47088..63c5a2c 100644 --- a/sound/usb/caiaq/midi.c +++ b/sound/usb/caiaq/midi.c @@ -37,12 +37,12 @@ static int snd_usb_caiaq_midi_input_close(struct snd_rawmidi_substream *substrea static void snd_usb_caiaq_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) { - struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; + struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; - if (!dev) + if (!cdev) return; - dev->midi_receive_substream = up ? substream : NULL; + cdev->midi_receive_substream = up ? substream : NULL; } @@ -53,49 +53,49 @@ static int snd_usb_caiaq_midi_output_open(struct snd_rawmidi_substream *substrea static int snd_usb_caiaq_midi_output_close(struct snd_rawmidi_substream *substream) { - struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; - if (dev->midi_out_active) { - usb_kill_urb(&dev->midi_out_urb); - dev->midi_out_active = 0; + struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; + if (cdev->midi_out_active) { + usb_kill_urb(&cdev->midi_out_urb); + cdev->midi_out_active = 0; } return 0; } -static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *dev, +static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *cdev, struct snd_rawmidi_substream *substream) { int len, ret; - dev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; - dev->midi_out_buf[1] = 0; /* port */ - len = snd_rawmidi_transmit(substream, dev->midi_out_buf + 3, + cdev->midi_out_buf[0] = EP1_CMD_MIDI_WRITE; + cdev->midi_out_buf[1] = 0; /* port */ + len = snd_rawmidi_transmit(substream, cdev->midi_out_buf + 3, EP1_BUFSIZE - 3); if (len <= 0) return; - dev->midi_out_buf[2] = len; - dev->midi_out_urb.transfer_buffer_length = len+3; + cdev->midi_out_buf[2] = len; + cdev->midi_out_urb.transfer_buffer_length = len+3; - ret = usb_submit_urb(&dev->midi_out_urb, GFP_ATOMIC); + ret = usb_submit_urb(&cdev->midi_out_urb, GFP_ATOMIC); if (ret < 0) log("snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed," "ret=%d, len=%d\n", substream, ret, len); else - dev->midi_out_active = 1; + cdev->midi_out_active = 1; } static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) { - struct snd_usb_caiaqdev *dev = substream->rmidi->private_data; + struct snd_usb_caiaqdev *cdev = substream->rmidi->private_data; if (up) { - dev->midi_out_substream = substream; - if (!dev->midi_out_active) - snd_usb_caiaq_midi_send(dev, substream); + cdev->midi_out_substream = substream; + if (!cdev->midi_out_active) + snd_usb_caiaq_midi_send(cdev, substream); } else { - dev->midi_out_substream = NULL; + cdev->midi_out_substream = NULL; } } @@ -114,13 +114,13 @@ static struct snd_rawmidi_ops snd_usb_caiaq_midi_input = .trigger = snd_usb_caiaq_midi_input_trigger, }; -void snd_usb_caiaq_midi_handle_input(struct snd_usb_caiaqdev *dev, +void snd_usb_caiaq_midi_handle_input(struct snd_usb_caiaqdev *cdev, int port, const char *buf, int len) { - if (!dev->midi_receive_substream) + if (!cdev->midi_receive_substream) return; - snd_rawmidi_receive(dev->midi_receive_substream, buf, len); + snd_rawmidi_receive(cdev->midi_receive_substream, buf, len); } int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device) @@ -160,15 +160,15 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device) void snd_usb_caiaq_midi_output_done(struct urb* urb) { - struct snd_usb_caiaqdev *dev = urb->context; + struct snd_usb_caiaqdev *cdev = urb->context; - dev->midi_out_active = 0; + cdev->midi_out_active = 0; if (urb->status != 0) return; - if (!dev->midi_out_substream) + if (!cdev->midi_out_substream) return; - snd_usb_caiaq_midi_send(dev, dev->midi_out_substream); + snd_usb_caiaq_midi_send(cdev, cdev->midi_out_substream); } |