2 * Line6 Linux USB driver - 0.8.0
4 * Copyright (C) 2004-2009 Markus Grabner (grabner@icg.tugraz.at)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
16 #include <sound/rawmidi.h>
21 #define MIDI_BUFFER_SIZE 1024
24 struct snd_line6_midi
{
26 Pointer back to the Line6 driver data structure.
28 struct usb_line6
*line6
;
31 MIDI substream for receiving (or NULL if not active).
33 struct snd_rawmidi_substream
*substream_receive
;
36 MIDI substream for transmitting (or NULL if not active).
38 struct snd_rawmidi_substream
*substream_transmit
;
41 Number of currently active MIDI send URBs.
43 int num_active_send_urbs
;
46 Spin lock to protect updates of send_urb.
48 spinlock_t send_urb_lock
;
51 Spin lock to protect MIDI buffer handling.
53 spinlock_t midi_transmit_lock
;
56 Wait queue for MIDI transmission.
58 wait_queue_head_t send_wait
;
61 Bit mask for output MIDI channels.
63 int midi_mask_transmit
;
66 Bit mask for input MIDI channels.
68 int midi_mask_receive
;
71 Buffer for incoming MIDI stream.
73 struct MidiBuffer midibuf_in
;
76 Buffer for outgoing MIDI stream.
78 struct MidiBuffer midibuf_out
;
82 extern int line6_init_midi(struct usb_line6
*line6
);
83 extern void line6_midi_receive(struct usb_line6
*line6
, unsigned char *data
,