Repository navigation
feat(usbd): submit and cancel asynchronous USB transfers - #2228
Closed
erick-dsnk wants to merge 2 commits into
Closed
erick-dsnk wants to merge 2 commits into
erick-dsnk wants to merge 2 commits into
Conversation
9 tasks done
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
Collaborator
|
Closing with #2224: no title reaches the async Usbd calls on main. Please reopen when one does. |
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Depends on #2224.
Implement
sceUsbdSubmitTransferandsceUsbdCancelTransferon the source-built libusb backend introduced by #2224. Submitted transfers now reach native USB I/O, completions copy status, byte counts and isochronous packet results back to the guest object, and cancellation completes through the same callback path. A separate native transfer invokes the original guest callback through the System V ABI, including on Windows. Supporting allocation/free changes preserve resubmission and freeing from callbacks, prevent freeing pending transfers, and release auto-free buffers through the guest heap.This contribution adds 2 implementations beyond #2224: CPU libraries move from 2600/3044 (85.41%) to 2602/3044 (85.48%). The 22 synchronous implementations and dependency files visible in the current diff belong to #2224; they are inherited unchanged. This branch is based on its exact head
3dbf85f0d9be6a45baa955d28528b46058426e27and should merge after it.sceUsbdCheckConnectedstill throws.The asynchronous signatures follow OpenOrbis Usbd.h and shadPS4 declarations. Transfer ownership, flags and completion behavior follow libusb 1.0.30. There is no additional third-party dependency in this follow-up.
PS5 hardware ABI, Windows asynchronous execution, game behavior and physical control/interrupt payloads remain unverified. Linux native tests enumerate devices and read descriptors; transfer completion tests use a deterministic native submission/event backend. These limits are recorded in TechnicalDebt.
Tested
Linux x86-64, GCC 13.3.0, Release, BUILD_TESTING=ON:
--target libs: passed.guest_usbd,guest_usbd_control,guest_usbd_async: passed. Native tests enumerated 17 host devices and read descriptors. The new asynchronous tests use real libusb allocations/context, wrapping only native allocation/free accounting and submit/cancel/event delivery. They verify error translation, double submission rejection, pending-free rejection, cancellation, guest callback identity and data, resubmission, freeing from callbacks, isochronous results, and guest-heap auto-free ownership.ctest --parallel 2 --timeout 30: 512 passed, 1 skipped (agc_driver_storage_cache_budget), 2 failed (agc_driver_dcc_keys_first_writeassertion andagc_driver_flat_storetimeout). Neither involves USB.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)