retval = register_netdev(dev); if (retval) goto out; 
static int __init e21_probe1(struct net_device *dev, int ioaddr){	int i, status, retval;	unsigned char *station_addr = dev->dev_addr;	static unsigned version_printed;	if (!request_region(ioaddr, E21_IO_EXTENT, DRV_NAME))		return -EBUSY;	/* First check the station address for the Ctron prefix. */	if (inb(ioaddr + E21_SAPROM + 0) != 0x00		|| inb(ioaddr + E21_SAPROM + 1) != 0x00		|| inb(ioaddr + E21_SAPROM + 2) != 0x1d) {		retval = -ENODEV;		goto out;	}	/* Verify by making certain that there is a 8390 at there. */	outb(E8390_NODMA + E8390_STOP, ioaddr);	udelay(1);	/* we want to delay one I/O cycle - which is 2MHz */	status = inb(ioaddr);	if (status != 0x21 && status != 0x23) {		retval = -ENODEV;		goto out;	}	/* Read the station address PROM.  */	for (i = 0; i < 6; i++)		station_addr[i] = inb(ioaddr + E21_SAPROM + i);	inb(ioaddr + E21_MEDIA); 		/* Point to media selection. */	outb(0, ioaddr + E21_ASIC); 	/* and disable the secondary interface. */	if (ei_debug  &&  version_printed++ == 0)		printk(version);	for (i = 0; i < 6; i++)		printk(" %02X", station_addr[i]);	if (dev->irq < 2) {		int irqlist[] = {15,11,10,12,5,9,3,4}, i;		for (i = 0; i < 8; i++)			if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) {				dev->irq = irqlist[i];				break;			}		if (i >= 8) {			printk(" unable to get IRQ %d.\n", dev->irq);			retval = -EAGAIN;			goto out;		}	} else if (dev->irq == 2)	/* Fixup luser bogosity: IRQ2 is really IRQ9 */		dev->irq = 9;	/* The 8390 is at the base address. */	dev->base_addr = ioaddr;	ei_status.name = "E2100";	ei_status.word16 = 1;	ei_status.tx_start_page = E21_TX_START_PG;	ei_status.rx_start_page = E21_RX_START_PG;	ei_status.stop_page = E21_RX_STOP_PG;	ei_status.saved_irq = dev->irq;	/* Check the media port used.  The port can be passed in on the	   low mem_end bits. */	if (dev->mem_end & 15)		dev->if_port = dev->mem_end & 7;	else {		dev->if_port = 0;		inb(ioaddr + E21_MEDIA); 	/* Turn automatic media detection on. */		for(i = 0; i < 6; i++)			if (station_addr[i] != inb(ioaddr + E21_SAPROM + 8 + i)) {				dev->if_port = 1;				break;			}	}	/* Never map in the E21 shared memory unless you are actively using it.	   Also, the shared memory has effective only one setting -- spread all	   over the 128K region! */	if (dev->mem_start == 0)		dev->mem_start = 0xd0000;	ei_status.mem = ioremap(dev->mem_start, 2*1024);	if (!ei_status.mem) {		printk("unable to remap memory\n");		retval = -EAGAIN;		goto out;	}#ifdef notdef	/* These values are unused.  The E2100 has a 2K window into the packet	   buffer.  The window can be set to start on any page boundary. */	ei_status.rmem_start = dev->mem_start + TX_PAGES*256;	dev->mem_end = ei_status.rmem_end = dev->mem_start + 2*1024;#endif	printk(", IRQ %d, %s media, memory @ %#lx.\n", dev->irq,		   dev->if_port ? "secondary" : "primary", dev->mem_start);	ei_status.reset_8390 = &e21_reset_8390;	ei_status.block_input = &e21_block_input;	ei_status.block_output = &e21_block_output;	ei_status.get_8390_hdr = &e21_get_8390_hdr;	dev->open = &e21_open;	dev->stop = &e21_close;#ifdef CONFIG_NET_POLL_CONTROLLER	dev->poll_controller = ei_poll;#endif	NS8390_init(dev, 0);	return 0;out:	release_region(ioaddr, E21_IO_EXTENT);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/e2100.c/clean/drivers/net/e2100.c