X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbBotPei%2FPeiUsbLib.c;fp=MdeModulePkg%2FBus%2FUsb%2FUsbBotPei%2FPeiUsbLib.c;h=dfc4e4069885fa3318076529851167ab759ebe75;hp=292682a2e4477986c85f4915f1e727757c576744;hb=1436aea4d5707e672672a11bda72be2c63c936c3;hpb=7c7184e201a90a1d2376e615e55e3f4074731468 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; } - -