host-drivers/base-driver/vca/blockio/hal_pci/vcablk_bcknd_hal_pci.c
dma_cookie_t vcablk_bcknd_dma_async(struct dma_chan *dma_ch, dma_addr_t dst,
		dma_addr_t src, size_t len, dma_async_tx_callback callback,
		void *callback_param, struct dma_async_tx_descriptor **out_tx)
{
	dma_cookie_t cookie;

	if (!dma_ch) {
		pr_err("no DMA channel available\n");
		cookie = -ENOMEM;
	} else {
		struct dma_device *ddev = dma_ch->device;
		struct dma_async_tx_descriptor *tx;

		tx = ddev->device_prep_dma_memcpy(dma_ch,  dst, src, len, DMA_PREP_INTERRUPT);
		if(!tx) {
			pr_err("Filed to setup dma tx descriptor! No transfer will be submitted\n");
			cookie = -ENOMEM;
		} else {
			tx->callback = callback;
			tx->callback_param = callback_param;
			if (out_tx) {
				/* It have to be before submitt because callback can be called
				 * in tx_submit() time. */
				*out_tx = tx;
			}
			cookie = tx->tx_submit(tx);
			if (!dma_submit_error(cookie)) {
				dma_async_issue_pending(dma_ch);
			} else {
				if (out_tx) {
					*out_tx = NULL;
				}
				pr_err("%s: Transmit error: %i\n", __func__, cookie);

			}
		}
	}
	return cookie;
}
/*
 * vcablk_bcknd_dma_async - Wrapper for asynchronous DMAs.
 *
 * @dma_ch - The address of the pointer to the device instance used
 * for DMA registration.
 * @dst - destination DMA address.
 * @src - source DMA address.
 * @len - size of the transfer.
 * @callback - callback routine
 * @callback_param - callback params
 * @out_tx - dma tx structure to disable callback when canceled.
 *
 * Return error code or dma cookie on successful transfer submi
 */
Wrapper for asynchronous DMAs.
@dma_ch - The address of the pointer to the device instance used
for DMA registration.
@dst - destination DMA address.
@src - source DMA address.
@len - size of the transfer.

Return error code or dma cookie on successful transfer submi
Wrapper for asynchronous DMAs . @dma_ch - The address of the pointer to the device instance used for DMA registration . @dst - destination DMA address . @src - source DMA address . @len - size of the transfer . Return error code or dma cookie on successful transfer submi
dma_cookie_t vcablk_bcknd_dma_async(struct dma_chan *dma_ch, dma_addr_t dst,
		dma_addr_t src, size_t len, dma_async_tx_callback callback,
		void *callback_param, struct dma_async_tx_descriptor **out_tx)
{
	dma_cookie_t cookie;
	if (!dma_ch) {
		pr_err("no DMA channel available\n");
		cookie = -ENOMEM;
	} else {
		struct dma_device *ddev = dma_ch->device;
		struct dma_async_tx_descriptor *tx;
		tx = ddev->device_prep_dma_memcpy(dma_ch,  dst, src, len, DMA_PREP_INTERRUPT);
		if(!tx) {
			pr_err("Filed to setup dma tx descriptor! No transfer will be submitted\n");
			cookie = -ENOMEM;
		} else {
			tx->callback = callback;
			tx->callback_param = callback_param;
			if (out_tx) {
				*out_tx = tx;
			}
			cookie = tx->tx_submit(tx);
			if (!dma_submit_error(cookie)) {
				dma_async_issue_pending(dma_ch);
			} else {
				if (out_tx) {
					*out_tx = NULL;
				}
				pr_err("%s: Transmit error: %i\n", __func__, cookie);
			}
		}
	}
	return cookie;
}
dma_cookie_t vcablk_bcknd_dma_async ( struct dma_chan * dma_ch , dma_addr_t dst , dma_addr_t src , size_t len , dma_async_tx_callback callback , void * callback_param , struct dma_async_tx_descriptor * * out_tx ) { dma_cookie_t cookie ; if ( ! dma_ch ) { pr_err ( " \n " ) ; cookie = - ENOMEM ; } else { struct dma_device * ddev = dma_ch -> device ; struct dma_async_tx_descriptor * tx ; tx = ddev -> device_prep_dma_memcpy ( dma_ch , dst , src , len , DMA_PREP_INTERRUPT ) ; if ( ! tx ) { pr_err ( " \n " ) ; cookie = - ENOMEM ; } else { tx -> callback = callback ; tx -> callback_param = callback_param ; if ( out_tx ) { * out_tx = tx ; } cookie = tx -> tx_submit ( tx ) ; if ( ! dma_submit_error ( cookie ) ) { dma_async_issue_pending ( dma_ch ) ; } else { if ( out_tx ) { * out_tx = NULL ; } pr_err ( " \n " , __func__ , cookie ) ; } } } return cookie ; }
vcablk_bcknd_dma_async - Wrapper for asynchronous DMAs.
vcablk_bcknd_dma_async - Wrapper for asynchronous DMAs .
/* It have to be before submitt because callback can be called
				 * in tx_submit() time. */