X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FIndustryStandard%2FUsb.h;h=c27ea15b4122af09cd49bda3daa4fcf42ad9eacf;hb=71a2a892658baac6301e81ad58a8abbc05fa17d2;hp=f64d96c87c3dc37baa95312384dda1511849a7f1;hpb=1b2afeaacd4df0915f80cbc6e43311a39d0c641b;p=mirror_edk2.git diff --git a/MdePkg/Include/IndustryStandard/Usb.h b/MdePkg/Include/IndustryStandard/Usb.h index f64d96c87c..c27ea15b41 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 - 2014, 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 @@ -15,9 +15,35 @@ #ifndef __USB_H__ #define __USB_H__ +// +// Subset of Class and Subclass definitions from USB Specs +// + +// +// Usb mass storage class code +// +#define USB_MASS_STORE_CLASS 0x08 + +// +// Usb mass storage subclass code, specify the command set used. +// +#define USB_MASS_STORE_RBC 0x01 ///< Reduced Block Commands +#define USB_MASS_STORE_8020I 0x02 ///< SFF-8020i, typically a CD/DVD device +#define USB_MASS_STORE_QIC 0x03 ///< Typically a tape device +#define USB_MASS_STORE_UFI 0x04 ///< Typically a floppy disk driver device +#define USB_MASS_STORE_8070I 0x05 ///< SFF-8070i, typically a floppy disk driver device. +#define USB_MASS_STORE_SCSI 0x06 ///< SCSI transparent command set + +// +// Usb mass storage protocol code, specify the transport protocol +// +#define USB_MASS_STORE_CBI0 0x00 ///< CBI protocol with command completion interrupt +#define USB_MASS_STORE_CBI1 0x01 ///< CBI protocol without command completion interrupt +#define USB_MASS_STORE_BOT 0x50 ///< Bulk-Only Transport + // // 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 +89,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 +102,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 +123,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 +138,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 +154,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 +167,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 +180,7 @@ typedef struct { #pragma pack() -enum { +typedef enum { // // USB request type // @@ -170,6 +221,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 @@ -191,12 +243,24 @@ enum { //Use 200 ms to increase the error handling response time // EFI_USB_INTERRUPT_DELAY = 2000000 -}; +} USB_TYPES_DEFINITION; + + +// +// 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 constants definition, see HID rev1.0 +// 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 +358,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;