Lines Matching refs:sg
310 static inline dma_addr_t dpaa2_sg_get_addr(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_addr() argument
312 return (dma_addr_t)le64_to_cpu(sg->addr); in dpaa2_sg_get_addr()
320 static inline void dpaa2_sg_set_addr(struct dpaa2_sg_entry *sg, dma_addr_t addr) in dpaa2_sg_set_addr() argument
322 sg->addr = cpu_to_le64(addr); in dpaa2_sg_set_addr()
325 static inline bool dpaa2_sg_short_len(const struct dpaa2_sg_entry *sg) in dpaa2_sg_short_len() argument
327 return !!((le16_to_cpu(sg->format_offset) >> SG_SHORT_LEN_FLAG_SHIFT) in dpaa2_sg_short_len()
337 static inline u32 dpaa2_sg_get_len(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_len() argument
339 if (dpaa2_sg_short_len(sg)) in dpaa2_sg_get_len()
340 return le32_to_cpu(sg->len) & SG_SHORT_LEN_MASK; in dpaa2_sg_get_len()
342 return le32_to_cpu(sg->len); in dpaa2_sg_get_len()
350 static inline void dpaa2_sg_set_len(struct dpaa2_sg_entry *sg, u32 len) in dpaa2_sg_set_len() argument
352 sg->len = cpu_to_le32(len); in dpaa2_sg_set_len()
361 static inline u16 dpaa2_sg_get_offset(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_offset() argument
363 return le16_to_cpu(sg->format_offset) & SG_OFFSET_MASK; in dpaa2_sg_get_offset()
371 static inline void dpaa2_sg_set_offset(struct dpaa2_sg_entry *sg, in dpaa2_sg_set_offset() argument
374 sg->format_offset &= cpu_to_le16(~SG_OFFSET_MASK); in dpaa2_sg_set_offset()
375 sg->format_offset |= cpu_to_le16(offset); in dpaa2_sg_set_offset()
385 dpaa2_sg_get_format(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_format() argument
387 return (enum dpaa2_sg_format)((le16_to_cpu(sg->format_offset) in dpaa2_sg_get_format()
396 static inline void dpaa2_sg_set_format(struct dpaa2_sg_entry *sg, in dpaa2_sg_set_format() argument
399 sg->format_offset &= cpu_to_le16(~(SG_FORMAT_MASK << SG_FORMAT_SHIFT)); in dpaa2_sg_set_format()
400 sg->format_offset |= cpu_to_le16(format << SG_FORMAT_SHIFT); in dpaa2_sg_set_format()
409 static inline u16 dpaa2_sg_get_bpid(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_bpid() argument
411 return le16_to_cpu(sg->bpid) & SG_BPID_MASK; in dpaa2_sg_get_bpid()
419 static inline void dpaa2_sg_set_bpid(struct dpaa2_sg_entry *sg, u16 bpid) in dpaa2_sg_set_bpid() argument
421 sg->bpid &= cpu_to_le16(~(SG_BPID_MASK)); in dpaa2_sg_set_bpid()
422 sg->bpid |= cpu_to_le16(bpid); in dpaa2_sg_set_bpid()
431 static inline bool dpaa2_sg_is_final(const struct dpaa2_sg_entry *sg) in dpaa2_sg_is_final() argument
433 return !!(le16_to_cpu(sg->format_offset) >> SG_FINAL_FLAG_SHIFT); in dpaa2_sg_is_final()
441 static inline void dpaa2_sg_set_final(struct dpaa2_sg_entry *sg, bool final) in dpaa2_sg_set_final() argument
443 sg->format_offset &= cpu_to_le16((~(SG_FINAL_FLAG_MASK in dpaa2_sg_set_final()
445 sg->format_offset |= cpu_to_le16(final << SG_FINAL_FLAG_SHIFT); in dpaa2_sg_set_final()