static void corkscrew_setup(struct net_device *dev, int ioaddr, 
static int corkscrew_setup(struct net_device *dev, int ioaddr, 
static void corkscrew_setup(struct net_device *dev, int ioaddr,			    struct pnp_dev *idev, int card_number){	struct corkscrew_private *vp = netdev_priv(dev);	unsigned int eeprom[0x40], checksum = 0;	/* EEPROM contents */	int i;	int irq;	if (idev) {		irq = pnp_irq(idev, 0);		vp->dev = &idev->dev;	} else {		irq = inw(ioaddr + 0x2002) & 15;	}	dev->base_addr = ioaddr;	dev->irq = irq;	dev->dma = inw(ioaddr + 0x2000) & 7;	vp->product_name = "3c515";	vp->options = dev->mem_start;	vp->our_dev = dev;	if (!vp->options) {		 if (card_number >= MAX_UNITS)			vp->options = -1;		else			vp->options = options[card_number];	}	if (vp->options >= 0) {		vp->media_override = vp->options & 7;		if (vp->media_override == 2)			vp->media_override = 0;		vp->full_duplex = (vp->options & 8) ? 1 : 0;		vp->bus_master = (vp->options & 16) ? 1 : 0;	} else {		vp->media_override = 7;		vp->full_duplex = 0;		vp->bus_master = 0;	}#ifdef MODULE	list_add(&vp->list, &root_corkscrew_dev);#endif	printk(KERN_INFO "%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr);	spin_lock_init(&vp->lock);		/* Read the station address from the EEPROM. */	EL3WINDOW(0);	for (i = 0; i < 0x18; i++) {		short *phys_addr = (short *) dev->dev_addr;		int timer;		outw(EEPROM_Read + i, ioaddr + Wn0EepromCmd);		/* Pause for at least 162 us. for the read to take place. */		for (timer = 4; timer >= 0; timer--) {			udelay(162);			if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) == 0)				break;		}		eeprom[i] = inw(ioaddr + Wn0EepromData);		checksum ^= eeprom[i];		if (i < 3)			phys_addr[i] = htons(eeprom[i]);	}	checksum = (checksum ^ (checksum >> 8)) & 0xff;	if (checksum != 0x00)		printk(" ***INVALID CHECKSUM %4.4x*** ", checksum);	for (i = 0; i < 6; i++)		printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);	if (eeprom[16] == 0x11c7) {	/* Corkscrew */		if (request_dma(dev->dma, "3c515")) {			printk(", DMA %d allocation failed", dev->dma);			dev->dma = 0;		} else			printk(", DMA %d", dev->dma);	}	printk(", IRQ %d\n", dev->irq);	/* Tell them about an invalid IRQ. */	if (corkscrew_debug && (dev->irq <= 0 || dev->irq > 15))		printk(KERN_WARNING " *** Warning: this IRQ is unlikely to work! ***\n");	{		char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" };		union wn3_config config;		EL3WINDOW(3);		vp->available_media = inw(ioaddr + Wn3_Options);		config.i = inl(ioaddr + Wn3_Config);		if (corkscrew_debug > 1)			printk(KERN_INFO "  Internal config register is %4.4x, transceivers %#x.\n",				config.i, inw(ioaddr + Wn3_Options));		printk(KERN_INFO "  %dK %s-wide RAM %s Rx:Tx split, %s%s interface.\n",			8 << config.u.ram_size,			config.u.ram_width ? "word" : "byte",			ram_split[config.u.ram_split],			config.u.autoselect ? "autoselect/" : "",			media_tbl[config.u.xcvr].name);		dev->if_port = config.u.xcvr;		vp->default_media = config.u.xcvr;		vp->autoselect = config.u.autoselect;	}	if (vp->media_override != 7) {		printk(KERN_INFO "  Media override to transceiver type %d (%s).\n",		       vp->media_override,		       media_tbl[vp->media_override].name);		dev->if_port = vp->media_override;	}	vp->capabilities = eeprom[16];	vp->full_bus_master_tx = (vp->capabilities & 0x20) ? 1 : 0;	/* Rx is broken at 10mbps, so we always disable it. */	/* vp->full_bus_master_rx = 0; */	vp->full_bus_master_rx = (vp->capabilities & 0x20) ? 1 : 0;	/* The 3c51x-specific entries in the device structure. */	dev->open = &corkscrew_open;	dev->hard_start_xmit = &corkscrew_start_xmit;	dev->tx_timeout = &corkscrew_timeout;	dev->watchdog_timeo = (400 * HZ) / 1000;	dev->stop = &corkscrew_close;	dev->get_stats = &corkscrew_get_stats;	dev->set_multicast_list = &set_rx_mode;	dev->ethtool_ops = &netdev_ethtool_ops;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/3c515.c/clean/drivers/net/3c515.c