]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/IndustryStandard/Usb.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Usb.h
index 72d3ecfc5bef78cbd4037aaf5f212b91937252cc..7df6466a7d3532a47d228ec933a72d73196a63c2 100644 (file)
 //\r
 // Usb mass storage class code\r
 //\r
-#define USB_MASS_STORE_CLASS    0x08\r
+#define USB_MASS_STORE_CLASS  0x08\r
 \r
 //\r
 // Usb mass storage subclass code, specify the command set used.\r
 //\r
-#define USB_MASS_STORE_RBC      0x01 ///< Reduced Block Commands\r
-#define USB_MASS_STORE_8020I    0x02 ///< SFF-8020i, typically a CD/DVD device\r
-#define USB_MASS_STORE_QIC      0x03 ///< Typically a tape device\r
-#define USB_MASS_STORE_UFI      0x04 ///< Typically a floppy disk driver device\r
-#define USB_MASS_STORE_8070I    0x05 ///< SFF-8070i, typically a floppy disk driver device.\r
-#define USB_MASS_STORE_SCSI     0x06 ///< SCSI transparent command set\r
+#define USB_MASS_STORE_RBC    0x01   ///< Reduced Block Commands\r
+#define USB_MASS_STORE_8020I  0x02   ///< SFF-8020i, typically a CD/DVD device\r
+#define USB_MASS_STORE_QIC    0x03   ///< Typically a tape device\r
+#define USB_MASS_STORE_UFI    0x04   ///< Typically a floppy disk driver device\r
+#define USB_MASS_STORE_8070I  0x05   ///< SFF-8070i, typically a floppy disk driver device.\r
+#define USB_MASS_STORE_SCSI   0x06   ///< SCSI transparent command set\r
 \r
 //\r
 // Usb mass storage protocol code, specify the transport protocol\r
 //\r
-#define USB_MASS_STORE_CBI0     0x00 ///< CBI protocol with command completion interrupt\r
-#define USB_MASS_STORE_CBI1     0x01 ///< CBI protocol without command completion interrupt\r
-#define USB_MASS_STORE_BOT      0x50 ///< Bulk-Only Transport\r
+#define USB_MASS_STORE_CBI0  0x00    ///< CBI protocol with command completion interrupt\r
+#define USB_MASS_STORE_CBI1  0x01    ///< CBI protocol without command completion interrupt\r
+#define USB_MASS_STORE_BOT   0x50    ///< Bulk-Only Transport\r
 \r
 //\r
 // Standard device request and request type\r
 // USB 2.0 spec, Section 9.4\r
 //\r
-#define USB_DEV_GET_STATUS                  0x00\r
-#define USB_DEV_GET_STATUS_REQ_TYPE_D       0x80 // Receiver : Device\r
-#define USB_DEV_GET_STATUS_REQ_TYPE_I       0x81 // Receiver : Interface\r
-#define USB_DEV_GET_STATUS_REQ_TYPE_E       0x82 // Receiver : Endpoint\r
+#define USB_DEV_GET_STATUS             0x00\r
+#define USB_DEV_GET_STATUS_REQ_TYPE_D  0x80      // Receiver : Device\r
+#define USB_DEV_GET_STATUS_REQ_TYPE_I  0x81      // Receiver : Interface\r
+#define USB_DEV_GET_STATUS_REQ_TYPE_E  0x82      // Receiver : Endpoint\r
 \r
-#define USB_DEV_CLEAR_FEATURE               0x01\r
-#define USB_DEV_CLEAR_FEATURE_REQ_TYPE_D    0x00 // Receiver : Device\r
-#define USB_DEV_CLEAR_FEATURE_REQ_TYPE_I    0x01 // Receiver : Interface\r
-#define USB_DEV_CLEAR_FEATURE_REQ_TYPE_E    0x02 // Receiver : Endpoint\r
+#define USB_DEV_CLEAR_FEATURE             0x01\r
+#define USB_DEV_CLEAR_FEATURE_REQ_TYPE_D  0x00   // Receiver : Device\r
+#define USB_DEV_CLEAR_FEATURE_REQ_TYPE_I  0x01   // Receiver : Interface\r
+#define USB_DEV_CLEAR_FEATURE_REQ_TYPE_E  0x02   // Receiver : Endpoint\r
 \r
-#define USB_DEV_SET_FEATURE                 0x03\r
-#define USB_DEV_SET_FEATURE_REQ_TYPE_D      0x00 // Receiver : Device\r
-#define USB_DEV_SET_FEATURE_REQ_TYPE_I      0x01 // Receiver : Interface\r
-#define USB_DEV_SET_FEATURE_REQ_TYPE_E      0x02 // Receiver : Endpoint\r
+#define USB_DEV_SET_FEATURE             0x03\r
+#define USB_DEV_SET_FEATURE_REQ_TYPE_D  0x00     // Receiver : Device\r
+#define USB_DEV_SET_FEATURE_REQ_TYPE_I  0x01     // Receiver : Interface\r
+#define USB_DEV_SET_FEATURE_REQ_TYPE_E  0x02     // Receiver : Endpoint\r
 \r
-#define USB_DEV_SET_ADDRESS                 0x05\r
-#define USB_DEV_SET_ADDRESS_REQ_TYPE        0x00\r
+#define USB_DEV_SET_ADDRESS           0x05\r
+#define USB_DEV_SET_ADDRESS_REQ_TYPE  0x00\r
 \r
-#define USB_DEV_GET_DESCRIPTOR              0x06\r
-#define USB_DEV_GET_DESCRIPTOR_REQ_TYPE     0x80\r
+#define USB_DEV_GET_DESCRIPTOR           0x06\r
+#define USB_DEV_GET_DESCRIPTOR_REQ_TYPE  0x80\r
 \r
-#define USB_DEV_SET_DESCRIPTOR              0x07\r
-#define USB_DEV_SET_DESCRIPTOR_REQ_TYPE     0x00\r
+#define USB_DEV_SET_DESCRIPTOR           0x07\r
+#define USB_DEV_SET_DESCRIPTOR_REQ_TYPE  0x00\r
 \r
 #define USB_DEV_GET_CONFIGURATION           0x08\r
 #define USB_DEV_GET_CONFIGURATION_REQ_TYPE  0x80\r
 #define USB_DEV_SET_CONFIGURATION           0x09\r
 #define USB_DEV_SET_CONFIGURATION_REQ_TYPE  0x00\r
 \r
-#define USB_DEV_GET_INTERFACE               0x0A\r
-#define USB_DEV_GET_INTERFACE_REQ_TYPE      0x81\r
+#define USB_DEV_GET_INTERFACE           0x0A\r
+#define USB_DEV_GET_INTERFACE_REQ_TYPE  0x81\r
 \r
-#define USB_DEV_SET_INTERFACE               0x0B\r
-#define USB_DEV_SET_INTERFACE_REQ_TYPE      0x01\r
-\r
-#define USB_DEV_SYNCH_FRAME                 0x0C\r
-#define USB_DEV_SYNCH_FRAME_REQ_TYPE        0x82\r
+#define USB_DEV_SET_INTERFACE           0x0B\r
+#define USB_DEV_SET_INTERFACE_REQ_TYPE  0x01\r
 \r
+#define USB_DEV_SYNCH_FRAME           0x0C\r
+#define USB_DEV_SYNCH_FRAME_REQ_TYPE  0x82\r
 \r
 //\r
 // USB standard descriptors and reqeust\r
 /// USB 2.0 spec, Section 9.3\r
 ///\r
 typedef struct {\r
-  UINT8           RequestType;\r
-  UINT8           Request;\r
-  UINT16          Value;\r
-  UINT16          Index;\r
-  UINT16          Length;\r
+  UINT8     RequestType;\r
+  UINT8     Request;\r
+  UINT16    Value;\r
+  UINT16    Index;\r
+  UINT16    Length;\r
 } USB_DEVICE_REQUEST;\r
 \r
 ///\r
@@ -101,20 +100,20 @@ typedef struct {
 /// USB 2.0 spec, Section 9.6.1\r
 ///\r
 typedef struct {\r
-  UINT8           Length;\r
-  UINT8           DescriptorType;\r
-  UINT16          BcdUSB;\r
-  UINT8           DeviceClass;\r
-  UINT8           DeviceSubClass;\r
-  UINT8           DeviceProtocol;\r
-  UINT8           MaxPacketSize0;\r
-  UINT16          IdVendor;\r
-  UINT16          IdProduct;\r
-  UINT16          BcdDevice;\r
-  UINT8           StrManufacturer;\r
-  UINT8           StrProduct;\r
-  UINT8           StrSerialNumber;\r
-  UINT8           NumConfigurations;\r
+  UINT8     Length;\r
+  UINT8     DescriptorType;\r
+  UINT16    BcdUSB;\r
+  UINT8     DeviceClass;\r
+  UINT8     DeviceSubClass;\r
+  UINT8     DeviceProtocol;\r
+  UINT8     MaxPacketSize0;\r
+  UINT16    IdVendor;\r
+  UINT16    IdProduct;\r
+  UINT16    BcdDevice;\r
+  UINT8     StrManufacturer;\r
+  UINT8     StrProduct;\r
+  UINT8     StrSerialNumber;\r
+  UINT8     NumConfigurations;\r
 } USB_DEVICE_DESCRIPTOR;\r
 \r
 ///\r
@@ -122,14 +121,14 @@ typedef struct {
 /// USB 2.0 spec, Section 9.6.3\r
 ///\r
 typedef struct {\r
-  UINT8           Length;\r
-  UINT8           DescriptorType;\r
-  UINT16          TotalLength;\r
-  UINT8           NumInterfaces;\r
-  UINT8           ConfigurationValue;\r
-  UINT8           Configuration;\r
-  UINT8           Attributes;\r
-  UINT8           MaxPower;\r
+  UINT8     Length;\r
+  UINT8     DescriptorType;\r
+  UINT16    TotalLength;\r
+  UINT8     NumInterfaces;\r
+  UINT8     ConfigurationValue;\r
+  UINT8     Configuration;\r
+  UINT8     Attributes;\r
+  UINT8     MaxPower;\r
 } USB_CONFIG_DESCRIPTOR;\r
 \r
 ///\r
@@ -137,15 +136,15 @@ typedef struct {
 /// USB 2.0 spec, Section 9.6.5\r
 ///\r
 typedef struct {\r
-  UINT8           Length;\r
-  UINT8           DescriptorType;\r
-  UINT8           InterfaceNumber;\r
-  UINT8           AlternateSetting;\r
-  UINT8           NumEndpoints;\r
-  UINT8           InterfaceClass;\r
-  UINT8           InterfaceSubClass;\r
-  UINT8           InterfaceProtocol;\r
-  UINT8           Interface;\r
+  UINT8    Length;\r
+  UINT8    DescriptorType;\r
+  UINT8    InterfaceNumber;\r
+  UINT8    AlternateSetting;\r
+  UINT8    NumEndpoints;\r
+  UINT8    InterfaceClass;\r
+  UINT8    InterfaceSubClass;\r
+  UINT8    InterfaceProtocol;\r
+  UINT8    Interface;\r
 } USB_INTERFACE_DESCRIPTOR;\r
 \r
 ///\r
@@ -153,12 +152,12 @@ typedef struct {
 /// USB 2.0 spec, Section 9.6.6\r
 ///\r
 typedef struct {\r
-  UINT8           Length;\r
-  UINT8           DescriptorType;\r
-  UINT8           EndpointAddress;\r
-  UINT8           Attributes;\r
-  UINT16          MaxPacketSize;\r
-  UINT8           Interval;\r
+  UINT8     Length;\r
+  UINT8     DescriptorType;\r
+  UINT8     EndpointAddress;\r
+  UINT8     Attributes;\r
+  UINT16    MaxPacketSize;\r
+  UINT8     Interval;\r
 } USB_ENDPOINT_DESCRIPTOR;\r
 \r
 ///\r
@@ -166,45 +165,44 @@ typedef struct {
 /// USB 2.0 spec, Section 9.6.7\r
 ///\r
 typedef struct {\r
-  UINT8           Length;\r
-  UINT8           DescriptorType;\r
-  CHAR16          String[1];\r
+  UINT8     Length;\r
+  UINT8     DescriptorType;\r
+  CHAR16    String[1];\r
 } EFI_USB_STRING_DESCRIPTOR;\r
 \r
 #pragma pack()\r
 \r
-\r
 typedef enum {\r
   //\r
   // USB request type\r
   //\r
-  USB_REQ_TYPE_STANDARD   = (0x00 << 5),\r
-  USB_REQ_TYPE_CLASS      = (0x01 << 5),\r
-  USB_REQ_TYPE_VENDOR     = (0x02 << 5),\r
+  USB_REQ_TYPE_STANDARD = (0x00 << 5),\r
+  USB_REQ_TYPE_CLASS    = (0x01 << 5),\r
+  USB_REQ_TYPE_VENDOR   = (0x02 << 5),\r
 \r
   //\r
   // Standard control transfer request type, or the value\r
   // to fill in EFI_USB_DEVICE_REQUEST.Request\r
   //\r
-  USB_REQ_GET_STATUS      = 0x00,\r
-  USB_REQ_CLEAR_FEATURE   = 0x01,\r
-  USB_REQ_SET_FEATURE     = 0x03,\r
-  USB_REQ_SET_ADDRESS     = 0x05,\r
-  USB_REQ_GET_DESCRIPTOR  = 0x06,\r
-  USB_REQ_SET_DESCRIPTOR  = 0x07,\r
-  USB_REQ_GET_CONFIG      = 0x08,\r
-  USB_REQ_SET_CONFIG      = 0x09,\r
-  USB_REQ_GET_INTERFACE   = 0x0A,\r
-  USB_REQ_SET_INTERFACE   = 0x0B,\r
-  USB_REQ_SYNCH_FRAME     = 0x0C,\r
+  USB_REQ_GET_STATUS     = 0x00,\r
+  USB_REQ_CLEAR_FEATURE  = 0x01,\r
+  USB_REQ_SET_FEATURE    = 0x03,\r
+  USB_REQ_SET_ADDRESS    = 0x05,\r
+  USB_REQ_GET_DESCRIPTOR = 0x06,\r
+  USB_REQ_SET_DESCRIPTOR = 0x07,\r
+  USB_REQ_GET_CONFIG     = 0x08,\r
+  USB_REQ_SET_CONFIG     = 0x09,\r
+  USB_REQ_GET_INTERFACE  = 0x0A,\r
+  USB_REQ_SET_INTERFACE  = 0x0B,\r
+  USB_REQ_SYNCH_FRAME    = 0x0C,\r
 \r
   //\r
   // Usb control transfer target\r
   //\r
-  USB_TARGET_DEVICE       = 0,\r
-  USB_TARGET_INTERFACE    = 0x01,\r
-  USB_TARGET_ENDPOINT     = 0x02,\r
-  USB_TARGET_OTHER        = 0x03,\r
+  USB_TARGET_DEVICE    = 0,\r
+  USB_TARGET_INTERFACE = 0x01,\r
+  USB_TARGET_ENDPOINT  = 0x02,\r
+  USB_TARGET_OTHER     = 0x03,\r
 \r
   //\r
   // USB Descriptor types\r
@@ -225,21 +223,20 @@ typedef enum {
   //\r
   // USB endpoint types: 00: control, 01: isochronous, 10: bulk, 11: interrupt\r
   //\r
-  USB_ENDPOINT_CONTROL    = 0x00,\r
-  USB_ENDPOINT_ISO        = 0x01,\r
-  USB_ENDPOINT_BULK       = 0x02,\r
-  USB_ENDPOINT_INTERRUPT  = 0x03,\r
+  USB_ENDPOINT_CONTROL   = 0x00,\r
+  USB_ENDPOINT_ISO       = 0x01,\r
+  USB_ENDPOINT_BULK      = 0x02,\r
+  USB_ENDPOINT_INTERRUPT = 0x03,\r
 \r
-  USB_ENDPOINT_TYPE_MASK  = 0x03,\r
-  USB_ENDPOINT_DIR_IN     = 0x80,\r
+  USB_ENDPOINT_TYPE_MASK = 0x03,\r
+  USB_ENDPOINT_DIR_IN    = 0x80,\r
 \r
   //\r
-  //Use 200 ms to increase the error handling response time\r
+  // Use 200 ms to increase the error handling response time\r
   //\r
   EFI_USB_INTERRUPT_DELAY = 2000000\r
 } USB_TYPES_DEFINITION;\r
 \r
-\r
 //\r
 // HID constants definition, see Device Class Definition\r
 // for Human Interface Devices (HID) rev1.11\r
@@ -253,19 +250,19 @@ typedef enum {
 //\r
 // HID specific requests.\r
 //\r
-#define USB_HID_CLASS_GET_REQ_TYPE       0xa1\r
-#define USB_HID_CLASS_SET_REQ_TYPE       0x21\r
+#define USB_HID_CLASS_GET_REQ_TYPE  0xa1\r
+#define USB_HID_CLASS_SET_REQ_TYPE  0x21\r
 \r
 //\r
 // HID report item format\r
 //\r
-#define HID_ITEM_FORMAT_SHORT 0\r
-#define HID_ITEM_FORMAT_LONG  1\r
+#define HID_ITEM_FORMAT_SHORT  0\r
+#define HID_ITEM_FORMAT_LONG   1\r
 \r
 //\r
 // Special tag indicating long items\r
 //\r
-#define HID_ITEM_TAG_LONG 15\r
+#define HID_ITEM_TAG_LONG  15\r
 \r
 //\r
 // HID report descriptor item type (prefix bit 2,3)\r
@@ -287,15 +284,15 @@ typedef enum {
 //\r
 // HID report descriptor main item contents\r
 //\r
-#define HID_MAIN_ITEM_CONSTANT      0x001\r
-#define HID_MAIN_ITEM_VARIABLE      0x002\r
-#define HID_MAIN_ITEM_RELATIVE      0x004\r
-#define HID_MAIN_ITEM_WRAP          0x008\r
-#define HID_MAIN_ITEM_NONLINEAR     0x010\r
-#define HID_MAIN_ITEM_NO_PREFERRED  0x020\r
-#define HID_MAIN_ITEM_NULL_STATE    0x040\r
-#define HID_MAIN_ITEM_VOLATILE      0x080\r
-#define HID_MAIN_ITEM_BUFFERED_BYTE 0x100\r
+#define HID_MAIN_ITEM_CONSTANT       0x001\r
+#define HID_MAIN_ITEM_VARIABLE       0x002\r
+#define HID_MAIN_ITEM_RELATIVE       0x004\r
+#define HID_MAIN_ITEM_WRAP           0x008\r
+#define HID_MAIN_ITEM_NONLINEAR      0x010\r
+#define HID_MAIN_ITEM_NO_PREFERRED   0x020\r
+#define HID_MAIN_ITEM_NULL_STATE     0x040\r
+#define HID_MAIN_ITEM_VOLATILE       0x080\r
+#define HID_MAIN_ITEM_BUFFERED_BYTE  0x100\r
 \r
 //\r
 // HID report descriptor collection item types\r
@@ -323,16 +320,16 @@ typedef enum {
 //\r
 // HID report descriptor local item tags\r
 //\r
-#define HID_LOCAL_ITEM_TAG_USAGE              0\r
-#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM      1\r
-#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM      2\r
-#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX   3\r
-#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4\r
-#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5\r
-#define HID_LOCAL_ITEM_TAG_STRING_INDEX       7\r
-#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM     8\r
-#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM     9\r
-#define HID_LOCAL_ITEM_TAG_DELIMITER          10\r
+#define HID_LOCAL_ITEM_TAG_USAGE               0\r
+#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM       1\r
+#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM       2\r
+#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX    3\r
+#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM  4\r
+#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM  5\r
+#define HID_LOCAL_ITEM_TAG_STRING_INDEX        7\r
+#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM      8\r
+#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM      9\r
+#define HID_LOCAL_ITEM_TAG_DELIMITER           10\r
 \r
 //\r
 // HID report types\r
@@ -357,8 +354,8 @@ typedef enum {
 /// HID 1.1, section 6.2.1\r
 ///\r
 typedef struct hid_class_descriptor {\r
-  UINT8   DescriptorType;\r
-  UINT16  DescriptorLength;\r
+  UINT8     DescriptorType;\r
+  UINT16    DescriptorLength;\r
 } EFI_USB_HID_CLASS_DESCRIPTOR;\r
 \r
 ///\r
@@ -367,12 +364,12 @@ typedef struct hid_class_descriptor {
 /// HID 1.1, section 6.2.1\r
 ///\r
 typedef struct hid_descriptor {\r
-  UINT8                         Length;\r
-  UINT8                         DescriptorType;\r
-  UINT16                        BcdHID;\r
-  UINT8                         CountryCode;\r
-  UINT8                         NumDescriptors;\r
-  EFI_USB_HID_CLASS_DESCRIPTOR  HidClassDesc[1];\r
+  UINT8                           Length;\r
+  UINT8                           DescriptorType;\r
+  UINT16                          BcdHID;\r
+  UINT8                           CountryCode;\r
+  UINT8                           NumDescriptors;\r
+  EFI_USB_HID_CLASS_DESCRIPTOR    HidClassDesc[1];\r
 } EFI_USB_HID_DESCRIPTOR;\r
 \r
 #pragma pack()\r