summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c68
1 files changed, 32 insertions, 36 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c
index 292682a2e4..dfc4e40698 100644
--- a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c
+++ b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c
@@ -10,7 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "UsbPeim.h"
#include "PeiUsbLib.h"
-
/**
Clear a given usb feature.
@@ -27,11 +26,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
EFI_STATUS
PeiUsbClearDeviceFeature (
- IN EFI_PEI_SERVICES **PeiServices,
- IN PEI_USB_IO_PPI *UsbIoPpi,
- IN EFI_USB_RECIPIENT Recipient,
- IN UINT16 Value,
- IN UINT16 Target
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *UsbIoPpi,
+ IN EFI_USB_RECIPIENT Recipient,
+ IN UINT16 Value,
+ IN UINT16 Target
)
{
EFI_USB_DEVICE_REQUEST DevReq;
@@ -39,23 +38,23 @@ PeiUsbClearDeviceFeature (
ASSERT (UsbIoPpi != NULL);
switch (Recipient) {
- case EfiUsbDevice:
- DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_D;
- break;
+ case EfiUsbDevice:
+ DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_D;
+ break;
- case EfiUsbInterface:
- DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_I;
- break;
+ case EfiUsbInterface:
+ DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_I;
+ break;
- case EfiUsbEndpoint:
- DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_E;
- break;
+ case EfiUsbEndpoint:
+ DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_E;
+ break;
}
- DevReq.Request = USB_DEV_CLEAR_FEATURE;
- DevReq.Value = Value;
- DevReq.Index = Target;
- DevReq.Length = 0;
+ DevReq.Request = USB_DEV_CLEAR_FEATURE;
+ DevReq.Value = Value;
+ DevReq.Index = Target;
+ DevReq.Length = 0;
return UsbIoPpi->UsbControlTransfer (
PeiServices,
@@ -68,7 +67,6 @@ PeiUsbClearDeviceFeature (
);
}
-
/**
Clear Endpoint Halt.
@@ -83,9 +81,9 @@ PeiUsbClearDeviceFeature (
**/
EFI_STATUS
PeiUsbClearEndpointHalt (
- IN EFI_PEI_SERVICES **PeiServices,
- IN PEI_USB_IO_PPI *UsbIoPpi,
- IN UINT8 EndpointAddress
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *UsbIoPpi,
+ IN UINT8 EndpointAddress
)
{
EFI_STATUS Status;
@@ -93,18 +91,18 @@ PeiUsbClearEndpointHalt (
EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor;
UINT8 EndpointIndex;
-
//
// Check its interface
//
Status = UsbIoPpi->UsbGetInterfaceDescriptor (
- PeiServices,
- UsbIoPpi,
- &InterfaceDesc
- );
+ PeiServices,
+ UsbIoPpi,
+ &InterfaceDesc
+ );
if (EFI_ERROR (Status)) {
return Status;
}
+
for (EndpointIndex = 0; EndpointIndex < InterfaceDesc->NumEndpoints; EndpointIndex++) {
Status = UsbIoPpi->UsbGetEndpointDescriptor (PeiServices, UsbIoPpi, EndpointIndex, &EndpointDescriptor);
if (EFI_ERROR (Status)) {
@@ -121,14 +119,12 @@ PeiUsbClearEndpointHalt (
}
Status = PeiUsbClearDeviceFeature (
- PeiServices,
- UsbIoPpi,
- EfiUsbEndpoint,
- EfiUsbEndpointHalt,
- EndpointAddress
- );
+ PeiServices,
+ UsbIoPpi,
+ EfiUsbEndpoint,
+ EfiUsbEndpointHalt,
+ EndpointAddress
+ );
return Status;
}
-
-