FIXME: なにをするもの?
int i, count = dma_map_sg(dev, sglist, nents, direction); struct scatterlist *sg; for_each_sg(sglist, sg, count, i) { hw_address[i] = sg_dma_address(sg); hw_len[i] = sg_dma_len(sg); }
#include <linux/dma-attrs.h> /* DMA_ATTR_FOO should be defined in linux/dma-attrs.h and * documented in Documentation/DMA-attributes.txt */ ... DEFINE_DMA_ATTRS(attrs); dma_set_attr(DMA_ATTR_FOO, &attrs); .... n = dma_map_sg_attrs(dev, sg, nents, DMA_TO_DEVICE, &attr); ....
void whizco_dma_map_sg_attrs(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) { .... int foo = dma_get_attr(DMA_ATTR_FOO, attrs); .... if (foo) /* twizzle the frobnozzle */ ....
https://www.kernel.org/doc/Documentation/DMA-API.txt