kernels/linux-2.4.0/drivers/net/winbond-840.c
/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
Initialize the Rx and Tx rings, along with various 'dev' bits.
Initialize the Rx and Tx rings along with various ' dev ' bits .
static int alloc_ring(struct net_device *dev)
{
	struct netdev_private *np = (struct netdev_private *)dev->priv;
	np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
	np->rx_ring = pci_alloc_consistent(np->pdev,
			sizeof(struct w840_rx_desc)*RX_RING_SIZE +
			sizeof(struct w840_tx_desc)*TX_RING_SIZE,
			&np->ring_dma_addr);
	if(!np->rx_ring)
		return -ENOMEM;
	init_rxtx_rings(dev);
	return 0;
}
static int alloc_ring ( struct net_device * dev ) { struct netdev_private * np = ( struct netdev_private * ) dev -> priv ; np -> rx_buf_sz = ( dev -> mtu <= 1500 ? PKT_BUF_SZ : dev -> mtu + 32 ) ; np -> rx_ring = pci_alloc_consistent ( np -> pdev , sizeof ( struct w840_rx_desc ) * RX_RING_SIZE + sizeof ( struct w840_tx_desc ) * TX_RING_SIZE , & np -> ring_dma_addr ) ; if ( ! np -> rx_ring ) return - ENOMEM ; init_rxtx_rings ( dev ) ; return 0 ; }
Initialize the Rx and Tx rings, along with various 'dev' bits.
Initialize the Rx and Tx rings along with various ' dev ' bits .