On Fri, 10 Apr 2020, Andrey Konovalov wrote: > On Fri, Apr 10, 2020 at 2:29 AM Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > > Have you implemented wedge as well as halt? Wedge is needed for the > > mass-storage protocol; as far as I know it isn't used anywhere else. > > No, I didn't know about "wedge" at all :) Looks like the API for it is > really simple, just usb_ep_set_wedge(). I'll need to figure out what > it is and how it works, and I'll send a patch that adds halt/wedge > support then. usb_ep_set_wedge(ep) does almost the same thing as usb_ep_set_halt(ep). The difference is that a Clear-Feature(halt) request from the host will un-halt an endpoint if it is merely halted, but it won't un-halt a wedged endpoint. (I don't think this is documented anywhere, unfortunately.) > > And have you given any thought to suspend/resume support? It's a bit > > tricky because you have to consider both gadget suspend and USB bus > > suspend. > > Hm, no. Is there something specific I need to consider to support it? > I guess I'll need to read about how it works as well, before I can > understand what it would require and ask meaningful questions. The really tricky part involves a gadget that is in system suspend. If the USB bus isn't also suspended, the gadget won't work properly -- it won't be able to respond to requests from the host. Basically, when a UDC driver sees that the system is going into suspend, it has no choice but to disconnect from the USB bus. This probably isn't implemented very well in a lot of UDC drivers. USB bus suspend, on the other hand, _should_ be implemented. > > Nothing else springs to mind. > > Something else: I've been testing raw-gadget with various UDCs that I > have [1] and everything seems to work, except for emulating SuperSpeed > devices with net2280. I've just found it out yesterday night, and > haven't had a chance to debug that yet, but if you know about some > potential issues I could encounter with SuperSpeed/USB3+, please let > me know. Well, USB-3 has streams, unlike USB-2. You may want to think about supporting them. Also, bear in mind that dummy-hcd doesn't support isochronous transfers (although all real UDCs do support them). So perhaps you haven't given them as much testing. usbtest can help a little with that. Alan Stern