if (send_els->ls_code != ZFCP_LS_ADISC) { read_lock(&zfcp_data.config_lock); port = zfcp_get_port_by_did(adapter, d_id); if (port) zfcp_test_link(port); read_unlock(&zfcp_data.config_lock); } 
if (port && (send_els->ls_code != ZFCP_LS_ADISC)) zfcp_test_link(port); 
static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req){	struct zfcp_adapter *adapter;	fc_id_t d_id;	struct zfcp_port *port;	struct fsf_qtcb_header *header;	struct fsf_qtcb_bottom_support *bottom;	struct zfcp_send_els *send_els;	int retval = -EINVAL;	u16 subtable, rule, counter;	send_els = fsf_req->data.send_els;	adapter = send_els->adapter;	d_id = send_els->d_id;	header = &fsf_req->qtcb->header;	bottom = &fsf_req->qtcb->bottom.support;	if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)		goto skip_fsfstatus;	switch (header->fsf_status) {	case FSF_GOOD:		retval = 0;		break;	case FSF_SERVICE_CLASS_NOT_SUPPORTED:		if (adapter->fc_service_class <= 3) {			ZFCP_LOG_INFO("error: adapter %s does "				      "not support fibrechannel class %d.\n",				      zfcp_get_busid_by_adapter(adapter),				      adapter->fc_service_class);		} else {			ZFCP_LOG_INFO("bug: The fibrechannel class at "				      "adapter %s is invalid. "				      "(debug info %d)\n",				      zfcp_get_busid_by_adapter(adapter),				      adapter->fc_service_class);		}		/* stop operation for this adapter */		debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");		zfcp_erp_adapter_shutdown(adapter, 0);		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_ADAPTER_STATUS_AVAILABLE:		switch (header->fsf_status_qual.word[0]){		case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:			debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest");			if (send_els->ls_code != ZFCP_LS_ADISC) {				read_lock(&zfcp_data.config_lock);				port = zfcp_get_port_by_did(adapter, d_id);				if (port)					zfcp_test_link(port);				read_unlock(&zfcp_data.config_lock);			}			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;			break;		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:			debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp");			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;			retval =			  zfcp_handle_els_rjt(header->fsf_status_qual.word[1],					      (struct zfcp_ls_rjt_par *)					      &header->fsf_status_qual.word[2]);			break;		case FSF_SQ_RETRY_IF_POSSIBLE:			debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry");			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;			break;		default:			ZFCP_LOG_INFO("bug: Wrong status qualifier 0x%x\n",				      header->fsf_status_qual.word[0]);			ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO,				(char*)header->fsf_status_qual.word, 16);		}		break;	case FSF_ELS_COMMAND_REJECTED:		ZFCP_LOG_INFO("ELS has been rejected because command filter "			      "prohibited sending "			      "(adapter: %s, port d_id: 0x%08x)\n",			      zfcp_get_busid_by_adapter(adapter), d_id);		break;	case FSF_PAYLOAD_SIZE_MISMATCH:		ZFCP_LOG_INFO(			"ELS request size and ELS response size must be either "			"both 0, or both greater than 0 "			"(adapter: %s, req_buf_length=%d resp_buf_length=%d)\n",			zfcp_get_busid_by_adapter(adapter),			bottom->req_buf_length,			bottom->resp_buf_length);		break;	case FSF_REQUEST_SIZE_TOO_LARGE:		ZFCP_LOG_INFO(			"Length of the ELS request buffer, "			"specified in QTCB bottom, "			"exceeds the size of the buffers "			"that have been allocated for ELS request data "			"(adapter: %s, req_buf_length=%d)\n",			zfcp_get_busid_by_adapter(adapter),			bottom->req_buf_length);		break;	case FSF_RESPONSE_SIZE_TOO_LARGE:		ZFCP_LOG_INFO(			"Length of the ELS response buffer, "			"specified in QTCB bottom, "			"exceeds the size of the buffers "			"that have been allocated for ELS response data "			"(adapter: %s, resp_buf_length=%d)\n",			zfcp_get_busid_by_adapter(adapter),			bottom->resp_buf_length);		break;	case FSF_SBAL_MISMATCH:		/* should never occure, avoided in zfcp_fsf_send_els */		ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "			      "resp_buf_length=%d)\n",			      zfcp_get_busid_by_adapter(adapter),			      bottom->req_buf_length, bottom->resp_buf_length);		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	case FSF_ACCESS_DENIED:		ZFCP_LOG_NORMAL("access denied, cannot send ELS command "				"(adapter %s, port d_id=0x%08x)\n",				zfcp_get_busid_by_adapter(adapter), d_id);		for (counter = 0; counter < 2; counter++) {			subtable = header->fsf_status_qual.halfword[counter * 2];			rule = header->fsf_status_qual.halfword[counter * 2 + 1];			switch (subtable) {			case FSF_SQ_CFDC_SUBTABLE_OS:			case FSF_SQ_CFDC_SUBTABLE_PORT_WWPN:			case FSF_SQ_CFDC_SUBTABLE_PORT_DID:			case FSF_SQ_CFDC_SUBTABLE_LUN:				ZFCP_LOG_INFO("Access denied (%s rule %d)\n",					zfcp_act_subtable_type[subtable], rule);				break;			}		}		debug_text_event(adapter->erp_dbf, 1, "fsf_s_access");		read_lock(&zfcp_data.config_lock);		port = zfcp_get_port_by_did(adapter, d_id);		if (port != NULL)			zfcp_erp_port_access_denied(port);		read_unlock(&zfcp_data.config_lock);		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	default:		ZFCP_LOG_NORMAL(			"bug: An unknown FSF Status was presented "			"(adapter: %s, fsf_status=0x%08x)\n",			zfcp_get_busid_by_adapter(adapter),			header->fsf_status);		debug_text_event(adapter->erp_dbf, 0, "fsf_sq_inval");		debug_exception(adapter->erp_dbf, 0,			&header->fsf_status_qual.word[0], sizeof(u32));		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;		break;	}skip_fsfstatus:	send_els->status = retval;	if (send_els->handler != 0)		send_els->handler(send_els->handler_data);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/64b29a130901d5b8578e9f602cf2dae56aaff224/zfcp_fsf.c/clean/drivers/s390/scsi/zfcp_fsf.c