Lines Matching refs:line6
34 static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
41 void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
44 if (line6->line6midi->substream_receive)
45 snd_rawmidi_receive(line6->line6midi->substream_receive,
54 struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
55 struct snd_line6_midi *line6midi = line6->line6midi;
58 unsigned char chunk[line6->max_packet_size];
61 spin_lock_irqsave(&line6->line6midi->midi_transmit_lock, flags);
64 req = min(midibuf_bytes_free(mb), line6->max_packet_size);
71 line6_write_hexdump(line6, 's', chunk, done);
78 done = midibuf_read(mb, chunk, line6->max_packet_size);
86 send_midi_async(line6, chunk, done);
89 spin_unlock_irqrestore(&line6->line6midi->midi_transmit_lock, flags);
100 struct usb_line6 *line6 = (struct usb_line6 *)urb->context;
109 spin_lock_irqsave(&line6->line6midi->send_urb_lock, flags);
110 num = --line6->line6midi->num_active_send_urbs;
113 line6_midi_transmit(line6->line6midi->substream_transmit);
114 num = line6->line6midi->num_active_send_urbs;
118 wake_up_interruptible(&line6->line6midi->send_wait);
120 spin_unlock_irqrestore(&line6->line6midi->send_urb_lock, flags);
125 Assumes that line6->line6midi->send_urb_lock is held
128 static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
138 dev_err(line6->ifcdev, "Out of memory\n");
143 line6_write_hexdump(line6, 'S', data, length);
150 dev_err(line6->ifcdev, "Out of memory\n");
155 usb_fill_int_urb(urb, line6->usbdev,
156 usb_sndbulkpipe(line6->usbdev,
157 line6->ep_control_write),
158 transfer_buffer, length, midi_sent, line6,
159 line6->interval);
164 dev_err(line6->ifcdev, "usb_submit_urb failed\n");
169 ++line6->line6midi->num_active_send_urbs;
171 switch (line6->usbdev->descriptor.idProduct) {
179 pod_midi_postprocess((struct usb_line6_pod *)line6, data,
204 struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
206 line6->line6midi->substream_transmit = substream;
207 spin_lock_irqsave(&line6->line6midi->send_urb_lock, flags);
209 if (line6->line6midi->num_active_send_urbs == 0)
212 spin_unlock_irqrestore(&line6->line6midi->send_urb_lock, flags);
217 struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
218 wait_queue_head_t *head = &line6->line6midi->send_wait;
223 while (line6->line6midi->num_active_send_urbs > 0)
246 struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
249 line6->line6midi->substream_receive = substream;
251 line6->line6midi->substream_receive = 0;
280 err = snd_rawmidi_new(line6midi->line6->card, "Line6 MIDI", 0, 1, 1,
287 strcpy(rmidi->name, line6midi->line6->properties->name);
309 struct usb_line6 *line6 = usb_get_intfdata(interface);
310 return sprintf(buf, "%d\n", line6->line6midi->midi_mask_transmit);
321 struct usb_line6 *line6 = usb_get_intfdata(interface);
329 line6->line6midi->midi_mask_transmit = value;
341 struct usb_line6 *line6 = usb_get_intfdata(interface);
342 return sprintf(buf, "%d\n", line6->line6midi->midi_mask_receive);
353 struct usb_line6 *line6 = usb_get_intfdata(interface);
361 line6->line6midi->midi_mask_receive = value;
372 device_remove_file(line6midi->line6->ifcdev, &dev_attr_midi_mask_transmit);
373 device_remove_file(line6midi->line6->ifcdev, &dev_attr_midi_mask_receive);
382 int line6_init_midi(struct usb_line6 *line6)
391 if (!(line6->properties->capabilities & LINE6_BIT_CONTROL))
407 line6midi->line6 = line6;
410 line6->line6midi = line6midi;
412 err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi,
417 snd_card_set_dev(line6->card, line6->ifcdev);
423 err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_transmit);
427 err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_receive);