MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Usb Hub Request Support In PEI Phase
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
@@ -440,7 +440,7 @@ PeiDoHubConfig (
|
||||
HubDescriptor = (EFI_USB_HUB_DESCRIPTOR *) HubDescBuffer;
|
||||
|
||||
//
|
||||
// Get the hub descriptor
|
||||
// Get the hub descriptor
|
||||
//
|
||||
Status = PeiUsbHubReadDesc (
|
||||
PeiServices,
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Constants definitions for Usb Hub Peim
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/** @file
|
||||
Common Libarary for PEI USB
|
||||
|
||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/** @file
|
||||
Common Libarary for PEI USB
|
||||
|
||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# The Usb Bus Peim driver is used to support recovery from usb device.
|
||||
#
|
||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUsbTransferTimeoutValue ## CONSUMES
|
||||
|
||||
|
||||
[Ppis]
|
||||
gPeiUsbIoPpiGuid ## PRODUCES
|
||||
gPeiUsbHostControllerPpiGuid ## SOMETIMES_CONSUMES
|
||||
|
@@ -3,14 +3,14 @@
|
||||
//
|
||||
// The USB Bus PEIM driver is used to support recovery from USB devices.
|
||||
//
|
||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions
|
||||
// of the BSD License which accompanies this distribution. The
|
||||
// full text of the license may be found at
|
||||
// http://opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
//
|
||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// UsbBusPei Localized Strings and Content
|
||||
//
|
||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions
|
||||
@@ -14,8 +14,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"USB Bus PEI Module for Recovery"
|
||||
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/** @file
|
||||
The module is used to implement Usb Io PPI interfaces.
|
||||
|
||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
/**
|
||||
Submits control transfer to a target USB device.
|
||||
|
||||
|
||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||
@param This The pointer of PEI_USB_IO_PPI.
|
||||
@param Request USB device request to send.
|
||||
@@ -132,11 +132,11 @@ PeiUsbControlTransfer (
|
||||
|
||||
/**
|
||||
Submits bulk transfer to a bulk endpoint of a USB device.
|
||||
|
||||
|
||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||
@param This The pointer of PEI_USB_IO_PPI.
|
||||
@param DeviceEndpoint Endpoint number and its direction in bit 7.
|
||||
@param Data A pointer to the buffer of data to transmit
|
||||
@param Data A pointer to the buffer of data to transmit
|
||||
from or receive into.
|
||||
@param DataLength The lenght of the data buffer.
|
||||
@param Timeout Indicates the maximum time, in millisecond, which the
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/** @file
|
||||
The module to produce Usb Bus PPI.
|
||||
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
@@ -37,7 +37,7 @@ EFI_PEI_PPI_DESCRIPTOR mUsbIoPpiList = {
|
||||
|
||||
/**
|
||||
The enumeration routine to detect device change.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param UsbHcPpi The pointer of PEI_USB_HOST_CONTROLLER_PPI instance.
|
||||
@param Usb2HcPpi The pointer of PEI_USB2_HOST_CONTROLLER_PPI instance.
|
||||
@@ -56,7 +56,7 @@ PeiUsbEnumeration (
|
||||
|
||||
/**
|
||||
Configure new detected usb device.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param PeiUsbDevice The pointer of PEI_USB_DEVICE instance.
|
||||
@param Port The port to be configured.
|
||||
@@ -77,7 +77,7 @@ PeiConfigureUsbDevice (
|
||||
|
||||
/**
|
||||
Get all configurations from a detected usb device.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param PeiUsbDevice The pointer of PEI_USB_DEVICE instance.
|
||||
|
||||
@@ -94,7 +94,7 @@ PeiUsbGetAllConfiguration (
|
||||
|
||||
/**
|
||||
Get the start position of next wanted descriptor.
|
||||
|
||||
|
||||
@param Buffer Buffer containing data to parse.
|
||||
@param Length Buffer length.
|
||||
@param DescType Descriptor type.
|
||||
@@ -116,7 +116,7 @@ GetExpectedDescriptor (
|
||||
|
||||
/**
|
||||
The entrypoint of the module, it will enumerate all HCs.
|
||||
|
||||
|
||||
@param FileHandle Handle of the file being invoked.
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
|
||||
@@ -142,7 +142,7 @@ PeimInitializeUsb (
|
||||
}
|
||||
|
||||
//
|
||||
// gPeiUsbHostControllerPpiGuid and gPeiUsb2HostControllerPpiGuid should not
|
||||
// gPeiUsbHostControllerPpiGuid and gPeiUsb2HostControllerPpiGuid should not
|
||||
// be produced at the same time
|
||||
//
|
||||
Index = 0;
|
||||
@@ -176,18 +176,18 @@ PeimInitializeUsb (
|
||||
Index,
|
||||
NULL,
|
||||
(VOID **) &Usb2HcPpi
|
||||
);
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// No more host controller, break out
|
||||
//
|
||||
break;
|
||||
}
|
||||
PeiUsbEnumeration ((EFI_PEI_SERVICES **) PeiServices, NULL, Usb2HcPpi);
|
||||
}
|
||||
PeiUsbEnumeration ((EFI_PEI_SERVICES **) PeiServices, NULL, Usb2HcPpi);
|
||||
Index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Index == 0) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ PeimInitializeUsb (
|
||||
/**
|
||||
The Hub Enumeration just scans the hub ports one time. It also
|
||||
doesn't support hot-plug.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param PeiUsbDevice The pointer of PEI_USB_DEVICE instance.
|
||||
@param CurrentAddress The DeviceAddress of usb device.
|
||||
@@ -289,13 +289,13 @@ PeiHubEnumeration (
|
||||
NewPeiUsbDevice->IsHub = 0x0;
|
||||
NewPeiUsbDevice->DownStreamPortNo = 0x0;
|
||||
|
||||
if (((PortStatus.PortChangeStatus & USB_PORT_STAT_C_RESET) == 0) ||
|
||||
if (((PortStatus.PortChangeStatus & USB_PORT_STAT_C_RESET) == 0) ||
|
||||
((PortStatus.PortStatus & (USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE)) == 0)) {
|
||||
//
|
||||
// If the port already has reset change flag and is connected and enabled, skip the port reset logic.
|
||||
// If the port already has reset change flag and is connected and enabled, skip the port reset logic.
|
||||
//
|
||||
PeiResetHubPort (PeiServices, UsbIoPpi, (UINT8)(Index + 1));
|
||||
|
||||
|
||||
PeiHubGetPortStatus (
|
||||
PeiServices,
|
||||
UsbIoPpi,
|
||||
@@ -406,7 +406,7 @@ PeiHubEnumeration (
|
||||
|
||||
/**
|
||||
The enumeration routine to detect device change.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param UsbHcPpi The pointer of PEI_USB_HOST_CONTROLLER_PPI instance.
|
||||
@param Usb2HcPpi The pointer of PEI_USB2_HOST_CONTROLLER_PPI instance.
|
||||
@@ -440,7 +440,7 @@ PeiUsbEnumeration (
|
||||
PeiServices,
|
||||
Usb2HcPpi,
|
||||
(UINT8 *) &NumOfRootPort
|
||||
);
|
||||
);
|
||||
} else if (UsbHcPpi != NULL) {
|
||||
UsbHcPpi->GetRootHubPortNumber (
|
||||
PeiServices,
|
||||
@@ -464,7 +464,7 @@ PeiUsbEnumeration (
|
||||
Usb2HcPpi,
|
||||
(UINT8) Index,
|
||||
&PortStatus
|
||||
);
|
||||
);
|
||||
} else {
|
||||
UsbHcPpi->GetRootHubPortStatus (
|
||||
PeiServices,
|
||||
@@ -515,10 +515,10 @@ PeiUsbEnumeration (
|
||||
PeiUsbDevice->IsHub = 0x0;
|
||||
PeiUsbDevice->DownStreamPortNo = 0x0;
|
||||
|
||||
if (((PortStatus.PortChangeStatus & USB_PORT_STAT_C_RESET) == 0) ||
|
||||
if (((PortStatus.PortChangeStatus & USB_PORT_STAT_C_RESET) == 0) ||
|
||||
((PortStatus.PortStatus & (USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE)) == 0)) {
|
||||
//
|
||||
// If the port already has reset change flag and is connected and enabled, skip the port reset logic.
|
||||
// If the port already has reset change flag and is connected and enabled, skip the port reset logic.
|
||||
//
|
||||
ResetRootPort (
|
||||
PeiServices,
|
||||
@@ -550,7 +550,7 @@ PeiUsbEnumeration (
|
||||
Usb2HcPpi,
|
||||
(UINT8) Index,
|
||||
EfiUsbPortResetChange
|
||||
);
|
||||
);
|
||||
} else {
|
||||
UsbHcPpi->ClearRootHubPortFeature (
|
||||
PeiServices,
|
||||
@@ -650,7 +650,7 @@ PeiUsbEnumeration (
|
||||
|
||||
/**
|
||||
Configure new detected usb device.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param PeiUsbDevice The pointer of PEI_USB_DEVICE instance.
|
||||
@param Port The port to be configured.
|
||||
@@ -767,7 +767,7 @@ PeiConfigureUsbDevice (
|
||||
|
||||
/**
|
||||
Get all configurations from a detected usb device.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param PeiUsbDevice The pointer of PEI_USB_DEVICE instance.
|
||||
|
||||
@@ -920,7 +920,7 @@ PeiUsbGetAllConfiguration (
|
||||
|
||||
/**
|
||||
Get the start position of next wanted descriptor.
|
||||
|
||||
|
||||
@param Buffer Buffer containing data to parse.
|
||||
@param Length Buffer length.
|
||||
@param DescType Descriptor type.
|
||||
@@ -998,7 +998,7 @@ GetExpectedDescriptor (
|
||||
|
||||
/**
|
||||
Send reset signal over the given root hub port.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param UsbHcPpi The pointer of PEI_USB_HOST_CONTROLLER_PPI instance.
|
||||
@param Usb2HcPpi The pointer of PEI_USB2_HOST_CONTROLLER_PPI instance.
|
||||
@@ -1022,7 +1022,7 @@ ResetRootPort (
|
||||
|
||||
if (Usb2HcPpi != NULL) {
|
||||
MicroSecondDelay (200 * 1000);
|
||||
|
||||
|
||||
//
|
||||
// reset root port
|
||||
//
|
||||
@@ -1032,12 +1032,12 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortReset
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "SetRootHubPortFeature EfiUsbPortReset Failed\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Drive the reset signal for at least 50ms. Check USB 2.0 Spec
|
||||
// section 7.1.7.5 for timing requirements.
|
||||
@@ -1053,7 +1053,7 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortReset
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "ClearRootHubPortFeature EfiUsbPortReset Failed\n"));
|
||||
return;
|
||||
@@ -1073,7 +1073,7 @@ ResetRootPort (
|
||||
Usb2HcPpi,
|
||||
PortNum,
|
||||
&PortStatus
|
||||
);
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return;
|
||||
}
|
||||
@@ -1103,7 +1103,7 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortConnectChange
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Set port enable
|
||||
//
|
||||
@@ -1113,18 +1113,18 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortEnable
|
||||
);
|
||||
|
||||
|
||||
Usb2HcPpi->ClearRootHubPortFeature (
|
||||
PeiServices,
|
||||
Usb2HcPpi,
|
||||
PortNum,
|
||||
EfiUsbPortEnableChange
|
||||
);
|
||||
|
||||
|
||||
MicroSecondDelay ((RetryIndex + 1) * 50 * 1000);
|
||||
} else {
|
||||
MicroSecondDelay (200 * 1000);
|
||||
|
||||
|
||||
//
|
||||
// reset root port
|
||||
//
|
||||
@@ -1134,18 +1134,18 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortReset
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "SetRootHubPortFeature EfiUsbPortReset Failed\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Drive the reset signal for at least 50ms. Check USB 2.0 Spec
|
||||
// section 7.1.7.5 for timing requirements.
|
||||
//
|
||||
MicroSecondDelay (USB_SET_ROOT_PORT_RESET_STALL);
|
||||
|
||||
|
||||
//
|
||||
// clear reset root port
|
||||
//
|
||||
@@ -1155,12 +1155,12 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortReset
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "ClearRootHubPortFeature EfiUsbPortReset Failed\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
MicroSecondDelay (USB_CLR_ROOT_PORT_RESET_STALL);
|
||||
|
||||
//
|
||||
@@ -1175,7 +1175,7 @@ ResetRootPort (
|
||||
UsbHcPpi,
|
||||
PortNum,
|
||||
&PortStatus
|
||||
);
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return;
|
||||
}
|
||||
@@ -1205,7 +1205,7 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortConnectChange
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Set port enable
|
||||
//
|
||||
@@ -1215,14 +1215,14 @@ ResetRootPort (
|
||||
PortNum,
|
||||
EfiUsbPortEnable
|
||||
);
|
||||
|
||||
|
||||
UsbHcPpi->ClearRootHubPortFeature (
|
||||
PeiServices,
|
||||
UsbHcPpi,
|
||||
PortNum,
|
||||
EfiUsbPortEnableChange
|
||||
);
|
||||
|
||||
|
||||
MicroSecondDelay ((RetryIndex + 1) * 50 * 1000);
|
||||
}
|
||||
return;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/** @file
|
||||
Usb Peim definition.
|
||||
|
||||
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The
|
||||
@@ -88,7 +88,7 @@ typedef struct {
|
||||
#define USB_WAIT_PORT_STS_CHANGE_STALL (100)
|
||||
|
||||
//
|
||||
// Host software return timeout if port status doesn't change
|
||||
// Host software return timeout if port status doesn't change
|
||||
// after 500ms(LOOP * STALL = 5000 * 0.1ms), set by experience
|
||||
//
|
||||
#define USB_WAIT_PORT_STS_CHANGE_LOOP 5000
|
||||
@@ -112,7 +112,7 @@ typedef struct {
|
||||
|
||||
/**
|
||||
Submits control transfer to a target USB device.
|
||||
|
||||
|
||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||
@param This The pointer of PEI_USB_IO_PPI.
|
||||
@param Request USB device request to send.
|
||||
@@ -144,11 +144,11 @@ PeiUsbControlTransfer (
|
||||
|
||||
/**
|
||||
Submits bulk transfer to a bulk endpoint of a USB device.
|
||||
|
||||
|
||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||
@param This The pointer of PEI_USB_IO_PPI.
|
||||
@param DeviceEndpoint Endpoint number and its direction in bit 7.
|
||||
@param Data A pointer to the buffer of data to transmit
|
||||
@param Data A pointer to the buffer of data to transmit
|
||||
from or receive into.
|
||||
@param DataLength The lenght of the data buffer.
|
||||
@param Timeout Indicates the maximum time, in millisecond, which the
|
||||
@@ -233,7 +233,7 @@ PeiUsbPortReset (
|
||||
|
||||
/**
|
||||
Send reset signal over the given root hub port.
|
||||
|
||||
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
@param UsbHcPpi The pointer of PEI_USB_HOST_CONTROLLER_PPI instance.
|
||||
@param Usb2HcPpi The pointer of PEI_USB2_HOST_CONTROLLER_PPI instance.
|
||||
|
Reference in New Issue
Block a user