Re: [Patch] DMA mapping API for Alpha

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Tue Apr 29 2003 - 06:05:32 EST


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



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:31 EST