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