The Pedigree Project 0.1
UsbConstants.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 USBCONSTANTS_H
21#define USBCONSTANTS_H
22
23#include "pedigree/kernel/processor/types.h"
24
25namespace UsbRequestType {
26enum RequestType { Standard = 0x00, Class = 0x20, Vendor = 0x40 };
27};
28
29namespace UsbRequestRecipient {
30enum RequestRecipient { Device = 0x00, Interface = 0x01, Endpoint = 0x02, Other = 0x03 };
31};
32
33namespace UsbRequestDirection {
34enum RequestDirection { Out = 0x00, In = 0x80 };
35};
36
37namespace UsbRequest {
38enum Request {
39 GetStatus = 0,
40 ClearFeature = 1,
41 SetFeature = 3,
42 SetAddress = 5,
43 GetDescriptor = 6,
44 SetDescriptor = 7,
45 GetConfiguration = 8,
46 SetConfiguration = 9,
47 GetInterface = 10,
48 SetInterface = 11,
49 SynchFrame = 12,
50};
51};
52
53namespace UsbDescriptor {
54enum Descriptor {
55 Device = 1,
56 Configuration = 2,
57 String = 3,
58 Interface = 4,
59 Endpoint = 5,
60 DeviceQualifier = 6,
61 OtherSpeedConfiguration = 7,
62};
63};
64
65#endif