1 /* 2 * This file is auto-generated. Modifications will be lost. 3 * 4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ 5 * for more information. 6 */ 7 #ifndef __LINUX_USB_MIDI_H 8 #define __LINUX_USB_MIDI_H 9 #include <linux/types.h> 10 #define USB_MS_HEADER 0x01 11 #define USB_MS_MIDI_IN_JACK 0x02 12 #define USB_MS_MIDI_OUT_JACK 0x03 13 #define USB_MS_ELEMENT 0x04 14 #define USB_MS_GENERAL 0x01 15 #define USB_MS_EMBEDDED 0x01 16 #define USB_MS_EXTERNAL 0x02 17 struct usb_ms_header_descriptor { 18 __u8 bLength; 19 __u8 bDescriptorType; 20 __u8 bDescriptorSubtype; 21 __le16 bcdMSC; 22 __le16 wTotalLength; 23 } __attribute__((packed)); 24 #define USB_DT_MS_HEADER_SIZE 7 25 struct usb_midi_in_jack_descriptor { 26 __u8 bLength; 27 __u8 bDescriptorType; 28 __u8 bDescriptorSubtype; 29 __u8 bJackType; 30 __u8 bJackID; 31 __u8 iJack; 32 } __attribute__((packed)); 33 #define USB_DT_MIDI_IN_SIZE 6 34 struct usb_midi_source_pin { 35 __u8 baSourceID; 36 __u8 baSourcePin; 37 } __attribute__((packed)); 38 struct usb_midi_out_jack_descriptor { 39 __u8 bLength; 40 __u8 bDescriptorType; 41 __u8 bDescriptorSubtype; 42 __u8 bJackType; 43 __u8 bJackID; 44 __u8 bNrInputPins; 45 struct usb_midi_source_pin pins[]; 46 } __attribute__((packed)); 47 #define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p)) 48 #define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) struct usb_midi_out_jack_descriptor_ ##p { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bJackType; __u8 bJackID; __u8 bNrInputPins; struct usb_midi_source_pin pins[p]; __u8 iJack; \ 49 } __attribute__((packed)) 50 struct usb_ms_endpoint_descriptor { 51 __u8 bLength; 52 __u8 bDescriptorType; 53 __u8 bDescriptorSubtype; 54 __u8 bNumEmbMIDIJack; 55 __u8 baAssocJackID[]; 56 } __attribute__((packed)); 57 #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) 58 #define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) struct usb_ms_endpoint_descriptor_ ##n { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bNumEmbMIDIJack; __u8 baAssocJackID[n]; \ 59 } __attribute__((packed)) 60 #endif 61