static void __init init_hwif_ns87415 (ide_hwif_t *hwif) 
static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) 
static void __init init_hwif_ns87415 (ide_hwif_t *hwif){	struct pci_dev *dev = hwif->pci_dev;	unsigned int ctrl, using_inta;	u8 progif;#ifdef __sparc_v9__	int timeout;	u8 stat;#endif	hwif->autodma = 0;	hwif->selectproc = &ns87415_selectproc;	/*	 * We cannot probe for IRQ: both ports share common IRQ on INTA.	 * Also, leave IRQ masked during drive probing, to prevent infinite	 * interrupts from a potentially floating INTA..	 *	 * IRQs get unmasked in selectproc when drive is first used.	 */	(void) pci_read_config_dword(dev, 0x40, &ctrl);	(void) pci_read_config_byte(dev, 0x09, &progif);	/* is irq in "native" mode? */	using_inta = progif & (1 << (hwif->channel << 1));	if (!using_inta)		using_inta = ctrl & (1 << (4 + hwif->channel));	if (hwif->mate) {		hwif->select_data = hwif->mate->select_data;	} else {		hwif->select_data = (unsigned long)					&ns87415_control[ns87415_count++];		ctrl |= (1 << 8) | (1 << 9);	/* mask both IRQs */		if (using_inta)			ctrl &= ~(1 << 6);	/* unmask INTA */		*((unsigned int *)hwif->select_data) = ctrl;		(void) pci_write_config_dword(dev, 0x40, ctrl);		/*		 * Set prefetch size to 512 bytes for both ports,		 * but don't turn on/off prefetching here.		 */		pci_write_config_byte(dev, 0x55, 0xee);#ifdef __sparc_v9__		/*		 * XXX: Reset the device, if we don't it will not respond		 *      to SELECT_DRIVE() properly during first probe_hwif().		 */		timeout = 10000;		hwif->OUTB(12, hwif->io_ports[IDE_CONTROL_OFFSET]);		udelay(10);		hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);		do {			udelay(50);			stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);                	if (stat == 0xff)                        	break;        	} while ((stat & BUSY_STAT) && --timeout);#endif	}	if (!using_inta)		hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);	else if (!hwif->irq && hwif->mate && hwif->mate->irq)		hwif->irq = hwif->mate->irq;	/* share IRQ with mate */	if (!hwif->dma_base)		return;	hwif->OUTB(0x60, hwif->dma_status);	hwif->dma_setup = &ns87415_ide_dma_setup;	hwif->ide_dma_check = &ns87415_ide_dma_check;	hwif->ide_dma_end = &ns87415_ide_dma_end;	if (!noautodma)		hwif->autodma = 1;	hwif->drives[0].autodma = hwif->autodma;	hwif->drives[1].autodma = hwif->autodma;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c20530ed26e5b9e3b188b4088d0a5ab1d773a529/ns87415.c/buggy/drivers/ide/pci/ns87415.c