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:
Liming Gao
2018-06-27 21:08:52 +08:00
parent ca79bab7af
commit d1102dba72
1010 changed files with 13588 additions and 13588 deletions

View File

@@ -2,7 +2,7 @@
Usb Bus Driver Binding and Bus IO Protocol.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 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
@@ -862,7 +862,7 @@ UsbIoPortReset (
Dev->Address = DevAddress;
gBS->Stall (USB_SET_DEVICE_ADDRESS_STALL);
if (EFI_ERROR (Status)) {
//
// It may fail due to device disconnection or other reasons.
@@ -1036,7 +1036,7 @@ UsbBusBuildProtocol (
RootIf->Signature = USB_INTERFACE_SIGNATURE;
RootIf->Device = RootHub;
RootIf->DevicePath = UsbBus->DevicePath;
//
// Report Status Code here since we will enumerate the USB devices
//
@@ -1045,7 +1045,7 @@ UsbBusBuildProtocol (
(EFI_IO_BUS_USB | EFI_IOB_PC_DETECT),
UsbBus->DevicePath
);
Status = mUsbRootHubApi.Init (RootIf);
if (EFI_ERROR (Status)) {
@@ -1157,7 +1157,7 @@ UsbBusControllerDriverSupported (
//
if (RemainingDevicePath != NULL) {
//
// Check if RemainingDevicePath is the End of Device Path Node,
// Check if RemainingDevicePath is the End of Device Path Node,
// if yes, go on checking other conditions
//
if (!IsDevicePathEnd (RemainingDevicePath)) {
@@ -1166,13 +1166,13 @@ UsbBusControllerDriverSupported (
// check its validation
//
DevicePathNode.DevPath = RemainingDevicePath;
if ((DevicePathNode.DevPath->Type != MESSAGING_DEVICE_PATH) ||
(DevicePathNode.DevPath->SubType != MSG_USB_DP &&
DevicePathNode.DevPath->SubType != MSG_USB_CLASS_DP
&& DevicePathNode.DevPath->SubType != MSG_USB_WWID_DP
)) {
return EFI_UNSUPPORTED;
}
}
@@ -1208,7 +1208,7 @@ UsbBusControllerDriverSupported (
if (Status == EFI_ALREADY_STARTED) {
return EFI_SUCCESS;
}
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1235,7 +1235,7 @@ UsbBusControllerDriverSupported (
Controller
);
}
//
// Open the EFI Device Path protocol needed to perform the supported test
//
@@ -1362,7 +1362,7 @@ UsbBusControllerDriverStart (
//
// If RemainingDevicePath is the End of Device Path Node,
// skip enumerate any device and return EFI_SUCESSS
//
//
return EFI_SUCCESS;
}
}

View File

@@ -2,7 +2,7 @@
Usb Bus Driver Binding and Bus IO Protocol.
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 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
@@ -123,7 +123,7 @@ typedef struct _USB_HUB_API USB_HUB_API;
//
// Send general device request timeout.
//
//
// The USB Specification 2.0, section 11.24.1 recommends a value of
// 50 milliseconds. We use a value of 500 milliseconds to work
// around slower hubs and devices.

View File

@@ -1,7 +1,7 @@
## @file
# The Usb Bus Dxe driver is used to enumerate and manage all attached 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
@@ -29,7 +29,7 @@
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
#
# DRIVER_BINDING = mUsbBusDriverBinding
# DRIVER_BINDING = mUsbBusDriverBinding
# COMPONENT_NAME = mUsbBusComponentName
# COMPONENT_NAME2 = mUsbBusComponentName2
#
@@ -66,7 +66,7 @@
gEfiUsbIoProtocolGuid ## BY_START
## TO_START
## BY_START
gEfiDevicePathProtocolGuid
gEfiDevicePathProtocolGuid
gEfiUsb2HcProtocolGuid ## TO_START
gEfiUsbHcProtocolGuid ## TO_START

View File

@@ -3,13 +3,13 @@
//
// The USB Bus DXE driver is used to enumerate and manage all attached 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.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// UsbBusDxe 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 of the BSD License
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"USB Bus DXE Driver"

View File

@@ -2,7 +2,7 @@
Manage Usb Descriptor List
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 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
@@ -361,7 +361,7 @@ UsbParseConfigDesc (
Len -= Consumed;
//
// Make allowances for devices that return extra data at the
// Make allowances for devices that return extra data at the
// end of their config descriptors
//
while (Len >= sizeof (EFI_USB_INTERFACE_DESCRIPTOR)) {
@@ -689,7 +689,7 @@ UsbBuildLangTable (
Max = (Desc->Length - 2) / 2;
Max = MIN(Max, USB_MAX_LANG_ID);
Point = Desc->String;
for (Index = 0; Index < Max; Index++) {
UsbDev->LangId[Index] = *Point;

View File

@@ -2,7 +2,7 @@
Usb bus enumeration support.
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 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
@@ -33,9 +33,9 @@ UsbGetEndpointDesc (
USB_ENDPOINT_DESC *EpDesc;
UINT8 Index;
UINT8 NumEndpoints;
NumEndpoints = UsbIf->IfSetting->Desc.NumEndpoints;
for (Index = 0; Index < NumEndpoints; Index++) {
EpDesc = UsbIf->IfSetting->Endpoints[Index];
@@ -279,7 +279,7 @@ UsbConnectDriver (
// twisted TPL used. It should be no problem for us to connect
// or disconnect at CALLBACK.
//
//
// Only recursively wanted usb child device
//
@@ -493,13 +493,13 @@ UsbDisconnectDriver (
if (!EFI_ERROR (Status)) {
UsbIf->IsManaged = FALSE;
}
DEBUG (( EFI_D_INFO, "UsbDisconnectDriver: TPL after disconnect is %d, %d\n", (UINT32)UsbGetCurrentTpl(), Status));
ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);
gBS->RaiseTPL (OldTpl);
}
return Status;
}
@@ -524,7 +524,7 @@ UsbRemoveConfig (
// Remove each interface of the device
//
ReturnStatus = EFI_SUCCESS;
for (Index = 0; Index < Device->NumOfInterface; Index++) {
for (Index = 0; Index < Device->NumOfInterface; Index++) {
ASSERT (Index < USB_MAX_INTERFACE);
UsbIf = Device->Interfaces[Index];
@@ -683,11 +683,11 @@ UsbEnumerateNewDev (
Parent = HubIf->Device;
Bus = Parent->Bus;
HubApi = HubIf->HubApi;
HubApi = HubIf->HubApi;
Address = Bus->MaxDevices;
gBS->Stall (USB_WAIT_PORT_STABLE_STALL);
//
// Hub resets the device for at least 10 milliseconds.
// Host learns device speed. If device is of low/full speed
@@ -698,7 +698,7 @@ UsbEnumerateNewDev (
Status = HubApi->ResetPort (HubIf, Port);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status));
return Status;
}
DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: hub port %d is reset\n", Port));
@@ -927,60 +927,60 @@ UsbEnumeratePort (
// connect/disconnect. Other three events are: ENABLE, SUSPEND, RESET.
// ENABLE/RESET is used to reset port. SUSPEND isn't supported.
//
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_OVERCURRENT)) {
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_OVERCURRENT)) {
if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_OVERCURRENT)) {
//
// Case1:
// Both OverCurrent and OverCurrentChange set, means over current occurs,
// Both OverCurrent and OverCurrentChange set, means over current occurs,
// which probably is caused by short circuit. It has to wait system hardware
// to perform recovery.
//
DEBUG (( EFI_D_ERROR, "UsbEnumeratePort: Critical Over Current\n", Port));
return EFI_DEVICE_ERROR;
}
}
//
// Case2:
// Only OverCurrentChange set, means system has been recoveried from
// Only OverCurrentChange set, means system has been recoveried from
// over current. As a result, all ports are nearly power-off, so
// it's necessary to detach and enumerate all ports again.
// it's necessary to detach and enumerate all ports again.
//
DEBUG (( EFI_D_ERROR, "UsbEnumeratePort: 2.0 device Recovery Over Current\n", Port));
DEBUG (( EFI_D_ERROR, "UsbEnumeratePort: 2.0 device Recovery Over Current\n", Port));
}
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_ENABLE)) {
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_ENABLE)) {
//
// Case3:
// 1.1 roothub port reg doesn't reflect over-current state, while its counterpart
// on 2.0 roothub does. When over-current has influence on 1.1 device, the port
// on 2.0 roothub does. When over-current has influence on 1.1 device, the port
// would be disabled, so it's also necessary to detach and enumerate again.
//
DEBUG (( EFI_D_ERROR, "UsbEnumeratePort: 1.1 device Recovery Over Current\n", Port));
}
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_CONNECTION)) {
//
// Case4:
// Device connected or disconnected normally.
// Device connected or disconnected normally.
//
DEBUG ((EFI_D_INFO, "UsbEnumeratePort: Device Connect/Disconnect Normally\n", Port));
}
//
//
// Following as the above cases, it's safety to remove and create again.
//
Child = UsbFindChild (HubIf, Port);
if (Child != NULL) {
DEBUG (( EFI_D_INFO, "UsbEnumeratePort: device at port %d removed from root hub %p\n", Port, HubIf));
UsbRemoveDevice (Child);
}
if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_CONNECTION)) {
//
// Now, new device connected, enumerate and configure the device
// Now, new device connected, enumerate and configure the device
//
DEBUG (( EFI_D_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) {
@@ -988,11 +988,11 @@ UsbEnumeratePort (
} else {
Status = UsbEnumerateNewDev (HubIf, Port, TRUE);
}
} else {
DEBUG (( EFI_D_INFO, "UsbEnumeratePort: device disconnected event on port %d\n", Port));
}
HubApi->ClearPortChange (HubIf, Port);
return Status;
}
@@ -1017,7 +1017,7 @@ UsbHubEnumeration (
UINT8 Bit;
UINT8 Index;
USB_DEVICE *Child;
ASSERT (Context != NULL);
HubIf = (USB_INTERFACE *) Context;
@@ -1082,7 +1082,7 @@ UsbRootHubEnumeration (
DEBUG (( EFI_D_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from root hub %p, try again\n", Index, RootHub));
UsbRemoveDevice (Child);
}
UsbEnumeratePort (RootHub, Index);
}
}

View File

@@ -2,7 +2,7 @@
Unified interface for RootHub and Hub.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 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
@@ -716,10 +716,10 @@ UsbHubInit (
Depth = (UINT16)(HubIf->Device->Tier - 1);
DEBUG ((EFI_D_INFO, "UsbHubInit: Set Hub Depth as 0x%x\n", Depth));
UsbHubCtrlSetHubDepth (HubIf->Device, Depth);
for (Index = 0; Index < HubDesc->NumPorts; Index++) {
UsbHubCtrlSetPortFeature (HubIf->Device, Index, USB_HUB_PORT_REMOTE_WAKE_MASK);
}
}
} else {
//
// Feed power to all the hub ports. It should be ok

View File

@@ -96,7 +96,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define USB_HUB_SUBCLASS_CODE 0x00
//
// 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

View File

@@ -2,7 +2,7 @@
Wrapper function for usb host controller interface.
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 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
@@ -1163,7 +1163,7 @@ UsbBusAddWantedUsbIoDP (
DevicePathPtr = DuplicateDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) &mAllUsbClassDevicePath);
} else if (!IsDevicePathEnd (RemainingDevicePath)) {
//
// If RemainingDevicePath isn't the End of Device Path Node,
// If RemainingDevicePath isn't the End of Device Path Node,
// Create new Usb device path according to the usb part in remaining device path
//
DevicePathPtr = GetUsbDPFromFullDP (RemainingDevicePath);
@@ -1171,7 +1171,7 @@ UsbBusAddWantedUsbIoDP (
//
// If RemainingDevicePath is the End of Device Path Node,
// skip enumerate any device and return EFI_SUCESSS
//
//
return EFI_SUCCESS;
}