retval = register_netdev(dev); if (retval) goto out; 
static int __init ultra_probe1(struct net_device *dev, int ioaddr){	int i, retval;	int checksum = 0;	const char *model_name;	unsigned char eeprom_irq = 0;	static unsigned version_printed;	/* Values from various config regs. */	unsigned char num_pages, irqreg, addr, piomode;	unsigned char idreg = inb(ioaddr + 7);	unsigned char reg4 = inb(ioaddr + 4) & 0x7f;	if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME))		return -EBUSY;	/* Check the ID nibble. */	if ((idreg & 0xF0) != 0x20 			/* SMC Ultra */		&& (idreg & 0xF0) != 0x40) {		/* SMC EtherEZ */		retval = -ENODEV;		goto out;	}	/* Select the station address register set. */	outb(reg4, ioaddr + 4);	for (i = 0; i < 8; i++)		checksum += inb(ioaddr + 8 + i);	if ((checksum & 0xff) != 0xFF) {		retval = -ENODEV;		goto out;	}	if (ei_debug  &&  version_printed++ == 0)		printk(version);	model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ";	printk("%s: %s at %#3x,", dev->name, model_name, ioaddr);	for (i = 0; i < 6; i++)		printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));	/* Switch from the station address to the alternate register set and	   read the useful registers there. */	outb(0x80 | reg4, ioaddr + 4);	/* Enabled FINE16 mode to avoid BIOS ROM width mismatches @ reboot. */	outb(0x80 | inb(ioaddr + 0x0c), ioaddr + 0x0c);	piomode = inb(ioaddr + 0x8);	addr = inb(ioaddr + 0xb);	irqreg = inb(ioaddr + 0xd);	/* Switch back to the station address register set so that the MS-DOS driver	   can find the card after a warm boot. */	outb(reg4, ioaddr + 4);	if (dev->irq < 2) {		unsigned char irqmap[] = {0, 9, 3, 5, 7, 10, 11, 15};		int irq;		/* The IRQ bits are split. */		irq = irqmap[((irqreg & 0x40) >> 4) + ((irqreg & 0x0c) >> 2)];		if (irq == 0) {			printk(", failed to detect IRQ line.\n");			retval =  -EAGAIN;			goto out;		}		dev->irq = irq;		eeprom_irq = 1;	}	/* The 8390 isn't at the base address, so fake the offset */	dev->base_addr = ioaddr+ULTRA_NIC_OFFSET;	{		int addr_tbl[4] = {0x0C0000, 0x0E0000, 0xFC0000, 0xFE0000};		short num_pages_tbl[4] = {0x20, 0x40, 0x80, 0xff};		dev->mem_start = ((addr & 0x0f) << 13) + addr_tbl[(addr >> 6) & 3] ;		num_pages = num_pages_tbl[(addr >> 4) & 3];	}	ei_status.name = model_name;	ei_status.word16 = 1;	ei_status.tx_start_page = START_PG;	ei_status.rx_start_page = START_PG + TX_PAGES;	ei_status.stop_page = num_pages;	ei_status.mem = ioremap(dev->mem_start, (ei_status.stop_page - START_PG)*256);	if (!ei_status.mem) {		printk(", failed to ioremap.\n");		retval =  -ENOMEM;		goto out;	}	dev->mem_end = dev->mem_start + (ei_status.stop_page - START_PG)*256;	if (piomode) {		printk(",%s IRQ %d programmed-I/O mode.\n",			   eeprom_irq ? "EEPROM" : "assigned ", dev->irq);		ei_status.block_input = &ultra_pio_input;		ei_status.block_output = &ultra_pio_output;		ei_status.get_8390_hdr = &ultra_pio_get_hdr;	} else {		printk(",%s IRQ %d memory %#lx-%#lx.\n", eeprom_irq ? "" : "assigned ",			   dev->irq, dev->mem_start, dev->mem_end-1);		ei_status.block_input = &ultra_block_input;		ei_status.block_output = &ultra_block_output;		ei_status.get_8390_hdr = &ultra_get_8390_hdr;	}	ei_status.reset_8390 = &ultra_reset_8390;	dev->open = &ultra_open;	dev->stop = &ultra_close_card;#ifdef CONFIG_NET_POLL_CONTROLLER	dev->poll_controller = ei_poll;#endif	NS8390_init(dev, 0);	return 0;out:	release_region(ioaddr, ULTRA_IO_EXTENT);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/smc-ultra.c/clean/drivers/net/smc-ultra.c