Re: How to force enumeration from linux gadget/device

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

 



On 11-05-11 02:04 PM, Alan Stern wrote:
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?

The host is a WinCE device and there seems to be problems with it's USB/RNDIS/IP/DHCP stack such that it won't reestablish networking unless we unplug or cut VBUS power.

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.

OK thanks, I was afraid of that.

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

I'm assuming you mean g_ether.ko? I've tried this already and it didn't appear to help.

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

I'm assuming this is equivalent to the rmmod above?

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

Thanks, I'll have a look. I've been in Documentation/usb and the linux-usb lists past and present.

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