blob: c8af04ba58f32a065a870a500c8b8c35e2e9370a [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef __LINUX_USB_MIDI_H
8#define __LINUX_USB_MIDI_H
9#include <linux/types.h>
10#define USB_MS_HEADER 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070011#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
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define USB_MS_EMBEDDED 0x01
16#define USB_MS_EXTERNAL 0x02
17struct usb_ms_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080018 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -080019 __u8 bDescriptorType;
20 __u8 bDescriptorSubtype;
21 __le16 bcdMSC;
22 __le16 wTotalLength;
Tao Baod7db5942015-01-28 10:07:51 -080023} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define USB_DT_MS_HEADER_SIZE 7
25struct usb_midi_in_jack_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080026 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -080027 __u8 bDescriptorType;
28 __u8 bDescriptorSubtype;
29 __u8 bJackType;
30 __u8 bJackID;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u8 iJack;
32} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define USB_DT_MIDI_IN_SIZE 6
34struct usb_midi_source_pin {
Tao Baod7db5942015-01-28 10:07:51 -080035 __u8 baSourceID;
36 __u8 baSourcePin;
37} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070038struct usb_midi_out_jack_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u8 bLength;
40 __u8 bDescriptorType;
41 __u8 bDescriptorSubtype;
42 __u8 bJackType;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u8 bJackID;
44 __u8 bNrInputPins;
45 struct usb_midi_source_pin pins[];
46} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p))
Tao Baod7db5942015-01-28 10:07:51 -080048#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))
Ben Cheng655a7c02013-10-16 16:09:24 -070050struct usb_ms_endpoint_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080051 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -080052 __u8 bDescriptorType;
53 __u8 bDescriptorSubtype;
54 __u8 bNumEmbMIDIJack;
55 __u8 baAssocJackID[];
Tao Baod7db5942015-01-28 10:07:51 -080056} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
Tao Baod7db5942015-01-28 10:07:51 -080058#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))
Ben Cheng655a7c02013-10-16 16:09:24 -070060#endif