break; case PCI_DEVICE_ID_INTEL_82945G_HB: if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) { bridge->driver = &intel_915_driver; } else { bridge->driver = &intel_845_driver; } name = "945G"; 
static int __devinit agp_intel_probe(struct pci_dev *pdev,				     const struct pci_device_id *ent){	struct agp_bridge_data *bridge;	char *name = "(unknown)";	u8 cap_ptr = 0;	struct resource *r;	cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);	bridge = agp_alloc_bridge();	if (!bridge)		return -ENOMEM;	switch (pdev->device) {	case PCI_DEVICE_ID_INTEL_82443LX_0:		bridge->driver = &intel_generic_driver;		name = "440LX";		break;	case PCI_DEVICE_ID_INTEL_82443BX_0:		bridge->driver = &intel_generic_driver;		name = "440BX";		break;	case PCI_DEVICE_ID_INTEL_82443GX_0:		bridge->driver = &intel_generic_driver;		name = "440GX";		break;	case PCI_DEVICE_ID_INTEL_82810_MC1:		name = "i810";		if (!find_i810(PCI_DEVICE_ID_INTEL_82810_IG1))			goto fail;		bridge->driver = &intel_810_driver;		break;	case PCI_DEVICE_ID_INTEL_82810_MC3:		name = "i810 DC100";		if (!find_i810(PCI_DEVICE_ID_INTEL_82810_IG3))			goto fail;		bridge->driver = &intel_810_driver;		break;	case PCI_DEVICE_ID_INTEL_82810E_MC:		name = "i810 E";		if (!find_i810(PCI_DEVICE_ID_INTEL_82810E_IG))			goto fail;		bridge->driver = &intel_810_driver;		break;	 case PCI_DEVICE_ID_INTEL_82815_MC:		/*		 * The i815 can operate either as an i810 style		 * integrated device, or as an AGP4X motherboard.		 */		if (find_i810(PCI_DEVICE_ID_INTEL_82815_CGC))			bridge->driver = &intel_810_driver;		else			bridge->driver = &intel_815_driver;		name = "i815";		break;	case PCI_DEVICE_ID_INTEL_82820_HB:	case PCI_DEVICE_ID_INTEL_82820_UP_HB:		bridge->driver = &intel_820_driver;		name = "i820";		break;	case PCI_DEVICE_ID_INTEL_82830_HB:		if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC)) {			bridge->driver = &intel_830_driver;		} else {			bridge->driver = &intel_830mp_driver;		}		name = "830M";		break;	case PCI_DEVICE_ID_INTEL_82840_HB:		bridge->driver = &intel_840_driver;		name = "i840";		break;	case PCI_DEVICE_ID_INTEL_82845_HB:		bridge->driver = &intel_845_driver;		name = "i845";		break;	case PCI_DEVICE_ID_INTEL_82845G_HB:		if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG)) {			bridge->driver = &intel_830_driver;		} else {			bridge->driver = &intel_845_driver;		}		name = "845G";		break;	case PCI_DEVICE_ID_INTEL_82850_HB:		bridge->driver = &intel_850_driver;		name = "i850";		break;	case PCI_DEVICE_ID_INTEL_82855PM_HB:		bridge->driver = &intel_845_driver;		name = "855PM";		break;	case PCI_DEVICE_ID_INTEL_82855GM_HB:		if (find_i830(PCI_DEVICE_ID_INTEL_82855GM_IG)) {			bridge->driver = &intel_830_driver;			name = "855";		} else {			bridge->driver = &intel_845_driver;			name = "855GM";		}		break;	case PCI_DEVICE_ID_INTEL_82860_HB:		bridge->driver = &intel_860_driver;		name = "i860";		break;	case PCI_DEVICE_ID_INTEL_82865_HB:		if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG)) {			bridge->driver = &intel_830_driver;		} else {			bridge->driver = &intel_845_driver;		}		name = "865";		break;	case PCI_DEVICE_ID_INTEL_82875_HB:		bridge->driver = &intel_845_driver;		name = "i875";		break;	case PCI_DEVICE_ID_INTEL_82915G_HB:		if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG)) {			bridge->driver = &intel_915_driver;		} else {			bridge->driver = &intel_845_driver;		}		name = "915G";		break;	case PCI_DEVICE_ID_INTEL_82915GM_HB:		if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG)) {			bridge->driver = &intel_915_driver;		} else {			bridge->driver = &intel_845_driver;		}		name = "915GM";		break;	case PCI_DEVICE_ID_INTEL_7505_0:		bridge->driver = &intel_7505_driver;		name = "E7505";		break;	case PCI_DEVICE_ID_INTEL_7205_0:		bridge->driver = &intel_7505_driver;		name = "E7205";		break;	default:		if (cap_ptr)			printk(KERN_WARNING PFX "Unsupported Intel chipset (device id: %04x)\n",			    pdev->device);		agp_put_bridge(bridge);		return -ENODEV;	};	bridge->dev = pdev;	bridge->capndx = cap_ptr;	if (bridge->driver == &intel_810_driver)		bridge->dev_private_data = &intel_i810_private;	else if (bridge->driver == &intel_830_driver)		bridge->dev_private_data = &intel_i830_private;	printk(KERN_INFO PFX "Detected an Intel %s Chipset.\n", name);	/*	* The following fixes the case where the BIOS has "forgotten" to	* provide an address range for the GART.	* 20030610 - hamish@zot.org	*/	r = &pdev->resource[0];	if (!r->start && r->end) {		if(pci_assign_resource(pdev, 0)) {			printk(KERN_ERR PFX "could not assign resource 0\n");			agp_put_bridge(bridge);			return -ENODEV;		}	}	/*	* If the device has not been properly setup, the following will catch	* the problem and should stop the system from crashing.	* 20030610 - hamish@zot.org	*/	if (pci_enable_device(pdev)) {		printk(KERN_ERR PFX "Unable to Enable PCI device\n");		agp_put_bridge(bridge);		return -ENODEV;	}	/* Fill in the mode register */	if (cap_ptr) {		pci_read_config_dword(pdev,				bridge->capndx+PCI_AGP_STATUS,				&bridge->mode);	}	pci_set_drvdata(pdev, bridge);	return agp_add_bridge(bridge);fail:	printk(KERN_ERR PFX "Detected an Intel %s chipset, "		"but could not find the secondary device.\n", name);	agp_put_bridge(bridge);	return -ENODEV;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d0de98fa16169562bd74913c6c9b3857f9065c79/intel-agp.c/buggy/drivers/char/agp/intel-agp.c