0001 #ifndef _QLA_DSD_H_
0002 #define _QLA_DSD_H_
0003
0004 #include <asm/unaligned.h>
0005
0006
0007 struct dsd32 {
0008 __le32 address;
0009 __le32 length;
0010 };
0011
0012 static inline void append_dsd32(struct dsd32 **dsd, struct scatterlist *sg)
0013 {
0014 put_unaligned_le32(sg_dma_address(sg), &(*dsd)->address);
0015 put_unaligned_le32(sg_dma_len(sg), &(*dsd)->length);
0016 (*dsd)++;
0017 }
0018
0019
0020 struct dsd64 {
0021 __le64 address;
0022 __le32 length;
0023 } __packed;
0024
0025 static inline void append_dsd64(struct dsd64 **dsd, struct scatterlist *sg)
0026 {
0027 put_unaligned_le64(sg_dma_address(sg), &(*dsd)->address);
0028 put_unaligned_le32(sg_dma_len(sg), &(*dsd)->length);
0029 (*dsd)++;
0030 }
0031
0032 #endif