Re:Raw Gadget is a kernel module that allows to emulate USB ...
by Vogtinator on Wednesday February 12, 2020 @06:32AM
(#22307956)
No, this allows userspace to act as a USB gadget connected to the Linux kernel it's running on.
Re:Raw Gadget is a kernel module that allows to emulate USB ...
by XMPPwocky on Wednesday February 12, 2020 @06:42AM
(#22308008)
It sure doesn't seem to.
That's why they have a separate subproject for it-
https://github.com/xairy/raw-gadget/blob/master/dummy_hcd/RE...
But you certainly could know more than me about it! Why do you think it's exclusively for acting as a USB gadget connected to the Linux kernel it's running on?
Re:Raw Gadget is a kernel module that allows to emulate USB ...
by Vogtinator on Thursday February 13, 2020 @03:30AM
(#22316199)
It looks like I'm only partially right: dummy_hcd is just for the local kernel, but raw gadget is just yet another interface to the UDC, so like usb functionfs just without sanity checks.
I found documentation about this in the submission to mainline: https://lwn.net/ml/linux-usb/461a787e63a9a01d83edc563575b858...
When you plug an embedded Linux device like a phone into something, it could use USB gadgets to expose internal storage as a mass storage device, create a tty and expose that as a USB ACM/CDC device, etc- and using the gadget mechanism, allocate USB endpoints to each of these functions, and enable or disable them at runtime.
So, this project seems to be allowing a Linux device to emulate arbitrary peripherals to an external USB host.
Prior work in this area: see Facedancer. Neat.