/** @file\r
Usb Peim definition.\r
\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
-of the BSD License which accompanies this distribution. The\r
-full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
#include <IndustryStandard/Usb.h>\r
\r
+//\r
+// A common header for usb standard descriptor.\r
+// Each stand descriptor has a length and type.\r
+//\r
+#pragma pack(1)\r
+typedef struct {\r
+ UINT8 Len;\r
+ UINT8 Type;\r
+} USB_DESC_HEAD;\r
+#pragma pack()\r
+\r
#define MAX_INTERFACE 8\r
#define MAX_ENDPOINT 16\r
\r
#define USB_WAIT_PORT_STS_CHANGE_STALL (100)\r
\r
//\r
-// Host software return timeout if port status doesn't change \r
+// Host software return timeout if port status doesn't change\r
// after 500ms(LOOP * STALL = 5000 * 0.1ms), set by experience\r
//\r
#define USB_WAIT_PORT_STS_CHANGE_LOOP 5000\r
//\r
#define USB_SET_PORT_POWER_STALL (2 * USB_BUS_1_MILLISECOND)\r
\r
+//\r
+// Wait for set device address, refers to specification\r
+// [USB20-9.2.6.3, it says 2ms]\r
+//\r
+#define USB_SET_DEVICE_ADDRESS_STALL (2 * USB_BUS_1_MILLISECOND)\r
+\r
+//\r
+// Wait for get configuration descriptor, set by experience\r
+//\r
+#define USB_GET_CONFIG_DESCRIPTOR_STALL (1 * USB_BUS_1_MILLISECOND)\r
+\r
/**\r
Submits control transfer to a target USB device.\r
- \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
\r
/**\r
Submits bulk transfer to a bulk endpoint of a USB device.\r
- \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
+ @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
\r
/**\r
Send reset signal over the given root hub port.\r
- \r
+\r
@param PeiServices Describes the list of possible PEI Services.\r
@param UsbHcPpi The pointer of PEI_USB_HOST_CONTROLLER_PPI instance.\r
@param Usb2HcPpi The pointer of PEI_USB2_HOST_CONTROLLER_PPI instance.\r