Lines Matching refs:desc

151 static inline void cppi5_desc_dump(void *desc, u32 size)  in cppi5_desc_dump()  argument
154 32, 4, desc, size, false); in cppi5_desc_dump()
319 static inline void cppi5_hdesc_init(struct cppi5_host_desc_t *desc, u32 flags, in cppi5_hdesc_init() argument
322 WARN_ON(!desc); in cppi5_hdesc_init()
327 desc->hdr.pkt_info0 = (CPPI5_INFO0_DESC_TYPE_VAL_HOST << in cppi5_hdesc_init()
329 desc->hdr.pkt_info0 |= ((psdata_size >> 2) << in cppi5_hdesc_init()
332 desc->next_desc = 0; in cppi5_hdesc_init()
342 static inline void cppi5_hdesc_update_flags(struct cppi5_host_desc_t *desc, in cppi5_hdesc_update_flags() argument
345 WARN_ON(!desc); in cppi5_hdesc_update_flags()
349 desc->hdr.pkt_info0 &= ~(CPPI5_INFO0_HDESC_EPIB_PRESENT | in cppi5_hdesc_update_flags()
351 desc->hdr.pkt_info0 |= flags; in cppi5_hdesc_update_flags()
360 struct cppi5_host_desc_t *desc, u32 psdata_size) in cppi5_hdesc_update_psdata_size() argument
362 WARN_ON(!desc); in cppi5_hdesc_update_psdata_size()
365 desc->hdr.pkt_info0 &= ~CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK; in cppi5_hdesc_update_psdata_size()
366 desc->hdr.pkt_info0 |= ((psdata_size >> 2) << in cppi5_hdesc_update_psdata_size()
375 static inline u32 cppi5_hdesc_get_psdata_size(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_psdata_size() argument
379 WARN_ON(!desc); in cppi5_hdesc_get_psdata_size()
381 if (!(desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION)) in cppi5_hdesc_get_psdata_size()
382 psdata_size = (desc->hdr.pkt_info0 & in cppi5_hdesc_get_psdata_size()
395 static inline u32 cppi5_hdesc_get_pktlen(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_pktlen() argument
397 WARN_ON(!desc); in cppi5_hdesc_get_pktlen()
399 return (desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PKTLEN_MASK); in cppi5_hdesc_get_pktlen()
406 static inline void cppi5_hdesc_set_pktlen(struct cppi5_host_desc_t *desc, in cppi5_hdesc_set_pktlen() argument
409 WARN_ON(!desc); in cppi5_hdesc_set_pktlen()
411 desc->hdr.pkt_info0 |= (pkt_len & CPPI5_INFO0_HDESC_PKTLEN_MASK); in cppi5_hdesc_set_pktlen()
420 static inline u32 cppi5_hdesc_get_psflags(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_psflags() argument
422 WARN_ON(!desc); in cppi5_hdesc_get_psflags()
424 return (desc->hdr.pkt_info1 & CPPI5_INFO1_HDESC_PSFLGS_MASK) >> in cppi5_hdesc_get_psflags()
432 static inline void cppi5_hdesc_set_psflags(struct cppi5_host_desc_t *desc, in cppi5_hdesc_set_psflags() argument
435 WARN_ON(!desc); in cppi5_hdesc_set_psflags()
437 desc->hdr.pkt_info1 |= (ps_flags << in cppi5_hdesc_set_psflags()
446 static inline u32 cppi5_hdesc_get_pkttype(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_pkttype() argument
448 WARN_ON(!desc); in cppi5_hdesc_get_pkttype()
450 return (desc->hdr.pkt_info2 & CPPI5_INFO2_HDESC_PKTTYPE_MASK) >> in cppi5_hdesc_get_pkttype()
459 static inline void cppi5_hdesc_set_pkttype(struct cppi5_host_desc_t *desc, in cppi5_hdesc_set_pkttype() argument
462 WARN_ON(!desc); in cppi5_hdesc_set_pkttype()
463 desc->hdr.pkt_info2 |= in cppi5_hdesc_set_pkttype()
478 static inline void cppi5_hdesc_attach_buf(struct cppi5_host_desc_t *desc, in cppi5_hdesc_attach_buf() argument
482 WARN_ON(!desc); in cppi5_hdesc_attach_buf()
485 desc->buf_ptr = buf; in cppi5_hdesc_attach_buf()
486 desc->buf_info1 = buf_data_len & CPPI5_BUFINFO1_HDESC_DATA_LEN_MASK; in cppi5_hdesc_attach_buf()
487 desc->org_buf_ptr = obuf; in cppi5_hdesc_attach_buf()
488 desc->org_buf_len = obuf_len & CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK; in cppi5_hdesc_attach_buf()
491 static inline void cppi5_hdesc_get_obuf(struct cppi5_host_desc_t *desc, in cppi5_hdesc_get_obuf() argument
494 WARN_ON(!desc); in cppi5_hdesc_get_obuf()
498 *obuf = desc->org_buf_ptr; in cppi5_hdesc_get_obuf()
499 *obuf_len = desc->org_buf_len & CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK; in cppi5_hdesc_get_obuf()
502 static inline void cppi5_hdesc_reset_to_original(struct cppi5_host_desc_t *desc) in cppi5_hdesc_reset_to_original() argument
504 WARN_ON(!desc); in cppi5_hdesc_reset_to_original()
506 desc->buf_ptr = desc->org_buf_ptr; in cppi5_hdesc_reset_to_original()
507 desc->buf_info1 = desc->org_buf_len; in cppi5_hdesc_reset_to_original()
517 static inline void cppi5_hdesc_link_hbdesc(struct cppi5_host_desc_t *desc, in cppi5_hdesc_link_hbdesc() argument
520 WARN_ON(!desc); in cppi5_hdesc_link_hbdesc()
523 desc->next_desc = hbuf_desc; in cppi5_hdesc_link_hbdesc()
527 struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_next_hbdesc() argument
529 WARN_ON(!desc); in cppi5_hdesc_get_next_hbdesc()
531 return (dma_addr_t)desc->next_desc; in cppi5_hdesc_get_next_hbdesc()
534 static inline void cppi5_hdesc_reset_hbdesc(struct cppi5_host_desc_t *desc) in cppi5_hdesc_reset_hbdesc() argument
536 WARN_ON(!desc); in cppi5_hdesc_reset_hbdesc()
538 desc->hdr = (struct cppi5_desc_hdr_t) { 0 }; in cppi5_hdesc_reset_hbdesc()
539 desc->next_desc = 0; in cppi5_hdesc_reset_hbdesc()
561 static inline void *cppi5_hdesc_get_psdata(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_psdata() argument
566 WARN_ON(!desc); in cppi5_hdesc_get_psdata()
568 if (desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION) in cppi5_hdesc_get_psdata()
571 psdata_size = (desc->hdr.pkt_info0 & in cppi5_hdesc_get_psdata()
578 psdata = &desc->epib; in cppi5_hdesc_get_psdata()
580 if (cppi5_hdesc_epib_present(&desc->hdr)) in cppi5_hdesc_get_psdata()
586 static inline u32 *cppi5_hdesc_get_psdata32(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_psdata32() argument
588 return (u32 *)cppi5_hdesc_get_psdata(desc); in cppi5_hdesc_get_psdata32()
598 static inline void *cppi5_hdesc_get_swdata(struct cppi5_host_desc_t *desc) in cppi5_hdesc_get_swdata() argument
603 WARN_ON(!desc); in cppi5_hdesc_get_swdata()
605 if (!(desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION)) in cppi5_hdesc_get_swdata()
606 psdata_size = (desc->hdr.pkt_info0 & in cppi5_hdesc_get_swdata()
610 swdata = &desc->epib; in cppi5_hdesc_get_swdata()
612 if (cppi5_hdesc_epib_present(&desc->hdr)) in cppi5_hdesc_get_swdata()