/* Initialize a descriptor ring. Calxeda XGMAC is configured to use advanced descriptors.  */
static void init_rx_desc(struct calxeda_eth_dev *priv)
/* Initialize a descriptor ring. Calxeda XGMAC is configured to use advanced descriptors.  */
static void init_rx_desc(struct calxeda_eth_dev *priv)
{
	struct xgmac_dma_desc *rxdesc = priv->rx_chain;
	struct xgmac_regs *regs = (struct xgmac_regs *)priv->dev->iobase;
	void *rxbuffer = priv->rxbuffer;
	int i;
	desc_init_rx_desc(rxdesc, RX_NUM_DESC, ETH_BUF_SZ);
	writel((ulong)rxdesc, &regs->rxdesclist);
	for (i = 0; i < RX_NUM_DESC; i++) {
		desc_set_buf_addr(rxdesc + i, rxbuffer + (i * ETH_BUF_SZ),
				  ETH_BUF_SZ);
		desc_set_rx_owner(rxdesc + i);
	}
}