if (adapter->fc_topology == FSF_TOPO_P2P) { if (port->wwpn != adapter->peer_wwpn) { ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " "on adapter %s.\nPeer WWPN " "0x%016Lx does not match\n", port->wwpn, zfcp_get_busid_by_adapter(adapter), adapter->peer_wwpn); zfcp_erp_port_failed(port); retval = ZFCP_ERP_FAILED; break; } port->d_id = adapter->peer_d_id; atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status); retval = zfcp_erp_port_strategy_open_port(erp_action); break; } 
zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action){	int retval = 0;	struct zfcp_adapter *adapter = erp_action->adapter;	struct zfcp_port *port = erp_action->port;	switch (erp_action->step) {	case ZFCP_ERP_STEP_UNINITIALIZED:	case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:	case ZFCP_ERP_STEP_PORT_CLOSING:		if (!(adapter->nameserver_port)) {			retval = zfcp_nameserver_enqueue(adapter);			if (retval != 0) {				ZFCP_LOG_NORMAL("error: nameserver port "						"unavailable for adapter %s\n",						zfcp_get_busid_by_adapter(adapter));				retval = ZFCP_ERP_FAILED;				break;			}		}		if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,				      &adapter->nameserver_port->status)) {			ZFCP_LOG_DEBUG("nameserver port is not open -> open "				       "nameserver port\n");			/* nameserver port may live again */			atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING,					&adapter->nameserver_port->status);			if (zfcp_erp_port_reopen(adapter->nameserver_port, 0)			    >= 0) {				erp_action->step =					ZFCP_ERP_STEP_NAMESERVER_OPEN;				retval = ZFCP_ERP_CONTINUES;			} else				retval = ZFCP_ERP_FAILED;			break;		}		/* else nameserver port is already open, fall through */	case ZFCP_ERP_STEP_NAMESERVER_OPEN:		if (!atomic_test_mask(ZFCP_STATUS_COMMON_OPEN,				      &adapter->nameserver_port->status)) {			ZFCP_LOG_DEBUG("open failed for nameserver port\n");			retval = ZFCP_ERP_FAILED;		} else {			ZFCP_LOG_DEBUG("nameserver port is open -> "				       "nameserver look-up for port 0x%016Lx\n",				       port->wwpn);			retval = zfcp_erp_port_strategy_open_common_lookup				(erp_action);		}		break;	case ZFCP_ERP_STEP_NAMESERVER_LOOKUP:		if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) {			if (atomic_test_mask			    (ZFCP_STATUS_PORT_INVALID_WWPN, &port->status)) {				ZFCP_LOG_DEBUG("nameserver look-up failed "					       "for port 0x%016Lx "					       "(misconfigured WWPN?)\n",					       port->wwpn);				zfcp_erp_port_failed(port);				retval = ZFCP_ERP_EXIT;			} else {				ZFCP_LOG_DEBUG("nameserver look-up failed for "					       "port 0x%016Lx\n", port->wwpn);				retval = ZFCP_ERP_FAILED;			}		} else {			ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%08x -> "				       "trying open\n", port->wwpn, port->d_id);			retval = zfcp_erp_port_strategy_open_port(erp_action);		}		break;	case ZFCP_ERP_STEP_PORT_OPENING:		/* D_ID might have changed during open */		if (atomic_test_mask((ZFCP_STATUS_COMMON_OPEN |				      ZFCP_STATUS_PORT_DID_DID),				     &port->status)) {			ZFCP_LOG_DEBUG("port 0x%016Lx is open\n", port->wwpn);			retval = ZFCP_ERP_SUCCEEDED;		} else {			ZFCP_LOG_DEBUG("open failed for port 0x%016Lx\n",				       port->wwpn);			retval = ZFCP_ERP_FAILED;		}		break;	default:		ZFCP_LOG_NORMAL("bug: unknown erp step 0x%08x\n",				erp_action->step);		retval = ZFCP_ERP_FAILED;	}	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/91bbfbda8d41f834c70c47d6f8c95245c90019e5/zfcp_erp.c/clean/drivers/s390/scsi/zfcp_erp.c