sym_set_cam_status(cmd, CAM_REQUEUE_REQ); 
sym_set_cam_status(cmd, DID_SOFT_ERROR); 
void sym_complete_error(struct sym_hcb *np, struct sym_ccb *cp){	struct scsi_device *sdev;	struct scsi_cmnd *cmd;	struct sym_tcb *tp;	struct sym_lcb *lp;	int resid;	int i;	/*	 *  Paranoid check. :)	 */	if (!cp || !cp->cmd)		return;	cmd = cp->cmd;	sdev = cmd->device;	if (DEBUG_FLAGS & (DEBUG_TINY|DEBUG_RESULT)) {		dev_info(&sdev->sdev_gendev, "CCB=%p STAT=%x/%x/%x\n", cp,			cp->host_status, cp->ssss_status, cp->host_flags);	}	/*	 *  Get target and lun pointers.	 */	tp = &np->target[cp->target];	lp = sym_lp(tp, sdev->lun);	/*	 *  Check for extended errors.	 */	if (cp->xerr_status) {		if (sym_verbose)			sym_print_xerr(cmd, cp->xerr_status);		if (cp->host_status == HS_COMPLETE)			cp->host_status = HS_COMP_ERR;	}	/*	 *  Calculate the residual.	 */	resid = sym_compute_residual(np, cp);	if (!SYM_SETUP_RESIDUAL_SUPPORT) {/* If user does not want residuals */		resid  = 0;		 /* throw them away. :)		    */		cp->sv_resid = 0;	}#ifdef DEBUG_2_0_Xif (resid)	printf("XXXX RESID= %d - 0x%x\n", resid, resid);#endif	/*	 *  Dequeue all queued CCBs for that device 	 *  not yet started by SCRIPTS.	 */	i = (INL(np, nc_scratcha) - np->squeue_ba) / 4;	i = sym_dequeue_from_squeue(np, i, cp->target, sdev->lun, -1);	/*	 *  Restart the SCRIPTS processor.	 */	OUTL_DSP(np, SCRIPTA_BA(np, start));#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING	if (cp->host_status == HS_COMPLETE &&	    cp->ssss_status == S_QUEUE_FULL) {		if (!lp || lp->started_tags - i < 2)			goto weirdness;		/*		 *  Decrease queue depth as needed.		 */		lp->started_max = lp->started_tags - i - 1;		lp->num_sgood = 0;		if (sym_verbose >= 2) {			sym_print_addr(cmd, " queue depth is now %d\n",					lp->started_max);		}		/*		 *  Repair the CCB.		 */		cp->host_status = HS_BUSY;		cp->ssss_status = S_ILLEGAL;		/*		 *  Let's requeue it to device.		 */		sym_set_cam_status(cmd, CAM_REQUEUE_REQ);		goto finish;	}weirdness:#endif	/*	 *  Build result in CAM ccb.	 */	sym_set_cam_result_error(np, cp, resid);#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEINGfinish:#endif	/*	 *  Add this one to the COMP queue.	 */	sym_remque(&cp->link_ccbq);	sym_insque_head(&cp->link_ccbq, &np->comp_ccbq);	/*	 *  Complete all those commands with either error 	 *  or requeue condition.	 */	sym_flush_comp_queue(np, 0);#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING	/*	 *  Donnot start more than 1 command after an error.	 */	if (lp)		sym_start_next_ccbs(np, lp, 1);#endif}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/53222b906903fd861dc24ebccfa07ee125941313/sym_hipd.c/clean/drivers/scsi/sym53c8xx_2/sym_hipd.c