The Pedigree Project  0.1
UsbDescriptors.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef USBDESCRIPTORS_H
21 #define USBDESCRIPTORS_H
22 
23 #include "pedigree/kernel/compiler.h"
24 #include "pedigree/kernel/processor/types.h"
25 
27 {
28  uint8_t nLength;
29  uint8_t nType;
30  uint8_t nEndpoint : 4;
31  uint8_t res0 : 3;
32  uint8_t bDirection : 1;
33  uint8_t nTransferType : 2;
34  uint8_t res1 : 6;
35  uint16_t nMaxPacketSize : 11;
36  uint8_t res2 : 5;
37  uint8_t nInterval;
38 } PACKED;
39 
41 {
42  uint8_t nLength;
43  uint8_t nType;
44  uint8_t nInterface;
45  uint8_t nAlternateSetting;
46  uint8_t nEndpoints;
47  uint8_t nClass;
48  uint8_t nSubclass;
49  uint8_t nProtocol;
50  uint8_t nString;
51 } PACKED;
52 
54 {
55  uint8_t nLength;
56  uint8_t nType;
57  uint16_t nTotalLength;
58  uint8_t nInterfaces;
59  uint8_t nConfig;
60  uint8_t nString;
61  uint8_t nAttributes;
62  uint8_t nMaxPower;
63 } PACKED;
64 
66 {
67  uint8_t nLength;
68  uint8_t nType;
69  uint16_t nBcdUsbRelease;
70  uint8_t nClass;
71  uint8_t nSubclass;
72  uint8_t nProtocol;
73  uint8_t nMaxControlPacketSize;
74  uint16_t nVendorId;
75  uint16_t nProductId;
76  uint16_t nBcdDeviceRelease;
77  uint8_t nVendorString;
78  uint8_t nProductString;
79  uint8_t nSerialString;
80  uint8_t nConfigurations;
81 } PACKED;
82 
83 #endif