out_irq: free_irq(dev->irq, dev); 
static int __init ne_probe1(struct net_device *dev, int ioaddr){	int i;	unsigned char SA_prom[16];	int wordlength = 2;	const char *name = NULL;	int start_page, stop_page;	int reg0, ret;	static unsigned version_printed;	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);	unsigned char bus_width;	if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))		return -EBUSY;	reg0 = inb_p(ioaddr);	if (reg0 == 0xFF) {		ret = -ENODEV;		goto err_out;	}	/* Do a preliminary verification that we have a 8390. */	{		int regd;		outb_p(E8390_NODMA+E8390_PAGE1+E8390_STOP, ioaddr + E8390_CMD);		regd = inb_p(ioaddr + EI_SHIFT(0x0d));		outb_p(0xff, ioaddr + EI_SHIFT(0x0d));		outb_p(E8390_NODMA+E8390_PAGE0, ioaddr + E8390_CMD);		inb_p(ioaddr + EN0_COUNTER0); /* Clear the counter by reading. */		if (inb_p(ioaddr + EN0_COUNTER0) != 0) {			outb_p(reg0, ioaddr + EI_SHIFT(0));			outb_p(regd, ioaddr + EI_SHIFT(0x0d));	/* Restore the old values. */			ret = -ENODEV;			goto err_out;		}	}	if (ei_debug  &&  version_printed++ == 0)		printk(KERN_INFO "%s", version1);	printk(KERN_INFO "NE*000 ethercard probe at %08x:", ioaddr);	/* Read the 16 bytes of station address PROM.	   We must first initialize registers, similar to NS8390_init(eifdev, 0).	   We can't reliably read the SAPROM address without this.	   (I learned the hard way!). */	{		struct {unsigned char value, offset; } program_seq[] =		{			{E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, /* Select page 0*/			{0x48,	EN0_DCFG},	/* Set byte-wide (0x48) access. */			{0x00,	EN0_RCNTLO},	/* Clear the count regs. */			{0x00,	EN0_RCNTHI},			{0x00,	EN0_IMR},	/* Mask completion irq. */			{0xFF,	EN0_ISR},			{E8390_RXOFF, EN0_RXCR},	/* 0x20  Set to monitor */			{E8390_TXOFF, EN0_TXCR},	/* 0x02  and loopback mode. */			{32,	EN0_RCNTLO},			{0x00,	EN0_RCNTHI},			{0x00,	EN0_RSARLO},	/* DMA starting at 0x0000. */			{0x00,	EN0_RSARHI},			{E8390_RREAD+E8390_START, E8390_CMD},		};		for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)			outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);	}	bus_width = *(volatile unsigned char *)ABWCR;	bus_width &= 1 << ((ioaddr >> 21) & 7);	ei_status.word16 = (bus_width == 0); /* temporary setting */	for(i = 0; i < 16 /*sizeof(SA_prom)*/; i++) {		SA_prom[i] = inb_p(ioaddr + NE_DATAPORT);		inb_p(ioaddr + NE_DATAPORT); /* dummy read */	}	start_page = NESM_START_PG;	stop_page = NESM_STOP_PG;	if (bus_width)		wordlength = 1;	else		outb_p(0x49, ioaddr + EN0_DCFG);	/* Set up the rest of the parameters. */	name = (wordlength == 2) ? "NE2000" : "NE1000";	if (! dev->irq) {		printk(" failed to detect IRQ line.\n");		ret = -EAGAIN;		goto err_out;	}	/* Snarf the interrupt now.  There's no point in waiting since we cannot	   share and the board will usually be enabled. */	ret = request_irq(dev->irq, ei_interrupt, 0, name, dev);	if (ret) {		printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);		goto err_out;	}	dev->base_addr = ioaddr;	for(i = 0; i < ETHER_ADDR_LEN; i++) {		printk(" %2.2x", SA_prom[i]);		dev->dev_addr[i] = SA_prom[i];	}	printk("\n%s: %s found at %#x, using IRQ %d.\n",		dev->name, name, ioaddr, dev->irq);	ei_status.name = name;	ei_status.tx_start_page = start_page;	ei_status.stop_page = stop_page;	ei_status.word16 = (wordlength == 2);	ei_status.rx_start_page = start_page + TX_PAGES;#ifdef PACKETBUF_MEMSIZE	 /* Allow the packet buffer size to be overridden by know-it-alls. */	ei_status.stop_page = ei_status.tx_start_page + PACKETBUF_MEMSIZE;#endif	ei_status.reset_8390 = &ne_reset_8390;	ei_status.block_input = &ne_block_input;	ei_status.block_output = &ne_block_output;	ei_status.get_8390_hdr = &ne_get_8390_hdr;	ei_status.priv = 0;	dev->open = &ne_open;	dev->stop = &ne_close;#ifdef CONFIG_NET_POLL_CONTROLLER	dev->poll_controller = ei_poll;#endif	NS8390_init(dev, 0);	return 0;err_out:	release_region(ioaddr, NE_IO_EXTENT);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/ne-h8300.c/clean/drivers/net/ne-h8300.c