1. Added EFI_MEDIA_CHANGED and EFI_INVALID_PARAMETER returns in UsbMassReadBlocks().

2. Use DEBUG () to replace some native debug function in USB stack modules.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4689 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2008-02-13 09:08:24 +00:00
parent d1f076304d
commit 1c61953576
17 changed files with 236 additions and 589 deletions

View File

@@ -81,7 +81,7 @@ EhcGetCapability (
*PortNumber = (UINT8) (Ehc->HcStructParams & HCSP_NPORTS);
*Is64BitCapable = (UINT8) (Ehc->HcCapParams & HCCP_64BIT);
EHC_DEBUG (("EhcGetCapability: %d ports, 64 bit %d\n", *PortNumber, *Is64BitCapable));
DEBUG ((EFI_D_INFO, "EhcGetCapability: %d ports, 64 bit %d\n", *PortNumber, *Is64BitCapable));
gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
@@ -161,7 +161,7 @@ EhcReset (
}
ON_EXIT:
EHC_DEBUG (("EhcReset: exit status %r\n", Status));
DEBUG ((EFI_D_INFO, "EhcReset: exit status %r\n", Status));
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -206,7 +206,7 @@ EhcGetState (
gBS->RestoreTPL (OldTpl);
EHC_DEBUG (("EhcGetState: current state %d\n", *State));
DEBUG ((EFI_D_INFO, "EhcGetState: current state %d\n", *State));
return EFI_SUCCESS;
}
@@ -281,7 +281,7 @@ EhcSetState (
Status = EFI_INVALID_PARAMETER;
}
EHC_DEBUG (("EhcSetState: exit status %r\n", Status));
DEBUG ((EFI_D_INFO, "EhcSetState: exit status %r\n", Status));
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -450,7 +450,7 @@ EhcSetRootHubPortFeature (
Status = EhcRunHC (Ehc, EHC_GENERIC_TIMEOUT);
if (EFI_ERROR (Status)) {
EHC_DEBUG (("EhcSetRootHubPortFeature :failed to start HC - %r\n", Status));
DEBUG ((EFI_D_INFO, "EhcSetRootHubPortFeature :failed to start HC - %r\n", Status));
break;
}
}
@@ -480,7 +480,7 @@ EhcSetRootHubPortFeature (
}
ON_EXIT:
EHC_DEBUG (("EhcSetRootHubPortFeature: exit status %r\n", Status));
DEBUG ((EFI_D_INFO, "EhcSetRootHubPortFeature: exit status %r\n", Status));
gBS->RestoreTPL (OldTpl);
return Status;
@@ -608,7 +608,7 @@ EhcClearRootHubPortFeature (
}
ON_EXIT:
EHC_DEBUG (("EhcClearRootHubPortFeature: exit status %r\n", Status));
DEBUG ((EFI_D_INFO, "EhcClearRootHubPortFeature: exit status %r\n", Status));
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -700,7 +700,7 @@ EhcControlTransfer (
*TransferResult = EFI_USB_ERR_SYSTEM;
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {
EHC_ERROR (("EhcControlTransfer: HC halted at entrance\n"));
DEBUG ((EFI_D_ERROR, "EhcControlTransfer: HC halted at entrance\n"));
EhcAckAllInterrupt (Ehc);
goto ON_EXIT;
@@ -736,7 +736,7 @@ EhcControlTransfer (
);
if (Urb == NULL) {
EHC_ERROR (("EhcControlTransfer: failed to create URB"));
DEBUG ((EFI_D_ERROR, "EhcControlTransfer: failed to create URB"));
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -765,7 +765,7 @@ ON_EXIT:
gBS->RestoreTPL (OldTpl);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
DEBUG ((EFI_D_ERROR, "EhcControlTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
}
return Status;
@@ -851,7 +851,7 @@ EhcBulkTransfer (
Status = EFI_DEVICE_ERROR;
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {
EHC_ERROR (("EhcBulkTransfer: HC is halted\n"));
DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: HC is halted\n"));
EhcAckAllInterrupt (Ehc);
goto ON_EXIT;
@@ -881,7 +881,7 @@ EhcBulkTransfer (
);
if (Urb == NULL) {
EHC_ERROR (("EhcBulkTransfer: failed to create URB\n"));
DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: failed to create URB\n"));
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -907,7 +907,7 @@ ON_EXIT:
gBS->RestoreTPL (OldTpl);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
DEBUG ((EFI_D_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
}
return Status;
@@ -998,14 +998,14 @@ EhcAsyncInterruptTransfer (
if (!IsNewTransfer) {
Status = EhciDelAsyncIntTransfer (Ehc, DeviceAddress, EndPointAddress, DataToggle);
EHC_DEBUG (("EhcAsyncInterruptTransfer: remove old transfer - %r\n", Status));
DEBUG ((EFI_D_INFO, "EhcAsyncInterruptTransfer: remove old transfer - %r\n", Status));
goto ON_EXIT;
}
Status = EFI_SUCCESS;
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {
EHC_ERROR (("EhcAsyncInterruptTransfer: HC is halt\n"));
DEBUG ((EFI_D_ERROR, "EhcAsyncInterruptTransfer: HC is halt\n"));
EhcAckAllInterrupt (Ehc);
Status = EFI_DEVICE_ERROR;
@@ -1017,7 +1017,7 @@ EhcAsyncInterruptTransfer (
Data = AllocatePool (DataLength);
if (Data == NULL) {
EHC_ERROR (("EhcAsyncInterruptTransfer: failed to allocate buffer\n"));
DEBUG ((EFI_D_ERROR, "EhcAsyncInterruptTransfer: failed to allocate buffer\n"));
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -1041,7 +1041,7 @@ EhcAsyncInterruptTransfer (
);
if (Urb == NULL) {
EHC_ERROR (("EhcAsyncInterruptTransfer: failed to create URB\n"));
DEBUG ((EFI_D_ERROR, "EhcAsyncInterruptTransfer: failed to create URB\n"));
gBS->FreePool (Data);
Status = EFI_OUT_OF_RESOURCES;
@@ -1141,7 +1141,7 @@ EhcSyncInterruptTransfer (
Status = EFI_DEVICE_ERROR;
if (EhcIsHalt (Ehc) || EhcIsSysError (Ehc)) {
EHC_ERROR (("EhcSyncInterruptTransfer: HC is halt\n"));
DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: HC is halt\n"));
EhcAckAllInterrupt (Ehc);
goto ON_EXIT;
@@ -1167,7 +1167,7 @@ EhcSyncInterruptTransfer (
);
if (Urb == NULL) {
EHC_ERROR (("EhcSyncInterruptTransfer: failed to create URB\n"));
DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: failed to create URB\n"));
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -1190,7 +1190,7 @@ ON_EXIT:
gBS->RestoreTPL (OldTpl);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
}
return Status;
@@ -1448,7 +1448,7 @@ EhcCreateUsb2Hc (
Ehc->HcCapParams = EhcReadCapRegister (Ehc, EHC_HCCPARAMS_OFFSET);
Ehc->CapLen = EhcReadCapRegister (Ehc, EHC_CAPLENGTH_OFFSET) & 0x0FF;
EHC_DEBUG (("EhcCreateUsb2Hc: capability length %d\n", Ehc->CapLen));
DEBUG ((EFI_D_INFO, "EhcCreateUsb2Hc: capability length %d\n", Ehc->CapLen));
//
// Create AsyncRequest Polling Timer
@@ -1511,7 +1511,7 @@ EhcDriverBindingStart (
);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcDriverBindingStart: failed to open PCI_IO\n"));
DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to open PCI_IO\n"));
return EFI_DEVICE_ERROR;
}
@@ -1548,7 +1548,7 @@ EhcDriverBindingStart (
}
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcDriverBindingStart: failed to enable controller\n"));
DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to enable controller\n"));
goto CLOSE_PCIIO;
}
@@ -1558,7 +1558,7 @@ EhcDriverBindingStart (
Ehc = EhcCreateUsb2Hc (PciIo, OriginalPciAttributes);
if (Ehc == NULL) {
EHC_ERROR (("EhcDriverBindingStart: failed to create USB2_HC\n"));
DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to create USB2_HC\n"));
Status = EFI_OUT_OF_RESOURCES;
goto CLOSE_PCIIO;
@@ -1572,7 +1572,7 @@ EhcDriverBindingStart (
);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcDriverBindingStart: failed to install USB2_HC Protocol\n"));
DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to install USB2_HC Protocol\n"));
goto FREE_POOL;
}
@@ -1585,7 +1585,7 @@ EhcDriverBindingStart (
Status = EhcInitHC (Ehc);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcDriverBindingStart: failed to init host controller\n"));
DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to init host controller\n"));
goto UNINSTALL_USBHC;
}
@@ -1595,7 +1595,7 @@ EhcDriverBindingStart (
Status = gBS->SetTimer (Ehc->PollTimer, TimerPeriodic, EHC_ASYNC_POLL_INTERVAL);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcDriverBindingStart: failed to start async interrupt monitor\n"));
DEBUG ((EFI_D_ERROR, "EhcDriverBindingStart: failed to start async interrupt monitor\n"));
EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
goto UNINSTALL_USBHC;
@@ -1621,7 +1621,7 @@ EhcDriverBindingStart (
);
EHC_DEBUG (("EhcDriverBindingStart: EHCI started for controller @ %x\n", Controller));
DEBUG ((EFI_D_INFO, "EhcDriverBindingStart: EHCI started for controller @ %x\n", Controller));
return EFI_SUCCESS;
UNINSTALL_USBHC:

View File

@@ -15,8 +15,6 @@ Module Name:
Abstract:
This file provides the information dump support for EHCI when in debug mode.
You can dynamically adjust the debug level by changing variable mEhcDebugLevel
and mEhcErrorLevel.
Revision History
@@ -25,100 +23,11 @@ Revision History
#include "Ehci.h"
#ifdef EFI_DEBUG
UINTN mEhcDebugMask = USB_DEBUG_FORCE_OUTPUT;
/**
EHCI's debug output function. It determines whether
to output by the mask and level
@param Level The output level
@param Format The format parameters to the print
@param ... The variable length parameters after format
@return None
**/
VOID
EhciDebugPrint (
IN UINTN Level,
IN CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
if (Level & mEhcDebugMask) {
if (mEhcDebugMask & USB_DEBUG_FORCE_OUTPUT) {
DebugVPrint (DEBUG_ERROR, Format, Marker);
} else {
DebugVPrint (DEBUG_INFO, Format, Marker);
}
}
VA_END (Marker);
}
/**
EHCI's debug output function. It determines whether
to output by the mask and level
@param Format The format parameters to the print
@param ... The variable length parameters after format
@return None
**/
VOID
EhcDebug (
IN CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
DebugVPrint (DEBUG_INFO, Format, Marker);
VA_END (Marker);
}
/**
EHCI's error output function. It determines whether
to output by the mask and level
@param Format The format parameters to the print
@param ... The variable length parameters after format
@return None
**/
VOID
EhcError (
IN CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
DebugVPrint (DEBUG_ERROR, Format, Marker);
VA_END (Marker);
}
/**
Dump the status byte in QTD/QH to a more friendly
format
@param State The state in the QTD/QH
@param Level The output level
@return None
@@ -126,43 +35,42 @@ EhcError (
STATIC
VOID
EhcDumpStatus (
IN UINT32 State,
IN UINTN Level
IN UINT32 State
)
{
if (EHC_BIT_IS_SET (State, QTD_STAT_DO_PING)) {
EhciDebugPrint (Level, " Do_Ping");
DEBUG ((EFI_D_INFO, " Do_Ping"));
} else {
EhciDebugPrint (Level, " Do_Out");
DEBUG ((EFI_D_INFO, " Do_Out"));
}
if (EHC_BIT_IS_SET (State, QTD_STAT_DO_CS)) {
EhciDebugPrint (Level, " Do_CS");
DEBUG ((EFI_D_INFO, " Do_CS"));
} else {
EhciDebugPrint (Level, " Do_SS");
DEBUG ((EFI_D_INFO, " Do_SS"));
}
if (EHC_BIT_IS_SET (State, QTD_STAT_TRANS_ERR)) {
EhciDebugPrint (Level, " Transfer_Error");
DEBUG ((EFI_D_INFO, " Transfer_Error"));
}
if (EHC_BIT_IS_SET (State, QTD_STAT_BABBLE_ERR)) {
EhciDebugPrint (Level, " Babble_Error");
DEBUG ((EFI_D_INFO, " Babble_Error"));
}
if (EHC_BIT_IS_SET (State, QTD_STAT_BUFF_ERR)) {
EhciDebugPrint (Level, " Buffer_Error");
DEBUG ((EFI_D_INFO, " Buffer_Error"));
}
if (EHC_BIT_IS_SET (State, QTD_STAT_HALTED)) {
EhciDebugPrint (Level, " Halted");
DEBUG ((EFI_D_INFO, " Halted"));
}
if (EHC_BIT_IS_SET (State, QTD_STAT_ACTIVE)) {
EhciDebugPrint (Level, " Active");
DEBUG ((EFI_D_INFO, " Active"));
}
EhciDebugPrint (Level, "\n");
DEBUG ((EFI_D_INFO, "\n"));
}
@@ -178,47 +86,44 @@ EhcDumpStatus (
VOID
EhcDumpQtd (
IN EHC_QTD *Qtd,
IN UINT8 *Msg
IN CHAR8 *Msg
)
{
QTD_HW *QtdHw;
UINTN Index;
UINTN Level;
Level = EHC_DEBUG_QTD;
if (Msg != NULL) {
EhciDebugPrint (Level, Msg);
DEBUG ((EFI_D_INFO, Msg));
}
EhciDebugPrint (Level, "Queue TD @ 0x%x, data length %d\n", Qtd, Qtd->DataLen);
DEBUG ((EFI_D_INFO, "Queue TD @ 0x%x, data length %d\n", Qtd, Qtd->DataLen));
QtdHw = &Qtd->QtdHw;
EhciDebugPrint (Level, "Next QTD : %x\n", QtdHw->NextQtd);
EhciDebugPrint (Level, "AltNext QTD : %x\n", QtdHw->AltNext);
EhciDebugPrint (Level, "Status : %x\n", QtdHw->Status);
EhcDumpStatus (QtdHw->Status, Level);
DEBUG ((EFI_D_INFO, "Next QTD : %x\n", QtdHw->NextQtd));
DEBUG ((EFI_D_INFO, "AltNext QTD : %x\n", QtdHw->AltNext));
DEBUG ((EFI_D_INFO, "Status : %x\n", QtdHw->Status));
EhcDumpStatus (QtdHw->Status);
if (QtdHw->Pid == QTD_PID_SETUP) {
EhciDebugPrint (Level, "PID : Setup\n");
DEBUG ((EFI_D_INFO, "PID : Setup\n"));
} else if (QtdHw->Pid == QTD_PID_INPUT) {
EhciDebugPrint (Level, "PID : IN\n");
DEBUG ((EFI_D_INFO, "PID : IN\n"));
} else if (QtdHw->Pid == QTD_PID_OUTPUT) {
EhciDebugPrint (Level, "PID : OUT\n");
DEBUG ((EFI_D_INFO, "PID : OUT\n"));
}
EhciDebugPrint (Level, "Error Count : %d\n", QtdHw->ErrCnt);
EhciDebugPrint (Level, "Current Page : %d\n", QtdHw->CurPage);
EhciDebugPrint (Level, "IOC : %d\n", QtdHw->IOC);
EhciDebugPrint (Level, "Total Bytes : %d\n", QtdHw->TotalBytes);
EhciDebugPrint (Level, "Data Toggle : %d\n", QtdHw->DataToggle);
DEBUG ((EFI_D_INFO, "Error Count : %d\n", QtdHw->ErrCnt));
DEBUG ((EFI_D_INFO, "Current Page : %d\n", QtdHw->CurPage));
DEBUG ((EFI_D_INFO, "IOC : %d\n", QtdHw->IOC));
DEBUG ((EFI_D_INFO, "Total Bytes : %d\n", QtdHw->TotalBytes));
DEBUG ((EFI_D_INFO, "Data Toggle : %d\n", QtdHw->DataToggle));
for (Index = 0; Index < 5; Index++) {
EhciDebugPrint (Level, "Page[%d] : 0x%x\n", Index, QtdHw->Page[Index]);
DEBUG ((EFI_D_INFO, "Page[%d] : 0x%x\n", Index, QtdHw->Page[Index]));
}
}
@@ -236,7 +141,7 @@ EhcDumpQtd (
VOID
EhcDumpQh (
IN EHC_QH *Qh,
IN UINT8 *Msg,
IN CHAR8 *Msg,
IN BOOLEAN DumpBuf
)
{
@@ -244,64 +149,62 @@ EhcDumpQh (
QH_HW *QhHw;
LIST_ENTRY *Entry;
UINTN Index;
UINTN Level;
Level = EHC_DEBUG_QH;
if (Msg != NULL) {
EhciDebugPrint (Level, Msg);
DEBUG ((EFI_D_INFO, Msg));
}
EhciDebugPrint (Level, "Queue head @ 0x%x, interval %d, next qh %x\n",
Qh, Qh->Interval, Qh->NextQh);
DEBUG ((EFI_D_INFO, "Queue head @ 0x%x, interval %d, next qh %x\n",
Qh, Qh->Interval, Qh->NextQh));
QhHw = &Qh->QhHw;
EhciDebugPrint (Level, "Hoziontal link: %x\n", QhHw->HorizonLink);
EhciDebugPrint (Level, "Device address: %d\n", QhHw->DeviceAddr);
EhciDebugPrint (Level, "Inactive : %d\n", QhHw->Inactive);
EhciDebugPrint (Level, "EP number : %d\n", QhHw->EpNum);
EhciDebugPrint (Level, "EP speed : %d\n", QhHw->EpSpeed);
EhciDebugPrint (Level, "DT control : %d\n", QhHw->DtCtrl);
EhciDebugPrint (Level, "Reclaim head : %d\n", QhHw->ReclaimHead);
EhciDebugPrint (Level, "Max packet len: %d\n", QhHw->MaxPacketLen);
EhciDebugPrint (Level, "Ctrl EP : %d\n", QhHw->CtrlEp);
EhciDebugPrint (Level, "Nak reload : %d\n", QhHw->NakReload);
DEBUG ((EFI_D_INFO, "Hoziontal link: %x\n", QhHw->HorizonLink));
DEBUG ((EFI_D_INFO, "Device address: %d\n", QhHw->DeviceAddr));
DEBUG ((EFI_D_INFO, "Inactive : %d\n", QhHw->Inactive));
DEBUG ((EFI_D_INFO, "EP number : %d\n", QhHw->EpNum));
DEBUG ((EFI_D_INFO, "EP speed : %d\n", QhHw->EpSpeed));
DEBUG ((EFI_D_INFO, "DT control : %d\n", QhHw->DtCtrl));
DEBUG ((EFI_D_INFO, "Reclaim head : %d\n", QhHw->ReclaimHead));
DEBUG ((EFI_D_INFO, "Max packet len: %d\n", QhHw->MaxPacketLen));
DEBUG ((EFI_D_INFO, "Ctrl EP : %d\n", QhHw->CtrlEp));
DEBUG ((EFI_D_INFO, "Nak reload : %d\n", QhHw->NakReload));
EhciDebugPrint (Level, "SMask : %x\n", QhHw->SMask);
EhciDebugPrint (Level, "CMask : %x\n", QhHw->CMask);
EhciDebugPrint (Level, "Hub address : %d\n", QhHw->HubAddr);
EhciDebugPrint (Level, "Hub port : %d\n", QhHw->PortNum);
EhciDebugPrint (Level, "Multiplier : %d\n", QhHw->Multiplier);
DEBUG ((EFI_D_INFO, "SMask : %x\n", QhHw->SMask));
DEBUG ((EFI_D_INFO, "CMask : %x\n", QhHw->CMask));
DEBUG ((EFI_D_INFO, "Hub address : %d\n", QhHw->HubAddr));
DEBUG ((EFI_D_INFO, "Hub port : %d\n", QhHw->PortNum));
DEBUG ((EFI_D_INFO, "Multiplier : %d\n", QhHw->Multiplier));
EhciDebugPrint (Level, "Cur QTD : %x\n", QhHw->CurQtd);
DEBUG ((EFI_D_INFO, "Cur QTD : %x\n", QhHw->CurQtd));
EhciDebugPrint (Level, "Next QTD : %x\n", QhHw->NextQtd);
EhciDebugPrint (Level, "AltNext QTD : %x\n", QhHw->AltQtd);
EhciDebugPrint (Level, "Status : %x\n", QhHw->Status);
EhcDumpStatus (QhHw->Status, Level);
DEBUG ((EFI_D_INFO, "Next QTD : %x\n", QhHw->NextQtd));
DEBUG ((EFI_D_INFO, "AltNext QTD : %x\n", QhHw->AltQtd));
DEBUG ((EFI_D_INFO, "Status : %x\n", QhHw->Status));
EhcDumpStatus (QhHw->Status);
if (QhHw->Pid == QTD_PID_SETUP) {
EhciDebugPrint (Level, "PID : Setup\n");
DEBUG ((EFI_D_INFO, "PID : Setup\n"));
} else if (QhHw->Pid == QTD_PID_INPUT) {
EhciDebugPrint (Level, "PID : IN\n");
DEBUG ((EFI_D_INFO, "PID : IN\n"));
} else if (QhHw->Pid == QTD_PID_OUTPUT) {
EhciDebugPrint (Level, "PID : OUT\n");
DEBUG ((EFI_D_INFO, "PID : OUT\n"));
}
EhciDebugPrint (Level, "Error Count : %d\n", QhHw->ErrCnt);
EhciDebugPrint (Level, "Current Page : %d\n", QhHw->CurPage);
EhciDebugPrint (Level, "IOC : %d\n", QhHw->IOC);
EhciDebugPrint (Level, "Total Bytes : %d\n", QhHw->TotalBytes);
EhciDebugPrint (Level, "Data Toggle : %d\n", QhHw->DataToggle);
DEBUG ((EFI_D_INFO, "Error Count : %d\n", QhHw->ErrCnt));
DEBUG ((EFI_D_INFO, "Current Page : %d\n", QhHw->CurPage));
DEBUG ((EFI_D_INFO, "IOC : %d\n", QhHw->IOC));
DEBUG ((EFI_D_INFO, "Total Bytes : %d\n", QhHw->TotalBytes));
DEBUG ((EFI_D_INFO, "Data Toggle : %d\n", QhHw->DataToggle));
for (Index = 0; Index < 5; Index++) {
EhciDebugPrint (Level, "Page[%d] : 0x%x\n", Index, QhHw->Page[Index]);
DEBUG ((EFI_D_INFO, "Page[%d] : 0x%x\n", Index, QhHw->Page[Index]));
}
EhciDebugPrint (Level, "\n");
DEBUG ((EFI_D_INFO, "\n"));
EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) {
Qtd = EFI_LIST_CONTAINER (Entry, EHC_QTD, QtdList);
@@ -333,13 +236,11 @@ EhcDumpBuf (
for (Index = 0; Index < Len; Index++) {
if (Index % 16 == 0) {
EhciDebugPrint (EHC_DEBUG_BUF, "\n");
DEBUG ((EFI_D_INFO,"\n"));
}
EhciDebugPrint (EHC_DEBUG_BUF, "%02x ", Buf[Index]);
DEBUG ((EFI_D_INFO, "%02x ", Buf[Index]));
}
EhciDebugPrint (EHC_DEBUG_BUF, "\n");
DEBUG ((EFI_D_INFO, "\n"));
}
#endif

View File

@@ -25,73 +25,6 @@ Revision History
#define _EFI_EHCI_DEBUG_H_
enum {
USB_DEBUG_FORCE_OUTPUT = (UINTN)(1 << 0),
EHC_DEBUG_QH = (UINTN)(1 << 8),
EHC_DEBUG_QTD = (UINTN)(1 << 9),
EHC_DEBUG_BUF = (UINTN)(1 << 10)
};
/**
EHCI's debug output function. It determines whether
to output by the mask and level
@param Level The output level
@param Format The format parameters to the print
@param ... The variable length parameters after format
@return None
**/
VOID
EhciDebugPrint (
IN UINTN Level,
IN CHAR8 *Format,
...
)
;
/**
EHCI's debug output function. It determines whether
to output by the mask and level
@param Format The format parameters to the print
@param ... The variable length parameters after format
@return None
**/
VOID
EhcDebug (
IN CHAR8 *Format,
...
)
;
/**
EHCI's error output function. It determines whether
to output by the mask and level
@param Format The format parameters to the print
@param ... The variable length parameters after format
@return None
**/
VOID
EhcError (
IN CHAR8 *Format,
...
)
;
/**
Dump the fields of a QTD
@@ -104,7 +37,7 @@ EhcError (
VOID
EhcDumpQtd (
IN EHC_QTD *Qtd,
IN UINT8 *Msg
IN CHAR8 *Msg
)
;
@@ -123,7 +56,7 @@ EhcDumpQtd (
VOID
EhcDumpQh (
IN EHC_QH *Qh,
IN UINT8 *Msg,
IN CHAR8 *Msg,
IN BOOLEAN DumpBuf
)
;
@@ -146,18 +79,4 @@ EhcDumpBuf (
)
;
#ifdef EFI_DEBUG
#define EHC_DEBUG(arg) EhcDebug arg
#define EHC_ERROR(arg) EhcError arg
#define EHC_DUMP_QH(arg) EhcDumpQh arg
#define EHC_DUMP_QTD(arg) EhcDumpQtd arg
#define EHC_DUMP_BUF(arg) EhcDumpBuf arg
#else
#define EHC_DEBUG(arg)
#define EHC_ERROR(arg)
#define EHC_DUMP_QH(arg)
#define EHC_DUMP_QTD(arg)
#define EHC_DUMP_BUF(arg)
#endif
#endif

View File

@@ -54,7 +54,7 @@ EhcReadCapRegister (
);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcReadCapRegister: Pci Io read error - %r at %d\n", Status, Offset));
DEBUG ((EFI_D_ERROR, "EhcReadCapRegister: Pci Io read error - %r at %d\n", Status, Offset));
Data = 0xFFFF;
}
@@ -92,7 +92,7 @@ EhcReadOpReg (
);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset));
DEBUG ((EFI_D_ERROR, "EhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset));
Data = 0xFFFF;
}
@@ -131,7 +131,7 @@ EhcWriteOpReg (
);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset));
DEBUG ((EFI_D_ERROR, "EhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset));
}
}
@@ -245,7 +245,7 @@ EhcClearLegacySupport (
UINT32 Value;
UINT32 TimeOut;
EHC_DEBUG (("EhcClearLegacySupport: called to clear legacy support\n"));
DEBUG ((EFI_D_INFO, "EhcClearLegacySupport: called to clear legacy support\n"));
PciIo = Ehc->PciIo;
ExtendCap = (Ehc->HcCapParams >> 8) & 0xFF;
@@ -622,14 +622,14 @@ EhcInitHC (
Status = EhcEnablePeriodSchd (Ehc, EHC_GENERIC_TIMEOUT);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcInitHC: failed to enable period schedule\n"));
DEBUG ((EFI_D_ERROR, "EhcInitHC: failed to enable period schedule\n"));
return Status;
}
Status = EhcEnableAsyncSchd (Ehc, EHC_GENERIC_TIMEOUT);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcInitHC: failed to enable async schedule\n"));
DEBUG ((EFI_D_ERROR, "EhcInitHC: failed to enable async schedule\n"));
return Status;
}

View File

@@ -345,7 +345,7 @@ EhcUnlinkQhFromAsync (
Status = EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcUnlinkQhFromAsync: Failed to synchronize with doorbell\n"));
DEBUG ((EFI_D_ERROR, "EhcUnlinkQhFromAsync: Failed to synchronize with doorbell\n"));
}
}
@@ -598,7 +598,7 @@ EhcCheckUrbResult (
}
if ((QtdHw->TotalBytes != 0) && (QtdHw->Pid == QTD_PID_INPUT)) {
EHC_DUMP_QH ((Urb->Qh, "Short packet read", FALSE));
EhcDumpQh (Urb->Qh, "Short packet read", FALSE);
//
// Short packet read condition. If it isn't a setup transfer,
@@ -607,13 +607,13 @@ EhcCheckUrbResult (
// Status Stage of the setup transfer to get the finial result
//
if (QtdHw->AltNext == QTD_LINK (Ehc->ShortReadStop, FALSE)) {
EHC_DEBUG (("EhcCheckUrbResult: Short packet read, break\n"));
DEBUG ((EFI_D_INFO, "EhcCheckUrbResult: Short packet read, break\n"));
Finished = TRUE;
goto ON_EXIT;
}
EHC_DEBUG (("EhcCheckUrbResult: Short packet read, continue\n"));
DEBUG ((EFI_D_INFO, "EhcCheckUrbResult: Short packet read, continue\n"));
}
}
}
@@ -673,14 +673,14 @@ EhcExecTransfer (
}
if (!Finished) {
EHC_ERROR (("EhcExecTransfer: transfer not finished in %dms\n", TimeOut));
EHC_DUMP_QH ((Urb->Qh, NULL, FALSE));
DEBUG ((EFI_D_ERROR, "EhcExecTransfer: transfer not finished in %dms\n", TimeOut));
EhcDumpQh (Urb->Qh, NULL, FALSE);
Status = EFI_TIMEOUT;
} else if (Urb->Result != EFI_USB_NOERROR) {
EHC_ERROR (("EhcExecTransfer: transfer failed with %x\n", Urb->Result));
EHC_DUMP_QH ((Urb->Qh, NULL, FALSE));
DEBUG ((EFI_D_ERROR, "EhcExecTransfer: transfer failed with %x\n", Urb->Result));
EhcDumpQh (Urb->Qh, NULL, FALSE);
Status = EFI_DEVICE_ERROR;
}
@@ -781,14 +781,14 @@ EhcFlushAsyncIntMap (
Routine Description:
Flush data from PCI controller specific address to mapped system
Flush data from PCI controller specific address to mapped system
memory address.
Arguments:
Ehc - The EHCI device
Urb - The URB to unmap
Returns:
EFI_SUCCESS - Success to flush data to mapped system memory
@@ -811,7 +811,7 @@ Returns:
} else {
MapOp = EfiPciIoOperationBusMasterRead;
}
Status = PciIo->Unmap (PciIo, Urb->DataMap);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
@@ -953,14 +953,14 @@ EhcMoniteAsyncRequests (
}
//
// Flush any PCI posted write transactions from a PCI host
// Flush any PCI posted write transactions from a PCI host
// bridge to system memory.
//
Status = EhcFlushAsyncIntMap (Ehc, Urb);
if (EFI_ERROR (Status)) {
EHC_ERROR (("EhcMoniteAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n"));
DEBUG ((EFI_D_ERROR, "EhcMoniteAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n"));
}
//
// Allocate a buffer then copy the transferred data for user.
// If failed to allocate the buffer, update the URB for next

View File

@@ -24,9 +24,6 @@ Revision History
#include "Ehci.h"
UINTN mUsbHcDebugLevel = DEBUG_INFO;
/**
Allocate a block of memory to be used by the buffer pool
@@ -117,9 +114,6 @@ UsbHcAllocMemBlock (
Block->Buf = (UINT8 *) ((UINTN) MappedAddr);
Block->Mapping = Mapping;
DEBUG ((mUsbHcDebugLevel, "UsbHcAllocMemBlock: block %x created with buffer %x\n",
Block, Block->Buf));
return Block;
FREE_BUFFER:
@@ -455,7 +449,7 @@ UsbHcAllocateMem (
NewBlock = UsbHcAllocMemBlock (Pool, Pages);
if (NewBlock == NULL) {
DEBUG ((mUsbHcDebugLevel, "UsbHcAllocateMem: failed to allocate block\n"));
DEBUG ((EFI_D_INFO, "UsbHcAllocateMem: failed to allocate block\n"));
return NULL;
}
@@ -539,8 +533,6 @@ UsbHcFreeMem (
// Release the current memory block if it is empty and not the head
//
if ((Block != Head) && UsbHcIsMemBlockEmpty (Block)) {
DEBUG ((mUsbHcDebugLevel, "UsbHcFreeMem: block %x is empty, recycle\n", Block));
UsbHcUnlinkMemBlock (Head, Block);
UsbHcFreeMemBlock (Pool, Block);
}

View File

@@ -320,7 +320,7 @@ Uhci2GetCapability (
Uhc->RootPorts = *PortNumber;
UHCI_DEBUG (("Uhci2GetCapability: %d ports\n", Uhc->RootPorts));
DEBUG ((EFI_D_INFO, "Uhci2GetCapability: %d ports\n", Uhc->RootPorts));
return EFI_SUCCESS;
}
@@ -376,7 +376,7 @@ Uhci2GetRootHubPortStatus (
}
if (PortSC & USBPORTSC_SUSP) {
UHCI_DEBUG (("Uhci2GetRootHubPortStatus: port %d is suspended\n", PortNumber));
DEBUG ((EFI_D_INFO, "Uhci2GetRootHubPortStatus: port %d is suspended\n", PortNumber));
PortStatus->PortStatus |= USB_PORT_STAT_SUSPEND;
}

View File

@@ -16,8 +16,6 @@ Module Name:
Abstract:
This file provides the information dump support for Uhci when in debug mode.
You can dynamically adjust the debug level by changing variable gEHCDebugLevel
and gEHCErrorLevel.
Revision History
@@ -27,87 +25,6 @@ Revision History
#include "Uhci.h"
#include "UhciDebug.h"
#ifdef EFI_DEBUG
UINTN mUhciDebugMask = USB_DEBUG_FORCE_OUTPUT;
/**
Debug debug print interface for UHCI
@param Format String to use for the print, followed by print arguments
@return None
**/
VOID
UhciDebug (
IN CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
DebugVPrint (DEBUG_INFO, Format, Marker);
VA_END (Marker);
}
/**
Debug error print interface for UHCI
@param Format String to use for the print, followed by print arguments
@return None
**/
VOID
UhciError (
IN CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
DebugVPrint (DEBUG_ERROR, Format, Marker);
VA_END (Marker);
}
/**
Debug print interface for UHCI
@param Level Level to control debug print
@param Format String to use for the print, followed by print arguments
@return None
**/
VOID
UhciDebugPrint (
IN UINTN Level,
IN CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
if (Level & mUhciDebugMask) {
if (mUhciDebugMask & USB_DEBUG_FORCE_OUTPUT) {
DebugVPrint (DEBUG_ERROR, Format, Marker);
} else {
DebugVPrint (DEBUG_INFO, Format, Marker);
}
}
VA_END (Marker);
}
/**
Dump the content of QH structure
@@ -122,16 +39,12 @@ UhciDumpQh (
IN UHCI_QH_SW *QhSw
)
{
UINTN Level;
Level = UHCI_DEBUG_QH;
UhciDebugPrint (Level, "&QhSw @ 0x%x\n", QhSw);
UhciDebugPrint (Level, "QhSw.NextQh - 0x%x\n", QhSw->NextQh);
UhciDebugPrint (Level, "QhSw.TDs - 0x%x\n", QhSw->TDs);
UhciDebugPrint (Level, "QhSw.QhHw:\n");
UhciDebugPrint (Level, " Horizon Link - %x\n", QhSw->QhHw.HorizonLink);
UhciDebugPrint (Level, " Vertical Link - %x\n\n", QhSw->QhHw.VerticalLink);
DEBUG ((EFI_D_INFO, "&QhSw @ 0x%x\n", QhSw));
DEBUG ((EFI_D_INFO, "QhSw.NextQh - 0x%x\n", QhSw->NextQh));
DEBUG ((EFI_D_INFO, "QhSw.TDs - 0x%x\n", QhSw->TDs));
DEBUG ((EFI_D_INFO, "QhSw.QhHw:\n"));
DEBUG ((EFI_D_INFO, " Horizon Link - %x\n", QhSw->QhHw.HorizonLink));
DEBUG ((EFI_D_INFO, " Vertical Link - %x\n\n", QhSw->QhHw.VerticalLink));
}
@@ -150,34 +63,31 @@ UhciDumpTds (
)
{
UHCI_TD_SW *CurTdSw;
UINTN Level;
Level = UHCI_DEBUG_TD;
CurTdSw = TdSw;
while (CurTdSw != NULL) {
UhciDebugPrint (Level, "TdSw @ 0x%x\n", CurTdSw);
UhciDebugPrint (Level, "TdSw.NextTd - 0x%x\n", CurTdSw->NextTd);
UhciDebugPrint (Level, "TdSw.DataLen - %d\n", CurTdSw->DataLen);
UhciDebugPrint (Level, "TdSw.Data - 0x%x\n", CurTdSw->Data);
UhciDebugPrint (Level, "TdHw:\n");
UhciDebugPrint (Level, " NextLink - 0x%x\n", CurTdSw->TdHw.NextLink);
UhciDebugPrint (Level, " ActualLen - %d\n", CurTdSw->TdHw.ActualLen);
UhciDebugPrint (Level, " Status - 0x%x\n", CurTdSw->TdHw.Status);
UhciDebugPrint (Level, " IOC - %d\n", CurTdSw->TdHw.IntOnCpl);
UhciDebugPrint (Level, " IsIsoCh - %d\n", CurTdSw->TdHw.IsIsoch);
UhciDebugPrint (Level, " LowSpeed - %d\n", CurTdSw->TdHw.LowSpeed);
UhciDebugPrint (Level, " ErrorCount - %d\n", CurTdSw->TdHw.ErrorCount);
UhciDebugPrint (Level, " ShortPacket - %d\n", CurTdSw->TdHw.ShortPacket);
UhciDebugPrint (Level, " PidCode - 0x%x\n", CurTdSw->TdHw.PidCode);
UhciDebugPrint (Level, " DevAddr - %d\n", CurTdSw->TdHw.DeviceAddr);
UhciDebugPrint (Level, " EndPoint - %d\n", CurTdSw->TdHw.EndPoint);
UhciDebugPrint (Level, " DataToggle - %d\n", CurTdSw->TdHw.DataToggle);
UhciDebugPrint (Level, " MaxPacketLen - %d\n", CurTdSw->TdHw.MaxPacketLen);
UhciDebugPrint (Level, " DataBuffer - 0x%x\n\n",CurTdSw->TdHw.DataBuffer);
DEBUG ((EFI_D_INFO, "TdSw @ 0x%x\n", CurTdSw));
DEBUG ((EFI_D_INFO, "TdSw.NextTd - 0x%x\n", CurTdSw->NextTd));
DEBUG ((EFI_D_INFO, "TdSw.DataLen - %d\n", CurTdSw->DataLen));
DEBUG ((EFI_D_INFO, "TdSw.Data - 0x%x\n", CurTdSw->Data));
DEBUG ((EFI_D_INFO, "TdHw:\n"));
DEBUG ((EFI_D_INFO, " NextLink - 0x%x\n", CurTdSw->TdHw.NextLink));
DEBUG ((EFI_D_INFO, " ActualLen - %d\n", CurTdSw->TdHw.ActualLen));
DEBUG ((EFI_D_INFO, " Status - 0x%x\n", CurTdSw->TdHw.Status));
DEBUG ((EFI_D_INFO, " IOC - %d\n", CurTdSw->TdHw.IntOnCpl));
DEBUG ((EFI_D_INFO, " IsIsoCh - %d\n", CurTdSw->TdHw.IsIsoch));
DEBUG ((EFI_D_INFO, " LowSpeed - %d\n", CurTdSw->TdHw.LowSpeed));
DEBUG ((EFI_D_INFO, " ErrorCount - %d\n", CurTdSw->TdHw.ErrorCount));
DEBUG ((EFI_D_INFO, " ShortPacket - %d\n", CurTdSw->TdHw.ShortPacket));
DEBUG ((EFI_D_INFO, " PidCode - 0x%x\n", CurTdSw->TdHw.PidCode));
DEBUG ((EFI_D_INFO, " DevAddr - %d\n", CurTdSw->TdHw.DeviceAddr));
DEBUG ((EFI_D_INFO, " EndPoint - %d\n", CurTdSw->TdHw.EndPoint));
DEBUG ((EFI_D_INFO, " DataToggle - %d\n", CurTdSw->TdHw.DataToggle));
DEBUG ((EFI_D_INFO, " MaxPacketLen - %d\n", CurTdSw->TdHw.MaxPacketLen));
DEBUG ((EFI_D_INFO, " DataBuffer - 0x%x\n\n",CurTdSw->TdHw.DataBuffer));
CurTdSw = CurTdSw->NextTd;
}
}
#endif

View File

@@ -25,69 +25,6 @@ Revision History
#ifndef _EFI_UHCI_DEBUG_H_
#define _EFI_UHCI_DEBUG_H_
//
// DEBUG support
//
#define USB_DEBUG_FORCE_OUTPUT (UINTN) (1 << 0)
#define UHCI_DEBUG_QH (UINTN) (1 << 2)
#define UHCI_DEBUG_TD (UINTN) (1 << 3)
VOID
UhciDebugPrint (
IN UINTN Level,
IN CHAR8 *Format,
...
)
/*++
Routine Description:
Debug print interface for UHCI
Arguments:
Level - Level to control debug print
Format - String to use for the print, followed by print arguments
Returns:
None
--*/
;
/**
Debug print interface for UHCI
@param Format String to use for the print, followed by print arguments
@return None
**/
VOID
UhciDebug (
IN CHAR8 *Format,
...
)
;
/**
Debug error print interface for UHCI
@param Format String to use for the print, followed by print arguments
@return None
**/
VOID
UhciError (
IN CHAR8 *Format,
...
)
;
/**
Dump the content of QH structure
@@ -118,17 +55,4 @@ UhciDumpTds (
)
;
#ifdef EFI_DEBUG
#define UHCI_DEBUG(arg) UhciDebug arg
#define UHCI_ERROR(arg) UhciError arg
#define UHCI_DUMP_TDS(arg) UhciDumpTds arg
#define UHCI_DUMP_QH(arg) UhciDumpQh arg
#else
#define UHCI_DEBUG(arg)
#define UHCI_ERROR(arg)
#define UHCI_DUMP_TDS(arg)
#define UHCI_DUMP_QH(arg)
#endif
#endif

View File

@@ -53,7 +53,7 @@ UhciReadReg (
);
if (EFI_ERROR (Status)) {
UHCI_ERROR (("UhciReadReg: PciIo Io.Read error: %r at offset %d\n", Status, Offset));
DEBUG ((EFI_D_ERROR, "UhciReadReg: PciIo Io.Read error: %r at offset %d\n", Status, Offset));
Data = 0xFFFF;
}
@@ -91,7 +91,7 @@ UhciWriteReg (
);
if (EFI_ERROR (Status)) {
UHCI_ERROR (("UhciWriteReg: PciIo Io.Write error: %r at offset %d\n", Status, Offset));
DEBUG ((EFI_D_ERROR, "UhciWriteReg: PciIo Io.Write error: %r at offset %d\n", Status, Offset));
}
}
@@ -167,7 +167,7 @@ UhciAckAllInterrupt (
// is a temporary error status.
//
if (!UhciIsHcWorking (Uhc->PciIo)) {
UHCI_ERROR (("UhciAckAllInterrupt: re-enable the UHCI from system error\n"));
DEBUG ((EFI_D_ERROR, "UhciAckAllInterrupt: re-enable the UHCI from system error\n"));
Uhc->Usb2Hc.SetState (&Uhc->Usb2Hc, EfiUsbHcStateOperational);
}
}
@@ -232,7 +232,7 @@ UhciIsHcWorking (
UsbSts = UhciReadReg (PciIo, USBSTS_OFFSET);
if (UsbSts & (USBSTS_HCPE | USBSTS_HSE | USBSTS_HCH)) {
UHCI_ERROR (("UhciIsHcWorking: current USB state is %x\n", UsbSts));
DEBUG ((EFI_D_ERROR, "UhciIsHcWorking: current USB state is %x\n", UsbSts));
return FALSE;
}
@@ -271,7 +271,7 @@ UhciSetFrameListBaseAddr (
);
if (EFI_ERROR (Status)) {
UHCI_ERROR (("UhciSetFrameListBaseAddr: PciIo Io.Write error: %r\n", Status));
DEBUG ((EFI_D_ERROR, "UhciSetFrameListBaseAddr: PciIo Io.Write error: %r\n", Status));
}
}

View File

@@ -121,11 +121,7 @@ UhciInitFrameList (
// in supporting the full speed bandwidth reclamation in the previous
// mentioned form. Most new platforms don't suffer it.
//
#ifdef UHCI_NO_BW_RECLAMATION
Uhc->BulkQh->QhHw.HorizonLink = QH_HLINK (NULL, TRUE);
#else
Uhc->BulkQh->QhHw.HorizonLink = QH_HLINK (Uhc->BulkQh, FALSE);
#endif
Uhc->BulkQh->NextQh = NULL;
@@ -515,7 +511,7 @@ UhciCheckTdStatus (
// terminate the transfer
//
if (!IsLow && (TdHw->ShortPacket == 1) && (Len < Td->DataLen)) {
UHCI_DEBUG (("UhciCheckTdStatus: short packet read occured\n"));
DEBUG ((EFI_D_INFO, "UhciCheckTdStatus: short packet read occured\n"));
Finished = TRUE;
goto ON_EXIT;
@@ -576,7 +572,7 @@ UhciExecuteTransfer (
Finished = FALSE;
Status = EFI_SUCCESS;
Delay = (TimeOut * UHC_1_MILLISECOND / UHC_SYNC_POLL_INTERVAL) + 1;
for (Index = 0; Index < Delay; Index++) {
Finished = UhciCheckTdStatus (Uhc, Td, IsLow, QhResult);
@@ -591,16 +587,16 @@ UhciExecuteTransfer (
}
if (!Finished) {
UHCI_ERROR (("UhciExecuteTransfer: execution not finished for %dms\n", TimeOut));
UHCI_DUMP_QH ((Qh));
UHCI_DUMP_TDS ((Td));
DEBUG ((EFI_D_ERROR, "UhciExecuteTransfer: execution not finished for %dms\n", TimeOut));
UhciDumpQh (Qh);
UhciDumpTds (Td);
Status = EFI_TIMEOUT;
} else if (QhResult->Result != EFI_USB_NOERROR) {
UHCI_ERROR (("UhciExecuteTransfer: execution failed with result %x\n", QhResult->Result));
UHCI_DUMP_QH ((Qh));
UHCI_DUMP_TDS ((Td));
DEBUG ((EFI_D_ERROR, "UhciExecuteTransfer: execution failed with result %x\n", QhResult->Result));
UhciDumpQh (Qh);
UhciDumpTds (Td);
Status = EFI_DEVICE_ERROR;
}

View File

@@ -23,9 +23,6 @@ Revision History
#include "Uhci.h"
UINTN mUsbHcDebugLevel = DEBUG_INFO;
/**
Allocate a block of memory to be used by the buffer pool
@@ -116,9 +113,6 @@ UsbHcAllocMemBlock (
Block->Buf = (UINT8 *) ((UINTN) MappedAddr);
Block->Mapping = Mapping;
DEBUG ((mUsbHcDebugLevel, "UsbHcAllocMemBlock: block %x created with buffer %x\n",
Block, Block->Buf));
return Block;
FREE_BUFFER:
@@ -454,7 +448,7 @@ UsbHcAllocateMem (
NewBlock = UsbHcAllocMemBlock (Pool, Pages);
if (NewBlock == NULL) {
DEBUG ((mUsbHcDebugLevel, "UsbHcAllocateMem: failed to allocate block\n"));
DEBUG ((EFI_D_INFO, "UsbHcAllocateMem: failed to allocate block\n"));
return NULL;
}
@@ -538,8 +532,6 @@ UsbHcFreeMem (
// Release the current memory block if it is empty and not the head
//
if ((Block != Head) && UsbHcIsMemBlockEmpty (Block)) {
DEBUG ((mUsbHcDebugLevel, "UsbHcFreeMem: block %x is empty, recycle\n", Block));
UsbHcUnlinkMemBlock (Head, Block);
UsbHcFreeMemBlock (Pool, Block);
}