Full support for Ginger Console
[linux-ginger.git] / drivers / staging / line6 / midi.h
blobc69fd118957bb6cc4528ab02fd8baa51db89efac
1 /*
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.
12 #ifndef MIDI_H
13 #define MIDI_H
16 #include <sound/rawmidi.h>
18 #include "midibuf.h"
21 #define MIDI_BUFFER_SIZE 1024
24 struct snd_line6_midi {
25 /**
26 Pointer back to the Line6 driver data structure.
28 struct usb_line6 *line6;
30 /**
31 MIDI substream for receiving (or NULL if not active).
33 struct snd_rawmidi_substream *substream_receive;
35 /**
36 MIDI substream for transmitting (or NULL if not active).
38 struct snd_rawmidi_substream *substream_transmit;
40 /**
41 Number of currently active MIDI send URBs.
43 int num_active_send_urbs;
45 /**
46 Spin lock to protect updates of send_urb.
48 spinlock_t send_urb_lock;
50 /**
51 Spin lock to protect MIDI buffer handling.
53 spinlock_t midi_transmit_lock;
55 /**
56 Wait queue for MIDI transmission.
58 wait_queue_head_t send_wait;
60 /**
61 Bit mask for output MIDI channels.
63 int midi_mask_transmit;
65 /**
66 Bit mask for input MIDI channels.
68 int midi_mask_receive;
70 /**
71 Buffer for incoming MIDI stream.
73 struct MidiBuffer midibuf_in;
75 /**
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,
84 int length);
87 #endif