Skip to content

Commit

Permalink
USB: Disconnect the virtual device only for TRANSFER_NO_DEVICE error
Browse files Browse the repository at this point in the history
Resolve: RPCS3#15565
  • Loading branch information
Florin9doi committed May 9, 2024
1 parent c02aae4 commit 0afc6df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rpcs3/Emu/Cell/lv2/sys_usbd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,7 @@ void usb_handler_thread::transfer_complete(struct libusb_transfer* transfer)
case LIBUSB_TRANSFER_COMPLETED: usbd_transfer->result = HC_CC_NOERR; break;
case LIBUSB_TRANSFER_TIMED_OUT: usbd_transfer->result = EHCI_CC_XACT; break;
case LIBUSB_TRANSFER_OVERFLOW: usbd_transfer->result = EHCI_CC_BABBLE; break;
case LIBUSB_TRANSFER_ERROR:
case LIBUSB_TRANSFER_CANCELLED:
case LIBUSB_TRANSFER_STALL:
case LIBUSB_TRANSFER_NO_DEVICE:
default:
usbd_transfer->result = EHCI_CC_HALTED;
if (usbd_transfer->assigned_number && handled_devices.erase(usbd_transfer->assigned_number))
{
Expand All @@ -600,6 +596,12 @@ void usb_handler_thread::transfer_complete(struct libusb_transfer* transfer)
usbd_transfer->assigned_number = 0;
}
break;
case LIBUSB_TRANSFER_ERROR:
case LIBUSB_TRANSFER_CANCELLED:
case LIBUSB_TRANSFER_STALL:
default:
usbd_transfer->result = EHCI_CC_HALTED;
break;
}

usbd_transfer->count = transfer->actual_length;
Expand Down

0 comments on commit 0afc6df

Please sign in to comment.