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

From: James Bottomley
Date: Thu Jun 17 2004 - 15:13:22 EST


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


-
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/