Skip to content

rocknix: Update 260817 - #445

Merged
aleksei74 merged 14 commits into
UzuCore:nextfrom
aleksei74:next
Aug 17, 2026
Merged

rocknix: Update 260817#445
aleksei74 merged 14 commits into
UzuCore:nextfrom
aleksei74:next

Conversation

@aleksei74

Copy link
Copy Markdown
Collaborator

Summary

  • What is the goal of this PR? (e.g. Bump up an emulator version, implement a new feature. )

Testing

  • How was this tested? (e.g. Built and tested on specific devices, manual testing steps, URLs for CI/CD build artifacts.)
  • Test results: (e.g. Screenshots, logs, performance metrics if applicable.)

Additional Context

  • Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on.)

AI Usage

While ROCKNIX doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? YES | PARTIALLY | NO

xiaodoudou and others added 14 commits August 12, 2026 12:29
uMTP-Responder is built with CONFIG_USB_SS_SUPPORT commented out in
inc/buildconf.h, so the descriptor blob it writes to functionfs only
carries FUNCTIONFS_HAS_FS_DESC and FUNCTIONFS_HAS_HS_DESC. On a gadget
whose configfs max_speed is left at its default of super-speed-plus,
usb_add_function() never sets config->superspeed, and once the link
comes up at SuperSpeed config_desc() skips the only configuration and
returns -EINVAL. That stalls GET_DESCRIPTOR(CONFIGURATION): the UDC
stays at "addressed" forever and Windows reports the device as
"Unknown USB Device (Configuration Descriptor Request Failed)".

Cap the MTP gadget at high speed so the descriptors it has are the ones
the host asks for. The network gadget is untouched and keeps SuperSpeed,
since f_ncm supplies real ss_descriptors.

Two more things were wrong once enumeration got that far:

bDeviceClass was 0x02, copied from the CDC gadget. A non-zero device
class makes hosts bind on it rather than falling through to the
interface, so Windows looked for a CDC driver instead of matching
umtprd's 06/01/01 plus the "MTP" interface string. Set it to 0.

The MTP gadget also shared 1d6b:0104 with the network gadget, so both
modes landed on one entry in the host's driver cache. Move MTP to
1d6b:0100, which is what /etc/umtprd/umtprd.conf already declares.

QUIRK_DEVICE is only exported into a login shell. Anything invoking
usbgadget without one wrote an empty product string, which is a zero
length iProduct on the wire. With the speed, class and product ID all
corrected, the gadget still stopped at "addressed" until the product
string was populated. Resolve the model directly instead of trusting
the environment.

Finally, usb_stop() unmounted /dev/ffs-umtp before killing umtprd, which
holds ep0 open, so the umount always failed with EBUSY and left the
mount behind for the next start to trip over. Kill first, then unmount.

Tested on an AYN Odin 2 (SM8550, USB 3.1 capable dwc3). Against Windows
11, file transfer enumerates at high speed, reaches "configured", shows
up as an MTP device and supports browsing, copying, renaming and
deleting under /storage/roms. Against Ubuntu 24.04, lsusb reports the
expected 06/01/01 interface, mtp-detect opens a session and reports the
storage as read/write, and a file sent and read back is byte identical
before being deleted again. Cycling file_transfer to network and back
leaves no stale functionfs mount, umtprd or udhcpd behind, and network
mode still links at SuperSpeed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
usbgadget: make MTP file transfer enumerate on SuperSpeed hosts
lsfg-vk: add enable environment setting
SM8750: port sm8550 patch + silence spam
@aleksei74
aleksei74 merged commit fdaee3d into UzuCore:next Aug 17, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants