scatterlist.h 777 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _ASM_X86_SCATTERLIST_H
  2. #define _ASM_X86_SCATTERLIST_H
  3. #include <asm/types.h>
  4. struct scatterlist {
  5. #ifdef CONFIG_DEBUG_SG
  6. unsigned long sg_magic;
  7. #endif
  8. unsigned long page_link;
  9. unsigned int offset;
  10. unsigned int length;
  11. dma_addr_t dma_address;
  12. #ifdef CONFIG_X86_64
  13. unsigned int dma_length;
  14. #endif
  15. };
  16. #define ARCH_HAS_SG_CHAIN
  17. #define ISA_DMA_THRESHOLD (0x00ffffff)
  18. /*
  19. * These macros should be used after a pci_map_sg call has been done
  20. * to get bus addresses of each of the SG entries and their lengths.
  21. * You should only work with the number of sg entries pci_map_sg
  22. * returns.
  23. */
  24. #define sg_dma_address(sg) ((sg)->dma_address)
  25. #ifdef CONFIG_X86_32
  26. # define sg_dma_len(sg) ((sg)->length)
  27. #else
  28. # define sg_dma_len(sg) ((sg)->dma_length)
  29. #endif
  30. #endif