AristoChen / usb-proxy

A USB proxy based on raw-gadget and libusb
Apache License 2.0
152 stars 29 forks source link

Strip down proxied device interface altsettings based on UDC capabilities #24

Open xairy opened 3 months ago

xairy commented 3 months ago

As encountered in https://github.com/AristoChen/usb-proxy/pull/23#issuecomment-2182790558, the UDC might not provide enough capabilities (e.g. max packet size) to emulate the proxied device. Failing to proxy the device would be the expected behavior in this case.

However, we could also dynamically edit the device descriptor exposed to the host to remove interface altsettings that cannot be supported by the UDC. This will sever the proxied device functionality available to the host, but this might good enough for certain use cases.