]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg UsbBotPei: The UsbBotPei module contains the private structure definitio...
authorStar Zeng <star.zeng@intel.com>
Sun, 26 Jan 2014 02:49:41 +0000 (02:49 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 26 Jan 2014 02:49:41 +0000 (02:49 +0000)
If the structure layout in UsbBusPei is changed, then the UsbBotPei will not work.

1. As the maximum number of endpoints is 16, use UINT16 type rather than UINT8 for DataToggle.
2. DataToggle needs to be reset to 0 when endpoint stall is cleared, do it in PeiUsbControlTransfer().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15185 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c
MdeModulePkg/Bus/Usb/UsbBotPei/UsbPeim.h
MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h
MdeModulePkg/Bus/Usb/UsbBusPei/UsbIoPeim.c
MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.h

index 2a8fde07ff9858d9d6de32dbadf0feb99d119bd7..46c1a0644458e3a989899757410acb1fa5e33888 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Common Libarary  for PEI USB.\r
 \r
 /** @file\r
 Common Libarary  for PEI USB.\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -215,15 +215,24 @@ PeiUsbClearEndpointHalt (
   IN UINT8                    EndpointAddress\r
   )\r
 {\r
   IN UINT8                    EndpointAddress\r
   )\r
 {\r
-  EFI_STATUS                  Status;\r
-  PEI_USB_DEVICE              *PeiUsbDev;\r
-  EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor;\r
-  UINT8                       EndpointIndex;\r
+  EFI_STATUS                    Status;\r
+  EFI_USB_INTERFACE_DESCRIPTOR  *InterfaceDesc;\r
+  EFI_USB_ENDPOINT_DESCRIPTOR   *EndpointDescriptor;\r
+  UINT8                         EndpointIndex;\r
 \r
 \r
-  EndpointIndex = 0;\r
-  PeiUsbDev     = PEI_USB_DEVICE_FROM_THIS (UsbIoPpi);\r
 \r
 \r
-  while (EndpointIndex < MAX_ENDPOINT) {\r
+  //\r
+  // Check its interface\r
+  //\r
+  Status = UsbIoPpi->UsbGetInterfaceDescriptor (\r
+                      PeiServices,\r
+                      UsbIoPpi,\r
+                      &InterfaceDesc\r
+                      );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  for (EndpointIndex = 0; EndpointIndex < InterfaceDesc->NumEndpoints; EndpointIndex++) {\r
     Status = UsbIoPpi->UsbGetEndpointDescriptor (PeiServices, UsbIoPpi, EndpointIndex, &EndpointDescriptor);\r
     if (EFI_ERROR (Status)) {\r
       return EFI_INVALID_PARAMETER;\r
     Status = UsbIoPpi->UsbGetEndpointDescriptor (PeiServices, UsbIoPpi, EndpointIndex, &EndpointDescriptor);\r
     if (EFI_ERROR (Status)) {\r
       return EFI_INVALID_PARAMETER;\r
@@ -232,11 +241,9 @@ PeiUsbClearEndpointHalt (
     if (EndpointDescriptor->EndpointAddress == EndpointAddress) {\r
       break;\r
     }\r
     if (EndpointDescriptor->EndpointAddress == EndpointAddress) {\r
       break;\r
     }\r
-\r
-    EndpointIndex++;\r
   }\r
 \r
   }\r
 \r
-  if (EndpointIndex == MAX_ENDPOINT) {\r
+  if (EndpointIndex == InterfaceDesc->NumEndpoints) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -248,13 +255,6 @@ PeiUsbClearEndpointHalt (
             EndpointAddress\r
             );\r
 \r
             EndpointAddress\r
             );\r
 \r
-  //\r
-  // set data toggle to zero.\r
-  //\r
-  if ((PeiUsbDev->DataToggle & (1 << EndpointIndex)) != 0) {\r
-    PeiUsbDev->DataToggle = (UINT8) (PeiUsbDev->DataToggle ^ (1 << EndpointIndex));\r
-  }\r
-\r
   return Status;\r
 }\r
 \r
   return Status;\r
 }\r
 \r
index 4f3f57f0bc474f1aad4e927d74188360ae78c458..6dcd189f775f727040e9449155ab1c31216a4e88 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Usb Peim definition.\r
 \r
 /** @file\r
 Usb Peim definition.\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -21,7 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <PiPei.h>\r
 \r
 #include <Ppi/UsbIo.h>\r
 #include <PiPei.h>\r
 \r
 #include <Ppi/UsbIo.h>\r
-#include <Ppi/UsbHostController.h>\r
 #include <Ppi/BlockIo.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Ppi/BlockIo.h>\r
 \r
 #include <Library/DebugLib.h>\r
@@ -30,150 +29,4 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <IndustryStandard/Usb.h>\r
 \r
 \r
 #include <IndustryStandard/Usb.h>\r
 \r
-#define MAX_ROOT_PORT             2\r
-#define MAX_ENDPOINT              16\r
-\r
-#define USB_SLOW_SPEED_DEVICE     0x01\r
-#define USB_FULL_SPEED_DEVICE     0x02\r
-\r
-#define PEI_USB_DEVICE_SIGNATURE  SIGNATURE_32 ('U', 's', 'b', 'D')\r
-typedef struct {\r
-  UINTN                         Signature;\r
-  PEI_USB_IO_PPI                UsbIoPpi;\r
-  EFI_PEI_PPI_DESCRIPTOR        UsbIoPpiList;\r
-  UINT8                         DeviceAddress;\r
-  UINT8                         MaxPacketSize0;\r
-  UINT8                         DeviceSpeed;\r
-  UINT8                         DataToggle;\r
-  UINT8                         IsHub;\r
-  UINT8                         DownStreamPortNo;\r
-  UINT8                         Reserved[2];  // Padding for IPF\r
-  UINTN                         AllocateAddress;\r
-  PEI_USB_HOST_CONTROLLER_PPI   *UsbHcPpi;\r
-  UINT8                         ConfigurationData[1024];\r
-  EFI_USB_CONFIG_DESCRIPTOR     *ConfigDesc;\r
-  EFI_USB_INTERFACE_DESCRIPTOR  *InterfaceDesc;\r
-  EFI_USB_ENDPOINT_DESCRIPTOR   *EndpointDesc[MAX_ENDPOINT];\r
-} PEI_USB_DEVICE;\r
-\r
-#define PEI_USB_DEVICE_FROM_THIS(a) CR (a, PEI_USB_DEVICE, UsbIoPpi, PEI_USB_DEVICE_SIGNATURE)\r
-\r
-\r
-/**\r
-  Submits control transfer to a target USB device.\r
-  \r
-  @param  PeiServices            The pointer of EFI_PEI_SERVICES.\r
-  @param  This                   The pointer of PEI_USB_IO_PPI.\r
-  @param  Request                USB device request to send.\r
-  @param  Direction              Specifies the data direction for the data stage.\r
-  @param  Timeout                Indicates the maximum timeout, in millisecond.\r
-  @param  Data                   Data buffer to be transmitted or received from USB device.\r
-  @param  DataLength             The size (in bytes) of the data buffer.\r
-\r
-  @retval EFI_SUCCESS            Transfer was completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES   The transfer failed due to lack of resources.\r
-  @retval EFI_INVALID_PARAMETER  Some parameters are invalid.\r
-  @retval EFI_TIMEOUT            Transfer failed due to timeout.\r
-  @retval EFI_DEVICE_ERROR       Transfer failed due to host controller or device error.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbControlTransfer (\r
-  IN     EFI_PEI_SERVICES          **PeiServices,\r
-  IN     PEI_USB_IO_PPI            *This,\r
-  IN     EFI_USB_DEVICE_REQUEST    *Request,\r
-  IN     EFI_USB_DATA_DIRECTION    Direction,\r
-  IN     UINT32                    Timeout,\r
-  IN OUT VOID                      *Data,      OPTIONAL\r
-  IN     UINTN                     DataLength  OPTIONAL\r
-  );\r
-\r
-/**\r
-  Submits bulk transfer to a bulk endpoint of a USB device.\r
-  \r
-  @param  PeiServices           The pointer of EFI_PEI_SERVICES.\r
-  @param  This                  The pointer of PEI_USB_IO_PPI.\r
-  @param  DeviceEndpoint        Endpoint number and its direction in bit 7.\r
-  @param  Data                  A pointer to the buffer of data to transmit \r
-                                from or receive into.\r
-  @param  DataLength            The lenght of the data buffer.\r
-  @param  Timeout               Indicates the maximum time, in millisecond, which the\r
-                                transfer is allowed to complete.\r
-\r
-  @retval EFI_SUCCESS           The transfer was completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  The transfer failed due to lack of resource.\r
-  @retval EFI_INVALID_PARAMETER Parameters are invalid.\r
-  @retval EFI_TIMEOUT           The transfer failed due to timeout.\r
-  @retval EFI_DEVICE_ERROR      The transfer failed due to host controller error.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbBulkTransfer (\r
-  IN     EFI_PEI_SERVICES    **PeiServices,\r
-  IN     PEI_USB_IO_PPI      *This,\r
-  IN     UINT8               DeviceEndpoint,\r
-  IN OUT VOID                *Data,\r
-  IN OUT UINTN               *DataLength,\r
-  IN     UINTN               Timeout\r
-  );\r
-\r
-/**\r
-  Get the usb interface descriptor.\r
-\r
-  @param  PeiServices          General-purpose services that are available to every PEIM.\r
-  @param  This                 Indicates the PEI_USB_IO_PPI instance.\r
-  @param  InterfaceDescriptor  Request interface descriptor.\r
-\r
-\r
-  @retval EFI_SUCCESS     Usb interface descriptor is obtained successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbGetInterfaceDescriptor (\r
-  IN  EFI_PEI_SERVICES                **PeiServices,\r
-  IN  PEI_USB_IO_PPI                  *This,\r
-  OUT EFI_USB_INTERFACE_DESCRIPTOR    **InterfaceDescriptor\r
-  );\r
-\r
-/**\r
-  Get the usb endpoint descriptor.\r
-\r
-  @param  PeiServices          General-purpose services that are available to every PEIM.\r
-  @param  This                 Indicates the PEI_USB_IO_PPI instance.\r
-  @param  EndpointIndex        The valid index of the specified endpoint.\r
-  @param  EndpointDescriptor   Request endpoint descriptor.\r
-\r
-  @retval EFI_SUCCESS       Usb endpoint descriptor is obtained successfully.\r
-  @retval EFI_NOT_FOUND     Usb endpoint descriptor is NOT found.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbGetEndpointDescriptor (\r
-  IN  EFI_PEI_SERVICES               **PeiServices,\r
-  IN  PEI_USB_IO_PPI                 *This,\r
-  IN  UINT8                          EndpointIndex,\r
-  OUT EFI_USB_ENDPOINT_DESCRIPTOR    **EndpointDescriptor\r
-  );\r
-\r
-/**\r
-  Reset the port and re-configure the usb device.\r
-\r
-  @param  PeiServices    General-purpose services that are available to every PEIM.\r
-  @param  This           Indicates the PEI_USB_IO_PPI instance.\r
-\r
-  @retval EFI_SUCCESS    Usb device is reset and configured successfully.\r
-  @retval Others         Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbPortReset (\r
-  IN EFI_PEI_SERVICES    **PeiServices,\r
-  IN PEI_USB_IO_PPI      *This\r
-  );\r
-\r
 #endif\r
 #endif\r
index 2ac8d7bae3713767236f9a3ea78b81d4fe97cffe..6fef61e5658ab56bc41028e4cb9b5a7235040e48 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Common Libarary for PEI USB\r
 \r
 /** @file\r
 Common Libarary for PEI USB\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -196,68 +196,6 @@ PeiUsbSetConfiguration (
                      );\r
 }\r
 \r
                      );\r
 }\r
 \r
-/**\r
-  Clear Endpoint Halt.\r
-\r
-  @param  PeiServices       General-purpose services that are available to every PEIM.\r
-  @param  UsbIoPpi          Indicates the PEI_USB_IO_PPI instance.\r
-  @param  EndpointAddress   The endpoint address.\r
-\r
-  @retval EFI_SUCCESS       Endpoint halt is cleared successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot clear the endpoint halt status due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbClearEndpointHalt (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN UINT8                    EndpointAddress\r
-  )\r
-{\r
-  EFI_STATUS                  Status;\r
-  PEI_USB_DEVICE              *PeiUsbDev;\r
-  EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor;\r
-  UINT8                       EndpointIndex;\r
-\r
-  EndpointIndex = 0;\r
-  PeiUsbDev     = PEI_USB_DEVICE_FROM_THIS (UsbIoPpi);\r
-\r
-  while (EndpointIndex < MAX_ENDPOINT) {\r
-    Status = UsbIoPpi->UsbGetEndpointDescriptor (PeiServices, UsbIoPpi, EndpointIndex, &EndpointDescriptor);\r
-    if (EFI_ERROR (Status)) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if (EndpointDescriptor->EndpointAddress == EndpointAddress) {\r
-      break;\r
-    }\r
-\r
-    EndpointIndex++;\r
-  }\r
-\r
-  if (EndpointIndex == MAX_ENDPOINT) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = PeiUsbClearDeviceFeature (\r
-            PeiServices,\r
-            UsbIoPpi,\r
-            EfiUsbEndpoint,\r
-            EfiUsbEndpointHalt,\r
-            EndpointAddress\r
-            );\r
-\r
-  //\r
-  // set data toggle to zero.\r
-  //\r
-  if ((PeiUsbDev->DataToggle & (1 << EndpointIndex)) != 0) {\r
-    PeiUsbDev->DataToggle = (UINT8) (PeiUsbDev->DataToggle ^ (1 << EndpointIndex));\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
 /**\r
   Judge if the port is connected with a usb device or not.\r
 \r
 /**\r
   Judge if the port is connected with a usb device or not.\r
 \r
index dd4ce1befc3f621667a811560fc7ef4795e38065..e0557f8eea47506e17409300dc5f188de0cd8040 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Common Libarary for PEI USB\r
 \r
 /** @file\r
 Common Libarary for PEI USB\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -187,25 +187,6 @@ PeiUsbSetConfiguration (
   IN PEI_USB_IO_PPI           *UsbIoPpi\r
   );\r
 \r
   IN PEI_USB_IO_PPI           *UsbIoPpi\r
   );\r
 \r
-/**\r
-  Clear Endpoint Halt.\r
-\r
-  @param  PeiServices       General-purpose services that are available to every PEIM.\r
-  @param  UsbIoPpi          Indicates the PEI_USB_IO_PPI instance.\r
-  @param  EndpointAddress   The endpoint address.\r
-\r
-  @retval EFI_SUCCESS       Endpoint halt is cleared successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot clear the endpoint halt status due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbClearEndpointHalt (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN UINT8                    EndpointAddress\r
-  );\r
-\r
 /**\r
   Judge if the port is connected with a usb device or not.\r
 \r
 /**\r
   Judge if the port is connected with a usb device or not.\r
 \r
index e647cc46df8760376ec0decb90bffd6ae151dca5..492f124296a050fd7964e8004725fa91e6f4f6b0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 The module is used to implement Usb Io PPI interfaces.\r
 \r
 /** @file\r
 The module is used to implement Usb Io PPI interfaces.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -52,9 +52,38 @@ PeiUsbControlTransfer (
   EFI_STATUS                  Status;\r
   PEI_USB_DEVICE              *PeiUsbDev;\r
   UINT32                      TransferResult;\r
   EFI_STATUS                  Status;\r
   PEI_USB_DEVICE              *PeiUsbDev;\r
   UINT32                      TransferResult;\r
+  EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor;\r
+  UINT8                       EndpointIndex;\r
 \r
   PeiUsbDev = PEI_USB_DEVICE_FROM_THIS (This);\r
 \r
 \r
   PeiUsbDev = PEI_USB_DEVICE_FROM_THIS (This);\r
 \r
+  EndpointDescriptor = NULL;\r
+  EndpointIndex = 0;\r
+\r
+  if ((Request->Request     == USB_REQ_CLEAR_FEATURE) &&\r
+      (Request->RequestType == USB_DEV_CLEAR_FEATURE_REQ_TYPE_E) &&\r
+      (Request->Value       == USB_FEATURE_ENDPOINT_HALT)) {\r
+    //\r
+    // Request->Index is the Endpoint Address, use it to get the Endpoint Index.\r
+    //\r
+    while (EndpointIndex < MAX_ENDPOINT) {\r
+      Status = PeiUsbGetEndpointDescriptor (PeiServices, This, EndpointIndex, &EndpointDescriptor);\r
+      if (EFI_ERROR (Status)) {\r
+        return EFI_INVALID_PARAMETER;\r
+      }\r
+\r
+      if (EndpointDescriptor->EndpointAddress == Request->Index) {\r
+        break;\r
+      }\r
+\r
+      EndpointIndex++;\r
+    }\r
+\r
+    if (EndpointIndex == MAX_ENDPOINT) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+  }\r
+\r
   if (PeiUsbDev->Usb2HcPpi != NULL) {\r
     Status = PeiUsbDev->Usb2HcPpi->ControlTransfer (\r
                         PeiServices,\r
   if (PeiUsbDev->Usb2HcPpi != NULL) {\r
     Status = PeiUsbDev->Usb2HcPpi->ControlTransfer (\r
                         PeiServices,\r
@@ -85,6 +114,18 @@ PeiUsbControlTransfer (
                         &TransferResult\r
                         );\r
   }\r
                         &TransferResult\r
                         );\r
   }\r
+\r
+  //\r
+  // Reset the endpoint toggle when endpoint stall is cleared\r
+  //\r
+  if ((Request->Request     == USB_REQ_CLEAR_FEATURE) &&\r
+      (Request->RequestType == USB_DEV_CLEAR_FEATURE_REQ_TYPE_E) &&\r
+      (Request->Value       == USB_FEATURE_ENDPOINT_HALT)) {\r
+    if ((PeiUsbDev->DataToggle & (1 << EndpointIndex)) != 0) {\r
+      PeiUsbDev->DataToggle = (UINT16) (PeiUsbDev->DataToggle ^ (1 << EndpointIndex));\r
+    }\r
+  }\r
+\r
   return Status;\r
 }\r
 \r
   return Status;\r
 }\r
 \r
@@ -194,7 +235,7 @@ PeiUsbBulkTransfer (
   }\r
 \r
   if (OldToggle != DataToggle) {\r
   }\r
 \r
   if (OldToggle != DataToggle) {\r
-    PeiUsbDev->DataToggle = (UINT8) (PeiUsbDev->DataToggle ^ (1 << EndpointIndex));\r
+    PeiUsbDev->DataToggle = (UINT16) (PeiUsbDev->DataToggle ^ (1 << EndpointIndex));\r
   }\r
 \r
   return Status;\r
   }\r
 \r
   return Status;\r
index 336a6373ae679ecabe58fc063f4728c6b2ffc392..21235b56996dde5d56dd679d8d42f194923d7c81 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Usb Peim definition.\r
 \r
 /** @file\r
 Usb Peim definition.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -47,10 +47,10 @@ typedef struct {
   UINT8                         DeviceAddress;\r
   UINT8                         MaxPacketSize0;\r
   UINT8                         DeviceSpeed;\r
   UINT8                         DeviceAddress;\r
   UINT8                         MaxPacketSize0;\r
   UINT8                         DeviceSpeed;\r
-  UINT8                         DataToggle;\r
   UINT8                         IsHub;\r
   UINT8                         IsHub;\r
+  UINT16                        DataToggle;\r
   UINT8                         DownStreamPortNo;\r
   UINT8                         DownStreamPortNo;\r
-  UINT8                         Reserved[2];  // Padding for IPF\r
+  UINT8                         Reserved;  // Padding for IPF\r
   UINTN                         AllocateAddress;\r
   PEI_USB_HOST_CONTROLLER_PPI   *UsbHcPpi;\r
   PEI_USB2_HOST_CONTROLLER_PPI  *Usb2HcPpi;\r
   UINTN                         AllocateAddress;\r
   PEI_USB_HOST_CONTROLLER_PPI   *UsbHcPpi;\r
   PEI_USB2_HOST_CONTROLLER_PPI  *Usb2HcPpi;\r