int flags;
wdc_atapi_get_params(chp, drive, flags, id)	struct channel_softc *chp;	u_int8_t drive;	int flags;	struct ataparams *id;{	struct wdc_command wdc_c;	/* if no ATAPI device detected at wdc attach time, skip */	/*	 * XXX this will break scsireprobe if this is of any interest for	 * ATAPI devices one day.	 */	if ((chp->ch_drive[drive].drive_flags & DRIVE_ATAPI) == 0) {		WDCDEBUG_PRINT(("wdc_atapi_get_params: drive %d not present\n",		    drive), DEBUG_PROBE);		return (-1);	}	bzero(&wdc_c, sizeof(struct wdc_command));	wdc_c.r_command = ATAPI_SOFT_RESET;	wdc_c.r_st_bmask = 0;	wdc_c.r_st_pmask = 0;	wdc_c.flags = AT_POLL;	wdc_c.timeout = WDC_RESET_WAIT;	if (wdc_exec_command(&chp->ch_drive[drive], &wdc_c) != WDC_COMPLETE) {		printf("wdc_atapi_get_params: ATAPI_SOFT_RESET failed for"		    " drive %s:%d:%d: driver failed\n",		    chp->wdc->sc_dev.dv_xname, chp->channel, drive);		panic("wdc_atapi_get_params");	}	if (wdc_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {		WDCDEBUG_PRINT(("wdc_atapi_get_params: ATAPI_SOFT_RESET "		    "failed for drive %s:%d:%d: error 0x%x\n",		    chp->wdc->sc_dev.dv_xname, chp->channel, drive, 		    wdc_c.r_error), DEBUG_PROBE);		return (-1);	}	chp->ch_drive[drive].state = 0;	bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);		/* Some ATAPI devices need a bit more time after software reset. */	delay(5000);	if (ata_get_params(&chp->ch_drive[drive], AT_POLL, id) != 0) {		WDCDEBUG_PRINT(("wdc_atapi_get_params: ATAPI_IDENTIFY_DEVICE "		    "failed for drive %s:%d:%d: error 0x%x\n",		    chp->wdc->sc_dev.dv_xname, chp->channel, drive, 		    wdc_c.r_error), DEBUG_PROBE);		return (-1);	}	return (COMPLETE);}