#endif  #ifdef CONFIG_NET_POLL_CONTROLLER dev->poll_controller = mv643xx_netpoll; 
static int mv643xx_eth_probe(struct device *ddev){	struct platform_device *pdev = to_platform_device(ddev);	struct mv643xx_eth_platform_data *pd;	int port_num = pdev->id;	struct mv643xx_private *mp;	struct net_device *dev;	u8 *p;	struct resource *res;	int err;	dev = alloc_etherdev(sizeof(struct mv643xx_private));	if (!dev)		return -ENOMEM;	dev_set_drvdata(ddev, dev);	mp = netdev_priv(dev);	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);	BUG_ON(!res);	dev->irq = res->start;	mp->port_num = port_num;	dev->open = mv643xx_eth_open;	dev->stop = mv643xx_eth_stop;	dev->hard_start_xmit = mv643xx_eth_start_xmit;	dev->get_stats = mv643xx_eth_get_stats;	dev->set_mac_address = mv643xx_eth_set_mac_address;	dev->set_multicast_list = mv643xx_eth_set_rx_mode;	/* No need to Tx Timeout */	dev->tx_timeout = mv643xx_eth_tx_timeout;#ifdef MV643XX_NAPI	dev->poll = mv643xx_poll;	dev->weight = 64;#endif	dev->watchdog_timeo = 2 * HZ;	dev->tx_queue_len = mp->tx_ring_size;	dev->base_addr = 0;	dev->change_mtu = mv643xx_eth_change_mtu;	SET_ETHTOOL_OPS(dev, &mv643xx_ethtool_ops);#ifdef MV643XX_CHECKSUM_OFFLOAD_TX#ifdef MAX_SKB_FRAGS	/*	 * Zero copy can only work if we use Discovery II memory. Else, we will	 * have to map the buffers to ISA memory which is only 16 MB	 */	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HW_CSUM;#endif#endif	/* Configure the timeout task */	INIT_WORK(&mp->tx_timeout_task,			(void (*)(void *))mv643xx_eth_tx_timeout_task, dev);	spin_lock_init(&mp->lock);	/* set default config values */	eth_port_uc_addr_get(dev, dev->dev_addr);	mp->port_config = MV643XX_ETH_PORT_CONFIG_DEFAULT_VALUE;	mp->port_config_extend = MV643XX_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE;	mp->port_sdma_config = MV643XX_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE;	mp->port_serial_control = MV643XX_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE;	mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE;	mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE;	pd = pdev->dev.platform_data;	if (pd) {		if (pd->mac_addr != NULL)			memcpy(dev->dev_addr, pd->mac_addr, 6);		if (pd->phy_addr || pd->force_phy_addr)			ethernet_phy_set(port_num, pd->phy_addr);		if (pd->port_config || pd->force_port_config)			mp->port_config = pd->port_config;		if (pd->port_config_extend || pd->force_port_config_extend)			mp->port_config_extend = pd->port_config_extend;		if (pd->port_sdma_config || pd->force_port_sdma_config)			mp->port_sdma_config = pd->port_sdma_config;		if (pd->port_serial_control || pd->force_port_serial_control)			mp->port_serial_control = pd->port_serial_control;		if (pd->rx_queue_size)			mp->rx_ring_size = pd->rx_queue_size;		if (pd->tx_queue_size)			mp->tx_ring_size = pd->tx_queue_size;		if (pd->tx_sram_size) {			mp->tx_sram_size = pd->tx_sram_size;			mp->tx_sram_addr = pd->tx_sram_addr;		}		if (pd->rx_sram_size) {			mp->rx_sram_size = pd->rx_sram_size;			mp->rx_sram_addr = pd->rx_sram_addr;		}	}	err = ethernet_phy_detect(port_num);	if (err) {		pr_debug("MV643xx ethernet port %d: "					"No PHY detected at addr %d\n",					port_num, ethernet_phy_get(port_num));		return err;	}	err = register_netdev(dev);	if (err)		goto out;	p = dev->dev_addr;	printk(KERN_NOTICE		"%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",		dev->name, port_num, p[0], p[1], p[2], p[3], p[4], p[5]);	if (dev->features & NETIF_F_SG)		printk(KERN_NOTICE "%s: Scatter Gather Enabled\n", dev->name);	if (dev->features & NETIF_F_IP_CSUM)		printk(KERN_NOTICE "%s: TX TCP/IP Checksumming Supported\n",								dev->name);#ifdef MV643XX_CHECKSUM_OFFLOAD_TX	printk(KERN_NOTICE "%s: RX TCP/UDP Checksum Offload ON \n", dev->name);#endif#ifdef MV643XX_COAL	printk(KERN_NOTICE "%s: TX and RX Interrupt Coalescing ON \n",								dev->name);#endif#ifdef MV643XX_NAPI	printk(KERN_NOTICE "%s: RX NAPI Enabled \n", dev->name);#endif	return 0;out:	free_netdev(dev);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/63c9e549148fb95c11befb4f255c84ded9277f89/mv643xx_eth.c/clean/drivers/net/mv643xx_eth.c