summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2021-11-16 19:21:29 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit87000d77082339be464d07855d9fc194c6b4e8a6 (patch)
tree2ac61c88056fa10bf27c2d60515c848293eaa08e /MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
parent917e98f3e5268c3754d472f7b20eb9bf8eba169d (diff)
downloadedk2-87000d77082339be464d07855d9fc194c6b4e8a6.tar.gz
edk2-87000d77082339be464d07855d9fc194c6b4e8a6.tar.bz2
edk2-87000d77082339be464d07855d9fc194c6b4e8a6.zip
MdeModulePkg: Change use of EFI_D_* to DEBUG_*
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index d3e0cfa626..500978a9de 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
@@ -132,7 +132,7 @@ UsbCreateInterface (
UsbIf->DevicePath = AppendDevicePathNode (HubIf->DevicePath, &UsbNode.Header);
if (UsbIf->DevicePath == NULL) {
- DEBUG ((EFI_D_ERROR, "UsbCreateInterface: failed to create device path\n"));
+ DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to create device path\n"));
Status = EFI_OUT_OF_RESOURCES;
goto ON_ERROR;
@@ -148,7 +148,7 @@ UsbCreateInterface (
);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbCreateInterface: failed to install UsbIo - %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to install UsbIo - %r\n", Status));
goto ON_ERROR;
}
@@ -167,7 +167,7 @@ UsbCreateInterface (
NULL
);
- DEBUG ((EFI_D_ERROR, "UsbCreateInterface: failed to open host for child - %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "UsbCreateInterface: failed to open host for child - %r\n", Status));
goto ON_ERROR;
}
@@ -262,7 +262,7 @@ UsbConnectDriver (
// connect drivers with this interface
//
if (UsbIsHubInterface (UsbIf)) {
- DEBUG ((EFI_D_INFO, "UsbConnectDriver: found a hub device\n"));
+ DEBUG ((DEBUG_INFO, "UsbConnectDriver: found a hub device\n"));
Status = mUsbHubApi.Init (UsbIf);
} else {
@@ -279,14 +279,14 @@ UsbConnectDriver (
//
if (UsbBusIsWantedUsbIO (UsbIf->Device->Bus, UsbIf)) {
OldTpl = UsbGetCurrentTpl ();
- DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d, %p\n", (UINT32)OldTpl, UsbIf->Handle));
+ DEBUG ((DEBUG_INFO, "UsbConnectDriver: TPL before connect is %d, %p\n", (UINT32)OldTpl, UsbIf->Handle));
gBS->RestoreTPL (TPL_CALLBACK);
Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE);
UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status);
- DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl()));
+ DEBUG ((DEBUG_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl()));
ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);
gBS->RaiseTPL (OldTpl);
@@ -340,7 +340,7 @@ UsbSelectSetting (
IfDesc->ActiveIndex = Index;
ASSERT (Setting != NULL);
- DEBUG ((EFI_D_INFO, "UsbSelectSetting: setting %d selected for interface %d\n",
+ DEBUG ((DEBUG_INFO, "UsbSelectSetting: setting %d selected for interface %d\n",
Alternate, Setting->Desc.InterfaceNumber));
//
@@ -399,7 +399,7 @@ UsbSelectConfig (
Device->ActiveConfig = ConfigDesc;
- DEBUG ((EFI_D_INFO, "UsbSelectConfig: config %d selected for device %d\n",
+ DEBUG ((DEBUG_INFO, "UsbSelectConfig: config %d selected for device %d\n",
ConfigValue, Device->Address));
//
@@ -479,7 +479,7 @@ UsbDisconnectDriver (
// or disconnect at CALLBACK.
//
OldTpl = UsbGetCurrentTpl ();
- DEBUG ((EFI_D_INFO, "UsbDisconnectDriver: old TPL is %d, %p\n", (UINT32)OldTpl, UsbIf->Handle));
+ DEBUG ((DEBUG_INFO, "UsbDisconnectDriver: old TPL is %d, %p\n", (UINT32)OldTpl, UsbIf->Handle));
gBS->RestoreTPL (TPL_CALLBACK);
@@ -488,7 +488,7 @@ UsbDisconnectDriver (
UsbIf->IsManaged = FALSE;
}
- DEBUG (( EFI_D_INFO, "UsbDisconnectDriver: TPL after disconnect is %d, %d\n", (UINT32)UsbGetCurrentTpl(), Status));
+ DEBUG (( DEBUG_INFO, "UsbDisconnectDriver: TPL after disconnect is %d, %d\n", (UINT32)UsbGetCurrentTpl(), Status));
ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);
gBS->RaiseTPL (OldTpl);
@@ -586,7 +586,7 @@ UsbRemoveDevice (
} else {
Bus->Devices[Index]->DisconnectFail = TRUE;
ReturnStatus = Status;
- DEBUG ((EFI_D_INFO, "UsbRemoveDevice: failed to remove child %p at parent %p\n", Child, Device));
+ DEBUG ((DEBUG_INFO, "UsbRemoveDevice: failed to remove child %p at parent %p\n", Child, Device));
}
}
@@ -597,7 +597,7 @@ UsbRemoveDevice (
Status = UsbRemoveConfig (Device);
if (!EFI_ERROR (Status)) {
- DEBUG (( EFI_D_INFO, "UsbRemoveDevice: device %d removed\n", Device->Address));
+ DEBUG (( DEBUG_INFO, "UsbRemoveDevice: device %d removed\n", Device->Address));
ASSERT (Device->Address < Bus->MaxDevices);
Bus->Devices[Device->Address] = NULL;
@@ -691,13 +691,13 @@ UsbEnumerateNewDev (
if (ResetIsNeeded) {
Status = HubApi->ResetPort (HubIf, Port);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status));
+ DEBUG ((DEBUG_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));
+ DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: hub port %d is reset\n", Port));
} else {
- DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: hub port %d reset is skipped\n", Port));
+ DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: hub port %d reset is skipped\n", Port));
}
Child = UsbCreateDevice (HubIf, Port);
@@ -713,12 +713,12 @@ UsbEnumerateNewDev (
Status = HubApi->GetPortStatus (HubIf, Port, &PortState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to get speed of port %d\n", Port));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to get speed of port %d\n", Port));
goto ON_ERROR;
}
if (!USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_CONNECTION)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: No device present at port %d\n", Port));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: No device present at port %d\n", Port));
Status = EFI_NOT_FOUND;
goto ON_ERROR;
} else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_SUPER_SPEED)){
@@ -735,7 +735,7 @@ UsbEnumerateNewDev (
Child->MaxPacket0 = 8;
}
- DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: device is of %d speed\n", Child->Speed));
+ DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: device is of %d speed\n", Child->Speed));
if (((Child->Speed == EFI_USB_SPEED_LOW) || (Child->Speed == EFI_USB_SPEED_FULL)) &&
(Parent->Speed == EFI_USB_SPEED_HIGH)) {
@@ -751,7 +751,7 @@ UsbEnumerateNewDev (
} else {
Child->Translator = Parent->Translator;
}
- DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: device uses translator (%d, %d)\n",
+ DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: device uses translator (%d, %d)\n",
Child->Translator.TranslatorHubAddress,
Child->Translator.TranslatorPortNumber));
@@ -775,7 +775,7 @@ UsbEnumerateNewDev (
}
if (Address >= Bus->MaxDevices) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: address pool is full for port %d\n", Port));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: address pool is full for port %d\n", Port));
Status = EFI_ACCESS_DENIED;
goto ON_ERROR;
@@ -786,13 +786,13 @@ UsbEnumerateNewDev (
Bus->Devices[Address] = Child;
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to set device address - %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to set device address - %r\n", Status));
goto ON_ERROR;
}
gBS->Stall (USB_SET_DEVICE_ADDRESS_STALL);
- DEBUG ((EFI_D_INFO, "UsbEnumerateNewDev: device is now ADDRESSED at %d\n", Address));
+ DEBUG ((DEBUG_INFO, "UsbEnumerateNewDev: device is now ADDRESSED at %d\n", Address));
//
// Host sends a Get_Descriptor request to learn the max packet
@@ -801,11 +801,11 @@ UsbEnumerateNewDev (
Status = UsbGetMaxPacketSize0 (Child);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to get max packet for EP 0 - %r\n", Status));
goto ON_ERROR;
}
- DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: max packet size for EP 0 is %d\n", Child->MaxPacket0));
+ DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: max packet size for EP 0 is %d\n", Child->MaxPacket0));
//
// Host learns about the device's abilities by requesting device's
@@ -814,7 +814,7 @@ UsbEnumerateNewDev (
Status = UsbBuildDescTable (Child);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to build descriptor table - %r\n", Status));
goto ON_ERROR;
}
@@ -826,11 +826,11 @@ UsbEnumerateNewDev (
Status = UsbSetConfig (Child, Config);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to set configure %d - %r\n", Config, Status));
goto ON_ERROR;
}
- DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: device %d is now in CONFIGED state\n", Address));
+ DEBUG (( DEBUG_INFO, "UsbEnumerateNewDev: device %d is now in CONFIGED state\n", Address));
//
// Host assigns and loads a device driver.
@@ -838,7 +838,7 @@ UsbEnumerateNewDev (
Status = UsbSelectConfig (Child, Config);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to create interfaces - %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "UsbEnumerateNewDev: failed to create interfaces - %r\n", Status));
goto ON_ERROR;
}
@@ -902,7 +902,7 @@ UsbEnumeratePort (
Status = HubApi->GetPortStatus (HubIf, Port, &PortState);
if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "UsbEnumeratePort: failed to get state of port %d\n", Port));
+ DEBUG ((DEBUG_ERROR, "UsbEnumeratePort: failed to get state of port %d\n", Port));
return Status;
}
@@ -914,7 +914,7 @@ UsbEnumeratePort (
return EFI_SUCCESS;
}
- DEBUG (( EFI_D_INFO, "UsbEnumeratePort: port %d state - %02x, change - %02x on %p\n",
+ DEBUG (( DEBUG_INFO, "UsbEnumeratePort: port %d state - %02x, change - %02x on %p\n",
Port, PortState.PortStatus, PortState.PortChangeStatus, HubIf));
//
@@ -932,7 +932,7 @@ UsbEnumeratePort (
// 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));
+ DEBUG (( DEBUG_ERROR, "UsbEnumeratePort: Critical Over Current\n", Port));
return EFI_DEVICE_ERROR;
}
@@ -942,7 +942,7 @@ UsbEnumeratePort (
// over current. As a result, all ports are nearly power-off, so
// it's necessary to detach and enumerate all ports again.
//
- DEBUG (( EFI_D_ERROR, "UsbEnumeratePort: 2.0 device Recovery Over Current\n", Port));
+ DEBUG (( DEBUG_ERROR, "UsbEnumeratePort: 2.0 device Recovery Over Current\n", Port));
}
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_ENABLE)) {
@@ -952,7 +952,7 @@ UsbEnumeratePort (
// 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));
+ DEBUG (( DEBUG_ERROR, "UsbEnumeratePort: 1.1 device Recovery Over Current\n", Port));
}
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_CONNECTION)) {
@@ -960,7 +960,7 @@ UsbEnumeratePort (
// Case4:
// Device connected or disconnected normally.
//
- DEBUG ((EFI_D_INFO, "UsbEnumeratePort: Device Connect/Disconnect Normally\n", Port));
+ DEBUG ((DEBUG_INFO, "UsbEnumeratePort: Device Connect/Disconnect Normally\n", Port));
}
//
@@ -969,7 +969,7 @@ UsbEnumeratePort (
Child = UsbFindChild (HubIf, Port);
if (Child != NULL) {
- DEBUG (( EFI_D_INFO, "UsbEnumeratePort: device at port %d removed from root hub %p\n", Port, HubIf));
+ DEBUG (( DEBUG_INFO, "UsbEnumeratePort: device at port %d removed from root hub %p\n", Port, HubIf));
UsbRemoveDevice (Child);
}
@@ -977,7 +977,7 @@ UsbEnumeratePort (
//
// Now, new device connected, enumerate and configure the device
//
- DEBUG (( EFI_D_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));
+ DEBUG (( DEBUG_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));
if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) {
Status = UsbEnumerateNewDev (HubIf, Port, FALSE);
} else {
@@ -985,7 +985,7 @@ UsbEnumeratePort (
}
} else {
- DEBUG (( EFI_D_INFO, "UsbEnumeratePort: device disconnected event on port %d\n", Port));
+ DEBUG (( DEBUG_INFO, "UsbEnumeratePort: device disconnected event on port %d\n", Port));
}
HubApi->ClearPortChange (HubIf, Port);
@@ -1020,7 +1020,7 @@ UsbHubEnumeration (
for (Index = 0; Index < HubIf->NumOfPort; Index++) {
Child = UsbFindChild (HubIf, Index);
if ((Child != NULL) && (Child->DisconnectFail == TRUE)) {
- DEBUG (( EFI_D_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from hub %p, try again\n", Index, HubIf));
+ DEBUG (( DEBUG_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from hub %p, try again\n", Index, HubIf));
UsbRemoveDevice (Child);
}
}
@@ -1074,7 +1074,7 @@ UsbRootHubEnumeration (
for (Index = 0; Index < RootHub->NumOfPort; Index++) {
Child = UsbFindChild (RootHub, Index);
if ((Child != NULL) && (Child->DisconnectFail == TRUE)) {
- DEBUG (( EFI_D_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from root hub %p, try again\n", Index, RootHub));
+ DEBUG (( DEBUG_INFO, "UsbEnumeratePort: The device disconnect fails at port %d from root hub %p, try again\n", Index, RootHub));
UsbRemoveDevice (Child);
}