rc = pci_set_consistent_dma_mask(pdev, 0xffffffffULL); 
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 
static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent){	struct net_device *dev;	struct cp_private *cp;	int rc;	void __iomem *regs;	long pciaddr;	unsigned int addr_len, i, pci_using_dac;	u8 pci_rev;#ifndef MODULE	static int version_printed;	if (version_printed++ == 0)		printk("%s", version);#endif	pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev);	if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&	    pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {		printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",		       pci_name(pdev), pdev->vendor, pdev->device, pci_rev);		printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n");		return -ENODEV;	}	dev = alloc_etherdev(sizeof(struct cp_private));	if (!dev)		return -ENOMEM;	SET_MODULE_OWNER(dev);	SET_NETDEV_DEV(dev, &pdev->dev);	cp = netdev_priv(dev);	cp->pdev = pdev;	cp->dev = dev;	cp->msg_enable = (debug < 0 ? CP_DEF_MSG_ENABLE : debug);	spin_lock_init (&cp->lock);	cp->mii_if.dev = dev;	cp->mii_if.mdio_read = mdio_read;	cp->mii_if.mdio_write = mdio_write;	cp->mii_if.phy_id = CP_INTERNAL_PHY;	cp->mii_if.phy_id_mask = 0x1f;	cp->mii_if.reg_num_mask = 0x1f;	cp_set_rxbufsize(cp);	rc = pci_enable_device(pdev);	if (rc)		goto err_out_free;	rc = pci_set_mwi(pdev);	if (rc)		goto err_out_disable;	rc = pci_request_regions(pdev, DRV_NAME);	if (rc)		goto err_out_mwi;	pciaddr = pci_resource_start(pdev, 1);	if (!pciaddr) {		rc = -EIO;		printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n",		       pci_name(pdev));		goto err_out_res;	}	if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {		rc = -EIO;		printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n",		       pci_resource_len(pdev, 1), pci_name(pdev));		goto err_out_res;	}	/* Configure DMA attributes. */	if ((sizeof(dma_addr_t) > 4) &&	    !pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL) &&	    !pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {		pci_using_dac = 1;	} else {		pci_using_dac = 0;		rc = pci_set_dma_mask(pdev, 0xffffffffULL);		if (rc) {			printk(KERN_ERR PFX "No usable DMA configuration, "			       "aborting.\n");			goto err_out_res;		}		rc = pci_set_consistent_dma_mask(pdev, 0xffffffffULL);		if (rc) {			printk(KERN_ERR PFX "No usable consistent DMA configuration, "			       "aborting.\n");			goto err_out_res;		}	}	cp->cpcmd = (pci_using_dac ? PCIDAC : 0) |		    PCIMulRW | RxChkSum | CpRxOn | CpTxOn;	regs = ioremap(pciaddr, CP_REGS_SIZE);	if (!regs) {		rc = -EIO;		printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n",		       pci_resource_len(pdev, 1), pciaddr, pci_name(pdev));		goto err_out_res;	}	dev->base_addr = (unsigned long) regs;	cp->regs = regs;	cp_stop_hw(cp);	/* read MAC address from EEPROM */	addr_len = read_eeprom (regs, 0, 8) == 0x8129 ? 8 : 6;	for (i = 0; i < 3; i++)		((u16 *) (dev->dev_addr))[i] =		    le16_to_cpu (read_eeprom (regs, i + 7, addr_len));	dev->open = cp_open;	dev->stop = cp_close;	dev->set_multicast_list = cp_set_rx_mode;	dev->hard_start_xmit = cp_start_xmit;	dev->get_stats = cp_get_stats;	dev->do_ioctl = cp_ioctl;	dev->poll = cp_rx_poll;	dev->weight = 16;	/* arbitrary? from NAPI_HOWTO.txt. */#ifdef BROKEN	dev->change_mtu = cp_change_mtu;#endif	dev->ethtool_ops = &cp_ethtool_ops;#if 0	dev->tx_timeout = cp_tx_timeout;	dev->watchdog_timeo = TX_TIMEOUT;#endif#if CP_VLAN_TAG_USED	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;	dev->vlan_rx_register = cp_vlan_rx_register;	dev->vlan_rx_kill_vid = cp_vlan_rx_kill_vid;#endif	if (pci_using_dac)		dev->features |= NETIF_F_HIGHDMA;	dev->irq = pdev->irq;	rc = register_netdev(dev);	if (rc)		goto err_out_iomap;	printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, "		"%02x:%02x:%02x:%02x:%02x:%02x, "		"IRQ %d\n",		dev->name,		dev->base_addr,		dev->dev_addr[0], dev->dev_addr[1],		dev->dev_addr[2], dev->dev_addr[3],		dev->dev_addr[4], dev->dev_addr[5],		dev->irq);	pci_set_drvdata(pdev, dev);	/* enable busmastering and memory-write-invalidate */	pci_set_master(pdev);	if (cp->wol_enabled) cp_set_d3_state (cp);	return 0;err_out_iomap:	iounmap(regs);err_out_res:	pci_release_regions(pdev);err_out_mwi:	pci_clear_mwi(pdev);err_out_disable:	pci_disable_device(pdev);err_out_free:	free_netdev(dev);	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8662d061719a202e8196a19c1043ce271318d31b/8139cp.c/clean/drivers/net/8139cp.c