printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); 
if (netif_msg_probe(tp)) { printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); } 
rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,		   void __iomem **ioaddr_out){	void __iomem *ioaddr;	struct net_device *dev;	struct rtl8169_private *tp;	int rc = -ENOMEM, i, acpi_idle_state = 0, pm_cap;	assert(ioaddr_out != NULL);	/* dev zeroed in alloc_etherdev */	dev = alloc_etherdev(sizeof (*tp));	if (dev == NULL) {		printk(KERN_ERR PFX "unable to alloc new ethernet\n");		goto err_out;	}	SET_MODULE_OWNER(dev);	SET_NETDEV_DEV(dev, &pdev->dev);	tp = netdev_priv(dev);	/* enable device (incl. PCI PM wakeup and hotplug setup) */	rc = pci_enable_device(pdev);	if (rc) {		printk(KERN_ERR PFX "%s: enable failure\n", pci_name(pdev));		goto err_out_free_dev;	}	rc = pci_set_mwi(pdev);	if (rc < 0)		goto err_out_disable;	/* save power state before pci_enable_device overwrites it */	pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);	if (pm_cap) {		u16 pwr_command;		pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);		acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;	} else {		printk(KERN_ERR PFX		       "Cannot find PowerManagement capability, aborting.\n");		goto err_out_mwi;	}	/* make sure PCI base addr 1 is MMIO */	if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {		printk(KERN_ERR PFX		       "region #1 not an MMIO resource, aborting\n");		rc = -ENODEV;		goto err_out_mwi;	}	/* check for weird/broken PCI region reporting */	if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {		printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n");		rc = -ENODEV;		goto err_out_mwi;	}	rc = pci_request_regions(pdev, MODULENAME);	if (rc) {		printk(KERN_ERR PFX "%s: could not request regions.\n",		       pci_name(pdev));		goto err_out_mwi;	}	tp->cp_cmd = PCIMulRW | RxChkSum;	if ((sizeof(dma_addr_t) > 4) &&	    !pci_set_dma_mask(pdev, DMA_64BIT_MASK) && use_dac) {		tp->cp_cmd |= PCIDAC;		dev->features |= NETIF_F_HIGHDMA;	} else {		rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);		if (rc < 0) {			printk(KERN_ERR PFX "DMA configuration failed.\n");			goto err_out_free_res;		}	}	pci_set_master(pdev);	/* ioremap MMIO region */	ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);	if (ioaddr == NULL) {		printk(KERN_ERR PFX "cannot remap MMIO, aborting\n");		rc = -EIO;		goto err_out_free_res;	}	/* Unneeded ? Don't mess with Mrs. Murphy. */	rtl8169_irq_mask_and_ack(ioaddr);	/* Soft reset the chip. */	RTL_W8(ChipCmd, CmdReset);	/* Check that the chip has finished the reset. */	for (i = 1000; i > 0; i--) {		if ((RTL_R8(ChipCmd) & CmdReset) == 0)			break;		udelay(10);	}	/* Identify chip attached to board */	rtl8169_get_mac_version(tp, ioaddr);	rtl8169_get_phy_version(tp, ioaddr);	rtl8169_print_mac_version(tp);	rtl8169_print_phy_version(tp);	for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) {		if (tp->mac_version == rtl_chip_info[i].mac_version)			break;	}	if (i < 0) {		/* Unknown chip: assume array element #0, original RTL-8169 */		printk(KERN_DEBUG PFX		       "PCI device %s: unknown chip version, assuming %s\n",		       pci_name(pdev), rtl_chip_info[0].name);		i++;	}	tp->chipset = i;	*ioaddr_out = ioaddr;	*dev_out = dev;out:	return rc;err_out_free_res:	pci_release_regions(pdev);err_out_mwi:	pci_clear_mwi(pdev);err_out_disable:	pci_disable_device(pdev);err_out_free_dev:	free_netdev(dev);err_out:	*ioaddr_out = NULL;	*dev_out = NULL;	goto out;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b57b7e5a11c4e45565cf34d786d74ad35483fe83/r8169.c/clean/drivers/net/r8169.c