blob: 0431e65953d923abe29441bc759cc9b9120514bb [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 Cheng655a7c02013-10-16 16:09:24 -070023#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 Cheng655a7c02013-10-16 16:09:24 -070027#define USB_MS_EMBEDDED 0x01
28#define USB_MS_EXTERNAL 0x02
29struct usb_ms_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080030 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u8 bDescriptorType;
32 __u8 bDescriptorSubtype;
33 __le16 bcdMSC;
34 __le16 wTotalLength;
Tao Baod7db5942015-01-28 10:07:51 -080035} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define USB_DT_MS_HEADER_SIZE 7
37struct usb_midi_in_jack_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080038 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u8 bDescriptorType;
40 __u8 bDescriptorSubtype;
41 __u8 bJackType;
42 __u8 bJackID;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u8 iJack;
44} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define USB_DT_MIDI_IN_SIZE 6
46struct usb_midi_source_pin {
Tao Baod7db5942015-01-28 10:07:51 -080047 __u8 baSourceID;
48 __u8 baSourcePin;
49} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070050struct usb_midi_out_jack_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080051 __u8 bLength;
52 __u8 bDescriptorType;
53 __u8 bDescriptorSubtype;
54 __u8 bJackType;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u8 bJackID;
56 __u8 bNrInputPins;
57 struct usb_midi_source_pin pins[];
58} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p))
Tao Baod7db5942015-01-28 10:07:51 -080060#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 Cheng655a7c02013-10-16 16:09:24 -070062struct usb_ms_endpoint_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080063 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -080064 __u8 bDescriptorType;
65 __u8 bDescriptorSubtype;
66 __u8 bNumEmbMIDIJack;
67 __u8 baAssocJackID[];
Tao Baod7db5942015-01-28 10:07:51 -080068} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
Tao Baod7db5942015-01-28 10:07:51 -080070#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 Cheng655a7c02013-10-16 16:09:24 -070072#endif