dev->ethtool_ops	= &e100_ethtool_ops; 
etrax_ethernet_init(void){	struct net_device *dev;        struct net_local* np;	int i, err;	printk(KERN_INFO	       "ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000-2003 Axis Communications AB\n");	dev = alloc_etherdev(sizeof(struct net_local));	np = dev->priv;	if (!dev)		return -ENOMEM;	dev->base_addr = (unsigned int)R_NETWORK_SA_0; /* just to have something to show */	/* now setup our etrax specific stuff */	dev->irq = NETWORK_DMA_RX_IRQ_NBR; /* we really use DMATX as well... */	dev->dma = NETWORK_RX_DMA_NBR;	/* fill in our handlers so the network layer can talk to us in the future */	dev->open               = e100_open;	dev->hard_start_xmit    = e100_send_packet;	dev->stop               = e100_close;	dev->get_stats          = e100_get_stats;	dev->set_multicast_list = set_multicast_list;	dev->set_mac_address    = e100_set_mac_address;	dev->do_ioctl           = e100_ioctl;	dev->set_config		= e100_set_config;	dev->tx_timeout         = e100_tx_timeout;	/* Initialise the list of Etrax DMA-descriptors */	/* Initialise receive descriptors */	for (i = 0; i < NBR_OF_RX_DESC; i++) {		/* Allocate two extra cachelines to make sure that buffer used by DMA		 * does not share cacheline with any other data (to avoid cache bug)		 */		RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES);		RxDescList[i].descr.ctrl   = 0;		RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE;		RxDescList[i].descr.next   = virt_to_phys(&RxDescList[i + 1]);		RxDescList[i].descr.buf    = L1_CACHE_ALIGN(virt_to_phys(RxDescList[i].skb->data));		RxDescList[i].descr.status = 0;		RxDescList[i].descr.hw_len = 0;		prepare_rx_descriptor(&RxDescList[i].descr);	}	RxDescList[NBR_OF_RX_DESC - 1].descr.ctrl   = d_eol;	RxDescList[NBR_OF_RX_DESC - 1].descr.next   = virt_to_phys(&RxDescList[0]);	rx_queue_len = 0;	/* Initialize transmit descriptors */	for (i = 0; i < NBR_OF_TX_DESC; i++) {		TxDescList[i].descr.ctrl   = 0;		TxDescList[i].descr.sw_len = 0;		TxDescList[i].descr.next   = virt_to_phys(&TxDescList[i + 1].descr);		TxDescList[i].descr.buf    = 0;		TxDescList[i].descr.status = 0;		TxDescList[i].descr.hw_len = 0;		TxDescList[i].skb = 0;	}	TxDescList[NBR_OF_TX_DESC - 1].descr.ctrl   = d_eol;	TxDescList[NBR_OF_TX_DESC - 1].descr.next   = virt_to_phys(&TxDescList[0].descr);	/* Initialise initial pointers */	myNextRxDesc  = &RxDescList[0];	myLastRxDesc  = &RxDescList[NBR_OF_RX_DESC - 1];	myPrevRxDesc  = &RxDescList[NBR_OF_RX_DESC - 1];	myFirstTxDesc = &TxDescList[0];	myNextTxDesc  = &TxDescList[0];	myLastTxDesc  = &TxDescList[NBR_OF_TX_DESC - 1];	/* Register device */	err = register_netdev(dev);	if (err) {		free_netdev(dev);		return err;	}	/* set the default MAC address */	e100_set_mac_address(dev, &default_mac);	/* Initialize speed indicator stuff. */	current_speed = 10;	current_speed_selection = 0; /* Auto */	speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;        duplex_timer.data = (unsigned long)dev;	speed_timer.function = e100_check_speed;	clear_led_timer.function = e100_clear_network_leds;	full_duplex = 0;	current_duplex = autoneg;	duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL;        duplex_timer.data = (unsigned long)dev;	duplex_timer.function = e100_check_duplex;        /* Initialize mii interface */	np->mii_if.phy_id = mdio_phy_addr;	np->mii_if.phy_id_mask = 0x1f;	np->mii_if.reg_num_mask = 0x1f;	np->mii_if.dev = dev;	np->mii_if.mdio_read = e100_get_mdio_reg;	np->mii_if.mdio_write = e100_set_mdio_reg;	/* Initialize group address registers to make sure that no */	/* unwanted addresses are matched */	*R_NETWORK_GA_0 = 0x00000000;	*R_NETWORK_GA_1 = 0x00000000;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/76f2b4d98c3d6a88a260275acbede99c23a24d60/eth_v10.c/buggy/drivers/net/cris/eth_v10.c