zfcp_cmd_dbf_event_scsi("response", scpnt); 
if (scpnt->result != 0) zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt); else if (scpnt->retries > 0) zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt); else zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt); 
zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req){	int retval = 0;	struct scsi_cmnd *scpnt;	struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *)	    &(fsf_req->qtcb->bottom.io.fcp_rsp);	struct fcp_cmnd_iu *fcp_cmnd_iu = (struct fcp_cmnd_iu *)	    &(fsf_req->qtcb->bottom.io.fcp_cmnd);	u32 sns_len;	char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu);	unsigned long flags;	struct zfcp_unit *unit = fsf_req->unit;	read_lock_irqsave(&fsf_req->adapter->abort_lock, flags);	scpnt = (struct scsi_cmnd *) fsf_req->data;	if (unlikely(!scpnt)) {		ZFCP_LOG_DEBUG		    ("Command with fsf_req %p is not associated to "		     "a scsi command anymore. Aborted?\n", fsf_req);		goto out;	}	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTED)) {		/* FIXME: (design) mid-layer should handle DID_ABORT like		 *        DID_SOFT_ERROR by retrying the request for devices		 *        that allow retries.		 */		ZFCP_LOG_DEBUG("Setting DID_SOFT_ERROR and SUGGEST_RETRY\n");		set_host_byte(&scpnt->result, DID_SOFT_ERROR);		set_driver_byte(&scpnt->result, SUGGEST_RETRY);		goto skip_fsfstatus;	}	if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {		ZFCP_LOG_DEBUG("Setting DID_ERROR\n");		set_host_byte(&scpnt->result, DID_ERROR);		goto skip_fsfstatus;	}	/* set message byte of result in SCSI command */	scpnt->result |= COMMAND_COMPLETE << 8;	/*	 * copy SCSI status code of FCP_STATUS of FCP_RSP IU to status byte	 * of result in SCSI command	 */	scpnt->result |= fcp_rsp_iu->scsi_status;	if (unlikely(fcp_rsp_iu->scsi_status)) {		/* DEBUG */		ZFCP_LOG_DEBUG("status for SCSI Command:\n");		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,			      scpnt->cmnd, scpnt->cmd_len);		ZFCP_LOG_DEBUG("SCSI status code 0x%x\n",				fcp_rsp_iu->scsi_status);		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,			      (void *) fcp_rsp_iu, sizeof (struct fcp_rsp_iu));		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,			      zfcp_get_fcp_sns_info_ptr(fcp_rsp_iu),			      fcp_rsp_iu->fcp_sns_len);	}	/* check FCP_RSP_INFO */	if (unlikely(fcp_rsp_iu->validity.bits.fcp_rsp_len_valid)) {		ZFCP_LOG_DEBUG("rsp_len is valid\n");		switch (fcp_rsp_info[3]) {		case RSP_CODE_GOOD:			/* ok, continue */			ZFCP_LOG_TRACE("no failure or Task Management "				       "Function complete\n");			set_host_byte(&scpnt->result, DID_OK);			break;		case RSP_CODE_LENGTH_MISMATCH:			/* hardware bug */			ZFCP_LOG_NORMAL("bug: FCP response code indictates "					"that the fibrechannel protocol data "					"length differs from the burst length. "					"The problem occured on unit 0x%016Lx "					"on port 0x%016Lx on adapter %s",					unit->fcp_lun,					unit->port->wwpn,					zfcp_get_busid_by_unit(unit));			/* dump SCSI CDB as prepared by zfcp */			ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,				      (char *) &fsf_req->qtcb->				      bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);			zfcp_cmd_dbf_event_fsf("clenmis", fsf_req, NULL, 0);			set_host_byte(&scpnt->result, DID_ERROR);			goto skip_fsfstatus;		case RSP_CODE_FIELD_INVALID:			/* driver or hardware bug */			ZFCP_LOG_NORMAL("bug: FCP response code indictates "					"that the fibrechannel protocol data "					"fields were incorrectly set up. "					"The problem occured on the unit "					"0x%016Lx on port 0x%016Lx on "					"adapter %s",					unit->fcp_lun,					unit->port->wwpn,					zfcp_get_busid_by_unit(unit));			/* dump SCSI CDB as prepared by zfcp */			ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,				      (char *) &fsf_req->qtcb->				      bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);			set_host_byte(&scpnt->result, DID_ERROR);			zfcp_cmd_dbf_event_fsf("codeinv", fsf_req, NULL, 0);			goto skip_fsfstatus;		case RSP_CODE_RO_MISMATCH:			/* hardware bug */			ZFCP_LOG_NORMAL("bug: The FCP response code indicates "					"that conflicting  values for the "					"fibrechannel payload offset from the "					"header were found. "					"The problem occured on unit 0x%016Lx "					"on port 0x%016Lx on adapter %s.\n",					unit->fcp_lun,					unit->port->wwpn,					zfcp_get_busid_by_unit(unit));			/* dump SCSI CDB as prepared by zfcp */			ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,				      (char *) &fsf_req->qtcb->				      bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);			zfcp_cmd_dbf_event_fsf("codemism", fsf_req, NULL, 0);			set_host_byte(&scpnt->result, DID_ERROR);			goto skip_fsfstatus;		default:			ZFCP_LOG_NORMAL("bug: An invalid FCP response "					"code was detected for a command. "					"The problem occured on the unit "					"0x%016Lx on port 0x%016Lx on "					"adapter %s (debug info 0x%x)\n",					unit->fcp_lun,					unit->port->wwpn,					zfcp_get_busid_by_unit(unit),					fcp_rsp_info[3]);			/* dump SCSI CDB as prepared by zfcp */			ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,				      (char *) &fsf_req->qtcb->				      bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);			zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0);			set_host_byte(&scpnt->result, DID_ERROR);			goto skip_fsfstatus;		}	}	/* check for sense data */	if (unlikely(fcp_rsp_iu->validity.bits.fcp_sns_len_valid)) {		sns_len = FSF_FCP_RSP_SIZE -		    sizeof (struct fcp_rsp_iu) + fcp_rsp_iu->fcp_rsp_len;		ZFCP_LOG_TRACE("room for %i bytes sense data in QTCB\n",			       sns_len);		sns_len = min(sns_len, (u32) SCSI_SENSE_BUFFERSIZE);		ZFCP_LOG_TRACE("room for %i bytes sense data in SCSI command\n",			       SCSI_SENSE_BUFFERSIZE);		sns_len = min(sns_len, fcp_rsp_iu->fcp_sns_len);		ZFCP_LOG_TRACE("scpnt->result =0x%x, command was:\n",			       scpnt->result);		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,			      (void *) &scpnt->cmnd, scpnt->cmd_len);		ZFCP_LOG_TRACE("%i bytes sense data provided by FCP\n",			       fcp_rsp_iu->fcp_sns_len);		memcpy(&scpnt->sense_buffer,		       zfcp_get_fcp_sns_info_ptr(fcp_rsp_iu), sns_len);		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,			      (void *) &scpnt->sense_buffer, sns_len);	}	/* check for overrun */	if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_over)) {		ZFCP_LOG_INFO("A data overrun was detected for a command. "			      "unit 0x%016Lx, port 0x%016Lx, adapter %s. "			      "The response data length is "			      "%d, the original length was %d.\n",			      unit->fcp_lun,			      unit->port->wwpn,			      zfcp_get_busid_by_unit(unit),			      fcp_rsp_iu->fcp_resid,			      (int) zfcp_get_fcp_dl(fcp_cmnd_iu));	}	/* check for underrun */	if (unlikely(fcp_rsp_iu->validity.bits.fcp_resid_under)) {		ZFCP_LOG_INFO("A data underrun was detected for a command. "			      "unit 0x%016Lx, port 0x%016Lx, adapter %s. "			      "The response data length is "			      "%d, the original length was %d.\n",			      unit->fcp_lun,			      unit->port->wwpn,			      zfcp_get_busid_by_unit(unit),			      fcp_rsp_iu->fcp_resid,			      (int) zfcp_get_fcp_dl(fcp_cmnd_iu));		scpnt->resid = fcp_rsp_iu->fcp_resid;		if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow)			set_host_byte(&scpnt->result, DID_ERROR);	} skip_fsfstatus:	ZFCP_LOG_DEBUG("scpnt->result =0x%x\n", scpnt->result);	zfcp_cmd_dbf_event_scsi("response", scpnt);	/* cleanup pointer (need this especially for abort) */	scpnt->host_scribble = NULL;	/*	 * NOTE:	 * according to the outcome of a discussion on linux-scsi we	 * don't need to grab the io_request_lock here since we use	 * the new eh	 */	/* always call back */	(scpnt->scsi_done) (scpnt);	/*	 * We must hold this lock until scsi_done has been called.	 * Otherwise we may call scsi_done after abort regarding this	 * command has completed.	 * Note: scsi_done must not block!	 */ out:	read_unlock_irqrestore(&fsf_req->adapter->abort_lock, flags);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8a36e4532ea10471f0a8605207d071361d7be2c3/zfcp_fsf.c/clean/drivers/s390/scsi/zfcp_fsf.c