/* Note that if 7 descriptors are allocated, it's perfectly acceptable to initialize the ring with a smaller number of descriptors. The amount of memory allocated for the descriptor ring will not be reduced, and the descriptor ring may be reinitialized later */
int dma_init_descriptor_ring(DMA_DescriptorRing_t *ring, int numDescriptors)
/* Note that if 7 descriptors are allocated, it's perfectly acceptable to initialize the ring with a smaller number of descriptors. The amount of memory allocated for the descriptor ring will not be reduced, and the descriptor ring may be reinitialized later */
int dma_init_descriptor_ring(DMA_DescriptorRing_t *ring, int numDescriptors)
{
	if (ring->virtAddr == NULL) {
		return -EINVAL;
	}
	if (dmacHw_initDescriptor(ring->virtAddr,
				  ring->physAddr,
				  ring->bytesAllocated, numDescriptors) < 0) {
		printk(KERN_ERR
		       "dma_init_descriptor_ring: dmacHw_initDescriptor failed\n");
		return -ENOMEM;
	}
	return 0;
}