X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FIndustryStandard%2FUsb.h;h=c4367b58bb8861a6f7f79676961df2f317c59b75;hb=826a66d4c0e6983b11dd1156369b77ace1998534;hp=0c251142a9fdfff15eb27e4dcea8836db313e25a;hpb=e3c6b3d9802d267eff1c45c843a112c4c800334e;p=mirror_edk2.git diff --git a/MdePkg/Include/IndustryStandard/Usb.h b/MdePkg/Include/IndustryStandard/Usb.h index 0c251142a9..c4367b58bb 100644 --- a/MdePkg/Include/IndustryStandard/Usb.h +++ b/MdePkg/Include/IndustryStandard/Usb.h @@ -1,8 +1,8 @@ /** @file - Support for USB 1.1 standard. + Support for USB 2.0 standard. - Copyright (c) 2006 - 2007, Intel Corporation - All rights reserved. This program and the accompanying materials + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -17,7 +17,7 @@ // // Standard device request and request type -// By [Spec-USB20/Chapter-9.4] +// USB 2.0 spec, Section 9.4 // #define USB_DEV_GET_STATUS 0x00 #define USB_DEV_GET_STATUS_REQ_TYPE_D 0x80 // Receiver : Device @@ -63,6 +63,11 @@ // USB standard descriptors and reqeust // #pragma pack(1) + +/// +/// Format of Setup Data for USB Device Requests +/// USB 2.0 spec, Section 9.3 +/// typedef struct { UINT8 RequestType; UINT8 Request; @@ -71,6 +76,10 @@ typedef struct { UINT16 Length; } USB_DEVICE_REQUEST; +/// +/// Standard Device Descriptor +/// USB 2.0 spec, Section 9.6.1 +/// typedef struct { UINT8 Length; UINT8 DescriptorType; @@ -88,6 +97,10 @@ typedef struct { UINT8 NumConfigurations; } USB_DEVICE_DESCRIPTOR; +/// +/// Standard Configuration Descriptor +/// USB 2.0 spec, Section 9.6.3 +/// typedef struct { UINT8 Length; UINT8 DescriptorType; @@ -99,6 +112,10 @@ typedef struct { UINT8 MaxPower; } USB_CONFIG_DESCRIPTOR; +/// +/// Standard Interface Descriptor +/// USB 2.0 spec, Section 9.6.5 +/// typedef struct { UINT8 Length; UINT8 DescriptorType; @@ -111,6 +128,10 @@ typedef struct { UINT8 Interface; } USB_INTERFACE_DESCRIPTOR; +/// +/// Standard Endpoint Descriptor +/// USB 2.0 spec, Section 9.6.6 +/// typedef struct { UINT8 Length; UINT8 DescriptorType; @@ -120,6 +141,10 @@ typedef struct { UINT8 Interval; } USB_ENDPOINT_DESCRIPTOR; +/// +/// UNICODE String Descriptor +/// USB 2.0 spec, Section 9.6.7 +/// typedef struct { UINT8 Length; UINT8 DescriptorType; @@ -129,7 +154,7 @@ typedef struct { #pragma pack() -enum { +typedef enum { // // USB request type // @@ -170,6 +195,7 @@ enum { USB_DESC_TYPE_INTERFACE = 0x04, USB_DESC_TYPE_ENDPOINT = 0x05, USB_DESC_TYPE_HID = 0x21, + USB_DESC_TYPE_REPORT = 0x22, // // Features to be cleared by CLEAR_FEATURE requests @@ -190,14 +216,26 @@ enum { // //Use 200 ms to increase the error handling response time // - EFI_USB_INTERRUPT_DELAY = 2000000, -}; + EFI_USB_INTERRUPT_DELAY = 2000000 +} USB_TYPES_DEFINITION; // -// HID constants definition, see HID rev1.0 +// HID constants definition, see Device Class Definition +// for Human Interface Devices (HID) rev1.11 // +// +// HID standard GET_DESCRIPTOR request. +// +#define USB_HID_GET_DESCRIPTOR_REQ_TYPE 0x81 + +// +// HID specific requests. +// +#define USB_HID_CLASS_GET_REQ_TYPE 0xa1 +#define USB_HID_CLASS_SET_REQ_TYPE 0x21 + // // HID report item format // @@ -294,14 +332,20 @@ enum { #define EFI_USB_SET_PROTOCOL_REQUEST 0x0b #pragma pack(1) -// -// Descriptor header for Report/Physical Descriptors -// +/// +/// Descriptor header for Report/Physical Descriptors +/// HID 1.1, section 6.2.1 +/// typedef struct hid_class_descriptor { UINT8 DescriptorType; UINT16 DescriptorLength; } EFI_USB_HID_CLASS_DESCRIPTOR; +/// +/// The HID descriptor identifies the length and type +/// of subordinate descriptors for a device. +/// HID 1.1, section 6.2.1 +/// typedef struct hid_descriptor { UINT8 Length; UINT8 DescriptorType;