);\r
}\r
\r
-/**\r
- Clear a given usb feature.\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 Recipient The recipient of ClearFeature Request, should be one of Device/Interface/Endpoint.\r
- @param Value Request Value.\r
- @param Target Request Index.\r
-\r
- @retval EFI_SUCCESS Usb feature is cleared successfully.\r
- @retval EFI_DEVICE_ERROR Cannot clear the usb feature due to a hardware error.\r
- @retval Others Other failure occurs.\r
\r
-**/\r
-EFI_STATUS\r
-PeiUsbClearDeviceFeature (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_USB_IO_PPI *UsbIoPpi,\r
- IN EFI_USB_RECIPIENT Recipient,\r
- IN UINT16 Value,\r
- IN UINT16 Target\r
- )\r
-{\r
- EFI_USB_DEVICE_REQUEST DevReq;\r
-\r
- ASSERT (UsbIoPpi != NULL);\r
-\r
- switch (Recipient) {\r
- case EfiUsbDevice:\r
- DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_D;\r
- break;\r
-\r
- case EfiUsbInterface:\r
- DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_I;\r
- break;\r
-\r
- case EfiUsbEndpoint:\r
- DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_E;\r
- break;\r
- }\r
-\r
- DevReq.Request = USB_DEV_CLEAR_FEATURE;\r
- DevReq.Value = Value;\r
- DevReq.Index = Target;\r
- DevReq.Length = 0;\r
-\r
- return UsbIoPpi->UsbControlTransfer (\r
- PeiServices,\r
- UsbIoPpi,\r
- &DevReq,\r
- EfiUsbNoData,\r
- PcdGet32 (PcdUsbTransferTimeoutValue),\r
- NULL,\r
- 0\r
- );\r
-}\r
\r
/**\r
Configure a usb device to Configuration 1.\r
}\r
}\r
\r
-/**\r
- Judge if the port is in "connection change" status or not.\r
-\r
- @param PortChangeStatus The usb port change status gotten.\r
-\r
- @retval TRUE The port is in "connection change" status.\r
- @retval FALSE The port is NOT in "connection change" status.\r
\r
-**/\r
-BOOLEAN\r
-IsPortConnectChange (\r
- IN UINT16 PortChangeStatus\r
- )\r
-{\r
- //\r
- // return the bit 0 value of PortChangeStatus\r
- //\r
- if ((PortChangeStatus & USB_PORT_STAT_C_CONNECTION) != 0) {\r
- return TRUE;\r
- } else {\r
- return FALSE;\r
- }\r
-}\r