/* Return value: 0 if caller is required to return it to free_pool. Returns 1 if caller need not worry about freeing command block as error handler will take care of that.  */
static int _pmcraid_io_done(struct pmcraid_cmd *cmd, int reslen, int ioasc)
/* Return value: 0 if caller is required to return it to free_pool. Returns 1 if caller need not worry about freeing command block as error handler will take care of that.  */
static int _pmcraid_io_done(struct pmcraid_cmd *cmd, int reslen, int ioasc)
{
	struct scsi_cmnd *scsi_cmd = cmd->scsi_cmd;
	int rc = 0;
	scsi_set_resid(scsi_cmd, reslen);
	pmcraid_info("response(%d) CDB[0] = %x ioasc:result: %x:%x\n",
		le32_to_cpu(cmd->ioa_cb->ioarcb.response_handle) >> 2,
		cmd->ioa_cb->ioarcb.cdb[0],
		ioasc, scsi_cmd->result);
	if (PMCRAID_IOASC_SENSE_KEY(ioasc) != 0)
		rc = pmcraid_error_handler(cmd);
	if (rc == 0) {
		scsi_dma_unmap(scsi_cmd);
		scsi_cmd->scsi_done(scsi_cmd);
	}
	return rc;
}