1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef __LINUX_USB_MIDI_H 7 #define __LINUX_USB_MIDI_H 8 #include <linux/types.h> 9 #define USB_MS_HEADER 0x01 10 #define USB_MS_MIDI_IN_JACK 0x02 11 #define USB_MS_MIDI_OUT_JACK 0x03 12 #define USB_MS_ELEMENT 0x04 13 #define USB_MS_GENERAL 0x01 14 #define USB_MS_EMBEDDED 0x01 15 #define USB_MS_EXTERNAL 0x02 16 struct usb_ms_header_descriptor { 17 __u8 bLength; 18 __u8 bDescriptorType; 19 __u8 bDescriptorSubtype; 20 __le16 bcdMSC; 21 __le16 wTotalLength; 22 } __attribute__ ((packed)); 23 #define USB_DT_MS_HEADER_SIZE 7 24 struct usb_midi_in_jack_descriptor { 25 __u8 bLength; 26 __u8 bDescriptorType; 27 __u8 bDescriptorSubtype; 28 __u8 bJackType; 29 __u8 bJackID; 30 __u8 iJack; 31 } __attribute__ ((packed)); 32 #define USB_DT_MIDI_IN_SIZE 6 33 struct usb_midi_source_pin { 34 __u8 baSourceID; 35 __u8 baSourcePin; 36 } __attribute__ ((packed)); 37 struct usb_midi_out_jack_descriptor { 38 __u8 bLength; 39 __u8 bDescriptorType; 40 __u8 bDescriptorSubtype; 41 __u8 bJackType; 42 __u8 bJackID; 43 __u8 bNrInputPins; 44 struct usb_midi_source_pin pins[]; 45 46 } __attribute__ ((packed)); 47 #define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p)) 48 #define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \ 49 struct usb_midi_out_jack_descriptor_##p { \ 50 __u8 bLength; \ 51 __u8 bDescriptorType; \ 52 __u8 bDescriptorSubtype; \ 53 __u8 bJackType; \ 54 __u8 bJackID; \ 55 __u8 bNrInputPins; \ 56 struct usb_midi_source_pin pins[p]; \ 57 __u8 iJack; \ 58 } __attribute__ ((packed)) 59 struct usb_ms_endpoint_descriptor { 60 __u8 bLength; 61 __u8 bDescriptorType; 62 __u8 bDescriptorSubtype; 63 __u8 bNumEmbMIDIJack; 64 __u8 baAssocJackID[]; 65 } __attribute__ ((packed)); 66 #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) 67 #define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \ 68 struct usb_ms_endpoint_descriptor_##n { \ 69 __u8 bLength; \ 70 __u8 bDescriptorType; \ 71 __u8 bDescriptorSubtype; \ 72 __u8 bNumEmbMIDIJack; \ 73 __u8 baAssocJackID[n]; \ 74 } __attribute__ ((packed)) 75 #endif 76