sym_xpt_done2(np, cmd, CAM_REQ_ABORTED); 
sym_xpt_done2(np, cmd, DID_ABORT); 
static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd){	struct sym_hcb *np = SYM_SOFTC_PTR(cmd);	SYM_QUEHEAD *qp;	int to_do = SYM_EH_DO_IGNORE;	int sts = -1;	struct sym_eh_wait eh, *ep = &eh;	dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname);	/* This one is queued in some place -> to wait for completion */	FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {		struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);		if (cp->cmd == cmd) {			to_do = SYM_EH_DO_WAIT;			goto prepare;		}	}prepare:	/* Prepare stuff to either ignore, complete or wait for completion */	switch(to_do) {	default:	case SYM_EH_DO_IGNORE:		break;	case SYM_EH_DO_WAIT:		init_completion(&ep->done);		/* fall through */	case SYM_EH_DO_COMPLETE:		ep->old_done = cmd->scsi_done;		cmd->scsi_done = sym_eh_done;		SYM_UCMD_PTR(cmd)->eh_wait = ep;	}	/* Try to proceed the operation we have been asked for */	sts = -1;	switch(op) {	case SYM_EH_ABORT:		sts = sym_abort_scsiio(np, cmd, 1);		break;	case SYM_EH_DEVICE_RESET:		sts = sym_reset_scsi_target(np, cmd->device->id);		break;	case SYM_EH_BUS_RESET:		sym_reset_scsi_bus(np, 1);		sts = 0;		break;	case SYM_EH_HOST_RESET:		sym_reset_scsi_bus(np, 0);		sym_start_up (np, 1);		sts = 0;		break;	default:		break;	}	/* On error, restore everything and cross fingers :) */	if (sts) {		SYM_UCMD_PTR(cmd)->eh_wait = NULL;		cmd->scsi_done = ep->old_done;		to_do = SYM_EH_DO_IGNORE;	}	ep->to_do = to_do;	/* Complete the command with locks held as required by the driver */	if (to_do == SYM_EH_DO_COMPLETE)		sym_xpt_done2(np, cmd, CAM_REQ_ABORTED);	/* Wait for completion with locks released, as required by kernel */	if (to_do == SYM_EH_DO_WAIT) {		init_timer(&ep->timer);		ep->timer.expires = jiffies + (5*HZ);		ep->timer.function = sym_eh_timeout;		ep->timer.data = (u_long)cmd;		ep->timed_out = 1;	/* Be pessimistic for once :) */		add_timer(&ep->timer);		spin_unlock_irq(np->s.host->host_lock);		wait_for_completion(&ep->done);		spin_lock_irq(np->s.host->host_lock);		if (ep->timed_out)			sts = -2;	}	dev_warn(&cmd->device->sdev_gendev, "%s operation %s.\n", opname,			sts==0 ? "complete" :sts==-2 ? "timed-out" : "failed");	return sts ? SCSI_FAILED : SCSI_SUCCESS;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/53222b906903fd861dc24ebccfa07ee125941313/sym_glue.c/clean/drivers/scsi/sym53c8xx_2/sym_glue.c