USB Raw Gadget (an interface that allows to emulate USB devices through the USB Gadget subsystem) has been merged into mainline: git.kernel.org/pub/scm/linux/
Conversation
Replying to
wheee! I wonder whether it's possible to convince Android OEMs to start using that instead of hacking up their own kernel code for their weird custom file transfer USB gadgets...
2
1
5
Replying to
Perhaps. You should be able to use GadgetFS for that too. Raw Gadget isn't really optimized for performance yet, and will probably need some work to support more features required for real devices
1
Replying to
gadgetfs requires that the individual functions are implemented in the kernel though, right? so if you want to be an MTP gadget, you need to actually have parts of the MTP implementation in the kernel?
1
Replying to
No, with GadgetFS everything's in userspace. There are a few limitations that make it less suitable for fuzzing (some of them are here [1]), but for emulating functional devices it should work well
[1] git.kernel.org/pub/scm/linux/
1
2
5

