• Home
  • Raw
  • Download

Lines Matching full:sg

283  * @addr: address of the sg entry
284 * @len: length in this sg entry
301 /* Accessors for SG entry fields */
304 * dpaa2_sg_get_addr() - Get the address from SG entry
305 * @sg: the given scatter-gathering object
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()
315 * dpaa2_sg_set_addr() - Set the address in SG entry
316 * @sg: the given scatter-gathering object
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()
331 * dpaa2_sg_get_len() - Get the length in SG entry
332 * @sg: the given scatter-gathering object
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()
345 * dpaa2_sg_set_len() - Set the length in SG entry
346 * @sg: the given scatter-gathering object
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()
355 * dpaa2_sg_get_offset() - Get the offset in SG entry
356 * @sg: the given scatter-gathering object
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()
366 * dpaa2_sg_set_offset() - Set the offset in SG entry
367 * @sg: the given scatter-gathering object
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()
378 * dpaa2_sg_get_format() - Get the SG format in SG entry
379 * @sg: the given scatter-gathering object
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()
391 * dpaa2_sg_set_format() - Set the SG format in SG entry
392 * @sg: the given scatter-gathering object
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()
403 * dpaa2_sg_get_bpid() - Get the buffer pool id in SG entry
404 * @sg: the given scatter-gathering object
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()
414 * dpaa2_sg_set_bpid() - Set the buffer pool id in SG entry
415 * @sg: the given scatter-gathering object
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()
425 * dpaa2_sg_is_final() - Check final bit in SG entry
426 * @sg: the given scatter-gathering object
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()
436 * dpaa2_sg_set_final() - Set the final bit in SG entry
437 * @sg: the given scatter-gathering object
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()