On Tue, Feb 1, 2011 at 10:13 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Tue, 1 Feb 2011, Maulik Mankad wrote: > >> Thanks Alan. >> >> I will test this patch and let you know the result tomorrow. >> >> Am curious to know if bind() will fail for rndis if the interface is disabled? > > I don't know. That's an Android addition, not part of the regular > kernel. > I tested this and found that the bind() call for rndis succeeds, hence the fix you provided does not get triggered.However the fix seems to be valid for the bind failure case. It seems that composite.c does not manage well the interfaces that are disabled. We assign interface_id's to all the interfaces (enabled/disabled) but while sending the configuration descriptor to the host, only the enabled interfaces are announced. Thus host has no way to know of other interfaces available on the device. Thus there is a mismatch between the wIndex field (interface number) that the host sends and what the device expects. Also it is strange that config->interface[id] array also holds the disabled interface. Seems a bug in the composite framework. Any idea of how to address this? I tried some obvious things, like assigning interface_id's in usb_interface_id(), only if the function is enabled, but this does not gel well with the framework and I see bind failures. Regards, Maulik -- 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