0

I'm using Yocto in kernel 4.14 (computer 1). I have two USB port :

Host : with a USB key (mass storage device) plugged

OTG : connected to another computer (computer 2)

             ################    ###############
|USB_KEY|----## COMPUTER 1 ##----## COMPUTER 2##---|screen, keyboard, ...
             ################    ###############
           ^                   ^
      USB link 1            USB link 2

I am trying to access the USB key connected on the computer 1 from the computer 2.

I use g_ether gadget with the USB link 2 and I should use another gadget module like a mass storage gadget.

Can the computer 1 passthrough to a mass storage gadget?

Thanks

0

And the solution was :

g_multi

Edit :

g_multi is the gadget usb called "Multifunction Composite Gadget" in Kernel. This module have two options :

< > Multifunction Composite Gadget
[ ]    RNDIS + CDC Serial + Storage configuration
[ ]    CDC Ethernet + CDC Serial + Storage configuration

In my case I use the first option. But I have no reson to use the CDC Serial.

To enable it :

modprobe g_multi file=/dev/sda # sda is your USB mass storage device

This command will creates both usb0 network interface and mass storage device on host device. It also creates CDC Serial.

Now I use the USB gadget set up though configfs. See the documentaion : Gadget configfs documentation

With this "new" USB gadget system you will choose which all gadgets you want.

  • 1
    Can you explain exactly how you used g_multi? – Michael Mrozek Mar 31 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.