No empty .Rs/.Re
[netbsd-mini2440.git] / sys / dev / usb / umidireg.h
blob9e778bb232c263dad1d810aaec67b7fd8ef3ae66
1 /* $NetBSD: umidireg.h,v 1.7 2008/04/28 20:24:00 martin Exp $ */
2 /*
3 * Copyright (c) 2001 The NetBSD Foundation, Inc.
4 * All rights reserved.
6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Takuya SHIOZAKI (tshiozak@NetBSD.org).
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
31 /* Jack Descriptor */
32 #define UMIDI_MS_HEADER 0x01
33 #define UMIDI_IN_JACK 0x02
34 #define UMIDI_OUT_JACK 0x03
36 /* Jack Type */
37 #define UMIDI_EMBEDDED 0x01
38 #define UMIDI_EXTERNAL 0x02
40 /* generic, for iteration */
41 typedef struct {
42 uByte bLength;
43 uByte bDescriptorType;
44 uByte bDescriptorSubtype;
45 } UPACKED umidi_cs_descriptor_t;
47 typedef struct {
48 uByte bLength;
49 uByte bDescriptorType;
50 uByte bDescriptorSubtype;
51 uWord bcdMSC;
52 uWord wTotalLength;
53 } UPACKED umidi_cs_interface_descriptor_t;
54 #define UMIDI_CS_INTERFACE_DESCRIPTOR_SIZE 7
56 typedef struct {
57 uByte bLength;
58 uByte bDescriptorType;
59 uByte bDescriptorSubtype;
60 uByte bNumEmbMIDIJack;
61 } UPACKED umidi_cs_endpoint_descriptor_t;
62 #define UMIDI_CS_ENDPOINT_DESCRIPTOR_SIZE 4
64 typedef struct {
65 uByte bLength;
66 uByte bDescriptorType;
67 uByte bDescriptorSubtype;
68 uByte bJackType;
69 uByte bJackID;
70 } UPACKED umidi_jack_descriptor_t;
71 #define UMIDI_JACK_DESCRIPTOR_SIZE 5
74 #define TO_D(p) ((usb_descriptor_t *)(p))
75 #define NEXT_D(desc) TO_D((char *)(desc)+(desc)->bLength)
76 #define TO_IFD(desc) ((usb_interface_descriptor_t *)(desc))
77 #define TO_CSIFD(desc) ((umidi_cs_interface_descriptor_t *)(desc))
78 #define TO_EPD(desc) ((usb_endpoint_descriptor_t *)(desc))
79 #define TO_CSEPD(desc) ((umidi_cs_endpoint_descriptor_t *)(desc))