 retval = register_netdev(dev); if (retval) goto out1; 
static int __init es_probe1(struct net_device *dev, int ioaddr){	int i, retval;	unsigned long eisa_id;	if (!request_region(ioaddr + ES_SA_PROM, ES_IO_EXTENT, "es3210"))		return -ENODEV;#if ES_DEBUG & ES_D_PROBE	printk("es3210.c: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + ES_ID_PORT));	printk("es3210.c: config regs: %#x %#x %#x %#x %#x %#x\n",		inb(ioaddr + ES_CFG1), inb(ioaddr + ES_CFG2), inb(ioaddr + ES_CFG3),		inb(ioaddr + ES_CFG4), inb(ioaddr + ES_CFG5), inb(ioaddr + ES_CFG6));#endif/*	Check the EISA ID of the card. */	eisa_id = inl(ioaddr + ES_ID_PORT);	if ((eisa_id != ES_EISA_ID1) && (eisa_id != ES_EISA_ID2)) {		retval = -ENODEV;		goto out;	}/*	Check the Racal vendor ID as well. */	if (inb(ioaddr + ES_SA_PROM + 0) != ES_ADDR0		|| inb(ioaddr + ES_SA_PROM + 1) != ES_ADDR1		|| inb(ioaddr + ES_SA_PROM + 2) != ES_ADDR2 ) {		printk("es3210.c: card not found");		for(i = 0; i < ETHER_ADDR_LEN; i++)			printk(" %02x", inb(ioaddr + ES_SA_PROM + i));		printk(" (invalid prefix).\n");		retval = -ENODEV;		goto out;	}	printk("es3210.c: ES3210 rev. %ld at %#x, node", eisa_id>>24, ioaddr);	for(i = 0; i < ETHER_ADDR_LEN; i++)		printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + ES_SA_PROM + i)));	/* Snarf the interrupt now. */	if (dev->irq == 0) {		unsigned char hi_irq = inb(ioaddr + ES_CFG2) & 0x07;		unsigned char lo_irq = inb(ioaddr + ES_CFG1) & 0xfe;		if (hi_irq != 0) {			dev->irq = hi_irq_map[hi_irq - 1];		} else {			int i = 0;			while (lo_irq > (1<<i)) i++;			dev->irq = lo_irq_map[i];		}		printk(" using IRQ %d", dev->irq);#if ES_DEBUG & ES_D_PROBE		printk("es3210.c: hi_irq %#x, lo_irq %#x, dev->irq = %d\n",					hi_irq, lo_irq, dev->irq);#endif	} else {		if (dev->irq == 2)			dev->irq = 9;			/* Doh! */		printk(" assigning IRQ %d", dev->irq);	}	if (request_irq(dev->irq, ei_interrupt, 0, "es3210", dev)) {		printk (" unable to get IRQ %d.\n", dev->irq);		retval = -EAGAIN;		goto out;	}	if (dev->mem_start == 0) {		unsigned char mem_enabled = inb(ioaddr + ES_CFG2) & 0xc0;		unsigned char mem_bits = inb(ioaddr + ES_CFG3) & 0x07;		if (mem_enabled != 0x80) {			printk(" shared mem disabled - giving up\n");			retval = -ENXIO;			goto out1;		}		dev->mem_start = 0xC0000 + mem_bits*0x4000;		printk(" using ");	} else {		printk(" assigning ");	}	ei_status.mem = ioremap(dev->mem_start, (ES_STOP_PG - ES_START_PG)*256);	if (!ei_status.mem) {		printk("ioremap failed - giving up\n");		retval = -ENXIO;		goto out1;	}	dev->mem_end = dev->mem_start + (ES_STOP_PG - ES_START_PG)*256;	printk("mem %#lx-%#lx\n", dev->mem_start, dev->mem_end-1);#if ES_DEBUG & ES_D_PROBE	if (inb(ioaddr + ES_CFG5))		printk("es3210: Warning - DMA channel enabled, but not used here.\n");#endif	/* Note, point at the 8390, and not the card... */	dev->base_addr = ioaddr + ES_NIC_OFFSET;	ei_status.name = "ES3210";	ei_status.tx_start_page = ES_START_PG;	ei_status.rx_start_page = ES_START_PG + TX_PAGES;	ei_status.stop_page = ES_STOP_PG;	ei_status.word16 = 1;	if (ei_debug > 0)		printk(version);	ei_status.reset_8390 = &es_reset_8390;	ei_status.block_input = &es_block_input;	ei_status.block_output = &es_block_output;	ei_status.get_8390_hdr = &es_get_8390_hdr;	dev->open = &es_open;	dev->stop = &es_close;#ifdef CONFIG_NET_POLL_CONTROLLER	dev->poll_controller = ei_poll;#endif	NS8390_init(dev, 0);	return 0;out1:	free_irq(dev->irq, dev);out:	release_region(ioaddr + ES_SA_PROM, ES_IO_EXTENT);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/es3210.c/clean/drivers/net/es3210.c