if (pci_set_dma_mask(pdev,0xFFFFffff)) { 
if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 
static int __devinit w840_probe1 (struct pci_dev *pdev,				  const struct pci_device_id *ent){	struct net_device *dev;	struct netdev_private *np;	static int find_cnt;	int chip_idx = ent->driver_data;	int irq;	int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;	void __iomem *ioaddr;	int bar = 1;	i = pci_enable_device(pdev);	if (i) return i;	pci_set_master(pdev);	irq = pdev->irq;	if (pci_set_dma_mask(pdev,0xFFFFffff)) {		printk(KERN_WARNING "Winbond-840: Device %s disabled due to DMA limitations.\n",		       pci_name(pdev));		return -EIO;	}	dev = alloc_etherdev(sizeof(*np));	if (!dev)		return -ENOMEM;	SET_MODULE_OWNER(dev);	SET_NETDEV_DEV(dev, &pdev->dev);	if (pci_request_regions(pdev, DRV_NAME))		goto err_out_netdev;#ifdef USE_IO_OPS	bar = 0;#endif	ioaddr = pci_iomap(pdev, bar, pci_id_tbl[chip_idx].io_size);	if (!ioaddr)		goto err_out_free_res;	for (i = 0; i < 3; i++)		((u16 *)dev->dev_addr)[i] = le16_to_cpu(eeprom_read(ioaddr, i));	/* Reset the chip to erase previous misconfiguration.	   No hold time required! */	iowrite32(0x00000001, ioaddr + PCIBusCfg);	dev->base_addr = (unsigned long)ioaddr;	dev->irq = irq;	np = netdev_priv(dev);	np->pci_dev = pdev;	np->chip_id = chip_idx;	np->drv_flags = pci_id_tbl[chip_idx].drv_flags;	spin_lock_init(&np->lock);	np->mii_if.dev = dev;	np->mii_if.mdio_read = mdio_read;	np->mii_if.mdio_write = mdio_write;	np->base_addr = ioaddr;		pci_set_drvdata(pdev, dev);	if (dev->mem_start)		option = dev->mem_start;	/* The lower four bits are the media type. */	if (option > 0) {		if (option & 0x200)			np->mii_if.full_duplex = 1;		if (option & 15)			printk(KERN_INFO "%s: ignoring user supplied media type %d",				dev->name, option & 15);	}	if (find_cnt < MAX_UNITS  &&  full_duplex[find_cnt] > 0)		np->mii_if.full_duplex = 1;	if (np->mii_if.full_duplex)		np->mii_if.force_media = 1;	/* The chip-specific entries in the device structure. */	dev->open = &netdev_open;	dev->hard_start_xmit = &start_tx;	dev->stop = &netdev_close;	dev->get_stats = &get_stats;	dev->set_multicast_list = &set_rx_mode;	dev->do_ioctl = &netdev_ioctl;	dev->ethtool_ops = &netdev_ethtool_ops;	dev->tx_timeout = &tx_timeout;	dev->watchdog_timeo = TX_TIMEOUT;	i = register_netdev(dev);	if (i)		goto err_out_cleardev;	printk(KERN_INFO "%s: %s at %p, ",		   dev->name, pci_id_tbl[chip_idx].name, ioaddr);	for (i = 0; i < 5; i++)			printk("%2.2x:", dev->dev_addr[i]);	printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);	if (np->drv_flags & CanHaveMII) {		int phy, phy_idx = 0;		for (phy = 1; phy < 32 && phy_idx < MII_CNT; phy++) {			int mii_status = mdio_read(dev, phy, MII_BMSR);			if (mii_status != 0xffff  &&  mii_status != 0x0000) {				np->phys[phy_idx++] = phy;				np->mii_if.advertising = mdio_read(dev, phy, MII_ADVERTISE);				np->mii = (mdio_read(dev, phy, MII_PHYSID1) << 16)+						mdio_read(dev, phy, MII_PHYSID2);				printk(KERN_INFO "%s: MII PHY %8.8xh found at address %d, status "					   "0x%4.4x advertising %4.4x.\n",					   dev->name, np->mii, phy, mii_status, np->mii_if.advertising);			}		}		np->mii_cnt = phy_idx;		np->mii_if.phy_id = np->phys[0];		if (phy_idx == 0) {				printk(KERN_WARNING "%s: MII PHY not found -- this device may "					   "not operate correctly.\n", dev->name);		}	}	find_cnt++;	return 0;err_out_cleardev:	pci_set_drvdata(pdev, NULL);	pci_iounmap(pdev, ioaddr);err_out_free_res:	pci_release_regions(pdev);err_out_netdev:	free_netdev (dev);	return -ENODEV;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/10a87fcf40ce8cee1e85d936cd6d7662943c804e/winbond-840.c/buggy/drivers/net/tulip/winbond-840.c