3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Manage Usb Descriptor List
25 #ifndef _USB_DESCRIPTOR_H_
26 #define _USB_DESCRIPTOR_H_
29 USB_MAX_INTERFACE_SETTING
= 8,
33 // The RequestType in EFI_USB_DEVICE_REQUEST is composed of
34 // three fields: One bit direction, 2 bit type, and 5 bit
37 #define USB_REQUEST_TYPE(Dir, Type, Target) \
38 ((UINT8)((((Dir) == EfiUsbDataIn ? 0x01 : 0) << 7) | (Type) | (Target)))
41 // A common header for usb standard descriptor.
42 // Each stand descriptor has a length and type.
53 // Each USB device has a device descriptor. Each device may
54 // have several configures. Each configure contains several
55 // interfaces. Each interface may have several settings. Each
56 // setting has several endpoints.
58 // EFI_USB_..._DESCRIPTOR must be the first member of the
62 EFI_USB_ENDPOINT_DESCRIPTOR Desc
;
67 EFI_USB_INTERFACE_DESCRIPTOR Desc
;
68 USB_ENDPOINT_DESC
**Endpoints
;
69 } USB_INTERFACE_SETTING
;
72 // An interface may have several settings. Use a
73 // fixed max number of settings to simplify code.
74 // It should sufice in most environments.
77 USB_INTERFACE_SETTING
* Settings
[USB_MAX_INTERFACE_SETTING
];
79 UINT8 ActiveIndex
; // Index of active setting
83 EFI_USB_CONFIG_DESCRIPTOR Desc
;
84 USB_INTERFACE_DESC
**Interfaces
;
88 EFI_USB_DEVICE_DESCRIPTOR Desc
;
89 USB_CONFIG_DESC
**Configs
;
94 IN USB_DEVICE
*UsbDev
,
95 IN EFI_USB_DATA_DIRECTION Direction
,
106 UsbGetMaxPacketSize0 (
107 IN USB_DEVICE
*UsbDev
112 IN USB_DEVICE_DESC
*DevDesc
115 EFI_USB_STRING_DESCRIPTOR
*
117 IN USB_DEVICE
*UsbDev
,
118 IN UINT8 StringIndex
,
124 IN USB_DEVICE
*UsbDev
129 IN USB_DEVICE
*UsbDev
,
135 IN USB_DEVICE
*UsbDev
,
141 IN EFI_USB_IO_PROTOCOL
*UsbIo
,