/* Free the receive buffers for each ring slot and any attached socket buffers that need to go away.  */
static void velocity_free_rd_ring(struct velocity_info *vptr)
/* Free the receive buffers for each ring slot and any attached socket buffers that need to go away.  */
static void velocity_free_rd_ring(struct velocity_info *vptr)
{
	int i;
	if (vptr->rx.info == NULL)
		return;
	for (i = 0; i < vptr->options.numrx; i++) {
		struct velocity_rd_info *rd_info = &(vptr->rx.info[i]);
		struct rx_desc *rd = vptr->rx.ring + i;
		memset(rd, 0, sizeof(*rd));
		if (!rd_info->skb)
			continue;
		pci_unmap_single(vptr->pdev, rd_info->skb_dma, vptr->rx.buf_sz,
				 PCI_DMA_FROMDEVICE);
		rd_info->skb_dma = 0;
		dev_kfree_skb(rd_info->skb);
		rd_info->skb = NULL;
	}
	kfree(vptr->rx.info);
	vptr->rx.info = NULL;
}