feat(libSceUsbd): implement the device, descriptor and transfer exports #2493

Closed
tarfouss3 wants to merge 1 commit from upstream-pr/2493 into main
tarfouss3 commented 2026-10-09 23:11:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tarfouss3 on 2026-10-09T23:11:45Z.


What

Implements 23 exports that called NotImplemented: sceUsbdAllocTransfer, sceUsbdFreeTransfer, sceUsbdFillInterruptTransfer, sceUsbdSubmitTransfer, sceUsbdCancelTransfer, sceUsbdEventHandlingOk, sceUsbdClose, sceUsbdRefDevice, sceUsbdUnrefDevice, sceUsbdGetBusNumber, sceUsbdGetDeviceAddress, sceUsbdGetDeviceDescriptor, sceUsbdGetConfigDescriptor, sceUsbdFreeConfigDescriptor, sceUsbdClaimInterface, sceUsbdReleaseInterface, sceUsbdSetConfiguration, sceUsbdResetDevice, sceUsbdCheckConnected, sceUsbdKernelDriverActive, sceUsbdAttachKernelDriver, sceUsbdControlTransfer, sceUsbdGetStringDescriptor.

Signatures and behaviour follow the public reimplementations freebsd/freebsd-src; none is confirmed on a title, and the provenance of each function is recorded in docs/dev/TechnicalDebt.md. Inputs whose console behaviour is not established throw.

Left as stubs, as no reference establishes their signature or behaviour: sceUsbdOpen, sceUsbdGetActiveConfigDescriptor.

Tested

