midi.h
001:
002:
003:
004:
005:
006: <ben.williamson@greyinnovation.com>
007:
008:
009:
010:
011:
012:
013:
014:
015: http://www.usb.org/developers/devclass_docs/midi10.pdf
016:
017:
018: #ifndef __LINUX_USB_MIDI_H
019: #define __LINUX_USB_MIDI_H
020:
021: #include <linux/types.h>
022:
023:
024: #define USB_MS_HEADER 0x01
025: #define USB_MS_MIDI_IN_JACK 0x02
026: #define USB_MS_MIDI_OUT_JACK 0x03
027: #define USB_MS_ELEMENT 0x04
028:
029:
030: #define USB_MS_GENERAL 0x01
031:
032:
033: #define USB_MS_EMBEDDED 0x01
034: #define USB_MS_EXTERNAL 0x02
035:
036:
037: struct usb_ms_header_descriptor {
038: __u8 bLength;
039: __u8 bDescriptorType;
040: __u8 bDescriptorSubtype;
041: __le16 bcdMSC;
042: __le16 wTotalLength;
043: } __attribute__ ((packed));
044:
045: #define USB_DT_MS_HEADER_SIZE 7
046:
047:
048: struct usb_midi_in_jack_descriptor {
049: __u8 bLength;
050: __u8 bDescriptorType;
051: __u8 bDescriptorSubtype;
052: __u8 bJackType;
053: __u8 bJackID;
054: __u8 iJack;
055: } __attribute__ ((packed));
056:
057: #define USB_DT_MIDI_IN_SIZE 6
058:
059: struct usb_midi_source_pin {
060: __u8 baSourceID;
061: __u8 baSourcePin;
062: } __attribute__ ((packed));
063:
064:
065: struct usb_midi_out_jack_descriptor {
066: __u8 bLength;
067: __u8 bDescriptorType;
068: __u8 bDescriptorSubtype;
069: __u8 bJackType;
070: __u8 bJackID;
071: __u8 bNrInputPins;
072: struct usb_midi_source_pin pins[];
073:
074: } __attribute__ ((packed));
075:
076: #define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p))
077:
078:
079: #define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \
080: struct usb_midi_out_jack_descriptor_##p { \
081: __u8 bLength; \
082: __u8 bDescriptorType; \
083: __u8 bDescriptorSubtype; \
084: __u8 bJackType; \
085: __u8 bJackID; \
086: __u8 bNrInputPins; \
087: struct usb_midi_source_pin pins[p]; \
088: __u8 iJack; \
089: } __attribute__ ((packed))
090:
091:
092: struct usb_ms_endpoint_descriptor {
093: __u8 bLength;
094: __u8 bDescriptorType;
095: __u8 bDescriptorSubtype;
096: __u8 bNumEmbMIDIJack;
097: __u8 baAssocJackID[];
098: } __attribute__ ((packed));
099:
100: #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
101:
102:
103: #define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \
104: struct usb_ms_endpoint_descriptor_##n { \
105: __u8 bLength; \
106: __u8 bDescriptorType; \
107: __u8 bDescriptorSubtype; \
108: __u8 bNumEmbMIDIJack; \
109: __u8 baAssocJackID[n]; \
110: } __attribute__ ((packed))
111:
112: #endif
113:
© Andrew Scott 2006 -
2025,
All Rights Reserved