return 0;
return time;
wdcwait(chp, mask, bits, timeout)	struct channel_softc *chp;	int mask, bits, timeout;{	u_char status;	int time = 0;#ifdef WDCNDELAY_DEBUG	extern int cold;#endif	WDCDEBUG_PRINT(("wdcwait %s:%d\n", chp->wdc ?chp->wdc->sc_dev.dv_xname	    :"none", chp->channel), DEBUG_STATUS);	chp->ch_error = 0;	timeout = timeout * 1000 / WDCDELAY; /* delay uses microseconds */	for (;;) {#ifdef TEST_ALTSTS		chp->ch_status = status = CHP_READ_REG(chp, wdr_altsts);#else		chp->ch_status = status = CHP_READ_REG(chp, wdr_status);#endif		if (status == 0xff && (chp->ch_flags & WDCF_ONESLAVE)) {			CHP_WRITE_REG(chp, wdr_sdh, WDSD_IBM | 0x10);#ifdef TEST_ALTSTS			chp->ch_status = status = 			    CHP_READ_REG(chp, wdr_altsts);#else			chp->ch_status = status = 			    CHP_READ_REG(chp, wdr_status);#endif		}		if ((status & WDCS_BSY) == 0 && (status & mask) == bits) 			break;		if (++time > timeout) {			WDCDEBUG_PRINT(("wdcwait: timeout, status %x "			    "error %x\n", status,			    CHP_READ_REG(chp, wdr_error)),			    DEBUG_STATUSX | DEBUG_STATUS); 			return -1;		}		delay(WDCDELAY);	}#ifdef TEST_ALTSTS	/* Acknowledge any pending interrupts */	CHP_READ_REG(chp, wdr_status);#endif	if (status & WDCS_ERR) {		chp->ch_error = CHP_READ_REG(chp, wdr_error);		WDCDEBUG_PRINT(("wdcwait: error %x\n", chp->ch_error),			       DEBUG_STATUSX | DEBUG_STATUS);	}#ifdef WDCNDELAY_DEBUG	/* After autoconfig, there should be no long delays. */	if (!cold && time > WDCNDELAY_DEBUG) {		struct wdc_xfer *xfer = chp->ch_queue->sc_xfer.tqh_first;		if (xfer == NULL)			printf("%s channel %d: warning: busy-wait took %dus\n",			    chp->wdc->sc_dev.dv_xname, chp->channel,			    WDCDELAY * time);		else 			printf("%s:%d:%d: warning: busy-wait took %dus\n",			    chp->wdc->sc_dev.dv_xname, chp->channel,			    xfer->drive,			    WDCDELAY * time);	}#endif	return 0;}