Lines Matching refs:desc

65 	struct hsu_dma_desc *desc = hsuc->desc;
85 count = desc->nents - desc->active;
87 hsu_chan_writel(hsuc, HSU_CH_DxSAR(i), desc->sg[i].addr);
88 hsu_chan_writel(hsuc, HSU_CH_DxTSR(i), desc->sg[i].len);
94 desc->active++;
123 hsuc->desc = NULL;
128 hsuc->desc = to_hsu_dma_desc(vdesc);
214 struct hsu_dma_desc *desc;
225 desc = hsuc->desc;
226 if (desc) {
228 desc->status = DMA_ERROR;
229 } else if (desc->active < desc->nents) {
232 vchan_cookie_complete(&desc->vdesc);
233 desc->status = DMA_COMPLETE;
234 stat->bytes_transferred += desc->length;
246 struct hsu_dma_desc *desc;
248 desc = kzalloc(sizeof(*desc), GFP_NOWAIT);
249 if (!desc)
252 desc->sg = kcalloc(nents, sizeof(*desc->sg), GFP_NOWAIT);
253 if (!desc->sg) {
254 kfree(desc);
258 return desc;
263 struct hsu_dma_desc *desc = to_hsu_dma_desc(vdesc);
265 kfree(desc->sg);
266 kfree(desc);
275 struct hsu_dma_desc *desc;
279 desc = hsu_dma_alloc_desc(sg_len);
280 if (!desc)
284 desc->sg[i].addr = sg_dma_address(sg);
285 desc->sg[i].len = sg_dma_len(sg);
287 desc->length += sg_dma_len(sg);
290 desc->nents = sg_len;
291 desc->direction = direction;
292 /* desc->active = 0 by kzalloc */
293 desc->status = DMA_IN_PROGRESS;
295 return vchan_tx_prep(&hsuc->vchan, &desc->vdesc, flags);
304 if (vchan_issue_pending(&hsuc->vchan) && !hsuc->desc)
311 struct hsu_dma_desc *desc = hsuc->desc;
315 for (i = desc->active; i < desc->nents; i++)
316 bytes += desc->sg[i].len;
341 if (hsuc->desc && cookie == hsuc->desc->vdesc.tx.cookie) {
344 status = hsuc->desc->status;
370 if (hsuc->desc && hsuc->desc->status == DMA_IN_PROGRESS) {
372 hsuc->desc->status = DMA_PAUSED;
385 if (hsuc->desc && hsuc->desc->status == DMA_PAUSED) {
386 hsuc->desc->status = DMA_IN_PROGRESS;
403 if (hsuc->desc) {
404 hsu_dma_desc_free(&hsuc->desc->vdesc);
405 hsuc->desc = NULL;