retval = register_netdev(dev); if (retval) goto out; 
static int __init hpp_probe1(struct net_device *dev, int ioaddr){	int i, retval;	unsigned char checksum = 0;	const char name[] = "HP-PC-LAN+";	int mem_start;	static unsigned version_printed;	if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))		return -EBUSY;	/* Check for the HP+ signature, 50 48 0x 53. */	if (inw(ioaddr + HP_ID) != 0x4850		|| (inw(ioaddr + HP_PAGING) & 0xfff0) != 0x5300) {		retval = -ENODEV;		goto out;	}	if (ei_debug  &&  version_printed++ == 0)		printk(version);	printk("%s: %s at %#3x,", dev->name, name, ioaddr);	/* Retrieve and checksum the station address. */	outw(MAC_Page, ioaddr + HP_PAGING);	for(i = 0; i < ETHER_ADDR_LEN; i++) {		unsigned char inval = inb(ioaddr + 8 + i);		dev->dev_addr[i] = inval;		checksum += inval;		printk(" %2.2x", inval);	}	checksum += inb(ioaddr + 14);	if (checksum != 0xff) {		printk(" bad checksum %2.2x.\n", checksum);		retval = -ENODEV;		goto out;	} else {		/* Point at the Software Configuration Flags. */		outw(ID_Page, ioaddr + HP_PAGING);		printk(" ID %4.4x", inw(ioaddr + 12));	}	/* Read the IRQ line. */	outw(HW_Page, ioaddr + HP_PAGING);	{		int irq = inb(ioaddr + 13) & 0x0f;		int option = inw(ioaddr + HPP_OPTION);		dev->irq = irq;		if (option & MemEnable) {			mem_start = inw(ioaddr + 9) << 8;			printk(", IRQ %d, memory address %#x.\n", irq, mem_start);		} else {			mem_start = 0;			printk(", IRQ %d, programmed-I/O mode.\n", irq);		}	}	/* Set the wrap registers for string I/O reads.   */	outw((HP_START_PG + TX_PAGES/2) | ((HP_STOP_PG - 1) << 8), ioaddr + 14);	/* Set the base address to point to the NIC, not the "real" base! */	dev->base_addr = ioaddr + NIC_OFFSET;	dev->open = &hpp_open;	dev->stop = &hpp_close;#ifdef CONFIG_NET_POLL_CONTROLLER	dev->poll_controller = ei_poll;#endif	ei_status.name = name;	ei_status.word16 = 0;		/* Agggghhhhh! Debug time: 2 days! */	ei_status.tx_start_page = HP_START_PG;	ei_status.rx_start_page = HP_START_PG + TX_PAGES/2;	ei_status.stop_page = HP_STOP_PG;	ei_status.reset_8390 = &hpp_reset_8390;	ei_status.block_input = &hpp_io_block_input;	ei_status.block_output = &hpp_io_block_output;	ei_status.get_8390_hdr = &hpp_io_get_8390_hdr;	/* Check if the memory_enable flag is set in the option register. */	if (mem_start) {		ei_status.block_input = &hpp_mem_block_input;		ei_status.block_output = &hpp_mem_block_output;		ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr;		dev->mem_start = mem_start;		ei_status.rmem_start = dev->mem_start + TX_PAGES/2*256;		dev->mem_end = ei_status.rmem_end			= dev->mem_start + (HP_STOP_PG - HP_START_PG)*256;	}	outw(Perf_Page, ioaddr + HP_PAGING);	NS8390_init(dev, 0);	/* Leave the 8390 and HP chip reset. */	outw(inw(ioaddr + HPP_OPTION) & ~EnableIRQ, ioaddr + HPP_OPTION);	return 0;out:	release_region(ioaddr, HP_IO_EXTENT);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/hp-plus.c/buggy/drivers/net/hp-plus.c