2.1 KiB
2.1 KiB
libSceUsbd technical debt
Silent stubs
- libSceUsbd implements only the no-device path:
sceUsbdInitandsceUsbdExitsucceed without a host USB context, the device list is always empty and event handling waits for its timeout; calls that need a device throw. Transfers follow thelibusb_transferlayout from libusb.h, which shadPS4 passes to titles asSceUsbdTransfer:sceUsbdAllocTransferzero-allocates one with its iso packet count (a negative count returns null),sceUsbdFillInterruptTransferfills the fieldslibusb_fill_interrupt_transfersets, andsceUsbdCancelTransferreportsLIBUSB_ERROR_NOT_FOUNDmapped to0x80240005by shadPS4's0x80240000 - errorrule, since no transfer can be submitted.sceUsbdEventHandlingOkreturns 1 because no other thread handles events, andsceUsbdFreeConfigDescriptoraccepts only null because no descriptor is ever returned. The device and handle calls take the argument lists of FreeBSD 11.4 libusb (libusb.h) and return0x80240002for the null arguments it rejects withLIBUSB_ERROR_INVALID_PARAM(libusb10.c, libusb10_desc.c, libusb10_io.c); a null device or handle in the calls it treats as null-safe returns 0, null or nothing, as there.sceUsbdOpenandsceUsbdGetActiveConfigDescriptorthrow on a null device, which libusb dereferences. Any other device or handle was never returned by this library, so those calls throw. The layout, the argument lists and the error codes are unverified on PS5