Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,10 @@ XhcTransfer (
*TransferResult = Urb->Result;
*DataLength = Urb->Completed;

if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) {
//
// Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur.
//
if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE) || (*TransferResult == EDKII_USB_ERR_TRANSACTION)) {
ASSERT (Status == EFI_DEVICE_ERROR);
RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb);
if (EFI_ERROR (RecoveryStatus)) {
Expand Down
5 changes: 4 additions & 1 deletion MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,11 @@ XhcCheckUrbResult (
DEBUG ((EFI_D_ERROR, "XhcCheckUrbResult: ERR_BUFFER! Completecode = %x\n",EvtTrb->Completecode));
goto EXIT;

//
// Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur.
//
case TRB_COMPLETION_USB_TRANSACTION_ERROR:
CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT;
CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION;
CheckedUrb->Finished = TRUE;
DEBUG ((EFI_D_ERROR, "XhcCheckUrbResult: TRANSACTION_ERROR! Completecode = %x\n",EvtTrb->Completecode));
goto EXIT;
Expand Down
7 changes: 7 additions & 0 deletions MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define TRB_COMPLETION_STOPPED 26
#define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27

//
// USB Transfer Results Internal Definition
// Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur.
// Add the error code for USB Transaction error since UEFI spec don't have the related definition.
//
#define EDKII_USB_ERR_TRANSACTION 0x200

//
// The topology string used to present usb device location
//
Expand Down