XilinxProcessorIPLib/drivers/axicdma/src/xaxicdma_bdring.c
int XAxiCdma_BdRingStartTransfer(XAxiCdma *InstancePtr)
{

	if (InstancePtr->SimpleOnlyBuild) {
		return XST_FAILURE;
	}

	/* If no BDs need to be transferred, we are done
	 */
	if (InstancePtr->HwBdCnt == 0) {
		return XST_SUCCESS;
	}

	/* See whether hardware is in simple mode
	 */
	if (XAxiCdma_IsSimpleMode(InstancePtr)) {
		/* Cannot switch to SG mode
		 */
		if ((InstancePtr->SimpleNotDone) ||
		    (XAxiCdma_SwitchMode(InstancePtr, XAXICDMA_SG_MODE)
			!= XST_SUCCESS)) {
			return XST_FAILURE;
		}
	}

	/* Now it is in SG mode, update the tail pointer to start the
	 * SG transfer
	 */
	XAxiCdma_BdSetTailBdPtr(InstancePtr,
                XAxiCdma_BdGetPhysAddr((XAxiCdma_Bd *)InstancePtr->HwBdTail));


	InstancePtr->SGWaiting = 0;

	return XST_SUCCESS;
}
/*****************************************************************************/
/*
 * This function tries to start the SG transfer that has been submitted to
 * the driver, however, not to the hardware yet, because the hardware was
 * doing a simple transfer at the time of submit.
 *
 * This function should be called when the simple transfer is done.
 *
 * @param	InstancePtr is the driver instance we are working on
 *
 * @return
 *		- XST_SUCCESS if BD ring has been successfully started,
 *		SGWaiting will be 0
 *		- XST_FAILURE if BD ring cannot be be started, either because
 *		the hardware is simple only build or cannot switch to SG mode.
 *
 * @note	None.
 *
 *****************************************************************************/
This function tries to start the SG transfer that has been submitted to
the driver, however, not to the hardware yet, because the hardware was
doing a simple transfer at the time of submit.

This function should be called when the simple transfer is done.

@param       InstancePtr is the driver instance we are working on

@return
- XST_SUCCESS if BD ring has been successfully started,
SGWaiting will be 0
- XST_FAILURE if BD ring cannot be be started, either because
the hardware is simple only build or cannot switch to SG mode.

@note        None.
This function tries to start the SG transfer that has been submitted to the driver however not to the hardware yet because the hardware was doing a simple transfer at the time of submit . This function should be called when the simple transfer is done . @param InstancePtr is the driver instance we are working on @return - XST_SUCCESS if BD ring has been successfully started SGWaiting will be 0 - XST_FAILURE if BD ring cannot be be started either because the hardware is simple only build or cannot switch to SG mode . @note None .
int XAxiCdma_BdRingStartTransfer(XAxiCdma *InstancePtr)
{
	if (InstancePtr->SimpleOnlyBuild) {
		return XST_FAILURE;
	}
	if (InstancePtr->HwBdCnt == 0) {
		return XST_SUCCESS;
	}
	if (XAxiCdma_IsSimpleMode(InstancePtr)) {
		if ((InstancePtr->SimpleNotDone) ||
		    (XAxiCdma_SwitchMode(InstancePtr, XAXICDMA_SG_MODE)
			!= XST_SUCCESS)) {
			return XST_FAILURE;
		}
	}
	XAxiCdma_BdSetTailBdPtr(InstancePtr,
                XAxiCdma_BdGetPhysAddr((XAxiCdma_Bd *)InstancePtr->HwBdTail));
	InstancePtr->SGWaiting = 0;
	return XST_SUCCESS;
}
int XAxiCdma_BdRingStartTransfer ( XAxiCdma * InstancePtr ) { if ( InstancePtr -> SimpleOnlyBuild ) { return XST_FAILURE ; } if ( InstancePtr -> HwBdCnt == 0 ) { return XST_SUCCESS ; } if ( XAxiCdma_IsSimpleMode ( InstancePtr ) ) { if ( ( InstancePtr -> SimpleNotDone ) || ( XAxiCdma_SwitchMode ( InstancePtr , XAXICDMA_SG_MODE ) != XST_SUCCESS ) ) { return XST_FAILURE ; } } XAxiCdma_BdSetTailBdPtr ( InstancePtr , XAxiCdma_BdGetPhysAddr ( ( XAxiCdma_Bd * ) InstancePtr -> HwBdTail ) ) ; InstancePtr -> SGWaiting = 0 ; return XST_SUCCESS ; }
This function tries to start the SG transfer that has been submitted to
 the driver, however, not to the hardware yet, because the hardware was
 doing a simple transfer at the time of submit.
This function tries to start the SG transfer that has been submitted to the driver however not to the hardware yet because the hardware was doing a simple transfer at the time of submit .
/* If no BDs need to be transferred, we are done
	 */ /* See whether hardware is in simple mode
	 */ /* Cannot switch to SG mode
		 */ /* Now it is in SG mode, update the tail pointer to start the
	 * SG transfer
	 */