> I am writing a new gadget driver for a USB device controller by Renesas, > the M66591GP.
Great! Better embedded Linux platform support. More, more! > I have a question about the way the endpoint > autoconfiguration (linux/drivers/usb/gadget/epautoconf.c) interacts with > the endpoint list I provide from my driver. > > In ep_matches() (line 93 in 2.6.15 and 2.6.20.1), where the endpoint name > is parsed for the type of endpoint (bulk, interrupt, etc.): > > switch (type) { > case USB_ENDPOINT_XFER_INT: > /* bulk endpoints handle interrupt transfers, > * except the toggle-quirky iso-synch kind > */ > if ('s' == tmp[2]) // == "-iso" > return 0; > /* for now, avoid PXA "interrupt-in"; > * it's documented as never using DATA1. > */ > if (gadget_is_pxa (gadget) > && 'i' == tmp [1]) > return 0; > > break; > > Can someone explain the comment "bulk endpoints handle interrupt > transfers"? See the USB 2.0 spec ... you'll notice that on the wire there is no difference, except for a policy implemented on the host side: interrupt is polled and only transfers at most one packet per period, while bulk isn't polled and uses all available bandwidth. The two exceptions are: (a) high bandwidth mode, for high speed interrupt endpoints, can increase packet sizes and transfer up to three per period; and (b) a funky mode usable in some oddball iso synch modes, where the data toggle is never used. (So far as I know, nobody has ever asked to use that funky mode on Linux ...) So except for those two cases, any endpoint that can be used for bulk data transfers can also be used for interrupt transfers. The converse isn't quite true (see second case below). > Assuming it means that bulk endpoints can transmit interrupt frames, why > would there be dedicated interrupt endpoints in the controller? (Perhaps > this is an "ask the manufacturer" type of question, but I am looking for > guidance, not demanding answers -- speculations are welcome.) Primarily because of that funky iso synch mode; a simpler way to trigger it would be a per-endpoint "don't use data toggle" bit. Another reason would be for high speed hardware which allocates some "small" endpoints which don't have enough FIFO space to be usable as bulk endpoints at high speed: 512 bytes can be a lot of silicon to spend, especially since you'd usually want bulk endpoints to be double buffered (1024 bytes). - Dave ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel