zfcp_cmd_dbf_event_fsf("seqnoerr", fsf_req, &fsf_req->qtcb->prefix.prot_status_qual, sizeof (union fsf_prot_status_qual)); 
zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req){	int retval = 0;	struct zfcp_adapter *adapter = fsf_req->adapter;	ZFCP_LOG_DEBUG("QTCB is at %p\n", fsf_req->qtcb);	if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {		ZFCP_LOG_DEBUG("fsf_req 0x%lx has been dismissed\n",			       (unsigned long) fsf_req);		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |			ZFCP_STATUS_FSFREQ_RETRY; /* only for SCSI cmnds. */		zfcp_cmd_dbf_event_fsf("dismiss", fsf_req, NULL, 0);		goto skip_protstatus;	}	/* log additional information provided by FSF (if any) */	if (unlikely(fsf_req->qtcb->header.log_length)) {		/* do not trust them ;-) */		if (fsf_req->qtcb->header.log_start > sizeof(struct fsf_qtcb)) {			ZFCP_LOG_NORMAL			    ("bug: ULP (FSF logging) log data starts "			     "beyond end of packet header. Ignored. "			     "(start=%i, size=%li)\n",			     fsf_req->qtcb->header.log_start,			     sizeof(struct fsf_qtcb));			goto forget_log;		}		if ((size_t) (fsf_req->qtcb->header.log_start +		     fsf_req->qtcb->header.log_length)		    > sizeof(struct fsf_qtcb)) {			ZFCP_LOG_NORMAL("bug: ULP (FSF logging) log data ends "					"beyond end of packet header. Ignored. "					"(start=%i, length=%i, size=%li)\n",					fsf_req->qtcb->header.log_start,					fsf_req->qtcb->header.log_length,					sizeof(struct fsf_qtcb));			goto forget_log;		}		ZFCP_LOG_TRACE("ULP log data: \n");		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,			      (char *) fsf_req->qtcb +			      fsf_req->qtcb->header.log_start,			      fsf_req->qtcb->header.log_length);	} forget_log:	/* evaluate FSF Protocol Status */	switch (fsf_req->qtcb->prefix.prot_status) {	case FSF_PROT_GOOD:	case FSF_PROT_FSF_STATUS_PRESENTED:		break;	case FSF_PROT_QTCB_VERSION_ERROR:		ZFCP_LOG_NORMAL("error: The adapter %s contains "				"microcode of version 0x%x, the device driver "				"only supports 0x%x. Aborting.\n",				zfcp_get_busid_by_adapter(adapter),				fsf_req->qtcb->prefix.prot_status_qual.				version_error.fsf_version, ZFCP_QTCB_VERSION);		/* stop operation for this adapter */		debug_text_exception(adapter->erp_dbf, 0, "prot_ver_err");		zfcp_erp_adapter_shutdown(adapter, 0);		zfcp_cmd_dbf_event_fsf("qverserr", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_PROT_SEQ_NUMB_ERROR:		ZFCP_LOG_NORMAL("bug: Sequence number mismatch between "				"driver (0x%x) and adapter %s (0x%x). "				"Restarting all operations on this adapter.\n",				fsf_req->qtcb->prefix.req_seq_no,				zfcp_get_busid_by_adapter(adapter),				fsf_req->qtcb->prefix.prot_status_qual.				sequence_error.exp_req_seq_no);		debug_text_exception(adapter->erp_dbf, 0, "prot_seq_err");		/* restart operation on this adapter */		zfcp_erp_adapter_reopen(adapter, 0);		zfcp_cmd_dbf_event_fsf("seqnoerr", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY;		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_PROT_UNSUPP_QTCB_TYPE:		ZFCP_LOG_NORMAL("error: Packet header type used by the "				"device driver is incompatible with "				"that used on adapter %s. "				"Stopping all operations on this adapter.\n",				zfcp_get_busid_by_adapter(adapter));		debug_text_exception(adapter->erp_dbf, 0, "prot_unsup_qtcb");		zfcp_erp_adapter_shutdown(adapter, 0);		zfcp_cmd_dbf_event_fsf("unsqtcbt", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_PROT_HOST_CONNECTION_INITIALIZING:		zfcp_cmd_dbf_event_fsf("hconinit", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		atomic_set_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,				&(adapter->status));		debug_text_event(adapter->erp_dbf, 3, "prot_con_init");		break;	case FSF_PROT_DUPLICATE_REQUEST_ID:		if (fsf_req->qtcb) {			ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx "					"to the adapter %s is ambiguous. "					"Stopping all operations on this "					"adapter.\n",					*(unsigned long long *)					(&fsf_req->qtcb->bottom.support.					 req_handle),					zfcp_get_busid_by_adapter(adapter));		} else {			ZFCP_LOG_NORMAL("bug: The request identifier %p "					"to the adapter %s is ambiguous. "					"Stopping all operations on this "					"adapter. "					"(bug: got this for an unsolicited "					"status read request)\n",					fsf_req,					zfcp_get_busid_by_adapter(adapter));		}		debug_text_exception(adapter->erp_dbf, 0, "prot_dup_id");		zfcp_erp_adapter_shutdown(adapter, 0);		zfcp_cmd_dbf_event_fsf("dupreqid", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_PROT_LINK_DOWN:		/*		 * 'test and set' is not atomic here -		 * it's ok as long as calls to our response queue handler		 * (and thus execution of this code here) are serialized		 * by the qdio module		 */		if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,				      &adapter->status)) {			switch (fsf_req->qtcb->prefix.prot_status_qual.				locallink_error.code) {			case FSF_PSQ_LINK_NOLIGHT:				ZFCP_LOG_INFO("The local link to adapter %s "					      "is down (no light detected).\n",					      zfcp_get_busid_by_adapter(						      adapter));				break;			case FSF_PSQ_LINK_WRAPPLUG:				ZFCP_LOG_INFO("The local link to adapter %s "					      "is down (wrap plug detected).\n",					      zfcp_get_busid_by_adapter(						      adapter));				break;			case FSF_PSQ_LINK_NOFCP:				ZFCP_LOG_INFO("The local link to adapter %s "					      "is down (adjacent node on "					      "link does not support FCP).\n",					      zfcp_get_busid_by_adapter(						      adapter));				break;			default:				ZFCP_LOG_INFO("The local link to adapter %s "					      "is down "					      "(warning: unknown reason "					      "code).\n",					      zfcp_get_busid_by_adapter(						      adapter));				break;			}			/*			 * Due to the 'erp failed' flag the adapter won't			 * be recovered but will be just set to 'blocked'			 * state. All subordinary devices will have state			 * 'blocked' and 'erp failed', too.			 * Thus the adapter is still able to provide			 * 'link up' status without being flooded with			 * requests.			 * (note: even 'close port' is not permitted)			 */			ZFCP_LOG_INFO("Stopping all operations for adapter "				      "%s.\n",				      zfcp_get_busid_by_adapter(adapter));			atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |					ZFCP_STATUS_COMMON_ERP_FAILED,					&adapter->status);			zfcp_erp_adapter_reopen(adapter, 0);		}		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_PROT_REEST_QUEUE:		debug_text_event(adapter->erp_dbf, 1, "prot_reest_queue");		ZFCP_LOG_INFO("The local link to adapter with "			      "%s was re-plugged. "			      "Re-starting operations on this adapter.\n",			      zfcp_get_busid_by_adapter(adapter));		/* All ports should be marked as ready to run again */		zfcp_erp_modify_adapter_status(adapter,					       ZFCP_STATUS_COMMON_RUNNING,					       ZFCP_SET);		zfcp_erp_adapter_reopen(adapter,					ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED					| ZFCP_STATUS_COMMON_ERP_FAILED);		zfcp_cmd_dbf_event_fsf("reestque", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_PROT_ERROR_STATE:		ZFCP_LOG_NORMAL("error: The adapter %s "				"has entered the error state. "				"Restarting all operations on this "				"adapter.\n",				zfcp_get_busid_by_adapter(adapter));		debug_text_event(adapter->erp_dbf, 0, "prot_err_sta");		/* restart operation on this adapter */		zfcp_erp_adapter_reopen(adapter, 0);		zfcp_cmd_dbf_event_fsf("proterrs", fsf_req,				       &fsf_req->qtcb->prefix.prot_status_qual,				       sizeof (union fsf_prot_status_qual));		fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY;		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	default:		ZFCP_LOG_NORMAL("bug: Transfer protocol status information "				"provided by the adapter %s "				"is not compatible with the device driver. "				"Stopping all operations on this adapter. "				"(debug info 0x%x).\n",				zfcp_get_busid_by_adapter(adapter),				fsf_req->qtcb->prefix.prot_status);		debug_text_event(adapter->erp_dbf, 0, "prot_inval:");		debug_exception(adapter->erp_dbf, 0,				&fsf_req->qtcb->prefix.prot_status,				sizeof (u32));		zfcp_erp_adapter_shutdown(adapter, 0);		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;	} skip_protstatus:	/*	 * always call specific handlers to give them a chance to do	 * something meaningful even in error cases	 */	zfcp_fsf_fsfstatus_eval(fsf_req);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8a36e4532ea10471f0a8605207d071361d7be2c3/zfcp_fsf.c/clean/drivers/s390/scsi/zfcp_fsf.c