Re: Proposal for new generic device API: dma_get_required_mask()

James Bottomley
2004-06-17T20:12:20Z

On Thu, 2004-06-17 at 10:28, Matthew Wilcox wrote:
> So let's look at the sym2 implementation to see how this would work.
> A straight diff -u is not terribly helpful, So let's try a more verbose
> context diff:

actually, no. I'm proposing an additional API, not a modification to
dma_set_mask(), so the new code would read

struct pci_dev *pdev = &np->s.device;

if (np->features & FE_DAC) {
if (dma_set_mask(&pdev->dev, 0xffffffffffULL))
if (dma_get_required_mask(&pdev->dev) > 0xffffffffUL)
goto use_dac;

}

dma_set_mask(&pdev->dev, 0xffffffffUL);
return 0;

use_dac:
np->use_dac = 1;
printf_info("%s: using 64 bit DMA addressing\n", sym_name(np));
return 0;

James