Lines Matching defs:desc
84 struct at_desc *desc = NULL;
88 desc = dma_pool_alloc(atdma->dma_desc_pool, gfp_flags, &phys);
89 if (desc) {
90 memset(desc, 0, sizeof(struct at_desc));
91 INIT_LIST_HEAD(&desc->tx_list);
92 dma_async_tx_descriptor_init(&desc->txd, chan);
94 desc->txd.flags = DMA_CTRL_ACK;
95 desc->txd.tx_submit = atc_tx_submit;
96 desc->txd.phys = phys;
99 return desc;
108 struct at_desc *desc, *_desc;
114 list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
116 if (async_tx_test_ack(&desc->txd)) {
117 list_del(&desc->desc_node);
118 ret = desc;
122 "desc %p not ACKed\n", desc);
147 * @desc: descriptor, at the head of a chain, to move to free list
149 static void atc_desc_put(struct at_dma_chan *atchan, struct at_desc *desc)
151 if (desc) {
155 list_for_each_entry(child, &desc->tx_list, desc_node)
157 "moving child desc %p to freelist\n",
159 list_splice_init(&desc->tx_list, &atchan->free_list);
161 "moving desc %p to freelist\n", desc);
162 list_add(&desc->desc_node, &atchan->free_list);
170 * @desc: descriptor to asign cookie for
175 atc_assign_cookie(struct at_dma_chan *atchan, struct at_desc *desc)
183 desc->txd.cookie = cookie;
234 * @desc: descriptor at the head of the chain we want do complete
238 atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc)
242 struct dma_async_tx_descriptor *txd = &desc->txd;
252 list_splice_init(&desc->tx_list, &atchan->free_list);
254 list_move(&desc->desc_node, &atchan->free_list);
262 desc->lli.daddr,
263 desc->len, DMA_FROM_DEVICE);
266 desc->lli.daddr,
267 desc->len, DMA_FROM_DEVICE);
272 desc->lli.saddr,
273 desc->len, DMA_TO_DEVICE);
276 desc->lli.saddr,
277 desc->len, DMA_TO_DEVICE);
302 struct at_desc *desc, *_desc;
320 list_for_each_entry_safe(desc, _desc, &list, desc_node)
321 atc_chain_complete(atchan, desc);
332 struct at_desc *desc, *_desc;
337 list_for_each_entry_safe(desc, _desc, &atchan->active_list, desc_node) {
338 if (!(desc->lli.ctrla & ATC_DONE))
342 list_for_each_entry(child, &desc->tx_list, desc_node)
351 atc_chain_complete(atchan, desc);
489 * @desc: descriptor at the head of the transaction chain
497 struct at_desc *desc = txd_to_at_desc(tx);
502 cookie = atc_assign_cookie(atchan, desc);
506 desc->txd.cookie);
507 atc_dostart(atchan, desc);
508 list_add_tail(&desc->desc_node, &atchan->active_list);
511 desc->txd.cookie);
512 list_add_tail(&desc->desc_node, &atchan->queue);
533 struct at_desc *desc = NULL;
576 desc = atc_desc_get(atchan);
577 if (!desc)
580 desc->lli.saddr = src + offset;
581 desc->lli.daddr = dest + offset;
582 desc->lli.ctrla = ctrla | xfer_count;
583 desc->lli.ctrlb = ctrlb;
585 desc->txd.cookie = 0;
586 async_tx_ack(&desc->txd);
589 first = desc;
592 prev->lli.dscr = desc->txd.phys;
594 list_add_tail(&desc->desc_node,
597 prev = desc;
605 set_desc_eol(desc);
607 desc->txd.flags = flags; /* client is in control of this ack */
665 struct at_desc *desc;
669 desc = atc_desc_get(atchan);
670 if (!desc)
679 desc->lli.saddr = mem;
680 desc->lli.daddr = reg;
681 desc->lli.ctrla = ctrla
684 desc->lli.ctrlb = ctrlb;
687 first = desc;
690 prev->lli.dscr = desc->txd.phys;
692 list_add_tail(&desc->desc_node,
695 prev = desc;
707 struct at_desc *desc;
711 desc = atc_desc_get(atchan);
712 if (!desc)
721 desc->lli.saddr = reg;
722 desc->lli.daddr = mem;
723 desc->lli.ctrla = ctrla
726 desc->lli.ctrlb = ctrlb;
729 first = desc;
732 prev->lli.dscr = desc->txd.phys;
734 list_add_tail(&desc->desc_node,
737 prev = desc;
768 struct at_desc *desc, *_desc;
794 list_for_each_entry_safe(desc, _desc, &list, desc_node)
795 atc_chain_complete(atchan, desc);
875 struct at_desc *desc;
911 desc = atc_alloc_descriptor(chan, GFP_KERNEL);
912 if (!desc) {
917 list_add_tail(&desc->desc_node, &tmp_list);
944 struct at_desc *desc, *_desc;
955 list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
956 dev_vdbg(chan2dev(chan), " freeing descriptor %p\n", desc);
957 list_del(&desc->desc_node);
959 dma_pool_free(atdma->dma_desc_pool, desc, desc->txd.phys);