Lines Matching refs:sg

309 static inline dma_addr_t dpaa2_sg_get_addr(const struct dpaa2_sg_entry *sg)  in dpaa2_sg_get_addr()  argument
311 return (dma_addr_t)le64_to_cpu(sg->addr); in dpaa2_sg_get_addr()
319 static inline void dpaa2_sg_set_addr(struct dpaa2_sg_entry *sg, dma_addr_t addr) in dpaa2_sg_set_addr() argument
321 sg->addr = cpu_to_le64(addr); in dpaa2_sg_set_addr()
324 static inline bool dpaa2_sg_short_len(const struct dpaa2_sg_entry *sg) in dpaa2_sg_short_len() argument
326 return !!((le16_to_cpu(sg->format_offset) >> SG_SHORT_LEN_FLAG_SHIFT) in dpaa2_sg_short_len()
336 static inline u32 dpaa2_sg_get_len(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_len() argument
338 if (dpaa2_sg_short_len(sg)) in dpaa2_sg_get_len()
339 return le32_to_cpu(sg->len) & SG_SHORT_LEN_MASK; in dpaa2_sg_get_len()
341 return le32_to_cpu(sg->len); in dpaa2_sg_get_len()
349 static inline void dpaa2_sg_set_len(struct dpaa2_sg_entry *sg, u32 len) in dpaa2_sg_set_len() argument
351 sg->len = cpu_to_le32(len); in dpaa2_sg_set_len()
360 static inline u16 dpaa2_sg_get_offset(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_offset() argument
362 return le16_to_cpu(sg->format_offset) & SG_OFFSET_MASK; in dpaa2_sg_get_offset()
370 static inline void dpaa2_sg_set_offset(struct dpaa2_sg_entry *sg, in dpaa2_sg_set_offset() argument
373 sg->format_offset &= cpu_to_le16(~SG_OFFSET_MASK); in dpaa2_sg_set_offset()
374 sg->format_offset |= cpu_to_le16(offset); in dpaa2_sg_set_offset()
384 dpaa2_sg_get_format(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_format() argument
386 return (enum dpaa2_sg_format)((le16_to_cpu(sg->format_offset) in dpaa2_sg_get_format()
395 static inline void dpaa2_sg_set_format(struct dpaa2_sg_entry *sg, in dpaa2_sg_set_format() argument
398 sg->format_offset &= cpu_to_le16(~(SG_FORMAT_MASK << SG_FORMAT_SHIFT)); in dpaa2_sg_set_format()
399 sg->format_offset |= cpu_to_le16(format << SG_FORMAT_SHIFT); in dpaa2_sg_set_format()
408 static inline u16 dpaa2_sg_get_bpid(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_bpid() argument
410 return le16_to_cpu(sg->bpid) & SG_BPID_MASK; in dpaa2_sg_get_bpid()
418 static inline void dpaa2_sg_set_bpid(struct dpaa2_sg_entry *sg, u16 bpid) in dpaa2_sg_set_bpid() argument
420 sg->bpid &= cpu_to_le16(~(SG_BPID_MASK)); in dpaa2_sg_set_bpid()
421 sg->bpid |= cpu_to_le16(bpid); in dpaa2_sg_set_bpid()
430 static inline bool dpaa2_sg_is_final(const struct dpaa2_sg_entry *sg) in dpaa2_sg_is_final() argument
432 return !!(le16_to_cpu(sg->format_offset) >> SG_FINAL_FLAG_SHIFT); in dpaa2_sg_is_final()
440 static inline void dpaa2_sg_set_final(struct dpaa2_sg_entry *sg, bool final) in dpaa2_sg_set_final() argument
442 sg->format_offset &= cpu_to_le16((~(SG_FINAL_FLAG_MASK in dpaa2_sg_set_final()
444 sg->format_offset |= cpu_to_le16(final << SG_FINAL_FLAG_SHIFT); in dpaa2_sg_set_final()