/* This routine implements a generic reset handler for device, bus and host reset requests. Device, bus and host specific reset handlers can use this function after they do their specific tasks.  */
static int megasas_generic_reset(struct scsi_cmnd *scmd)
/* This routine implements a generic reset handler for device, bus and host reset requests. Device, bus and host specific reset handlers can use this function after they do their specific tasks.  */
static int megasas_generic_reset(struct scsi_cmnd *scmd)
{
	int ret_val;
	struct megasas_instance *instance;
	instance = (struct megasas_instance *)scmd->device->host->hostdata;
	scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x retries=%x\n",
		 scmd->serial_number, scmd->cmnd[0], scmd->retries);
	if (instance->hw_crit_error) {
		printk(KERN_ERR "megasas: cannot recover from previous reset "
		       "failures\n");
		return FAILED;
	}
	ret_val = megasas_wait_for_outstanding(instance);
	if (ret_val == SUCCESS)
		printk(KERN_NOTICE "megasas: reset successful \n");
	else
		printk(KERN_ERR "megasas: failed to do reset\n");
	return ret_val;
}