1/* 2 * BK Id: SCCS/s.scatterlist.h 1.9 10/15/01 22:51:33 paulus 3 */ 4#ifdef __KERNEL__ 5#ifndef _PPC_SCATTERLIST_H 6#define _PPC_SCATTERLIST_H 7 8#include <asm/dma.h> 9 10struct scatterlist { 11 char *address; /* Location data is to be transferred to, 12 * or NULL for highmem page */ 13 struct page * page; /* Location for highmem page, if any */ 14 unsigned int offset; /* for highmem, page offset */ 15 16 dma_addr_t dma_address; /* phys/bus dma address */ 17 unsigned int length; /* length */ 18}; 19 20/* 21 * These macros should be used after a pci_map_sg call has been done 22 * to get bus addresses of each of the SG entries and their lengths. 23 * You should only work with the number of sg entries pci_map_sg 24 * returns, or alternatively stop on the first sg_dma_len(sg) which 25 * is 0. 26 */ 27#define sg_dma_address(sg) ((sg)->dma_address) 28#define sg_dma_len(sg) ((sg)->length) 29 30#endif /* !(_PPC_SCATTERLIST_H) */ 31#endif /* __KERNEL__ */ 32