return 0; 
 return register_netdev(dev); 
static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr){	unsigned short hw_addr[3];	unsigned char buswidth;	unsigned int memory_size;	int i;	unsigned short xsum = 0;	struct net_local *lp = netdev_priv(dev);	printk("%s: EtherExpress 16 at %#x ",dev->name,ioaddr);	outb(ASIC_RST, ioaddr+EEPROM_Ctrl);	outb(0, ioaddr+EEPROM_Ctrl);	udelay(500);	outb(i586_RST, ioaddr+EEPROM_Ctrl);	hw_addr[0] = eexp_hw_readeeprom(ioaddr,2);	hw_addr[1] = eexp_hw_readeeprom(ioaddr,3);	hw_addr[2] = eexp_hw_readeeprom(ioaddr,4);	/* Standard Address or Compaq LTE Address */	if (!((hw_addr[2]==0x00aa && ((hw_addr[1] & 0xff00)==0x0000)) ||	      (hw_addr[2]==0x0080 && ((hw_addr[1] & 0xff00)==0x5F00)))) 	{		printk(" rejected: invalid address %04x%04x%04x\n",			hw_addr[2],hw_addr[1],hw_addr[0]);		return -ENODEV;	}	/* Calculate the EEPROM checksum.  Carry on anyway if it's bad,	 * though.	 */	for (i = 0; i < 64; i++)		xsum += eexp_hw_readeeprom(ioaddr, i);	if (xsum != 0xbaba)		printk(" (bad EEPROM xsum 0x%02x)", xsum);	dev->base_addr = ioaddr;	for ( i=0 ; i<6 ; i++ )		dev->dev_addr[i] = ((unsigned char *)hw_addr)[5-i];	{		static char irqmap[]={0, 9, 3, 4, 5, 10, 11, 0};		unsigned short setupval = eexp_hw_readeeprom(ioaddr,0);		/* Use the IRQ from EEPROM if none was given */		if (!dev->irq)			dev->irq = irqmap[setupval>>13];		if (dev->if_port == 0xff) {			dev->if_port = !(setupval & 0x1000) ? AUI :				eexp_hw_readeeprom(ioaddr,5) & 0x1 ? TPE : BNC;		}		buswidth = !((setupval & 0x400) >> 10);	}	memset(lp, 0, sizeof(struct net_local));	spin_lock_init(&lp->lock); 	printk("(IRQ %d, %s connector, %d-bit bus", dev->irq,  	       eexp_ifmap[dev->if_port], buswidth?8:16); 	if (!request_region(dev->base_addr + 0x300e, 1, "EtherExpress"))		return -EBUSY; 	eexp_hw_set_interface(dev); 	release_region(dev->base_addr + 0x300e, 1);  	/* Find out how much RAM we have on the card */	outw(0, dev->base_addr + WRITE_PTR);	for (i = 0; i < 32768; i++)		outw(0, dev->base_addr + DATAPORT);        for (memory_size = 0; memory_size < 64; memory_size++)	{		outw(memory_size<<10, dev->base_addr + READ_PTR);		if (inw(dev->base_addr+DATAPORT))			break;		outw(memory_size<<10, dev->base_addr + WRITE_PTR);		outw(memory_size | 0x5000, dev->base_addr+DATAPORT);		outw(memory_size<<10, dev->base_addr + READ_PTR);		if (inw(dev->base_addr+DATAPORT) != (memory_size | 0x5000))			break;	}	/* Sort out the number of buffers.  We may have 16, 32, 48 or 64k	 * of RAM to play with.	 */	lp->num_tx_bufs = 4;	lp->rx_buf_end = 0x3ff6;	switch (memory_size)	{	case 64:		lp->rx_buf_end += 0x4000;	case 48:		lp->num_tx_bufs += 4;		lp->rx_buf_end += 0x4000;	case 32:		lp->rx_buf_end += 0x4000;	case 16:		printk(", %dk RAM)\n", memory_size);		break;	default:		printk(") bad memory size (%dk).\n", memory_size);		return -ENODEV;		break;	}	lp->rx_buf_start = TX_BUF_START + (lp->num_tx_bufs*TX_BUF_SIZE);	lp->width = buswidth;	dev->open = eexp_open;	dev->stop = eexp_close;	dev->hard_start_xmit = eexp_xmit;	dev->get_stats = eexp_stats;	dev->set_multicast_list = &eexp_set_multicast;	dev->tx_timeout = eexp_timeout;	dev->watchdog_timeo = 2*HZ;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/eexpress.c/clean/drivers/net/eexpress.c