Re: DMA API issues

From: Jamey Hicks
Date: Fri Jun 18 2004 - 14:35:14 EST


James Bottomley wrote:

You still haven't explained what you want to do though. Apart from the
occasional brush with usbstorage, I don't have a good knowledge of the
layout of the USB drivers. I assume you simply want to persuade the
ohci driver to use your memory area somehow, but what do you actually
want the ohci driver to do with it? And how much leeway do you get to
customise the driver.



It's really not a question of laziness. The ASICs we are interested in implement OHCI, so I think the core OHCI driver should work unmodified. OHCI driver allocates dma_pools for managing endpoint descriptors (ED) and transaction descriptors (TD). I expect that the driver wrapper that initializes the OHCI controller driver will create dma_pools drawing from the ASIC's private SRAM. The OHCI driver uses dma_{alloc,free}_coherent to manage the space used for the top level control structure shared between the driver and the controller hardware. This also needs to be allocated in the SRAM. Finally, in drivers/usb/core/usb.c, the USB drivers call dma_map_single and dma_unmap_single given pointers to transfer buffers allocated by the USB device drivers. If the USB device is a network device (as it is on the iPAQ), the transfer buffers are allocated via dev_alloc_skb.

The reason I'm asking is beause it's still unclear whether this is a DMA
API issue or an ohci one. I could solve my Q720 issue simply by
exporting an interface from the ncr driver to supply alternative memory
allocation use and descriptors.



I really think this is a DMA API implementation issue. The problem touches more than the USB drivers. I say implementation because the DMA API already takes struct device, so the public interface would not have to change or would not have to change much. However, we would like to be able to provide device-specific implementations of the dma operations. One way to implement this would be a pointer to dma_operations from struct device.

Jamey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/