| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 2 | **************************************************************************** | 
|  | 3 | *** | 
|  | 4 | ***   This header was automatically generated from a Linux kernel header | 
|  | 5 | ***   of the same name, to make information necessary for userspace to | 
|  | 6 | ***   call into the kernel available to libc.  It contains only constants, | 
|  | 7 | ***   structures, and macros generated from the original header, and thus, | 
|  | 8 | ***   contains no copyrightable information. | 
|  | 9 | *** | 
|  | 10 | ***   To edit the content of this header, modify the corresponding | 
|  | 11 | ***   source file (e.g. under external/kernel-headers/original/) then | 
|  | 12 | ***   run bionic/libc/kernel/tools/update_all.py | 
|  | 13 | *** | 
|  | 14 | ***   Any manual change here will be lost the next time this script will | 
|  | 15 | ***   be run. You've been warned! | 
|  | 16 | *** | 
|  | 17 | **************************************************************************** | 
|  | 18 | ****************************************************************************/ | 
|  | 19 | #ifndef __LINUX_USB_MIDI_H | 
|  | 20 | #define __LINUX_USB_MIDI_H | 
|  | 21 | #include <linux/types.h> | 
|  | 22 | #define USB_MS_HEADER 0x01 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define USB_MS_MIDI_IN_JACK 0x02 | 
|  | 24 | #define USB_MS_MIDI_OUT_JACK 0x03 | 
|  | 25 | #define USB_MS_ELEMENT 0x04 | 
|  | 26 | #define USB_MS_GENERAL 0x01 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define USB_MS_EMBEDDED 0x01 | 
|  | 28 | #define USB_MS_EXTERNAL 0x02 | 
|  | 29 | struct usb_ms_header_descriptor { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 30 | __u8 bLength; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | __u8 bDescriptorType; | 
|  | 32 | __u8 bDescriptorSubtype; | 
|  | 33 | __le16 bcdMSC; | 
|  | 34 | __le16 wTotalLength; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | } __attribute__((packed)); | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define USB_DT_MS_HEADER_SIZE 7 | 
|  | 37 | struct usb_midi_in_jack_descriptor { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | __u8 bLength; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | __u8 bDescriptorType; | 
|  | 40 | __u8 bDescriptorSubtype; | 
|  | 41 | __u8 bJackType; | 
|  | 42 | __u8 bJackID; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | __u8 iJack; | 
|  | 44 | } __attribute__((packed)); | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | #define USB_DT_MIDI_IN_SIZE 6 | 
|  | 46 | struct usb_midi_source_pin { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | __u8 baSourceID; | 
|  | 48 | __u8 baSourcePin; | 
|  | 49 | } __attribute__((packed)); | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 50 | struct usb_midi_out_jack_descriptor { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 51 | __u8 bLength; | 
|  | 52 | __u8 bDescriptorType; | 
|  | 53 | __u8 bDescriptorSubtype; | 
|  | 54 | __u8 bJackType; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | __u8 bJackID; | 
|  | 56 | __u8 bNrInputPins; | 
|  | 57 | struct usb_midi_source_pin pins[]; | 
|  | 58 | } __attribute__((packed)); | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p)) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 60 | #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; \ | 
|  | 61 | } __attribute__((packed)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 62 | struct usb_ms_endpoint_descriptor { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | __u8 bLength; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | __u8 bDescriptorType; | 
|  | 65 | __u8 bDescriptorSubtype; | 
|  | 66 | __u8 bNumEmbMIDIJack; | 
|  | 67 | __u8 baAssocJackID[]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | } __attribute__((packed)); | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 70 | #define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) struct usb_ms_endpoint_descriptor_ ##n { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bNumEmbMIDIJack; __u8 baAssocJackID[n]; \ | 
|  | 71 | } __attribute__((packed)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #endif |