rem: FAST_LOG1( bus->log, ev_ide_reset_device, device->is_device1 ); SHOW_FLOW0( 3, "" );
context: bool reset_device( ide_device_info *device, ide_qrequest *ignore ){	ide_bus_info *bus = device->bus;	status_t res;	uint8 orig_command;		FAST_LOG1( bus->log, ev_ide_reset_device, device->is_device1 );	SHOW_FLOW0( 3, "" );	if( !device->is_atapi )		goto err;	if( device->reconnect_timer_installed ) {		cancel_timer( &device->reconnect_timer.te );		device->reconnect_timer_installed = false;	}	// select device	if( bus->controller->write_command_block_regs( bus->channel, &device->tf, 		ide_mask_device_head ) != B_OK ) 		goto err;	// safe original command to let caller restart it	orig_command = device->tf.write.command;	// send device reset, independ of current device state	// (that's the point of a reset)	device->tf.write.command = IDE_CMD_DEVICE_RESET;	res = bus->controller->write_command_block_regs( bus->channel, 		&device->tf, ide_mask_command );	device->tf.write.command = orig_command;		if( res != B_OK )		goto err;	// don't know how long to wait, but 31 seconds, like soft reset, 	// should be enough	if( !ide_wait( device, 0, ide_status_bsy, true, 31000000 ))		goto err;	// alright, resubmit all requests			finish_all_requests( device, ignore, SCSI_SCSI_BUS_RESET, true );	SHOW_FLOW0( 3, "done" );	return true;	err:	// do the hard way	return reset_bus( device, ignore );}