if (wdc_select_drive(chp, drive, wdc_c->timeout) != 0) { wdc_c->flags |= AT_TIMEOU; __wdccommand_done(chp, xfer); return; }
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh, WDSD_IBM | (drive << 4));  if (wdc_c->r_command != ATAPI_SOFT_RESET) { if (wdcwait(chp, wdc_c->r_st_bmask, wdc_c->r_st_bmask, wdc_c->timeout) != 0) { wdc_c->flags |= AT_TIMEOU; __wdccommand_done(chp, xfer); return; } } else DELAY(10);
__wdccommand_start(chp, xfer)	struct channel_softc *chp;	struct wdc_xfer *xfer;{   	int drive = xfer->drive;	struct wdc_command *wdc_c = xfer->cmd;	WDCDEBUG_PRINT(("__wdccommand_start %s:%d:%d\n",	    chp->wdc->sc_dev.dv_xname, chp->channel, xfer->drive),	    DEBUG_FUNCS);	/*	 * Disable interrupts if we're polling	 */	if (xfer->c_flags & C_POLL) {		wdc_disable_intr(chp);	}	/*	 * Make sure the bus isn't busy	 */	if (wdc_select_drive(chp, drive, wdc_c->timeout) != 0) {		wdc_c->flags |= AT_TIMEOU;		__wdccommand_done(chp, xfer);		return;	}	wdccommand(chp, drive, wdc_c->r_command, wdc_c->r_cyl, wdc_c->r_head,	    wdc_c->r_sector, wdc_c->r_count, wdc_c->r_precomp);	if ((wdc_c->flags & AT_POLL) == 0) {		chp->ch_flags |= WDCF_IRQ_WAIT; /* wait for interrupt */		timeout(wdctimeout, chp, wdc_c->timeout / 1000 * hz);		return;	}	/*	 * Polled command. Wait for drive ready or drq. Done in intr().	 * Wait for at last 400ns for status bit to be valid.	 */	delay(10);	__wdccommand_intr(chp, xfer, 0);}