Re: Multiple g_zero gadgets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/13/2017 10:53 AM, Krzysztof Opasiak wrote:


On 11/09/2017 12:15 PM, Felipe Balbi wrote:

Hi,

Hinko Kocevar <hinkocevar@xxxxxxxxx> writes:
The way dummy was written, it can only instantiate one gadget. You
either need a real USB peripheral controller, or you need to patch dummy
to instantiate more than one gadget.

--
balbi

By dummy - are you referring to g_zero of dummy_hcd?

Okay, we need a little more explanation. In order to have a gadget
driver like g_zero loaded, you need a USB peripheral controller (in your
case, that's handled by dummy).

Now, when you want that g_zero to be useful, you need to plug it to a
USB host controller (in your case, that's also handled by dummy).

What I'm saying, though, is that this dummy (dummy_hcd.c) can only
handle ONE gadget (a fake USB peripheral controller) at a time. It does
NOT instantiate more than one of those. Because of that, there's no way
to get g_zero to probe for a second time.

In fact, even if you were to patch dummy_hcd.c to instantiate N gadgets,

MODULE_PARM_DESC(num, "number of emulated controllers");

If you set this to 5 you will get 5 pairs of UDC and HCD.

you wouldn't be able to use g_zero.ko, and would be required to rely on
our configfs interface for dynamically generating and binding different
gadget drivers to each of your gadget instances, but that's another
story altogether.

Then you can use configfs and instantiate more then one g_zero equivalent and bind it do dummy_udc.0, dummy_udc.1 etc.

Each of them will be connected to a separate bus but they all will be visible in the system.

Grrrrr....
thunderbird messed up threading for this topic.
Sorry for repeating after Alan.

Best regards,
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux