Lines Matching +full:dma +full:- +full:info

1 /* SPDX-License-Identifier: GPL-2.0+ */
11 * with the Frame DMA engine on multiple Microchip switchcores.
13 * Frame DMA DCB format:
15 * +---------------------------+
17 * +---------------------------+
18 * | Reserved | Info |
19 * +---------------------------+
21 * +---------------------------+
23 * +---------------------------+
25 * +---------------------------+
27 * +---------------------------+
29 * +---------------------------+
31 * |-------------|-------------|
37 * |---------------------------|
39 * +-------------|-------------+
41 * +-------------|-------------+
44 * addresses of the data pointers can, as of writing, be either a: DMA address,
73 u64 info; member
78 /* User-provided callback to set the dataptr */
80 /* User-provided callback to set the nextptr */
91 /* DMA address */
92 dma_addr_t dma; member
97 /* Indexes used to access the next-to-be-used DCB or DB */
117 fdma->dcb_index++; in fdma_dcb_advance()
118 if (fdma->dcb_index >= fdma->n_dcbs) in fdma_dcb_advance()
119 fdma->dcb_index = 0; in fdma_dcb_advance()
125 fdma->db_index++; in fdma_db_advance()
131 fdma->db_index = 0; in fdma_db_reset()
137 return fdma->db_index != fdma->n_dbs; in fdma_dcb_is_reusable()
143 return db->status & FDMA_DCB_STATUS_DONE; in fdma_db_is_done()
149 return FDMA_DCB_STATUS_BLOCKL(db->status); in fdma_db_len_get()
155 dcb->info = FDMA_DCB_INFO_DATAL(len); in fdma_dcb_len_set()
162 return &fdma->dcbs[dcb_idx].db[db_idx]; in fdma_db_get()
168 return fdma_db_get(fdma, fdma->dcb_index, fdma->db_index); in fdma_db_next_get()
174 return &fdma->dcbs[dcb_idx]; in fdma_dcb_get()
180 return fdma_dcb_get(fdma, fdma->dcb_index); in fdma_dcb_next_get()
192 *nextptr = fdma->dma + (sizeof(struct fdma_dcb) * dcb_idx); in fdma_nextptr_cb()
196 /* Get the DMA address of a dataptr, by index. This function is only applicable
203 return fdma->dma + (sizeof(struct fdma_dcb) * fdma->n_dcbs) + in fdma_dataptr_get_contiguous()
204 (dcb_idx * fdma->n_dbs + db_idx) * fdma->db_size + in fdma_dataptr_get_contiguous()
215 return (u8 *)fdma->dcbs + (sizeof(struct fdma_dcb) * fdma->n_dcbs) + in fdma_dataptr_virt_get_contiguous()
216 (dcb_idx * fdma->n_dbs + db_idx) * fdma->db_size + in fdma_dataptr_virt_get_contiguous()
223 return dcb == fdma->last_dcb; in fdma_is_last()
226 int fdma_dcbs_init(struct fdma *fdma, u64 info, u64 status);
228 int fdma_dcb_add(struct fdma *fdma, int dcb_idx, u64 info, u64 status);
229 int __fdma_dcb_add(struct fdma *fdma, int dcb_idx, u64 info, u64 status,