On Tue, 26 Mar 2013, David Linares wrote: > >> The device I am working on is an embedded device, therefore the wireless > >> adapter has to be connected to the internal hub. This hub and the whole device > >> are powered via an usb cable. > > > > Oh. Then maybe the USB cable doesn't provide enough power to run both > > the embedded device and the wireless adapter. > There are 2 ports, so does the hub provide 500mA per port or in total? > If that's 500mA for each port, that's fine. You seem to be missing the point. You said above that your entire device is powered via a USB cable. That means the entire device gets only 500 mA, total. If the hub sends 500 mA out one of its ports then there will be nothing left for the other port and nothing left for the rest of your device. Of course, the way it works in reality is that the device uses a significant fraction of the total current, leaving a lot less than 500 mA available for the hub. For example, the hub may get only 200 mA. There's no way it can take that input and magically convert it to 500 mA for each of two ports. > I have done some progress on my side. I have noticed that in a failing case, > the 2-port hub is actually detected as a "standalone hub" but when it > works fine, > it is detected as a "compound device". > Also printed the "hubstatus" that I get from here > http://lxr.free-electrons.com/source/drivers/usb/core/hub.c#L1513 > and it is really weird: > > - when it works, the value returned is 1, and therefore, I fall into the > "Self-powered external hub" case > > - when it doesn't work, the value seems quite random (ex: 0xe6c0) and I fall > into the 100mA limit => my Ralink wireless adapter gets a rejected config. That's to be expected. When there isn't enough power, you start getting random data and things stop working. 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