kernels/linux-2.4.0/include/asm-arm/pci.h
/* Map a set of buffers described by scatterlist in streaming
 * mode for DMA.  This is the scather-gather version of the
 * above pci_map_single interface.  Here the scatter gather list
 * elements are each tagged with the appropriate dma address
 * and length.  They are obtained via sg_dma_{address,length}(SG).
 *
 * NOTE: An implementation may be able to use a smaller number of
 *       DMA address/length pairs than there are SG table elements.
 *       (for example via virtual mapping capabilities)
 *       The routine returns the number of addr/length pairs actually
 *       used, at most nents.
 *
 * Device ownership issues as mentioned above for pci_map_single are
 * the same here.
 */
Map a set of buffers described by scatterlist in streaming
mode for DMA.  This is the scather-gather version of the
above pci_map_single interface.  Here the scatter gather list
elements are each tagged with the appropriate dma address
and length.  They are obtained via sg_dma_{address,length}(SG).

An implementation may be able to use a smaller number of
DMA address/length pairs than there are SG table elements.
(for example via virtual mapping capabilities)
The routine returns the number of addr/length pairs actually
used, at most nents.

Device ownership issues as mentioned above for pci_map_single are
the same here.
Map a set of buffers described by scatterlist in streaming mode for DMA . This is the scather - gather version of the above pci_map_single interface . Here the scatter gather list elements are each tagged with the appropriate dma address and length . They are obtained via sg_dma_ { address length } ( SG ) . An implementation may be able to use a smaller number of DMA address / length pairs than there are SG table elements . ( for example via virtual mapping capabilities ) The routine returns the number of addr / length pairs actually used at most nents . Device ownership issues as mentioned above for pci_map_single are the same here .
extern inline int
pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
{
	int i;
	for (i = 0; i < nents; i++, sg++) {
		consistent_sync(sg->address, sg->length, direction);
		sg->dma_address = virt_to_bus(sg->address);
	}
	return nents;
}
extern inline int pci_map_sg ( struct pci_dev * hwdev , struct scatterlist * sg , int nents , int direction ) { int i ; for ( i = 0 ; i < nents ; i ++ , sg ++ ) { consistent_sync ( sg -> address , sg -> length , direction ) ; sg -> dma_address = virt_to_bus ( sg -> address ) ; } return nents ; }
Map a set of buffers described by scatterlist in streaming
 mode for DMA.
Map a set of buffers described by scatterlist in streaming mode for DMA .