Hi, On Tue, Oct 18, 2011 at 10:57:41AM +0300, ext Yauheni Kaliuta wrote: > Is there any requirement to device controller driver (struct usb_ep_ops > implementation) to handle premapped by higher levels (gadget driver) > usb_request's dma address? > > I see, musb driver does it, Fusb300 UDC, for example, doesn't. Yeah, there's a problem here. In short there's no real requirement set and each UDC is doing what it thinks is right. This means that in some controllers we have constructs such as: #define DMA_ADDR_INVALID ((dma_addr_t) ~(0)) struct usb_request *alloc() { req = kzalloc(); req->request.dma = DMA_ADDR_INVALID; return &req->request; } queue() { if (request->dma == DMA_ADDR_INVALID) map(); } and some won't have that sort of handling... Maybe the best will be require that UDC map the buffer to DMA. Then we drop all of that DMA_ADDR_INVALID hackery. -- balbi
Attachment:
signature.asc
Description: Digital signature