#ifndef __ASM_GENERIC_SCATTERLIST_H#define __ASM_GENERIC_SCATTERLIST_H#include <linux/types.h>structscatterlist{#ifdef CONFIG_DEBUG_SGunsignedlongsg_magic;#endifunsignedlongpage_link;unsignedintoffset;unsignedintlength;dma_addr_tdma_address;#ifdef CONFIG_NEED_SG_DMA_LENGTHunsignedintdma_length;#endif};/* * These macros should be used after a dma_map_sg call has been done * to get bus addresses of each of the SG entries and their lengths. * You should only work with the number of sg entries pci_map_sg * returns, or alternatively stop on the first sg_dma_len(sg) which * is 0. */#define sg_dma_address(sg) ((sg)->dma_address)#ifdef CONFIG_NEED_SG_DMA_LENGTH#define sg_dma_len(sg) ((sg)->dma_length)#else#define sg_dma_len(sg) ((sg)->length)#endif#endif /* __ASM_GENERIC_SCATTERLIST_H */