Linux x86-64 (Ubuntu 24.04, GCC 13.3, Release, BUILD_TESTING=ON), this branch alone on top of main (5bc7886a): full build and libs, then the whole ctest suite with Vulkan on lavapipe: 520 of 522 passed. The two failures are environmental and also fail without this change: agc_driver_vopc_compare (lavapipe result) and guest_sce_net (the test machine has no IPv6, so the existing CheckUnspecifiedIpv6 aborts). Tests added or extended for this change: guest_usbd. tools/check_conventions.py passes. Not tested with a title.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. Written with Claude Code: agents looked up each signature in the public reimplementations cited above, implemented and tested it, and a second agent reviewed every function against those sources and reverted what they did not support.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4806845785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2493). Originally posted by [tarfouss3](https://github.com/tarfouss3) on 2026-10-09T23:11:45Z. --- ### What Implements 23 exports that called NotImplemented: sceUsbdAllocTransfer, sceUsbdFreeTransfer, sceUsbdFillInterruptTransfer, sceUsbdSubmitTransfer, sceUsbdCancelTransfer, sceUsbdEventHandlingOk, sceUsbdClose, sceUsbdRefDevice, sceUsbdUnrefDevice, sceUsbdGetBusNumber, sceUsbdGetDeviceAddress, sceUsbdGetDeviceDescriptor, sceUsbdGetConfigDescriptor, sceUsbdFreeConfigDescriptor, sceUsbdClaimInterface, sceUsbdReleaseInterface, sceUsbdSetConfiguration, sceUsbdResetDevice, sceUsbdCheckConnected, sceUsbdKernelDriverActive, sceUsbdAttachKernelDriver, sceUsbdControlTransfer, sceUsbdGetStringDescriptor. Signatures and behaviour follow the public reimplementations freebsd/freebsd-src; none is confirmed on a title, and the provenance of each function is recorded in docs/dev/TechnicalDebt.md. Inputs whose console behaviour is not established throw. Left as stubs, as no reference establishes their signature or behaviour: sceUsbdOpen, sceUsbdGetActiveConfigDescriptor. ### Tested Linux x86-64 (Ubuntu 24.04, GCC 13.3, Release, `BUILD_TESTING=ON`), this branch alone on top of `main` (5bc7886a): full build and `libs`, then the whole `ctest` suite with Vulkan on lavapipe: 520 of 522 passed. The two failures are environmental and also fail without this change: `agc_driver_vopc_compare` (lavapipe result) and `guest_sce_net` (the test machine has no IPv6, so the existing `CheckUnspecifiedIpv6` aborts). Tests added or extended for this change: `guest_usbd`. `tools/check_conventions.py` passes. Not tested with a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes. Written with Claude Code: agents looked up each signature in the public reimplementations cited above, implemented and tested it, and a second agent reviewed every function against those sources and reverted what they did not support. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-09 23:18:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T23:18:55Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090907476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2493#issuecomment-6090907476). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T23:18:55Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
github-actions[bot] commented 2026-10-09 23:41:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T23:41:07Z.


Progress report (58706dc → a73c713)

📈 System libraries: 86.42% (+0.74%, +23 implemented functions)

✅ 23 implemented
Library Name
libSceUsbd sceUsbdAllocTransfer
libSceUsbd sceUsbdAttachKernelDriver
libSceUsbd sceUsbdCancelTransfer
libSceUsbd sceUsbdCheckConnected
libSceUsbd sceUsbdClaimInterface
libSceUsbd sceUsbdClose
libSceUsbd sceUsbdControlTransfer
libSceUsbd sceUsbdEventHandlingOk
libSceUsbd sceUsbdFillInterruptTransfer
libSceUsbd sceUsbdFreeConfigDescriptor
libSceUsbd sceUsbdFreeTransfer
libSceUsbd sceUsbdGetBusNumber
libSceUsbd sceUsbdGetConfigDescriptor
libSceUsbd sceUsbdGetDeviceAddress
libSceUsbd sceUsbdGetDeviceDescriptor
libSceUsbd sceUsbdGetStringDescriptor
libSceUsbd sceUsbdKernelDriverActive
libSceUsbd sceUsbdRefDevice
libSceUsbd sceUsbdReleaseInterface
libSceUsbd sceUsbdResetDevice
libSceUsbd sceUsbdSetConfiguration
libSceUsbd sceUsbdSubmitTransfer
libSceUsbd sceUsbdUnrefDevice
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6091147487 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2493#issuecomment-6091147487). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T23:41:07Z. --- <!-- progress-report --> ### Progress report (58706dc → a73c713) 📈 **System libraries**: 86.42% (+0.74%, +23 implemented functions) <details> <summary>✅ 23 implemented</summary> | Library | Name | | - | - | | libSceUsbd | `sceUsbdAllocTransfer` | | libSceUsbd | `sceUsbdAttachKernelDriver` | | libSceUsbd | `sceUsbdCancelTransfer` | | libSceUsbd | `sceUsbdCheckConnected` | | libSceUsbd | `sceUsbdClaimInterface` | | libSceUsbd | `sceUsbdClose` | | libSceUsbd | `sceUsbdControlTransfer` | | libSceUsbd | `sceUsbdEventHandlingOk` | | libSceUsbd | `sceUsbdFillInterruptTransfer` | | libSceUsbd | `sceUsbdFreeConfigDescriptor` | | libSceUsbd | `sceUsbdFreeTransfer` | | libSceUsbd | `sceUsbdGetBusNumber` | | libSceUsbd | `sceUsbdGetConfigDescriptor` | | libSceUsbd | `sceUsbdGetDeviceAddress` | | libSceUsbd | `sceUsbdGetDeviceDescriptor` | | libSceUsbd | `sceUsbdGetStringDescriptor` | | libSceUsbd | `sceUsbdKernelDriverActive` | | libSceUsbd | `sceUsbdRefDevice` | | libSceUsbd | `sceUsbdReleaseInterface` | | libSceUsbd | `sceUsbdResetDevice` | | libSceUsbd | `sceUsbdSetConfiguration` | | libSceUsbd | `sceUsbdSubmitTransfer` | | libSceUsbd | `sceUsbdUnrefDevice` | </details>

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2493
No description provided.