WDCDEBUG_PRINT(("%s:%d: 80-wire cable not detected\n", sc->sc_wdcdev.sc_dev.dv_xname, chp->channel), DEBUG_PROBE);
acer_setup_channel(chp)	struct channel_softc *chp;{	struct ata_drive_datas *drvp;	int drive;	u_int32_t acer_fifo_udma;	u_int32_t idedma_ctl;	struct pciide_channel *cp = (struct pciide_channel*)chp;	struct pciide_softc *sc = (struct pciide_softc *)cp->wdc_channel.wdc;	idedma_ctl = 0;	acer_fifo_udma = pci_conf_read(sc->sc_pc, sc->sc_tag, ACER_FTH_UDMA);	WDCDEBUG_PRINT(("acer_setup_channel: old fifo/udma reg 0x%x\n", 	    acer_fifo_udma), DEBUG_PROBE);	/* setup DMA if needed */	pciide_channel_dma_setup(cp);	if ((chp->ch_drive[0].drive_flags | chp->ch_drive[1].drive_flags) &	    DRIVE_UDMA)	{	/* check 80 pins cable */		if (pciide_pci_read(sc->sc_pc, sc->sc_tag, ACER_0x4A) &		    ACER_0x4A_80PIN(chp->channel)) {			if (chp->ch_drive[0].UDMA_mode > 2)				chp->ch_drive[0].UDMA_mode = 2;			if (chp->ch_drive[1].UDMA_mode > 2)				chp->ch_drive[1].UDMA_mode = 2;		}	}	for (drive = 0; drive < 2; drive++) {		drvp = &chp->ch_drive[drive];		/* If no drive, skip */		if ((drvp->drive_flags & DRIVE) == 0)			continue;		WDCDEBUG_PRINT(("acer_setup_channel: old timings reg for "		    "channel %d drive %d 0x%x\n", chp->channel, drive,		    pciide_pci_read(sc->sc_pc, sc->sc_tag,		    ACER_IDETIM(chp->channel, drive))), DEBUG_PROBE);		/* clear FIFO/DMA mode */		acer_fifo_udma &= ~(ACER_FTH_OPL(chp->channel, drive, 0x3) |		    ACER_UDMA_EN(chp->channel, drive) |		    ACER_UDMA_TIM(chp->channel, drive, 0x7));		/* add timing values, setup DMA if needed */		if ((drvp->drive_flags & DRIVE_DMA) == 0 &&		    (drvp->drive_flags & DRIVE_UDMA) == 0) {			acer_fifo_udma |=			    ACER_FTH_OPL(chp->channel, drive, 0x1);			goto pio;		}		acer_fifo_udma |= ACER_FTH_OPL(chp->channel, drive, 0x2);		if (drvp->drive_flags & DRIVE_UDMA) {			/* use Ultra/DMA */			drvp->drive_flags &= ~DRIVE_DMA;			acer_fifo_udma |= ACER_UDMA_EN(chp->channel, drive);			acer_fifo_udma |= 			    ACER_UDMA_TIM(chp->channel, drive,				acer_udma[drvp->UDMA_mode]);			/* XXX disable if one drive < UDMA3 ? */			if (drvp->UDMA_mode >= 3) {				pciide_pci_write(sc->sc_pc, sc->sc_tag,				    ACER_0x4B,				    pciide_pci_read(sc->sc_pc, sc->sc_tag,				        ACER_0x4B) | ACER_0x4B_UDMA66);			}		} else {			/*			 * use Multiword DMA			 * Timings will be used for both PIO and DMA,			 * so adjust DMA mode if needed			 */			if (drvp->PIO_mode > (drvp->DMA_mode + 2))				drvp->PIO_mode = drvp->DMA_mode + 2;			if (drvp->DMA_mode + 2 > (drvp->PIO_mode))				drvp->DMA_mode = (drvp->PIO_mode > 2) ?				    drvp->PIO_mode - 2 : 0;			if (drvp->DMA_mode == 0)				drvp->PIO_mode = 0;		}		idedma_ctl |= IDEDMA_CTL_DRV_DMA(drive);pio:		pciide_pci_write(sc->sc_pc, sc->sc_tag,		    ACER_IDETIM(chp->channel, drive),		    acer_pio[drvp->PIO_mode]);	}	WDCDEBUG_PRINT(("acer_setup_channel: new fifo/udma reg 0x%x\n",	    acer_fifo_udma), DEBUG_PROBE);	pci_conf_write(sc->sc_pc, sc->sc_tag, ACER_FTH_UDMA, acer_fifo_udma);	if (idedma_ctl != 0) {		/* Add software bits in status register */		bus_space_write_1(sc->sc_dma_iot, sc->sc_dma_ioh,		    IDEDMA_CTL(chp->channel), idedma_ctl);	}	pciide_print_modes(cp);}