qla_dsd.h 702 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _QLA_DSD_H_
  2. #define _QLA_DSD_H_
  3. #include <asm/unaligned.h>
  4. /* 32-bit data segment descriptor (8 bytes) */
  5. struct dsd32 {
  6. __le32 address;
  7. __le32 length;
  8. };
  9. static inline void append_dsd32(struct dsd32 **dsd, struct scatterlist *sg)
  10. {
  11. put_unaligned_le32(sg_dma_address(sg), &(*dsd)->address);
  12. put_unaligned_le32(sg_dma_len(sg), &(*dsd)->length);
  13. (*dsd)++;
  14. }
  15. /* 64-bit data segment descriptor (12 bytes) */
  16. struct dsd64 {
  17. __le64 address;
  18. __le32 length;
  19. } __packed;
  20. static inline void append_dsd64(struct dsd64 **dsd, struct scatterlist *sg)
  21. {
  22. put_unaligned_le64(sg_dma_address(sg), &(*dsd)->address);
  23. put_unaligned_le32(sg_dma_len(sg), &(*dsd)->length);
  24. (*dsd)++;
  25. }
  26. #endif