The Pedigree Project
0.1
src
modules
system
usb
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
26
struct
UsbEndpointDescriptor
{
27
uint8_t nLength;
28
uint8_t nType;
29
uint8_t nEndpoint : 4;
30
uint8_t res0 : 3;
31
uint8_t bDirection : 1;
32
uint8_t nTransferType : 2;
33
uint8_t res1 : 6;
34
uint16_t nMaxPacketSize : 11;
35
uint8_t res2 : 5;
36
uint8_t nInterval;
37
}
PACKED
;
38
39
struct
UsbInterfaceDescriptor
{
40
uint8_t nLength;
41
uint8_t nType;
42
uint8_t nInterface;
43
uint8_t nAlternateSetting;
44
uint8_t nEndpoints;
45
uint8_t nClass;
46
uint8_t nSubclass;
47
uint8_t nProtocol;
48
uint8_t nString;
49
}
PACKED
;
50
51
struct
UsbConfigurationDescriptor
{
52
uint8_t nLength;
53
uint8_t nType;
54
uint16_t nTotalLength;
55
uint8_t nInterfaces;
56
uint8_t nConfig;
57
uint8_t nString;
58
uint8_t nAttributes;
59
uint8_t nMaxPower;
60
}
PACKED
;
61
62
struct
UsbDeviceDescriptor
{
63
uint8_t nLength;
64
uint8_t nType;
65
uint16_t nBcdUsbRelease;
66
uint8_t nClass;
67
uint8_t nSubclass;
68
uint8_t nProtocol;
69
uint8_t nMaxControlPacketSize;
70
uint16_t nVendorId;
71
uint16_t nProductId;
72
uint16_t nBcdDeviceRelease;
73
uint8_t nVendorString;
74
uint8_t nProductString;
75
uint8_t nSerialString;
76
uint8_t nConfigurations;
77
}
PACKED
;
78
79
#endif
PACKED
#define PACKED
Definition
system/include/pedigree/kernel/compiler.h:48
UsbConfigurationDescriptor
Definition
UsbDescriptors.h:51
UsbDeviceDescriptor
Definition
UsbDescriptors.h:62
UsbEndpointDescriptor
Definition
UsbDescriptors.h:26
UsbInterfaceDescriptor
Definition
UsbDescriptors.h:39
Generated on Sat Oct 3 2026 06:38:07 for The Pedigree Project by
1.9.8