**/\r
USB_ENDPOINT_DESC *\r
UsbGetEndpointDesc (\r
- IN USB_INTERFACE *UsbIf,\r
- IN UINT8 EpAddr\r
+ IN USB_INTERFACE *UsbIf,\r
+ IN UINT8 EpAddr\r
)\r
{\r
- USB_ENDPOINT_DESC *EpDesc;\r
- UINT8 Index;\r
- UINT8 NumEndpoints;\r
+ USB_ENDPOINT_DESC *EpDesc;\r
+ UINT8 Index;\r
+ UINT8 NumEndpoints;\r
\r
NumEndpoints = UsbIf->IfSetting->Desc.NumEndpoints;\r
\r
return NULL;\r
}\r
\r
-\r
/**\r
Free the resource used by USB interface.\r
\r
**/\r
EFI_STATUS\r
UsbFreeInterface (\r
- IN USB_INTERFACE *UsbIf\r
+ IN USB_INTERFACE *UsbIf\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
UsbCloseHostProtoByChild (UsbIf->Device->Bus, UsbIf->Handle);\r
\r
Status = gBS->UninstallMultipleProtocolInterfaces (\r
UsbIf->Handle,\r
- &gEfiDevicePathProtocolGuid, UsbIf->DevicePath,\r
- &gEfiUsbIoProtocolGuid, &UsbIf->UsbIo,\r
+ &gEfiDevicePathProtocolGuid,\r
+ UsbIf->DevicePath,\r
+ &gEfiUsbIoProtocolGuid,\r
+ &UsbIf->UsbIo,\r
NULL\r
);\r
if (!EFI_ERROR (Status)) {\r
if (UsbIf->DevicePath != NULL) {\r
FreePool (UsbIf->DevicePath);\r
}\r
+\r
FreePool (UsbIf);\r
} else {\r
UsbOpenHostProtoByChild (UsbIf->Device->Bus, UsbIf->Handle);\r
}\r
+\r
return Status;\r
}\r
\r
-\r
/**\r
Create an interface for the descriptor IfDesc. Each\r
device's configuration can have several interfaces.\r
**/\r
USB_INTERFACE *\r
UsbCreateInterface (\r
- IN USB_DEVICE *Device,\r
- IN USB_INTERFACE_DESC *IfDesc\r
+ IN USB_DEVICE *Device,\r
+ IN USB_INTERFACE_DESC *IfDesc\r
)\r
{\r
- USB_DEVICE_PATH UsbNode;\r
- USB_INTERFACE *UsbIf;\r
- USB_INTERFACE *HubIf;\r
- EFI_STATUS Status;\r
+ USB_DEVICE_PATH UsbNode;\r
+ USB_INTERFACE *UsbIf;\r
+ USB_INTERFACE *HubIf;\r
+ EFI_STATUS Status;\r
\r
UsbIf = AllocateZeroPool (sizeof (USB_INTERFACE));\r
\r
return NULL;\r
}\r
\r
- UsbIf->Signature = USB_INTERFACE_SIGNATURE;\r
- UsbIf->Device = Device;\r
- UsbIf->IfDesc = IfDesc;\r
+ UsbIf->Signature = USB_INTERFACE_SIGNATURE;\r
+ UsbIf->Device = Device;\r
+ UsbIf->IfDesc = IfDesc;\r
ASSERT (IfDesc->ActiveIndex < USB_MAX_INTERFACE_SETTING);\r
- UsbIf->IfSetting = IfDesc->Settings[IfDesc->ActiveIndex];\r
+ UsbIf->IfSetting = IfDesc->Settings[IfDesc->ActiveIndex];\r
\r
CopyMem (\r
&(UsbIf->UsbIo),\r
//\r
// Install protocols for USBIO and device path\r
//\r
- UsbNode.Header.Type = MESSAGING_DEVICE_PATH;\r
- UsbNode.Header.SubType = MSG_USB_DP;\r
- UsbNode.ParentPortNumber = Device->ParentPort;\r
- UsbNode.InterfaceNumber = UsbIf->IfSetting->Desc.InterfaceNumber;\r
+ UsbNode.Header.Type = MESSAGING_DEVICE_PATH;\r
+ UsbNode.Header.SubType = MSG_USB_DP;\r
+ UsbNode.ParentPortNumber = Device->ParentPort;\r
+ UsbNode.InterfaceNumber = UsbIf->IfSetting->Desc.InterfaceNumber;\r
\r
SetDevicePathNodeLength (&UsbNode.Header, sizeof (UsbNode));\r
\r
return NULL;\r
}\r
\r
-\r
/**\r
Free the resource used by this USB device.\r
\r
**/\r
VOID\r
UsbFreeDevice (\r
- IN USB_DEVICE *Device\r
+ IN USB_DEVICE *Device\r
)\r
{\r
if (Device->DevDesc != NULL) {\r
gBS->FreePool (Device);\r
}\r
\r
-\r
/**\r
Create a device which is on the parent's ParentPort port.\r
\r
**/\r
USB_DEVICE *\r
UsbCreateDevice (\r
- IN USB_INTERFACE *ParentIf,\r
- IN UINT8 ParentPort\r
+ IN USB_INTERFACE *ParentIf,\r
+ IN UINT8 ParentPort\r
)\r
{\r
- USB_DEVICE *Device;\r
+ USB_DEVICE *Device;\r
\r
ASSERT (ParentIf != NULL);\r
\r
return NULL;\r
}\r
\r
- Device->Bus = ParentIf->Device->Bus;\r
- Device->MaxPacket0 = 8;\r
- Device->ParentAddr = ParentIf->Device->Address;\r
- Device->ParentIf = ParentIf;\r
- Device->ParentPort = ParentPort;\r
- Device->Tier = (UINT8)(ParentIf->Device->Tier + 1);\r
+ Device->Bus = ParentIf->Device->Bus;\r
+ Device->MaxPacket0 = 8;\r
+ Device->ParentAddr = ParentIf->Device->Address;\r
+ Device->ParentIf = ParentIf;\r
+ Device->ParentPort = ParentPort;\r
+ Device->Tier = (UINT8)(ParentIf->Device->Tier + 1);\r
return Device;\r
}\r
\r
-\r
/**\r
Connect the USB interface with its driver. EFI USB bus will\r
create a USB interface for each separate interface descriptor.\r
**/\r
EFI_STATUS\r
UsbConnectDriver (\r
- IN USB_INTERFACE *UsbIf\r
+ IN USB_INTERFACE *UsbIf\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_TPL OldTpl;\r
+ EFI_STATUS Status;\r
+ EFI_TPL OldTpl;\r
\r
Status = EFI_SUCCESS;\r
\r
if (UsbIsHubInterface (UsbIf)) {\r
DEBUG ((DEBUG_INFO, "UsbConnectDriver: found a hub device\n"));\r
Status = mUsbHubApi.Init (UsbIf);\r
-\r
} else {\r
//\r
// This function is called in both UsbIoControlTransfer and\r
// Only recursively wanted usb child device\r
//\r
if (UsbBusIsWantedUsbIO (UsbIf->Device->Bus, UsbIf)) {\r
- OldTpl = UsbGetCurrentTpl ();\r
+ OldTpl = UsbGetCurrentTpl ();\r
DEBUG ((DEBUG_INFO, "UsbConnectDriver: TPL before connect is %d, %p\n", (UINT32)OldTpl, UsbIf->Handle));\r
\r
gBS->RestoreTPL (TPL_CALLBACK);\r
\r
- Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE);\r
- UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status);\r
+ Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE);\r
+ UsbIf->IsManaged = (BOOLEAN) !EFI_ERROR (Status);\r
\r
- DEBUG ((DEBUG_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl()));\r
+ DEBUG ((DEBUG_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl ()));\r
ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);\r
\r
gBS->RaiseTPL (OldTpl);\r
return Status;\r
}\r
\r
-\r
/**\r
Select an alternate setting for the interface.\r
Each interface can have several mutually exclusive\r
**/\r
EFI_STATUS\r
UsbSelectSetting (\r
- IN USB_INTERFACE_DESC *IfDesc,\r
- IN UINT8 Alternate\r
+ IN USB_INTERFACE_DESC *IfDesc,\r
+ IN UINT8 Alternate\r
)\r
{\r
- USB_INTERFACE_SETTING *Setting;\r
- UINTN Index;\r
+ USB_INTERFACE_SETTING *Setting;\r
+ UINTN Index;\r
\r
//\r
// Locate the active alternate setting\r
IfDesc->ActiveIndex = Index;\r
\r
ASSERT (Setting != NULL);\r
- DEBUG ((DEBUG_INFO, "UsbSelectSetting: setting %d selected for interface %d\n",\r
- Alternate, Setting->Desc.InterfaceNumber));\r
+ DEBUG ((\r
+ DEBUG_INFO,\r
+ "UsbSelectSetting: setting %d selected for interface %d\n",\r
+ Alternate,\r
+ Setting->Desc.InterfaceNumber\r
+ ));\r
\r
//\r
// Reset the endpoint toggle to zero\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Select a new configuration for the device. Each\r
device may support several configurations.\r
**/\r
EFI_STATUS\r
UsbSelectConfig (\r
- IN USB_DEVICE *Device,\r
- IN UINT8 ConfigValue\r
+ IN USB_DEVICE *Device,\r
+ IN UINT8 ConfigValue\r
)\r
{\r
- USB_DEVICE_DESC *DevDesc;\r
- USB_CONFIG_DESC *ConfigDesc;\r
- USB_INTERFACE_DESC *IfDesc;\r
- USB_INTERFACE *UsbIf;\r
- EFI_STATUS Status;\r
- UINT8 Index;\r
+ USB_DEVICE_DESC *DevDesc;\r
+ USB_CONFIG_DESC *ConfigDesc;\r
+ USB_INTERFACE_DESC *IfDesc;\r
+ USB_INTERFACE *UsbIf;\r
+ EFI_STATUS Status;\r
+ UINT8 Index;\r
\r
//\r
// Locate the active config, then set the device's pointer\r
//\r
- DevDesc = Device->DevDesc;\r
- ConfigDesc = NULL;\r
+ DevDesc = Device->DevDesc;\r
+ ConfigDesc = NULL;\r
\r
for (Index = 0; Index < DevDesc->Desc.NumConfigurations; Index++) {\r
ConfigDesc = DevDesc->Configs[Index];\r
\r
Device->ActiveConfig = ConfigDesc;\r
\r
- DEBUG ((DEBUG_INFO, "UsbSelectConfig: config %d selected for device %d\n",\r
- ConfigValue, Device->Address));\r
+ DEBUG ((\r
+ DEBUG_INFO,\r
+ "UsbSelectConfig: config %d selected for device %d\n",\r
+ ConfigValue,\r
+ Device->Address\r
+ ));\r
\r
//\r
// Create interfaces for each USB interface descriptor.\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Disconnect the USB interface with its driver.\r
\r
**/\r
EFI_STATUS\r
UsbDisconnectDriver (\r
- IN USB_INTERFACE *UsbIf\r
+ IN USB_INTERFACE *UsbIf\r
)\r
{\r
- EFI_TPL OldTpl;\r
- EFI_STATUS Status;\r
+ EFI_TPL OldTpl;\r
+ EFI_STATUS Status;\r
\r
//\r
// Release the hub if it's a hub controller, otherwise\r
Status = EFI_SUCCESS;\r
if (UsbIf->IsHub) {\r
Status = UsbIf->HubApi->Release (UsbIf);\r
-\r
} else if (UsbIf->IsManaged) {\r
//\r
// This function is called in both UsbIoControlTransfer and\r
// twisted TPL used. It should be no problem for us to connect\r
// or disconnect at CALLBACK.\r
//\r
- OldTpl = UsbGetCurrentTpl ();\r
+ OldTpl = UsbGetCurrentTpl ();\r
DEBUG ((DEBUG_INFO, "UsbDisconnectDriver: old TPL is %d, %p\n", (UINT32)OldTpl, UsbIf->Handle));\r
\r
gBS->RestoreTPL (TPL_CALLBACK);\r
UsbIf->IsManaged = FALSE;\r
}\r
\r
- DEBUG (( DEBUG_INFO, "UsbDisconnectDriver: TPL after disconnect is %d, %d\n", (UINT32)UsbGetCurrentTpl(), Status));\r
+ DEBUG ((DEBUG_INFO, "UsbDisconnectDriver: TPL after disconnect is %d, %d\n", (UINT32)UsbGetCurrentTpl (), Status));\r
ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);\r
\r
gBS->RaiseTPL (OldTpl);\r
return Status;\r
}\r
\r
-\r
/**\r
Remove the current device configuration.\r
\r
**/\r
EFI_STATUS\r
UsbRemoveConfig (\r
- IN USB_DEVICE *Device\r
+ IN USB_DEVICE *Device\r
)\r
{\r
- USB_INTERFACE *UsbIf;\r
- UINTN Index;\r
- EFI_STATUS Status;\r
- EFI_STATUS ReturnStatus;\r
+ USB_INTERFACE *UsbIf;\r
+ UINTN Index;\r
+ EFI_STATUS Status;\r
+ EFI_STATUS ReturnStatus;\r
\r
//\r
// Remove each interface of the device\r
}\r
}\r
\r
- Device->ActiveConfig = NULL;\r
+ Device->ActiveConfig = NULL;\r
return ReturnStatus;\r
}\r
\r
-\r
/**\r
Remove the device and all its children from the bus.\r
\r
**/\r
EFI_STATUS\r
UsbRemoveDevice (\r
- IN USB_DEVICE *Device\r
+ IN USB_DEVICE *Device\r
)\r
{\r
- USB_BUS *Bus;\r
- USB_DEVICE *Child;\r
- EFI_STATUS Status;\r
- EFI_STATUS ReturnStatus;\r
- UINTN Index;\r
+ USB_BUS *Bus;\r
+ USB_DEVICE *Child;\r
+ EFI_STATUS Status;\r
+ EFI_STATUS ReturnStatus;\r
+ UINTN Index;\r
\r
Bus = Device->Bus;\r
\r
Bus->Devices[Index] = NULL;\r
} else {\r
Bus->Devices[Index]->DisconnectFail = TRUE;\r
- ReturnStatus = Status;\r
+ ReturnStatus = Status;\r
DEBUG ((DEBUG_INFO, "UsbRemoveDevice: failed to remove child %p at parent %p\n", Child, Device));\r
}\r
}\r
Status = UsbRemoveConfig (Device);\r
\r
if (!EFI_ERROR (Status)) {\r
- DEBUG (( DEBUG_INFO, "UsbRemoveDevice: device %d removed\n", Device->Address));\r
+ DEBUG ((DEBUG_INFO, "UsbRemoveDevice: device %d removed\n", Device->Address));\r
\r
ASSERT (Device->Address < Bus->MaxDevices);\r
Bus->Devices[Device->Address] = NULL;\r
} else {\r
Bus->Devices[Device->Address]->DisconnectFail = TRUE;\r
}\r
+\r
return Status;\r
}\r
\r
-\r
/**\r
Find the child device on the hub's port.\r
\r
**/\r
USB_DEVICE *\r
UsbFindChild (\r
- IN USB_INTERFACE *HubIf,\r
- IN UINT8 Port\r
+ IN USB_INTERFACE *HubIf,\r
+ IN UINT8 Port\r
)\r
{\r
- USB_DEVICE *Device;\r
- USB_BUS *Bus;\r
- UINTN Index;\r
+ USB_DEVICE *Device;\r
+ USB_BUS *Bus;\r
+ UINTN Index;\r
\r
Bus = HubIf->Device->Bus;\r
\r
Device = Bus->Devices[Index];\r
\r
if ((Device != NULL) && (Device->ParentAddr == HubIf->Device->Address) &&\r
- (Device->ParentPort == Port)) {\r
-\r
+ (Device->ParentPort == Port))\r
+ {\r
return Device;\r
}\r
}\r
return NULL;\r
}\r
\r
-\r
/**\r
Enumerate and configure the new device on the port of this HUB interface.\r
\r
**/\r
EFI_STATUS\r
UsbEnumerateNewDev (\r
- IN USB_INTERFACE *HubIf,\r
- IN UINT8 Port,\r
- IN BOOLEAN ResetIsNeeded\r
+ IN USB_INTERFACE *HubIf,\r
+ IN UINT8 Port,\r
+ IN BOOLEAN ResetIsNeeded\r
)\r
{\r
- USB_BUS *Bus;\r
- USB_HUB_API *HubApi;\r
- USB_DEVICE *Child;\r
- USB_DEVICE *Parent;\r
- EFI_USB_PORT_STATUS PortState;\r
- UINTN Address;\r
- UINT8 Config;\r
- EFI_STATUS Status;\r
+ USB_BUS *Bus;\r
+ USB_HUB_API *HubApi;\r
+ USB_DEVICE *Child;\r
+ USB_DEVICE *Parent;\r
+ EFI_USB_PORT_STATUS PortState;\r
+ UINTN Address;\r
+ UINT8 Config;\r
+ EFI_STATUS Status;\r
\r
Parent = HubIf->Device;\r
Bus = Parent->Bus;\r
\r
return Status;\r
}\r
- DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: hub port %d is reset\n", Port));\r
+\r
+ DEBUG ((DEBUG_INFO, "UsbEnumerateNewDev: hub port %d is reset\n", Port));\r
} else {\r
- DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: hub port %d reset is skipped\n", Port));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumerateNewDev: hub port %d reset is skipped\n", Port));\r
}\r
\r
Child = UsbCreateDevice (HubIf, Port);\r
DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: No device present at port %d\n", Port));\r
Status = EFI_NOT_FOUND;\r
goto ON_ERROR;\r
- } else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_SUPER_SPEED)){\r
+ } else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_SUPER_SPEED)) {\r
Child->Speed = EFI_USB_SPEED_SUPER;\r
Child->MaxPacket0 = 512;\r
} else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_HIGH_SPEED)) {\r
Child->MaxPacket0 = 8;\r
}\r
\r
- DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: device is of %d speed\n", Child->Speed));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumerateNewDev: device is of %d speed\n", Child->Speed));\r
\r
if (((Child->Speed == EFI_USB_SPEED_LOW) || (Child->Speed == EFI_USB_SPEED_FULL)) &&\r
- (Parent->Speed == EFI_USB_SPEED_HIGH)) {\r
+ (Parent->Speed == EFI_USB_SPEED_HIGH))\r
+ {\r
//\r
// If the child is a low or full speed device, it is necessary to\r
// set the transaction translator. Port TT is 1-based.\r
// 1. if parent is of high speed, then parent is our translator\r
// 2. otherwise use parent's translator.\r
//\r
- Child->Translator.TranslatorHubAddress = Parent->Address;\r
- Child->Translator.TranslatorPortNumber = (UINT8) (Port + 1);\r
+ Child->Translator.TranslatorHubAddress = Parent->Address;\r
+ Child->Translator.TranslatorPortNumber = (UINT8)(Port + 1);\r
} else {\r
Child->Translator = Parent->Translator;\r
}\r
- DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: device uses translator (%d, %d)\n",\r
- Child->Translator.TranslatorHubAddress,\r
- Child->Translator.TranslatorPortNumber));\r
+\r
+ DEBUG ((\r
+ DEBUG_INFO,\r
+ "UsbEnumerateNewDev: device uses translator (%d, %d)\n",\r
+ Child->Translator.TranslatorHubAddress,\r
+ Child->Translator.TranslatorPortNumber\r
+ ));\r
\r
//\r
// After port is reset, hub establishes a signal path between\r
goto ON_ERROR;\r
}\r
\r
- DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: max packet size for EP 0 is %d\n", Child->MaxPacket0));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumerateNewDev: max packet size for EP 0 is %d\n", Child->MaxPacket0));\r
\r
//\r
// Host learns about the device's abilities by requesting device's\r
goto ON_ERROR;\r
}\r
\r
- DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: device %d is now in CONFIGED state\n", Address));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumerateNewDev: device %d is now in CONFIGED state\n", Address));\r
\r
//\r
// Host assigns and loads a device driver.\r
return Status;\r
}\r
\r
-\r
/**\r
Process the events on the port.\r
\r
**/\r
EFI_STATUS\r
UsbEnumeratePort (\r
- IN USB_INTERFACE *HubIf,\r
- IN UINT8 Port\r
+ IN USB_INTERFACE *HubIf,\r
+ IN UINT8 Port\r
)\r
{\r
- USB_HUB_API *HubApi;\r
- USB_DEVICE *Child;\r
- EFI_USB_PORT_STATUS PortState;\r
- EFI_STATUS Status;\r
+ USB_HUB_API *HubApi;\r
+ USB_DEVICE *Child;\r
+ EFI_USB_PORT_STATUS PortState;\r
+ EFI_STATUS Status;\r
\r
- Child = NULL;\r
- HubApi = HubIf->HubApi;\r
+ Child = NULL;\r
+ HubApi = HubIf->HubApi;\r
\r
//\r
// Host learns of the new device by polling the hub for port changes.\r
return EFI_SUCCESS;\r
}\r
\r
- DEBUG (( DEBUG_INFO, "UsbEnumeratePort: port %d state - %02x, change - %02x on %p\n",\r
- Port, PortState.PortStatus, PortState.PortChangeStatus, HubIf));\r
+ DEBUG ((\r
+ DEBUG_INFO,\r
+ "UsbEnumeratePort: port %d state - %02x, change - %02x on %p\n",\r
+ Port,\r
+ PortState.PortStatus,\r
+ PortState.PortChangeStatus,\r
+ HubIf\r
+ ));\r
\r
//\r
// This driver only process two kinds of events now: over current and\r
//\r
\r
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_OVERCURRENT)) {\r
-\r
if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_OVERCURRENT)) {\r
//\r
// Case1:\r
// which probably is caused by short circuit. It has to wait system hardware\r
// to perform recovery.\r
//\r
- DEBUG (( DEBUG_ERROR, "UsbEnumeratePort: Critical Over Current\n", Port));\r
+ DEBUG ((DEBUG_ERROR, "UsbEnumeratePort: Critical Over Current\n", Port));\r
return EFI_DEVICE_ERROR;\r
-\r
}\r
+\r
//\r
// Case2:\r
// Only OverCurrentChange set, means system has been recoveried from\r
// over current. As a result, all ports are nearly power-off, so\r
// it's necessary to detach and enumerate all ports again.\r
//\r
- DEBUG (( DEBUG_ERROR, "UsbEnumeratePort: 2.0 device Recovery Over Current\n", Port));\r
+ DEBUG ((DEBUG_ERROR, "UsbEnumeratePort: 2.0 device Recovery Over Current\n", Port));\r
}\r
\r
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_ENABLE)) {\r
// on 2.0 roothub does. When over-current has influence on 1.1 device, the port\r
// would be disabled, so it's also necessary to detach and enumerate again.\r
//\r
- DEBUG (( DEBUG_ERROR, "UsbEnumeratePort: 1.1 device Recovery Over Current\n", Port));\r
+ DEBUG ((DEBUG_ERROR, "UsbEnumeratePort: 1.1 device Recovery Over Current\n", Port));\r
}\r
\r
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_CONNECTION)) {\r
Child = UsbFindChild (HubIf, Port);\r
\r
if (Child != NULL) {\r
- DEBUG (( DEBUG_INFO, "UsbEnumeratePort: device at port %d removed from root hub %p\n", Port, HubIf));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumeratePort: device at port %d removed from root hub %p\n", Port, HubIf));\r
UsbRemoveDevice (Child);\r
}\r
\r
//\r
// Now, new device connected, enumerate and configure the device\r
//\r
- DEBUG (( DEBUG_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));\r
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) {\r
Status = UsbEnumerateNewDev (HubIf, Port, FALSE);\r
} else {\r
Status = UsbEnumerateNewDev (HubIf, Port, TRUE);\r
}\r
-\r
} else {\r
- DEBUG (( DEBUG_INFO, "UsbEnumeratePort: device disconnected event on port %d\n", Port));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumeratePort: device disconnected event on port %d\n", Port));\r
}\r
\r
HubApi->ClearPortChange (HubIf, Port);\r
return Status;\r
}\r
\r
-\r
/**\r
Enumerate all the changed hub ports.\r
\r
VOID\r
EFIAPI\r
UsbHubEnumeration (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
)\r
{\r
- USB_INTERFACE *HubIf;\r
- UINT8 Byte;\r
- UINT8 Bit;\r
- UINT8 Index;\r
- USB_DEVICE *Child;\r
+ USB_INTERFACE *HubIf;\r
+ UINT8 Byte;\r
+ UINT8 Bit;\r
+ UINT8 Index;\r
+ USB_DEVICE *Child;\r
\r
ASSERT (Context != NULL);\r
\r
- HubIf = (USB_INTERFACE *) Context;\r
+ HubIf = (USB_INTERFACE *)Context;\r
\r
for (Index = 0; Index < HubIf->NumOfPort; Index++) {\r
Child = UsbFindChild (HubIf, Index);\r
if ((Child != NULL) && (Child->DisconnectFail == TRUE)) {\r
- DEBUG (( DEBUG_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from hub %p, try again\n", Index, HubIf));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from hub %p, try again\n", Index, HubIf));\r
UsbRemoveDevice (Child);\r
}\r
}\r
\r
if (HubIf->ChangeMap == NULL) {\r
- return ;\r
+ return;\r
}\r
\r
//\r
// HUB starts its port index with 1.\r
//\r
- Byte = 0;\r
- Bit = 1;\r
+ Byte = 0;\r
+ Bit = 1;\r
\r
for (Index = 0; Index < HubIf->NumOfPort; Index++) {\r
if (USB_BIT_IS_SET (HubIf->ChangeMap[Byte], USB_BIT (Bit))) {\r
\r
gBS->FreePool (HubIf->ChangeMap);\r
HubIf->ChangeMap = NULL;\r
- return ;\r
+ return;\r
}\r
\r
-\r
/**\r
Enumerate all the changed hub ports.\r
\r
VOID\r
EFIAPI\r
UsbRootHubEnumeration (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
)\r
{\r
- USB_INTERFACE *RootHub;\r
- UINT8 Index;\r
- USB_DEVICE *Child;\r
+ USB_INTERFACE *RootHub;\r
+ UINT8 Index;\r
+ USB_DEVICE *Child;\r
\r
- RootHub = (USB_INTERFACE *) Context;\r
+ RootHub = (USB_INTERFACE *)Context;\r
\r
for (Index = 0; Index < RootHub->NumOfPort; Index++) {\r
Child = UsbFindChild (RootHub, Index);\r
if ((Child != NULL) && (Child->DisconnectFail == TRUE)) {\r
- DEBUG (( DEBUG_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from root hub %p, try again\n", Index, RootHub));\r
+ DEBUG ((DEBUG_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from root hub %p, try again\n", Index, RootHub));\r
UsbRemoveDevice (Child);\r
}\r
\r