Lines Matching refs:line6
87 struct usb_line6 *line6;
105 static int line6_start_listen(struct usb_line6 *line6)
107 usb_fill_int_urb(line6->urb_listen, line6->usbdev,
108 usb_rcvintpipe(line6->usbdev, line6->ep_control_read),
109 line6->buffer_listen, LINE6_BUFSIZE_LISTEN,
110 line6_data_received, line6, line6->interval);
111 line6->urb_listen->actual_length = 0;
112 return usb_submit_urb(line6->urb_listen, GFP_KERNEL);
119 void line6_write_hexdump(struct usb_line6 *line6, char dir,
150 dev_info(line6->ifcdev, "%c%04X:%s %s\n", dir, i, hexdump, asc);
161 struct usb_line6 *line6 = (struct usb_line6 *)urb->context;
166 line6_write_hexdump(line6, 'R', (unsigned char *)urb->transfer_buffer,
174 int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
181 line6_write_hexdump(line6, 'S', buffer, size);
186 int frag_size = min(line6->max_packet_size, size - i);
189 retval = usb_interrupt_msg(line6->usbdev,
190 usb_sndintpipe(line6->usbdev,
191 line6->ep_control_write),
196 dev_err(line6->ifcdev,
228 struct usb_line6 *line6 = msg->line6;
230 int bytes = min(msg->size - done, line6->max_packet_size);
232 usb_fill_int_urb(urb, line6->usbdev,
233 usb_sndintpipe(line6->usbdev, line6->ep_control_write),
235 line6_async_request_sent, msg, line6->interval);
238 line6_write_hexdump(line6, 'S', (char *)msg->buffer + done, bytes);
245 dev_err(line6->ifcdev, "%s: usb_submit_urb failed (%d)\n",
258 int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer,
268 dev_err(line6->ifcdev, "Out of memory\n");
277 dev_err(line6->ifcdev, "Out of memory\n");
282 msg->line6 = line6;
294 int line6_send_sysex_message(struct usb_line6 *line6, const char *buffer,
297 return line6_send_raw_message(line6, buffer, size + SYSEX_EXTRA_SIZE) - SYSEX_EXTRA_SIZE;
305 char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2,
311 dev_err(line6->ifcdev, "out of memory\n");
328 struct usb_line6 *line6 = (struct usb_line6 *)urb->context;
329 struct MidiBuffer *mb = &line6->line6midi->midibuf_in;
343 DEBUG_MESSAGES(dev_err(line6->ifcdev, "%d %d buffer overflow - message skipped\n", done, urb->actual_length));
347 done = midibuf_read(mb, line6->buffer_message, LINE6_MESSAGE_MAXLEN);
353 if (midibuf_skip_message(mb, line6->line6midi->midi_mask_receive))
356 line6->message_length = done;
358 line6_write_hexdump(line6, 'r', line6->buffer_message, done);
360 line6_midi_receive(line6, line6->buffer_message, done);
362 switch (line6->usbdev->descriptor.idProduct) {
369 pod_process_message((struct usb_line6_pod *)line6);
373 switch (line6->interface_number) {
375 pod_process_message((struct usb_line6_pod *)line6);
379 variax_process_message((struct usb_line6_variax *)line6);
383 dev_err(line6->ifcdev, "PODxt Live interface %d not supported\n", line6->interface_number);
388 variax_process_message((struct usb_line6_variax *)line6);
396 line6_start_listen(line6);
399 static int line6_send(struct usb_line6 *line6, unsigned char *buf, size_t len)
405 line6_write_hexdump(line6, 'S', buf, len);
408 retval = usb_interrupt_msg(line6->usbdev,
409 usb_sndintpipe(line6->usbdev,
410 line6->ep_control_write),
415 dev_err(line6->ifcdev,
420 dev_err(line6->ifcdev,
431 int line6_send_program(struct usb_line6 *line6, int value)
438 dev_err(line6->ifcdev, "out of memory\n");
445 return line6_send(line6, buffer, len);
451 int line6_transmit_parameter(struct usb_line6 *line6, int param, int value)
458 dev_err(line6->ifcdev, "out of memory\n");
466 return line6_send(line6, buffer, len);
472 int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t datalen)
474 struct usb_device *usbdev = line6->usbdev;
486 dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
498 dev_err(line6->ifcdev,
506 dev_err(line6->ifcdev,
519 dev_err(line6->ifcdev, "read failed (error %d)\n", ret);
529 int line6_write_data(struct usb_line6 *line6, int address, void *data,
532 struct usb_device *usbdev = line6->usbdev;
542 dev_err(line6->ifcdev,
556 dev_err(line6->ifcdev,
565 dev_err(line6->ifcdev, "write failed (error %d)\n", ret);
576 int line6_read_serial_number(struct usb_line6 *line6, int *serial_number)
578 return line6_read_data(line6, 0x80d0, serial_number, sizeof(*serial_number));
607 struct usb_line6 *line6 = usb_get_intfdata(interface);
608 line6_send_raw_message(line6, buf, count);
618 struct usb_line6 *line6;
622 line6 = usb_get_intfdata(interface);
623 if (line6 == NULL)
627 kfree(line6->buffer_message);
628 kfree(line6->buffer_listen);
631 usb_free_urb(line6->urb_listen);
637 kfree(line6);
662 struct usb_line6 *line6 = NULL;
843 dev_err(line6->ifcdev, "driver bug: interface data size not set\n");
848 line6 = kzalloc(size, GFP_KERNEL);
850 if (line6 == NULL) {
857 line6->interface_number = interface_number;
858 line6->properties = properties;
859 line6->usbdev = usbdev;
860 line6->ifcdev = &interface->dev;
861 line6->ep_control_read = ep_read;
862 line6->ep_control_write = ep_write;
863 line6->product = product;
872 line6->interval = ep->desc.bInterval;
873 line6->max_packet_size = le16_to_cpu(ep->desc.wMaxPacketSize);
875 line6->interval = LINE6_FALLBACK_INTERVAL;
876 line6->max_packet_size = LINE6_FALLBACK_MAXPACKETSIZE;
877 dev_err(line6->ifcdev, "endpoint not available, using fallback values");
881 usb_set_intfdata(interface, line6);
885 line6->buffer_listen = kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL);
887 if (line6->buffer_listen == NULL) {
893 line6->buffer_message = kmalloc(LINE6_MESSAGE_MAXLEN, GFP_KERNEL);
895 if (line6->buffer_message == NULL) {
901 line6->urb_listen = usb_alloc_urb(0, GFP_KERNEL);
903 if (line6->urb_listen == NULL) {
910 ret = line6_start_listen(line6);
928 ret = pod_init(interface, (struct usb_line6_pod *)line6);
934 ret = pod_init(interface, (struct usb_line6_pod *)line6);
938 ret = variax_init(interface, (struct usb_line6_variax *)line6);
951 ret = variax_init(interface, (struct usb_line6_variax *)line6);
958 ret = toneport_init(interface, (struct usb_line6_toneport *)line6);
975 line6->properties->name);
976 line6_devices[devnum] = line6;
993 struct usb_line6 *line6;
1006 line6 = usb_get_intfdata(interface);
1008 if (line6 != NULL) {
1009 if (line6->urb_listen != NULL)
1010 usb_kill_urb(line6->urb_listen);
1012 if (usbdev != line6->usbdev)
1013 dev_err(line6->ifcdev,
1016 switch (line6->usbdev->descriptor.idProduct) {
1056 dev_info(&interface->dev, "Line6 %s now disconnected\n", line6->properties->name);
1059 if (line6_devices[i] == line6)