/* Overwrites data length in the descriptor. 
This function overwrites data length in the descriptor */
void dmacHw_setDataLength(dmacHw_CONFIG_t *pConfig, void *pDescriptor, size_t dataLen)
/* Overwrites data length in the descriptor. 
This function overwrites data length in the descriptor */
void dmacHw_setDataLength(dmacHw_CONFIG_t *pConfig, void *pDescriptor, size_t dataLen)
{
	dmacHw_DESC_t *pProg;
	dmacHw_DESC_t *pHead;
	int srcTs = 0;
	int srcTrSize = 0;
	pHead = (dmacHw_GET_DESC_RING(pDescriptor))->pHead;
	pProg = pHead;
	srcTrSize = dmacHw_GetTrWidthInBytes(pConfig->srcMaxTransactionWidth);
	srcTs = dataLen / srcTrSize;
	do {
		pProg->ctl.hi = srcTs & dmacHw_REG_CTL_BLOCK_TS_MASK;
		pProg = (dmacHw_DESC_t *) pProg->llp;
	} while (pProg != pHead);
}