if (sc->sc_pp->ide_product == PCI_PRODUCT_VIATECH_VT82C586A_IDE)
if (sc->sc_pp->ide_product == PCI_PRODUCT_VIATECH_VT82C586A_IDE && rev >= 6)
apollo_chip_map(sc, pa)	struct pciide_softc *sc;	struct pci_attach_args *pa;{	struct pciide_channel *cp;	pcireg_t interface = PCI_INTERFACE(pci_conf_read(sc->sc_pc,				    sc->sc_tag, PCI_CLASS_REG));	int channel;	u_int32_t ideconf;	bus_size_t cmdsize, ctlsize;	if (pciide_chipen(sc, pa) == 0)		return;	printf(": DMA");	pciide_mapreg_dma(sc, pa);	if (sc->sc_dma_ok) {		sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;		if (sc->sc_pp->ide_product == PCI_PRODUCT_VIATECH_VT82C586A_IDE)			sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;	}	sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_MODE;	sc->sc_wdcdev.PIO_cap = 4;	sc->sc_wdcdev.DMA_cap = 2;	sc->sc_wdcdev.UDMA_cap = 2;	sc->sc_wdcdev.set_modes = apollo_setup_channel;	sc->sc_wdcdev.channels = sc->wdc_chanarray;	sc->sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS;	sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16;	pciide_print_channels(sc->sc_wdcdev.nchannels, interface);		WDCDEBUG_PRINT(("apollo_chip_map: old APO_IDECONF=0x%x, "	    "APO_CTLMISC=0x%x, APO_DATATIM=0x%x, APO_UDMA=0x%x\n",	    pci_conf_read(sc->sc_pc, sc->sc_tag, APO_IDECONF),	    pci_conf_read(sc->sc_pc, sc->sc_tag, APO_CTLMISC),	    pci_conf_read(sc->sc_pc, sc->sc_tag, APO_DATATIM),	    pci_conf_read(sc->sc_pc, sc->sc_tag, APO_UDMA)),	    DEBUG_PROBE);	for (channel = 0; channel < sc->sc_wdcdev.nchannels; channel++) {		cp = &sc->pciide_channels[channel];		if (pciide_chansetup(sc, channel, interface) == 0)			continue;		ideconf = pci_conf_read(sc->sc_pc, sc->sc_tag, APO_IDECONF);		if ((ideconf & APO_IDECONF_EN(channel)) == 0) {			printf("%s: %s ignored (disabled)\n",			    sc->sc_wdcdev.sc_dev.dv_xname, cp->name);			continue;		}		pciide_mapchan(pa, cp, interface, &cmdsize, &ctlsize,		    pciide_pci_intr);		if (cp->hw_ok == 0)			continue;		if (pciide_chan_candisable(cp)) {			ideconf &= ~APO_IDECONF_EN(channel);			pci_conf_write(sc->sc_pc, sc->sc_tag, APO_IDECONF,				    ideconf);		}		pciide_map_compat_intr(pa, cp, channel, interface);		if (cp->hw_ok == 0)			continue;		apollo_setup_channel(&sc->pciide_channels[channel].wdc_channel);	}	WDCDEBUG_PRINT(("apollo_chip_map: APO_DATATIM=0x%x, APO_UDMA=0x%x\n",	    pci_conf_read(sc->sc_pc, sc->sc_tag, APO_DATATIM),	    pci_conf_read(sc->sc_pc, sc->sc_tag, APO_UDMA)), DEBUG_PROBE);}