Re: How to force enumeration from linux gadget/device

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

 



On Wed, 11 May 2011, Marc St-Jean wrote:

> I'm trying to force a host to re-enumerate our device from the linux
> g_ether\RNDIS side. Currently it appears to only do so if I unplug the
> cable or drop VBUS on the cable. We can't do this as the user won't have
> access to the cable in the completed system.

As far as I know, g_ether doesn't have any method for doing this -- or 
any reason for doing it, either.  Why do you want to force the host to 
re-enumerate a g_ether/RNDIS gadget?

> Searching through the list I found the following. I've tried many
> combinations but it's not clear to me exactly what names where to be
> echoed and from which "controller".
> 
> Also, I realize that the advice was for the host side with a hub and our
> gadget port is direct connected. But can the same un/bind method be
> used?

The advice you found was for the host side; it is useless on the gadget
side.

There are a couple of things you could do.  The easiest is to unload
the gadget driver and then reload it a second or so later.  For
example, if you're using g_ether:

	rmmod g-ether
	sleep 1
	modprobe g-ether

Alternatively, if you can change the source code for the gadget driver 
and if your controller driver supports this, you can have the gadget 
driver call:

	usb_gadget_disconnect(gadget);
	ssleep(1);
	usb_gadget_connect(gadget);

This is documented in include/linux/usb/gadget.h.

Alan Stern

--
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