Re: [Patch] DMA mapping API for Alpha

Ivan Kokshaysky
2003-04-29T10:53:55Z

On Mon, Apr 28, 2003 at 08:38:27PM +0200, Marc Zyngier wrote:
> As part of my effort to get the Jensen up and running on the latest
> 2.5 kernels, I have introduced some support for the DMA API, rather
> than relying on the generic PCI based one (which introduces problems
> with the EISA bus).

Since the Jensen is the only non-PCI alpha, I'd really prefer to
keep existing pci_* functions as is and make dma_* ones just
wrappers.
Actually what we need is a single function, for now just

struct pci_dev *
pci_dev_to_pci(struct device *dev)
{
if (dev && dev->bus == &pci_bus_type)
return = to_pci_dev(dev);
/* Some day we'll be able to play nicely with "isa_bridge",
device parents and dma masks here (hopefully). */
return NULL;
}

Then the rest would be

static inline dma_addr_t
dma_map_single(struct device *dev, void *cpu_addr, size_t size,
enum dma_data_direction dir)
{
return pci_map_single(pci_dev_to_pci(dev), cpu_addr, size, dir);
}

and so on.

Though it's perfectly ok to have Jensen-specific dma_* stuff.

Ivan.