> > Thank you for your input. I've actually considered doing some matching/resizing in > the .match_ep route as well, but it doesn't work well for situations where multiple > configurations are in play. The reason being that if you look at the epautoconf APIs, > the configfs driver will use the usb_ep_autoconfig_reset() to reset the endpoints > claimed between initialization of each configuration. This means that the > epautoconf driver expects to re-use the usb_endpoints: > > static int configfs_composite_bind(struct usb_gadget *gadget, > struct usb_gadget_driver *gdriver) > { > ... > > /* Go through all configs, attach all functions */ list_for_each_entry(c, &gi- > >cdev.configs, list) { ... > list_for_each_entry_safe(f, tmp, &cfg->func_list, list) { > list_del(&f->list); > ret = usb_add_function(c, f); > if (ret) { > list_add(&f->list, &cfg->func_list); > goto err_purge_funcs; > } > } > usb_ep_autoconfig_reset(cdev->gadget); > } > > So in this situation, I wouldn't want the dwc3 gadget driver to assign a different > dwc3 ep for endpoints in each configuration, when we know that only one set of > EPs will be active when the host chooses. I hope I understood your feedback > correctly, and definitely appreciate the input! > Thanks for mention that, we didn't consider multiple configurations use case, it needs the UDC driver to record the configuration information, it is too complex at current framework. I think your solution is OK, reserving one packet for each IN endpoint to avoid running out of FIFO for later endpoints and fit the first endpoints with larger FIFO room to get the best performance, it could use as many as FIFOs the device owns. Peter