On Sun, 29 Jul 2012, Rajaram R wrote: > > The ep list doesn't belong to the gadget driver; it belongs to the UDC > > driver. The maxpacket has to be adjusted to match the value stored in > > the descriptor so that the UDC will tell the hardware to use the right > > maxpacket value. > > The ep list is owned by UDC and thus the function or class should not update it. > This will create problem when we switch functions > > For example: > > Lets assume the UDC has an interrupt EP in the ep-list with maxpktsize > say 32. When for the 1st time a class a requires interrupt EP, chooses > this EP and adjusts the size to say 8. Then when we switch to a > function that requies an interrupt EP of size say 10. This time though > the UDC is capable of supporting this requirement, EP autoconf will > not be successful. > > So IMO, classes should not update eplist. This patch has to be > corrected and pls let me know if I am missing something? Ah, I see what you mean. But the problem is even worse than you think, because several of the UDC drivers adjust ep->maxpacket in this same way when the endpoint is enabled. The documentation in include/linux/usb/gadget.h should be updated to indicate that the maxpacket value is the largest allowed by the hardware, not the endpoint's current setting. The same is probably true for maxburst and mult. 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