*PortNumber = (UINT8) (Ehc->HcStructParams & HCSP_NPORTS);\r
*Is64BitCapable = (UINT8) (Ehc->HcCapParams & HCCP_64BIT);\r
\r
- EHC_DEBUG (("EhcGetCapability: %d ports, 64 bit %d\n", *PortNumber, *Is64BitCapable));\r
+ DEBUG ((EFI_D_INFO, "EhcGetCapability: %d ports, 64 bit %d\n", *PortNumber, *Is64BitCapable));\r
\r
gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
\r
ON_EXIT:\r
- EHC_DEBUG (("EhcReset: exit status %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "EhcReset: exit status %r\n", Status));\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
\r
gBS->RestoreTPL (OldTpl);\r
\r
- EHC_DEBUG (("EhcGetState: current state %d\n", *State));\r
+ DEBUG ((EFI_D_INFO, "EhcGetState: current state %d\n", *State));\r
return EFI_SUCCESS;\r
}\r
\r
Status = EFI_INVALID_PARAMETER;\r
}\r
\r
- EHC_DEBUG (("EhcSetState: exit status %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "EhcSetState: exit status %r\n", Status));\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
Status = EhcRunHC (Ehc, EHC_GENERIC_TIMEOUT);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_DEBUG (("EhcSetRootHubPortFeature :failed to start HC - %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "EhcSetRootHubPortFeature :failed to start HC - %r\n", Status));\r
break;\r
}\r
}\r
}\r
\r
ON_EXIT:\r
- EHC_DEBUG (("EhcSetRootHubPortFeature: exit status %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "EhcSetRootHubPortFeature: exit status %r\n", Status));\r
\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
\r
ON_EXIT:\r
- EHC_DEBUG (("EhcClearRootHubPortFeature: exit status %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "EhcClearRootHubPortFeature: exit status %r\n", Status));\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
*TransferResult = EFI_USB_ERR_SYSTEM;\r
\r
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {\r
- EHC_ERROR (("EhcControlTransfer: HC halted at entrance\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcControlTransfer: HC halted at entrance\n"));\r
\r
EhcAckAllInterrupt (Ehc);\r
goto ON_EXIT;\r
);\r
\r
if (Urb == NULL) {\r
- EHC_ERROR (("EhcControlTransfer: failed to create URB"));\r
+ DEBUG ((EFI_D_ERROR, "EhcControlTransfer: failed to create URB"));\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
gBS->RestoreTPL (OldTpl);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult));\r
+ DEBUG ((EFI_D_ERROR, "EhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult));\r
}\r
\r
return Status;\r
Status = EFI_DEVICE_ERROR;\r
\r
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {\r
- EHC_ERROR (("EhcBulkTransfer: HC is halted\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: HC is halted\n"));\r
\r
EhcAckAllInterrupt (Ehc);\r
goto ON_EXIT;\r
);\r
\r
if (Urb == NULL) {\r
- EHC_ERROR (("EhcBulkTransfer: failed to create URB\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: failed to create URB\n"));\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
gBS->RestoreTPL (OldTpl);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));\r
+ DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));\r
}\r
\r
return Status;\r
if (!IsNewTransfer) {\r
Status = EhciDelAsyncIntTransfer (Ehc, DeviceAddress, EndPointAddress, DataToggle);\r
\r
- EHC_DEBUG (("EhcAsyncInterruptTransfer: remove old transfer - %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "EhcAsyncInterruptTransfer: remove old transfer - %r\n", Status));\r
goto ON_EXIT;\r
}\r
\r
Status = EFI_SUCCESS;\r
\r
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {\r
- EHC_ERROR (("EhcAsyncInterruptTransfer: HC is halt\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcAsyncInterruptTransfer: HC is halt\n"));\r
EhcAckAllInterrupt (Ehc);\r
\r
Status = EFI_DEVICE_ERROR;\r
Data = AllocatePool (DataLength);\r
\r
if (Data == NULL) {\r
- EHC_ERROR (("EhcAsyncInterruptTransfer: failed to allocate buffer\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcAsyncInterruptTransfer: failed to allocate buffer\n"));\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
);\r
\r
if (Urb == NULL) {\r
- EHC_ERROR (("EhcAsyncInterruptTransfer: failed to create URB\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcAsyncInterruptTransfer: failed to create URB\n"));\r
\r
gBS->FreePool (Data);\r
Status = EFI_OUT_OF_RESOURCES;\r
Status = EFI_DEVICE_ERROR;\r
\r
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {\r
- EHC_ERROR (("EhcSyncInterruptTransfer: HC is halt\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: HC is halt\n"));\r
\r
EhcAckAllInterrupt (Ehc);\r
goto ON_EXIT;\r
);\r
\r
if (Urb == NULL) {\r
- EHC_ERROR (("EhcSyncInterruptTransfer: failed to create URB\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: failed to create URB\n"));\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
gBS->RestoreTPL (OldTpl);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult));\r
+ DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult));\r
}\r
\r
return Status;\r
Ehc->HcCapParams = EhcReadCapRegister (Ehc, EHC_HCCPARAMS_OFFSET);\r
Ehc->CapLen = EhcReadCapRegister (Ehc, EHC_CAPLENGTH_OFFSET) & 0x0FF;\r
\r
- EHC_DEBUG (("EhcCreateUsb2Hc: capability length %d\n", Ehc->CapLen));\r
+ DEBUG ((EFI_D_INFO, "EhcCreateUsb2Hc: capability length %d\n", Ehc->CapLen));\r
\r
//\r
// Create AsyncRequest Polling Timer\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcDriverBindingStart: failed to open PCI_IO\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to open PCI_IO\n"));\r
return EFI_DEVICE_ERROR;\r
}\r
\r
}\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcDriverBindingStart: failed to enable controller\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to enable controller\n"));\r
goto CLOSE_PCIIO;\r
}\r
\r
Ehc = EhcCreateUsb2Hc (PciIo, OriginalPciAttributes);\r
\r
if (Ehc == NULL) {\r
- EHC_ERROR (("EhcDriverBindingStart: failed to create USB2_HC\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to create USB2_HC\n"));\r
\r
Status = EFI_OUT_OF_RESOURCES;\r
goto CLOSE_PCIIO;\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcDriverBindingStart: failed to install USB2_HC Protocol\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to install USB2_HC Protocol\n"));\r
goto FREE_POOL;\r
}\r
\r
Status = EhcInitHC (Ehc);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcDriverBindingStart: failed to init host controller\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to init host controller\n"));\r
goto UNINSTALL_USBHC;\r
}\r
\r
Status = gBS->SetTimer (Ehc->PollTimer, TimerPeriodic, EHC_ASYNC_POLL_INTERVAL);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcDriverBindingStart: failed to start async interrupt monitor\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to start async interrupt monitor\n"));\r
\r
EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);\r
goto UNINSTALL_USBHC;\r
);\r
\r
\r
- EHC_DEBUG (("EhcDriverBindingStart: EHCI started for controller @ %x\n", Controller));\r
+ DEBUG ((EFI_D_INFO, "EhcDriverBindingStart: EHCI started for controller @ %x\n", Controller));\r
return EFI_SUCCESS;\r
\r
UNINSTALL_USBHC:\r
\r
Abstract:\r
This file provides the information dump support for EHCI when in debug mode.\r
-You can dynamically adjust the debug level by changing variable mEhcDebugLevel\r
-and mEhcErrorLevel.\r
\r
Revision History\r
\r
\r
#include "Ehci.h"\r
\r
-#ifdef EFI_DEBUG\r
-UINTN mEhcDebugMask = USB_DEBUG_FORCE_OUTPUT;\r
-\r
-\r
-/**\r
- EHCI's debug output function. It determines whether\r
- to output by the mask and level\r
-\r
- @param Level The output level\r
- @param Format The format parameters to the print\r
- @param ... The variable length parameters after format\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-EhciDebugPrint (\r
- IN UINTN Level,\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-{\r
-\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, Format);\r
-\r
- if (Level & mEhcDebugMask) {\r
- if (mEhcDebugMask & USB_DEBUG_FORCE_OUTPUT) {\r
- DebugVPrint (DEBUG_ERROR, Format, Marker);\r
- } else {\r
- DebugVPrint (DEBUG_INFO, Format, Marker);\r
- }\r
- }\r
-\r
- VA_END (Marker);\r
-}\r
-\r
-\r
-/**\r
- EHCI's debug output function. It determines whether\r
- to output by the mask and level\r
-\r
- @param Format The format parameters to the print\r
- @param ... The variable length parameters after format\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-EhcDebug (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-{\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, Format);\r
- DebugVPrint (DEBUG_INFO, Format, Marker);\r
- VA_END (Marker);\r
-}\r
-\r
-\r
-/**\r
- EHCI's error output function. It determines whether\r
- to output by the mask and level\r
-\r
- @param Format The format parameters to the print\r
- @param ... The variable length parameters after format\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-EhcError (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-{\r
-\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, Format);\r
- DebugVPrint (DEBUG_ERROR, Format, Marker);\r
- VA_END (Marker);\r
-}\r
-\r
-\r
/**\r
Dump the status byte in QTD/QH to a more friendly\r
format\r
\r
@param State The state in the QTD/QH\r
- @param Level The output level\r
\r
@return None\r
\r
STATIC\r
VOID\r
EhcDumpStatus (\r
- IN UINT32 State,\r
- IN UINTN Level\r
+ IN UINT32 State\r
)\r
{\r
if (EHC_BIT_IS_SET (State, QTD_STAT_DO_PING)) {\r
- EhciDebugPrint (Level, " Do_Ping");\r
+ DEBUG ((EFI_D_INFO, " Do_Ping"));\r
} else {\r
- EhciDebugPrint (Level, " Do_Out");\r
+ DEBUG ((EFI_D_INFO, " Do_Out"));\r
}\r
\r
if (EHC_BIT_IS_SET (State, QTD_STAT_DO_CS)) {\r
- EhciDebugPrint (Level, " Do_CS");\r
+ DEBUG ((EFI_D_INFO, " Do_CS"));\r
} else {\r
- EhciDebugPrint (Level, " Do_SS");\r
+ DEBUG ((EFI_D_INFO, " Do_SS"));\r
}\r
\r
if (EHC_BIT_IS_SET (State, QTD_STAT_TRANS_ERR)) {\r
- EhciDebugPrint (Level, " Transfer_Error");\r
+ DEBUG ((EFI_D_INFO, " Transfer_Error"));\r
}\r
\r
if (EHC_BIT_IS_SET (State, QTD_STAT_BABBLE_ERR)) {\r
- EhciDebugPrint (Level, " Babble_Error");\r
+ DEBUG ((EFI_D_INFO, " Babble_Error"));\r
}\r
\r
if (EHC_BIT_IS_SET (State, QTD_STAT_BUFF_ERR)) {\r
- EhciDebugPrint (Level, " Buffer_Error");\r
+ DEBUG ((EFI_D_INFO, " Buffer_Error"));\r
}\r
\r
if (EHC_BIT_IS_SET (State, QTD_STAT_HALTED)) {\r
- EhciDebugPrint (Level, " Halted");\r
+ DEBUG ((EFI_D_INFO, " Halted"));\r
}\r
\r
if (EHC_BIT_IS_SET (State, QTD_STAT_ACTIVE)) {\r
- EhciDebugPrint (Level, " Active");\r
+ DEBUG ((EFI_D_INFO, " Active"));\r
}\r
\r
- EhciDebugPrint (Level, "\n");\r
+ DEBUG ((EFI_D_INFO, "\n"));\r
}\r
\r
\r
VOID\r
EhcDumpQtd (\r
IN EHC_QTD *Qtd,\r
- IN UINT8 *Msg\r
+ IN CHAR8 *Msg\r
)\r
{\r
QTD_HW *QtdHw;\r
UINTN Index;\r
- UINTN Level;\r
-\r
- Level = EHC_DEBUG_QTD;\r
\r
if (Msg != NULL) {\r
- EhciDebugPrint (Level, Msg);\r
+ DEBUG ((EFI_D_INFO, Msg));\r
}\r
\r
- EhciDebugPrint (Level, "Queue TD @ 0x%x, data length %d\n", Qtd, Qtd->DataLen);\r
+ DEBUG ((EFI_D_INFO, "Queue TD @ 0x%x, data length %d\n", Qtd, Qtd->DataLen));\r
\r
QtdHw = &Qtd->QtdHw;\r
\r
- EhciDebugPrint (Level, "Next QTD : %x\n", QtdHw->NextQtd);\r
- EhciDebugPrint (Level, "AltNext QTD : %x\n", QtdHw->AltNext);\r
- EhciDebugPrint (Level, "Status : %x\n", QtdHw->Status);\r
- EhcDumpStatus (QtdHw->Status, Level);\r
+ DEBUG ((EFI_D_INFO, "Next QTD : %x\n", QtdHw->NextQtd));\r
+ DEBUG ((EFI_D_INFO, "AltNext QTD : %x\n", QtdHw->AltNext));\r
+ DEBUG ((EFI_D_INFO, "Status : %x\n", QtdHw->Status));\r
+ EhcDumpStatus (QtdHw->Status);\r
\r
if (QtdHw->Pid == QTD_PID_SETUP) {\r
- EhciDebugPrint (Level, "PID : Setup\n");\r
+ DEBUG ((EFI_D_INFO, "PID : Setup\n"));\r
\r
} else if (QtdHw->Pid == QTD_PID_INPUT) {\r
- EhciDebugPrint (Level, "PID : IN\n");\r
+ DEBUG ((EFI_D_INFO, "PID : IN\n"));\r
\r
} else if (QtdHw->Pid == QTD_PID_OUTPUT) {\r
- EhciDebugPrint (Level, "PID : OUT\n");\r
+ DEBUG ((EFI_D_INFO, "PID : OUT\n"));\r
\r
}\r
\r
- EhciDebugPrint (Level, "Error Count : %d\n", QtdHw->ErrCnt);\r
- EhciDebugPrint (Level, "Current Page : %d\n", QtdHw->CurPage);\r
- EhciDebugPrint (Level, "IOC : %d\n", QtdHw->IOC);\r
- EhciDebugPrint (Level, "Total Bytes : %d\n", QtdHw->TotalBytes);\r
- EhciDebugPrint (Level, "Data Toggle : %d\n", QtdHw->DataToggle);\r
+ DEBUG ((EFI_D_INFO, "Error Count : %d\n", QtdHw->ErrCnt));\r
+ DEBUG ((EFI_D_INFO, "Current Page : %d\n", QtdHw->CurPage));\r
+ DEBUG ((EFI_D_INFO, "IOC : %d\n", QtdHw->IOC));\r
+ DEBUG ((EFI_D_INFO, "Total Bytes : %d\n", QtdHw->TotalBytes));\r
+ DEBUG ((EFI_D_INFO, "Data Toggle : %d\n", QtdHw->DataToggle));\r
\r
for (Index = 0; Index < 5; Index++) {\r
- EhciDebugPrint (Level, "Page[%d] : 0x%x\n", Index, QtdHw->Page[Index]);\r
+ DEBUG ((EFI_D_INFO, "Page[%d] : 0x%x\n", Index, QtdHw->Page[Index]));\r
}\r
}\r
\r
VOID\r
EhcDumpQh (\r
IN EHC_QH *Qh,\r
- IN UINT8 *Msg,\r
+ IN CHAR8 *Msg,\r
IN BOOLEAN DumpBuf\r
)\r
{\r
QH_HW *QhHw;\r
LIST_ENTRY *Entry;\r
UINTN Index;\r
- UINTN Level;\r
-\r
- Level = EHC_DEBUG_QH;\r
\r
if (Msg != NULL) {\r
- EhciDebugPrint (Level, Msg);\r
+ DEBUG ((EFI_D_INFO, Msg));\r
}\r
\r
- EhciDebugPrint (Level, "Queue head @ 0x%x, interval %d, next qh %x\n",\r
- Qh, Qh->Interval, Qh->NextQh);\r
+ DEBUG ((EFI_D_INFO, "Queue head @ 0x%x, interval %d, next qh %x\n",\r
+ Qh, Qh->Interval, Qh->NextQh));\r
\r
QhHw = &Qh->QhHw;\r
\r
- EhciDebugPrint (Level, "Hoziontal link: %x\n", QhHw->HorizonLink);\r
- EhciDebugPrint (Level, "Device address: %d\n", QhHw->DeviceAddr);\r
- EhciDebugPrint (Level, "Inactive : %d\n", QhHw->Inactive);\r
- EhciDebugPrint (Level, "EP number : %d\n", QhHw->EpNum);\r
- EhciDebugPrint (Level, "EP speed : %d\n", QhHw->EpSpeed);\r
- EhciDebugPrint (Level, "DT control : %d\n", QhHw->DtCtrl);\r
- EhciDebugPrint (Level, "Reclaim head : %d\n", QhHw->ReclaimHead);\r
- EhciDebugPrint (Level, "Max packet len: %d\n", QhHw->MaxPacketLen);\r
- EhciDebugPrint (Level, "Ctrl EP : %d\n", QhHw->CtrlEp);\r
- EhciDebugPrint (Level, "Nak reload : %d\n", QhHw->NakReload);\r
-\r
- EhciDebugPrint (Level, "SMask : %x\n", QhHw->SMask);\r
- EhciDebugPrint (Level, "CMask : %x\n", QhHw->CMask);\r
- EhciDebugPrint (Level, "Hub address : %d\n", QhHw->HubAddr);\r
- EhciDebugPrint (Level, "Hub port : %d\n", QhHw->PortNum);\r
- EhciDebugPrint (Level, "Multiplier : %d\n", QhHw->Multiplier);\r
-\r
- EhciDebugPrint (Level, "Cur QTD : %x\n", QhHw->CurQtd);\r
-\r
- EhciDebugPrint (Level, "Next QTD : %x\n", QhHw->NextQtd);\r
- EhciDebugPrint (Level, "AltNext QTD : %x\n", QhHw->AltQtd);\r
- EhciDebugPrint (Level, "Status : %x\n", QhHw->Status);\r
- EhcDumpStatus (QhHw->Status, Level);\r
+ DEBUG ((EFI_D_INFO, "Hoziontal link: %x\n", QhHw->HorizonLink));\r
+ DEBUG ((EFI_D_INFO, "Device address: %d\n", QhHw->DeviceAddr));\r
+ DEBUG ((EFI_D_INFO, "Inactive : %d\n", QhHw->Inactive));\r
+ DEBUG ((EFI_D_INFO, "EP number : %d\n", QhHw->EpNum));\r
+ DEBUG ((EFI_D_INFO, "EP speed : %d\n", QhHw->EpSpeed));\r
+ DEBUG ((EFI_D_INFO, "DT control : %d\n", QhHw->DtCtrl));\r
+ DEBUG ((EFI_D_INFO, "Reclaim head : %d\n", QhHw->ReclaimHead));\r
+ DEBUG ((EFI_D_INFO, "Max packet len: %d\n", QhHw->MaxPacketLen));\r
+ DEBUG ((EFI_D_INFO, "Ctrl EP : %d\n", QhHw->CtrlEp));\r
+ DEBUG ((EFI_D_INFO, "Nak reload : %d\n", QhHw->NakReload));\r
+\r
+ DEBUG ((EFI_D_INFO, "SMask : %x\n", QhHw->SMask));\r
+ DEBUG ((EFI_D_INFO, "CMask : %x\n", QhHw->CMask));\r
+ DEBUG ((EFI_D_INFO, "Hub address : %d\n", QhHw->HubAddr));\r
+ DEBUG ((EFI_D_INFO, "Hub port : %d\n", QhHw->PortNum));\r
+ DEBUG ((EFI_D_INFO, "Multiplier : %d\n", QhHw->Multiplier));\r
+\r
+ DEBUG ((EFI_D_INFO, "Cur QTD : %x\n", QhHw->CurQtd));\r
+\r
+ DEBUG ((EFI_D_INFO, "Next QTD : %x\n", QhHw->NextQtd));\r
+ DEBUG ((EFI_D_INFO, "AltNext QTD : %x\n", QhHw->AltQtd));\r
+ DEBUG ((EFI_D_INFO, "Status : %x\n", QhHw->Status));\r
+\r
+ EhcDumpStatus (QhHw->Status);\r
\r
if (QhHw->Pid == QTD_PID_SETUP) {\r
- EhciDebugPrint (Level, "PID : Setup\n");\r
+ DEBUG ((EFI_D_INFO, "PID : Setup\n"));\r
\r
} else if (QhHw->Pid == QTD_PID_INPUT) {\r
- EhciDebugPrint (Level, "PID : IN\n");\r
+ DEBUG ((EFI_D_INFO, "PID : IN\n"));\r
\r
} else if (QhHw->Pid == QTD_PID_OUTPUT) {\r
- EhciDebugPrint (Level, "PID : OUT\n");\r
+ DEBUG ((EFI_D_INFO, "PID : OUT\n"));\r
}\r
\r
- EhciDebugPrint (Level, "Error Count : %d\n", QhHw->ErrCnt);\r
- EhciDebugPrint (Level, "Current Page : %d\n", QhHw->CurPage);\r
- EhciDebugPrint (Level, "IOC : %d\n", QhHw->IOC);\r
- EhciDebugPrint (Level, "Total Bytes : %d\n", QhHw->TotalBytes);\r
- EhciDebugPrint (Level, "Data Toggle : %d\n", QhHw->DataToggle);\r
+ DEBUG ((EFI_D_INFO, "Error Count : %d\n", QhHw->ErrCnt));\r
+ DEBUG ((EFI_D_INFO, "Current Page : %d\n", QhHw->CurPage));\r
+ DEBUG ((EFI_D_INFO, "IOC : %d\n", QhHw->IOC));\r
+ DEBUG ((EFI_D_INFO, "Total Bytes : %d\n", QhHw->TotalBytes));\r
+ DEBUG ((EFI_D_INFO, "Data Toggle : %d\n", QhHw->DataToggle));\r
\r
for (Index = 0; Index < 5; Index++) {\r
- EhciDebugPrint (Level, "Page[%d] : 0x%x\n", Index, QhHw->Page[Index]);\r
+ DEBUG ((EFI_D_INFO, "Page[%d] : 0x%x\n", Index, QhHw->Page[Index]));\r
}\r
\r
- EhciDebugPrint (Level, "\n");\r
+ DEBUG ((EFI_D_INFO, "\n"));\r
\r
EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) {\r
Qtd = EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList);\r
\r
for (Index = 0; Index < Len; Index++) {\r
if (Index % 16 == 0) {\r
- EhciDebugPrint (EHC_DEBUG_BUF, "\n");\r
+ DEBUG ((EFI_D_INFO,"\n"));\r
}\r
\r
- EhciDebugPrint (EHC_DEBUG_BUF, "%02x ", Buf[Index]);\r
+ DEBUG ((EFI_D_INFO, "%02x ", Buf[Index]));\r
}\r
\r
- EhciDebugPrint (EHC_DEBUG_BUF, "\n");\r
+ DEBUG ((EFI_D_INFO, "\n"));\r
}\r
-\r
-#endif\r
#define _EFI_EHCI_DEBUG_H_\r
\r
\r
-enum {\r
- USB_DEBUG_FORCE_OUTPUT = (UINTN)(1 << 0),\r
-\r
- EHC_DEBUG_QH = (UINTN)(1 << 8),\r
- EHC_DEBUG_QTD = (UINTN)(1 << 9),\r
- EHC_DEBUG_BUF = (UINTN)(1 << 10)\r
-};\r
-\r
-\r
-/**\r
- EHCI's debug output function. It determines whether\r
- to output by the mask and level\r
-\r
- @param Level The output level\r
- @param Format The format parameters to the print\r
- @param ... The variable length parameters after format\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-EhciDebugPrint (\r
- IN UINTN Level,\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-;\r
-\r
-\r
-/**\r
- EHCI's debug output function. It determines whether\r
- to output by the mask and level\r
-\r
- @param Format The format parameters to the print\r
- @param ... The variable length parameters after format\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-EhcDebug (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-;\r
-\r
-\r
-\r
-/**\r
- EHCI's error output function. It determines whether\r
- to output by the mask and level\r
-\r
- @param Format The format parameters to the print\r
- @param ... The variable length parameters after format\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-EhcError (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-;\r
-\r
-\r
-\r
/**\r
Dump the fields of a QTD\r
\r
VOID\r
EhcDumpQtd (\r
IN EHC_QTD *Qtd,\r
- IN UINT8 *Msg\r
+ IN CHAR8 *Msg\r
)\r
;\r
\r
VOID\r
EhcDumpQh (\r
IN EHC_QH *Qh,\r
- IN UINT8 *Msg,\r
+ IN CHAR8 *Msg,\r
IN BOOLEAN DumpBuf\r
)\r
;\r
)\r
;\r
\r
-#ifdef EFI_DEBUG\r
- #define EHC_DEBUG(arg) EhcDebug arg\r
- #define EHC_ERROR(arg) EhcError arg\r
- #define EHC_DUMP_QH(arg) EhcDumpQh arg\r
- #define EHC_DUMP_QTD(arg) EhcDumpQtd arg\r
- #define EHC_DUMP_BUF(arg) EhcDumpBuf arg\r
-#else\r
- #define EHC_DEBUG(arg)\r
- #define EHC_ERROR(arg)\r
- #define EHC_DUMP_QH(arg)\r
- #define EHC_DUMP_QTD(arg)\r
- #define EHC_DUMP_BUF(arg)\r
-#endif\r
-\r
#endif\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcReadCapRegister: Pci Io read error - %r at %d\n", Status, Offset));\r
+ DEBUG ((EFI_D_ERROR, "EhcReadCapRegister: Pci Io read error - %r at %d\n", Status, Offset));\r
Data = 0xFFFF;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset));\r
+ DEBUG ((EFI_D_ERROR, "EhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset));\r
Data = 0xFFFF;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset));\r
+ DEBUG ((EFI_D_ERROR, "EhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset));\r
}\r
}\r
\r
UINT32 Value;\r
UINT32 TimeOut;\r
\r
- EHC_DEBUG (("EhcClearLegacySupport: called to clear legacy support\n"));\r
+ DEBUG ((EFI_D_INFO, "EhcClearLegacySupport: called to clear legacy support\n"));\r
\r
PciIo = Ehc->PciIo;\r
ExtendCap = (Ehc->HcCapParams >> 8) & 0xFF;\r
Status = EhcEnablePeriodSchd (Ehc, EHC_GENERIC_TIMEOUT);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcInitHC: failed to enable period schedule\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcInitHC: failed to enable period schedule\n"));\r
return Status;\r
}\r
\r
Status = EhcEnableAsyncSchd (Ehc, EHC_GENERIC_TIMEOUT);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcInitHC: failed to enable async schedule\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcInitHC: failed to enable async schedule\n"));\r
return Status;\r
}\r
\r
Status = EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT);\r
\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcUnlinkQhFromAsync: Failed to synchronize with doorbell\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcUnlinkQhFromAsync: Failed to synchronize with doorbell\n"));\r
}\r
}\r
\r
}\r
\r
if ((QtdHw->TotalBytes != 0) && (QtdHw->Pid == QTD_PID_INPUT)) {\r
- EHC_DUMP_QH ((Urb->Qh, "Short packet read", FALSE));\r
+ EhcDumpQh (Urb->Qh, "Short packet read", FALSE);\r
\r
//\r
// Short packet read condition. If it isn't a setup transfer,\r
// Status Stage of the setup transfer to get the finial result\r
//\r
if (QtdHw->AltNext == QTD_LINK (Ehc->ShortReadStop, FALSE)) {\r
- EHC_DEBUG (("EhcCheckUrbResult: Short packet read, break\n"));\r
+ DEBUG ((EFI_D_INFO, "EhcCheckUrbResult: Short packet read, break\n"));\r
\r
Finished = TRUE;\r
goto ON_EXIT;\r
}\r
\r
- EHC_DEBUG (("EhcCheckUrbResult: Short packet read, continue\n"));\r
+ DEBUG ((EFI_D_INFO, "EhcCheckUrbResult: Short packet read, continue\n"));\r
}\r
}\r
}\r
}\r
\r
if (!Finished) {\r
- EHC_ERROR (("EhcExecTransfer: transfer not finished in %dms\n", TimeOut));\r
- EHC_DUMP_QH ((Urb->Qh, NULL, FALSE));\r
+ DEBUG ((EFI_D_ERROR, "EhcExecTransfer: transfer not finished in %dms\n", TimeOut));\r
+ EhcDumpQh (Urb->Qh, NULL, FALSE);\r
\r
Status = EFI_TIMEOUT;\r
\r
} else if (Urb->Result != EFI_USB_NOERROR) {\r
- EHC_ERROR (("EhcExecTransfer: transfer failed with %x\n", Urb->Result));\r
- EHC_DUMP_QH ((Urb->Qh, NULL, FALSE));\r
+ DEBUG ((EFI_D_ERROR, "EhcExecTransfer: transfer failed with %x\n", Urb->Result));\r
+ EhcDumpQh (Urb->Qh, NULL, FALSE);\r
\r
Status = EFI_DEVICE_ERROR;\r
}\r
\r
Routine Description:\r
\r
- Flush data from PCI controller specific address to mapped system \r
+ Flush data from PCI controller specific address to mapped system\r
memory address.\r
\r
Arguments:\r
\r
Ehc - The EHCI device\r
Urb - The URB to unmap\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - Success to flush data to mapped system memory\r
} else {\r
MapOp = EfiPciIoOperationBusMasterRead;\r
}\r
- \r
+\r
Status = PciIo->Unmap (PciIo, Urb->DataMap);\r
if (EFI_ERROR (Status)) {\r
goto ON_ERROR;\r
}\r
\r
//\r
- // Flush any PCI posted write transactions from a PCI host \r
+ // Flush any PCI posted write transactions from a PCI host\r
// bridge to system memory.\r
//\r
Status = EhcFlushAsyncIntMap (Ehc, Urb);\r
if (EFI_ERROR (Status)) {\r
- EHC_ERROR (("EhcMoniteAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n"));\r
+ DEBUG ((EFI_D_ERROR, "EhcMoniteAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n"));\r
}\r
- \r
+\r
//\r
// Allocate a buffer then copy the transferred data for user.\r
// If failed to allocate the buffer, update the URB for next\r
#include "Ehci.h"\r
\r
\r
-UINTN mUsbHcDebugLevel = DEBUG_INFO;\r
-\r
-\r
/**\r
Allocate a block of memory to be used by the buffer pool\r
\r
Block->Buf = (UINT8 *) ((UINTN) MappedAddr);\r
Block->Mapping = Mapping;\r
\r
- DEBUG ((mUsbHcDebugLevel, "UsbHcAllocMemBlock: block %x created with buffer %x\n",\r
- Block, Block->Buf));\r
-\r
return Block;\r
\r
FREE_BUFFER:\r
NewBlock = UsbHcAllocMemBlock (Pool, Pages);\r
\r
if (NewBlock == NULL) {\r
- DEBUG ((mUsbHcDebugLevel, "UsbHcAllocateMem: failed to allocate block\n"));\r
+ DEBUG ((EFI_D_INFO, "UsbHcAllocateMem: failed to allocate block\n"));\r
return NULL;\r
}\r
\r
// Release the current memory block if it is empty and not the head\r
//\r
if ((Block != Head) && UsbHcIsMemBlockEmpty (Block)) {\r
- DEBUG ((mUsbHcDebugLevel, "UsbHcFreeMem: block %x is empty, recycle\n", Block));\r
-\r
UsbHcUnlinkMemBlock (Head, Block);\r
UsbHcFreeMemBlock (Pool, Block);\r
}\r
\r
Uhc->RootPorts = *PortNumber;\r
\r
- UHCI_DEBUG (("Uhci2GetCapability: %d ports\n", Uhc->RootPorts));\r
+ DEBUG ((EFI_D_INFO, "Uhci2GetCapability: %d ports\n", Uhc->RootPorts));\r
return EFI_SUCCESS;\r
}\r
\r
}\r
\r
if (PortSC & USBPORTSC_SUSP) {\r
- UHCI_DEBUG (("Uhci2GetRootHubPortStatus: port %d is suspended\n", PortNumber));\r
+ DEBUG ((EFI_D_INFO, "Uhci2GetRootHubPortStatus: port %d is suspended\n", PortNumber));\r
PortStatus->PortStatus |= USB_PORT_STAT_SUSPEND;\r
}\r
\r
Abstract:\r
\r
This file provides the information dump support for Uhci when in debug mode.\r
- You can dynamically adjust the debug level by changing variable gEHCDebugLevel\r
- and gEHCErrorLevel.\r
\r
Revision History\r
\r
#include "Uhci.h"\r
#include "UhciDebug.h"\r
\r
-#ifdef EFI_DEBUG\r
-\r
-UINTN mUhciDebugMask = USB_DEBUG_FORCE_OUTPUT;\r
-\r
-\r
-/**\r
- Debug debug print interface for UHCI\r
-\r
- @param Format String to use for the print, followed by print arguments\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-UhciDebug (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-{\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, Format);\r
- DebugVPrint (DEBUG_INFO, Format, Marker);\r
- VA_END (Marker);\r
-}\r
-\r
-\r
-/**\r
- Debug error print interface for UHCI\r
-\r
- @param Format String to use for the print, followed by print arguments\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-UhciError (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-{\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, Format);\r
- DebugVPrint (DEBUG_ERROR, Format, Marker);\r
- VA_END (Marker);\r
-}\r
-\r
-\r
-\r
-/**\r
- Debug print interface for UHCI\r
-\r
- @param Level Level to control debug print\r
- @param Format String to use for the print, followed by print arguments\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-UhciDebugPrint (\r
- IN UINTN Level,\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-{\r
- VA_LIST Marker;\r
-\r
- VA_START (Marker, Format);\r
-\r
- if (Level & mUhciDebugMask) {\r
- if (mUhciDebugMask & USB_DEBUG_FORCE_OUTPUT) {\r
- DebugVPrint (DEBUG_ERROR, Format, Marker);\r
- } else {\r
- DebugVPrint (DEBUG_INFO, Format, Marker);\r
- }\r
- }\r
-\r
- VA_END (Marker);\r
-}\r
-\r
\r
/**\r
Dump the content of QH structure\r
IN UHCI_QH_SW *QhSw\r
)\r
{\r
- UINTN Level;\r
-\r
- Level = UHCI_DEBUG_QH;\r
-\r
- UhciDebugPrint (Level, "&QhSw @ 0x%x\n", QhSw);\r
- UhciDebugPrint (Level, "QhSw.NextQh - 0x%x\n", QhSw->NextQh);\r
- UhciDebugPrint (Level, "QhSw.TDs - 0x%x\n", QhSw->TDs);\r
- UhciDebugPrint (Level, "QhSw.QhHw:\n");\r
- UhciDebugPrint (Level, " Horizon Link - %x\n", QhSw->QhHw.HorizonLink);\r
- UhciDebugPrint (Level, " Vertical Link - %x\n\n", QhSw->QhHw.VerticalLink);\r
+ DEBUG ((EFI_D_INFO, "&QhSw @ 0x%x\n", QhSw));\r
+ DEBUG ((EFI_D_INFO, "QhSw.NextQh - 0x%x\n", QhSw->NextQh));\r
+ DEBUG ((EFI_D_INFO, "QhSw.TDs - 0x%x\n", QhSw->TDs));\r
+ DEBUG ((EFI_D_INFO, "QhSw.QhHw:\n"));\r
+ DEBUG ((EFI_D_INFO, " Horizon Link - %x\n", QhSw->QhHw.HorizonLink));\r
+ DEBUG ((EFI_D_INFO, " Vertical Link - %x\n\n", QhSw->QhHw.VerticalLink));\r
}\r
\r
\r
)\r
{\r
UHCI_TD_SW *CurTdSw;\r
- UINTN Level;\r
\r
- Level = UHCI_DEBUG_TD;\r
CurTdSw = TdSw;\r
\r
while (CurTdSw != NULL) {\r
- UhciDebugPrint (Level, "TdSw @ 0x%x\n", CurTdSw);\r
- UhciDebugPrint (Level, "TdSw.NextTd - 0x%x\n", CurTdSw->NextTd);\r
- UhciDebugPrint (Level, "TdSw.DataLen - %d\n", CurTdSw->DataLen);\r
- UhciDebugPrint (Level, "TdSw.Data - 0x%x\n", CurTdSw->Data);\r
- UhciDebugPrint (Level, "TdHw:\n");\r
- UhciDebugPrint (Level, " NextLink - 0x%x\n", CurTdSw->TdHw.NextLink);\r
- UhciDebugPrint (Level, " ActualLen - %d\n", CurTdSw->TdHw.ActualLen);\r
- UhciDebugPrint (Level, " Status - 0x%x\n", CurTdSw->TdHw.Status);\r
- UhciDebugPrint (Level, " IOC - %d\n", CurTdSw->TdHw.IntOnCpl);\r
- UhciDebugPrint (Level, " IsIsoCh - %d\n", CurTdSw->TdHw.IsIsoch);\r
- UhciDebugPrint (Level, " LowSpeed - %d\n", CurTdSw->TdHw.LowSpeed);\r
- UhciDebugPrint (Level, " ErrorCount - %d\n", CurTdSw->TdHw.ErrorCount);\r
- UhciDebugPrint (Level, " ShortPacket - %d\n", CurTdSw->TdHw.ShortPacket);\r
- UhciDebugPrint (Level, " PidCode - 0x%x\n", CurTdSw->TdHw.PidCode);\r
- UhciDebugPrint (Level, " DevAddr - %d\n", CurTdSw->TdHw.DeviceAddr);\r
- UhciDebugPrint (Level, " EndPoint - %d\n", CurTdSw->TdHw.EndPoint);\r
- UhciDebugPrint (Level, " DataToggle - %d\n", CurTdSw->TdHw.DataToggle);\r
- UhciDebugPrint (Level, " MaxPacketLen - %d\n", CurTdSw->TdHw.MaxPacketLen);\r
- UhciDebugPrint (Level, " DataBuffer - 0x%x\n\n",CurTdSw->TdHw.DataBuffer);\r
+ DEBUG ((EFI_D_INFO, "TdSw @ 0x%x\n", CurTdSw));\r
+ DEBUG ((EFI_D_INFO, "TdSw.NextTd - 0x%x\n", CurTdSw->NextTd));\r
+ DEBUG ((EFI_D_INFO, "TdSw.DataLen - %d\n", CurTdSw->DataLen));\r
+ DEBUG ((EFI_D_INFO, "TdSw.Data - 0x%x\n", CurTdSw->Data));\r
+ DEBUG ((EFI_D_INFO, "TdHw:\n"));\r
+ DEBUG ((EFI_D_INFO, " NextLink - 0x%x\n", CurTdSw->TdHw.NextLink));\r
+ DEBUG ((EFI_D_INFO, " ActualLen - %d\n", CurTdSw->TdHw.ActualLen));\r
+ DEBUG ((EFI_D_INFO, " Status - 0x%x\n", CurTdSw->TdHw.Status));\r
+ DEBUG ((EFI_D_INFO, " IOC - %d\n", CurTdSw->TdHw.IntOnCpl));\r
+ DEBUG ((EFI_D_INFO, " IsIsoCh - %d\n", CurTdSw->TdHw.IsIsoch));\r
+ DEBUG ((EFI_D_INFO, " LowSpeed - %d\n", CurTdSw->TdHw.LowSpeed));\r
+ DEBUG ((EFI_D_INFO, " ErrorCount - %d\n", CurTdSw->TdHw.ErrorCount));\r
+ DEBUG ((EFI_D_INFO, " ShortPacket - %d\n", CurTdSw->TdHw.ShortPacket));\r
+ DEBUG ((EFI_D_INFO, " PidCode - 0x%x\n", CurTdSw->TdHw.PidCode));\r
+ DEBUG ((EFI_D_INFO, " DevAddr - %d\n", CurTdSw->TdHw.DeviceAddr));\r
+ DEBUG ((EFI_D_INFO, " EndPoint - %d\n", CurTdSw->TdHw.EndPoint));\r
+ DEBUG ((EFI_D_INFO, " DataToggle - %d\n", CurTdSw->TdHw.DataToggle));\r
+ DEBUG ((EFI_D_INFO, " MaxPacketLen - %d\n", CurTdSw->TdHw.MaxPacketLen));\r
+ DEBUG ((EFI_D_INFO, " DataBuffer - 0x%x\n\n",CurTdSw->TdHw.DataBuffer));\r
\r
CurTdSw = CurTdSw->NextTd;\r
}\r
}\r
\r
-#endif\r
#ifndef _EFI_UHCI_DEBUG_H_\r
#define _EFI_UHCI_DEBUG_H_\r
\r
-//\r
-// DEBUG support\r
-//\r
-#define USB_DEBUG_FORCE_OUTPUT (UINTN) (1 << 0)\r
-#define UHCI_DEBUG_QH (UINTN) (1 << 2)\r
-#define UHCI_DEBUG_TD (UINTN) (1 << 3)\r
-\r
-VOID\r
-UhciDebugPrint (\r
- IN UINTN Level,\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Debug print interface for UHCI\r
-\r
-Arguments:\r
-\r
- Level - Level to control debug print\r
- Format - String to use for the print, followed by print arguments\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-;\r
-\r
-\r
-/**\r
- Debug print interface for UHCI\r
-\r
- @param Format String to use for the print, followed by print arguments\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-UhciDebug (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-;\r
-\r
-\r
-/**\r
- Debug error print interface for UHCI\r
-\r
- @param Format String to use for the print, followed by print arguments\r
-\r
- @return None\r
-\r
-**/\r
-VOID\r
-UhciError (\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-;\r
-\r
\r
/**\r
Dump the content of QH structure\r
)\r
;\r
\r
-\r
-#ifdef EFI_DEBUG\r
- #define UHCI_DEBUG(arg) UhciDebug arg\r
- #define UHCI_ERROR(arg) UhciError arg\r
- #define UHCI_DUMP_TDS(arg) UhciDumpTds arg\r
- #define UHCI_DUMP_QH(arg) UhciDumpQh arg\r
-#else\r
- #define UHCI_DEBUG(arg)\r
- #define UHCI_ERROR(arg)\r
- #define UHCI_DUMP_TDS(arg)\r
- #define UHCI_DUMP_QH(arg)\r
-#endif\r
-\r
#endif\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- UHCI_ERROR (("UhciReadReg: PciIo Io.Read error: %r at offset %d\n", Status, Offset));\r
+ DEBUG ((EFI_D_ERROR, "UhciReadReg: PciIo Io.Read error: %r at offset %d\n", Status, Offset));\r
\r
Data = 0xFFFF;\r
}\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- UHCI_ERROR (("UhciWriteReg: PciIo Io.Write error: %r at offset %d\n", Status, Offset));\r
+ DEBUG ((EFI_D_ERROR, "UhciWriteReg: PciIo Io.Write error: %r at offset %d\n", Status, Offset));\r
}\r
}\r
\r
// is a temporary error status.\r
//\r
if (!UhciIsHcWorking (Uhc->PciIo)) {\r
- UHCI_ERROR (("UhciAckAllInterrupt: re-enable the UHCI from system error\n"));\r
+ DEBUG ((EFI_D_ERROR, "UhciAckAllInterrupt: re-enable the UHCI from system error\n"));\r
Uhc->Usb2Hc.SetState (&Uhc->Usb2Hc, EfiUsbHcStateOperational);\r
}\r
}\r
UsbSts = UhciReadReg (PciIo, USBSTS_OFFSET);\r
\r
if (UsbSts & (USBSTS_HCPE | USBSTS_HSE | USBSTS_HCH)) {\r
- UHCI_ERROR (("UhciIsHcWorking: current USB state is %x\n", UsbSts));\r
+ DEBUG ((EFI_D_ERROR, "UhciIsHcWorking: current USB state is %x\n", UsbSts));\r
return FALSE;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- UHCI_ERROR (("UhciSetFrameListBaseAddr: PciIo Io.Write error: %r\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UhciSetFrameListBaseAddr: PciIo Io.Write error: %r\n", Status));\r
}\r
}\r
\r
// in supporting the full speed bandwidth reclamation in the previous\r
// mentioned form. Most new platforms don't suffer it.\r
//\r
-#ifdef UHCI_NO_BW_RECLAMATION\r
- Uhc->BulkQh->QhHw.HorizonLink = QH_HLINK (NULL, TRUE);\r
-#else\r
Uhc->BulkQh->QhHw.HorizonLink = QH_HLINK (Uhc->BulkQh, FALSE);\r
-#endif\r
\r
Uhc->BulkQh->NextQh = NULL;\r
\r
// terminate the transfer\r
//\r
if (!IsLow && (TdHw->ShortPacket == 1) && (Len < Td->DataLen)) {\r
- UHCI_DEBUG (("UhciCheckTdStatus: short packet read occured\n"));\r
+ DEBUG ((EFI_D_INFO, "UhciCheckTdStatus: short packet read occured\n"));\r
\r
Finished = TRUE;\r
goto ON_EXIT;\r
Finished = FALSE;\r
Status = EFI_SUCCESS;\r
Delay = (TimeOut * UHC_1_MILLISECOND / UHC_SYNC_POLL_INTERVAL) + 1;\r
- \r
+\r
for (Index = 0; Index < Delay; Index++) {\r
Finished = UhciCheckTdStatus (Uhc, Td, IsLow, QhResult);\r
\r
}\r
\r
if (!Finished) {\r
- UHCI_ERROR (("UhciExecuteTransfer: execution not finished for %dms\n", TimeOut));\r
- UHCI_DUMP_QH ((Qh));\r
- UHCI_DUMP_TDS ((Td));\r
+ DEBUG ((EFI_D_ERROR, "UhciExecuteTransfer: execution not finished for %dms\n", TimeOut));\r
+ UhciDumpQh (Qh);\r
+ UhciDumpTds (Td);\r
\r
Status = EFI_TIMEOUT;\r
\r
} else if (QhResult->Result != EFI_USB_NOERROR) {\r
- UHCI_ERROR (("UhciExecuteTransfer: execution failed with result %x\n", QhResult->Result));\r
- UHCI_DUMP_QH ((Qh));\r
- UHCI_DUMP_TDS ((Td));\r
+ DEBUG ((EFI_D_ERROR, "UhciExecuteTransfer: execution failed with result %x\n", QhResult->Result));\r
+ UhciDumpQh (Qh);\r
+ UhciDumpTds (Td);\r
\r
Status = EFI_DEVICE_ERROR;\r
}\r
#include "Uhci.h"\r
\r
\r
-UINTN mUsbHcDebugLevel = DEBUG_INFO;\r
-\r
-\r
/**\r
Allocate a block of memory to be used by the buffer pool\r
\r
Block->Buf = (UINT8 *) ((UINTN) MappedAddr);\r
Block->Mapping = Mapping;\r
\r
- DEBUG ((mUsbHcDebugLevel, "UsbHcAllocMemBlock: block %x created with buffer %x\n",\r
- Block, Block->Buf));\r
-\r
return Block;\r
\r
FREE_BUFFER:\r
NewBlock = UsbHcAllocMemBlock (Pool, Pages);\r
\r
if (NewBlock == NULL) {\r
- DEBUG ((mUsbHcDebugLevel, "UsbHcAllocateMem: failed to allocate block\n"));\r
+ DEBUG ((EFI_D_INFO, "UsbHcAllocateMem: failed to allocate block\n"));\r
return NULL;\r
}\r
\r
// Release the current memory block if it is empty and not the head\r
//\r
if ((Block != Head) && UsbHcIsMemBlockEmpty (Block)) {\r
- DEBUG ((mUsbHcDebugLevel, "UsbHcFreeMem: block %x is empty, recycle\n", Block));\r
-\r
UsbHcUnlinkMemBlock (Head, Block);\r
UsbHcFreeMemBlock (Pool, Block);\r
}\r
USB_MASS_STORE_RBC = 0x01, // Reduced Block Commands\r
USB_MASS_STORE_8020I = 0x02, // SFF-8020i, typically a CD/DVD device\r
USB_MASS_STORE_QIC = 0x03, // Typically a tape device\r
- USB_MASS_STORE_UFI = 0x04, // Typically a floopy disk driver device\r
+ USB_MASS_STORE_UFI = 0x04, // Typically a floppy disk driver device\r
USB_MASS_STORE_8070I = 0x05, // SFF-8070i, typically a floppy disk driver device.\r
USB_MASS_STORE_SCSI = 0x06, // SCSI transparent command set\r
\r
IN UINT8 EndpointAddress\r
);\r
\r
-extern UINTN mUsbMscInfo;\r
-extern UINTN mUsbMscError;\r
#endif\r
&CmdResult\r
);\r
if (EFI_ERROR (Status) || CmdResult != USB_MASS_CMD_SUCCESS) {\r
- DEBUG ((mUsbMscError, "UsbBootRequestSense: (%r) CmdResult=0x%x\n", Status, CmdResult));\r
+ DEBUG ((EFI_D_ERROR, "UsbBootRequestSense: (%r) CmdResult=0x%x\n", Status, CmdResult));\r
return Status;\r
}\r
\r
break;\r
}\r
\r
- DEBUG ((mUsbMscInfo, "UsbBootRequestSense: (%r) with sense key %x/%x/%x\n",\r
+ DEBUG ((EFI_D_INFO, "UsbBootRequestSense: (%r) with sense key %x/%x/%x\n",\r
Status,\r
USB_BOOT_SENSE_KEY (SenseData.SenseKey),\r
SenseData.ASC,\r
return EFI_SUCCESS;\r
}\r
\r
- DEBUG ((mUsbMscInfo, "UsbBootExecCmd: Fail to Exec 0x%x Cmd /w %r\n",\r
+ DEBUG ((EFI_D_INFO, "UsbBootExecCmd: Fail to Exec 0x%x Cmd /w %r\n",\r
*(UINT8 *)Cmd ,Status));\r
\r
return UsbBootRequestSense (UsbMass);\r
DataDir,\r
Data,\r
DataLen,\r
- Timeout * (Index + 1)\r
+ Timeout\r
);\r
if (Status == EFI_SUCCESS ||\r
Status == EFI_MEDIA_CHANGED) {\r
return EFI_NOT_READY;\r
}\r
\r
- DEBUG ((mUsbMscInfo, "UsbBootReadCapacity Success LBA=%ld BlockSize=%d\n",\r
+ DEBUG ((EFI_D_INFO, "UsbBootReadCapacity Success LBA=%ld BlockSize=%d\n",\r
Media->LastBlock, Media->BlockSize));\r
\r
return EFI_SUCCESS;\r
\r
Status = UsbBootInquiry (UsbMass);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbBootGetParams: UsbBootInquiry (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBootGetParams: UsbBootInquiry (%r)\n", Status));\r
return Status;\r
}\r
\r
\r
Status = UsbBootIsUnitReady (UsbMass);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbBootDetectMedia: UsbBootIsUnitReady (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBootDetectMedia: UsbBootIsUnitReady (%r)\n", Status));\r
goto ON_ERROR;\r
}\r
\r
\r
Status = UsbBootReadCapacity (UsbMass);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbBootDetectMedia: UsbBootReadCapacity (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBootDetectMedia: UsbBootReadCapacity (%r)\n", Status));\r
goto ON_ERROR;\r
}\r
\r
(Media->LastBlock != OldMedia.LastBlock)) {\r
\r
OldTpl = UsbGetCurrentTpl ();\r
- DEBUG ((mUsbMscError, "UsbBootDetectMedia: TPL before reinstall BlockIoProtocol is %d\n", OldTpl));\r
+ DEBUG ((EFI_D_ERROR, "UsbBootDetectMedia: TPL before reinstall BlockIoProtocol is %d\n", OldTpl));\r
\r
gBS->RestoreTPL (TPL_CALLBACK);\r
\r
&UsbMass->BlockIo\r
);\r
\r
- DEBUG ((mUsbMscError, "UsbBootDetectMedia: TPL after reinstall is %d\n", UsbGetCurrentTpl()));\r
+ DEBUG ((EFI_D_ERROR, "UsbBootDetectMedia: TPL after reinstall is %d\n", UsbGetCurrentTpl()));\r
ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);\r
\r
gBS->RaiseTPL (OldTpl);\r
#include "UsbMass.h"\r
#include "UsbMassBot.h"\r
\r
-UINTN mUsbBotInfo = DEBUG_INFO;\r
-UINTN mUsbBotError = DEBUG_ERROR;\r
-\r
STATIC\r
EFI_STATUS\r
UsbBotResetDevice (\r
Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &UsbBot->Interface);\r
\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbBotError, "UsbBotInit: Get invalid BOT interface (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotInit: Get invalid BOT interface (%r)\n", Status));\r
goto ON_ERROR;\r
}\r
\r
}\r
\r
if ((UsbBot->BulkInEndpoint == NULL) || (UsbBot->BulkOutEndpoint == NULL)) {\r
- DEBUG ((mUsbBotError, "UsbBotInit: In/Out Endpoint invalid\n"));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotInit: In/Out Endpoint invalid\n"));\r
Status = EFI_UNSUPPORTED;\r
goto ON_ERROR;\r
}\r
&Result\r
);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbBotError, "UsbBotDataTransfer: (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotDataTransfer: (%r)\n", Status));\r
if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) {\r
- DEBUG ((mUsbBotError, "UsbBotDataTransfer: DataIn Stall\n"));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotDataTransfer: DataIn Stall\n"));\r
UsbClearEndpointStall (UsbBot->UsbIo, Endpoint->EndpointAddress);\r
} else if (USB_IS_ERROR (Result, EFI_USB_ERR_NAK)) {\r
Status = EFI_NOT_READY;\r
EFI_USB_IO_PROTOCOL *UsbIo;\r
UINT32 Index;\r
UINTN Timeout;\r
- \r
+\r
*CmdStatus = USB_BOT_COMMAND_ERROR;\r
Status = EFI_DEVICE_ERROR;\r
Endpoint = UsbBot->BulkInEndpoint->EndpointAddress;\r
&Result\r
);\r
if (EFI_ERROR(Status)) {\r
- DEBUG ((mUsbBotError, "UsbBotGetStatus (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotGetStatus (%r)\n", Status));\r
if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) {\r
- DEBUG ((mUsbBotError, "UsbBotGetStatus: DataIn Stall\n"));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotGetStatus: DataIn Stall\n"));\r
UsbClearEndpointStall (UsbIo, Endpoint);\r
}\r
continue;\r
//\r
// Invalid Csw need perform reset recovery\r
//\r
- DEBUG ((mUsbBotError, "UsbBotGetStatus: Device return a invalid signature\n"));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotGetStatus: Device return a invalid signature\n"));\r
Status = UsbBotResetDevice (UsbBot, FALSE);\r
} else if (Csw.CmdStatus == USB_BOT_COMMAND_ERROR) {\r
//\r
// Respond phase error need perform reset recovery\r
//\r
- DEBUG ((mUsbBotError, "UsbBotGetStatus: Device return a phase error\n"));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotGetStatus: Device return a phase error\n"));\r
Status = UsbBotResetDevice (UsbBot, FALSE);\r
} else {\r
\r
//\r
Status = UsbBotSendCommand (UsbBot, Cmd, CmdLen, DataDir, DataLen);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbBotError, "UsbBotExecCommand: UsbBotSendCommand (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotSendCommand (%r)\n", Status));\r
return Status;\r
}\r
\r
//\r
Status = UsbBotGetStatus (UsbBot, DataLen, &Result);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbBotError, "UsbBotExecCommand: UsbBotGetStatus (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotGetStatus (%r)\n", Status));\r
return Status;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbBotError, "UsbBotResetDevice: (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbBotResetDevice: (%r)\n", Status));\r
return Status;\r
}\r
\r
#include "UsbMass.h"\r
#include "UsbMassCbi.h"\r
\r
-UINTN mUsbCbiInfo = DEBUG_INFO;\r
-UINTN mUsbCbiError = DEBUG_ERROR;\r
-\r
STATIC\r
EFI_STATUS\r
UsbCbiResetDevice (\r
//\r
Status = UsbCbiSendCommand (UsbCbi, Cmd, CmdLen, Timeout);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbCbiError, "UsbCbiExecCommand: UsbCbiSendCommand (%r)\n",Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbCbiExecCommand: UsbCbiSendCommand (%r)\n",Status));\r
return Status;\r
}\r
\r
\r
Status = UsbCbiDataTransfer (UsbCbi, DataDir, Data, &TransLen, Timeout);\r
if (UsbCbi->InterruptEndpoint == NULL) {\r
- DEBUG ((mUsbCbiError, "UsbCbiExecCommand: UsbCbiDataTransfer (%r)\n",Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbCbiExecCommand: UsbCbiDataTransfer (%r)\n",Status));\r
return Status;\r
}\r
\r
//\r
Status = UsbCbiGetStatus (UsbCbi, Timeout, &Result);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbCbiError, "UsbCbiExecCommand: UsbCbiGetStatus (%r)\n",Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbCbiExecCommand: UsbCbiGetStatus (%r)\n",Status));\r
return EFI_DEVICE_ERROR;\r
}\r
\r
NULL\r
};\r
\r
-UINTN mUsbMscInfo = DEBUG_INFO;\r
-UINTN mUsbMscError = DEBUG_ERROR;\r
-\r
-\r
/**\r
Retrieve the media parameters such as disk gemotric for the\r
device's BLOCK IO protocol.\r
Media->ReadOnly = FALSE;\r
Media->WriteCaching = FALSE;\r
Media->IoAlign = 0;\r
+ Media->MediaId = 1;\r
\r
//\r
// Some device may spend several seconds before it is ready.\r
\r
Status = UsbBootIsUnitReady (UsbMass);\r
if (EFI_ERROR (Status)) {\r
- gBS->Stall (USB_BOOT_RETRY_UNIT_READY_STALL * (Index + 1)); \r
+ gBS->Stall (USB_BOOT_RETRY_UNIT_READY_STALL * (Index + 1));\r
}\r
\r
}\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
UsbMassReset (\r
IN EFI_BLOCK_IO_PROTOCOL *This,\r
IN BOOLEAN ExtendedVerification\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
UsbMassReadBlocks (\r
IN EFI_BLOCK_IO_PROTOCOL *This,\r
IN UINT32 MediaId,\r
EFI_STATUS Status;\r
EFI_TPL OldTpl;\r
UINTN TotalBlock;\r
- \r
+\r
OldTpl = gBS->RaiseTPL (USB_MASS_TPL);\r
UsbMass = USB_MASS_DEVICE_FROM_BLOCKIO (This);\r
Media = &UsbMass->BlockIoMedia;\r
Status = EFI_INVALID_PARAMETER;\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// If it is a removable media, such as CD-Rom or Usb-Floppy,\r
- // need to detect the media before each rw. While some of \r
+ // need to detect the media before each rw. While some of\r
// Usb-Flash is marked as removable media.\r
- // \r
- // \r
+ //\r
+ //\r
if (Media->RemovableMedia == TRUE) {\r
Status = UsbBootDetectMedia (UsbMass);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbMassReadBlocks: UsbBootDetectMedia (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbMassReadBlocks: UsbBootDetectMedia (%r)\n", Status));\r
goto ON_EXIT;\r
- } \r
+ }\r
}\r
- \r
+\r
//\r
// Make sure BlockSize and LBA is consistent with BufferSize\r
//\r
TotalBlock = BufferSize / Media->BlockSize;\r
\r
if (Lba + TotalBlock - 1 > Media->LastBlock) {\r
- Status = EFI_BAD_BUFFER_SIZE;\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto ON_EXIT;\r
+ }\r
+\r
+ if (!(Media->MediaPresent)) {\r
+ Status = EFI_NO_MEDIA;\r
+ goto ON_EXIT;\r
+ }\r
+\r
+ if (MediaId != Media->MediaId) {\r
+ Status = EFI_MEDIA_CHANGED;\r
goto ON_EXIT;\r
}\r
- \r
+\r
Status = UsbBootReadBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbMassReadBlocks: UsbBootReadBlocks (%r) -> Reset\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbMassReadBlocks: UsbBootReadBlocks (%r) -> Reset\n", Status));\r
UsbMassReset (This, TRUE);\r
}\r
\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
UsbMassWriteBlocks (\r
IN EFI_BLOCK_IO_PROTOCOL *This,\r
IN UINT32 MediaId,\r
Status = EFI_INVALID_PARAMETER;\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// If it is a removable media, such as CD-Rom or Usb-Floppy,\r
- // need to detect the media before each rw. While some of \r
+ // need to detect the media before each rw. While some of\r
// Usb-Flash is marked as removable media.\r
- // \r
- // \r
+ //\r
+ //\r
if (Media->RemovableMedia == TRUE) {\r
Status = UsbBootDetectMedia (UsbMass);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbMassWriteBlocks: UsbBootDetectMedia (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbMassWriteBlocks: UsbBootDetectMedia (%r)\n", Status));\r
goto ON_EXIT;\r
- } \r
+ }\r
}\r
- \r
+\r
//\r
// Make sure BlockSize and LBA is consistent with BufferSize\r
//\r
TotalBlock = BufferSize / Media->BlockSize;\r
\r
if (Lba + TotalBlock - 1 > Media->LastBlock) {\r
- Status = EFI_BAD_BUFFER_SIZE;\r
+ Status = EFI_INVALID_PARAMETER;\r
goto ON_EXIT;\r
}\r
- \r
+\r
+ if (!(Media->MediaPresent)) {\r
+ Status = EFI_NO_MEDIA;\r
+ goto ON_EXIT;\r
+ }\r
+\r
+ if (MediaId != Media->MediaId) {\r
+ Status = EFI_MEDIA_CHANGED;\r
+ goto ON_EXIT;\r
+ }\r
+\r
//\r
// Try to write the data even the device is marked as ReadOnly,\r
// and clear the status should the write succeed.\r
//\r
Status = UsbBootWriteBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "UsbMassWriteBlocks: UsbBootWriteBlocks (%r) -> Reset\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "UsbMassWriteBlocks: UsbBootWriteBlocks (%r) -> Reset\n", Status));\r
UsbMassReset (This, TRUE);\r
}\r
- \r
+\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
UsbMassFlushBlocks (\r
IN EFI_BLOCK_IO_PROTOCOL *This\r
)\r
}\r
}\r
\r
- DEBUG ((mUsbMscInfo, "Found a USB mass store device %r\n", Status));\r
+ DEBUG ((EFI_D_INFO, "Found a USB mass store device %r\n", Status));\r
\r
ON_EXIT:\r
gBS->CloseProtocol (\r
//\r
Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "USBMassDriverBindingStart: UsbIo->UsbGetInterfaceDescriptor (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbIo->UsbGetInterfaceDescriptor (%r)\n", Status));\r
goto ON_ERROR;\r
}\r
\r
}\r
\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((mUsbMscError, "USBMassDriverBindingStart: Transport->Init (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: Transport->Init (%r)\n", Status));\r
goto ON_ERROR;\r
}\r
\r
(UsbMass->Pdt != USB_PDT_CDROM) &&\r
(UsbMass->Pdt != USB_PDT_OPTICAL) &&\r
(UsbMass->Pdt != USB_PDT_SIMPLE_DIRECT)) {\r
- DEBUG ((mUsbMscError, "USBMassDriverBindingStart: Found an unsupported peripheral type[%d]\n", UsbMass->Pdt));\r
+ DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: Found an unsupported peripheral type[%d]\n", UsbMass->Pdt));\r
goto ON_ERROR;\r
}\r
} else if (Status != EFI_NO_MEDIA){\r
- DEBUG ((mUsbMscError, "USBMassDriverBindingStart: UsbMassInitMedia (%r)\n", Status));\r
+ DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbMassInitMedia (%r)\n", Status));\r
goto ON_ERROR;\r
}\r
\r