/* This indicates the intent to be logged into the remote port. If it appears we are already logged in, ADISC is used to verify the setup.  */
int fc_rport_login(struct fc_rport_priv *rdata)
/* This indicates the intent to be logged into the remote port. If it appears we are already logged in, ADISC is used to verify the setup.  */
int fc_rport_login(struct fc_rport_priv *rdata)
{
	mutex_lock(&rdata->rp_mutex);
	switch (rdata->rp_state) {
	case RPORT_ST_READY:
		FC_RPORT_DBG(rdata, "ADISC port\n");
		fc_rport_enter_adisc(rdata);
		break;
	case RPORT_ST_RESTART:
		break;
	case RPORT_ST_DELETE:
		FC_RPORT_DBG(rdata, "Restart deleted port\n");
		fc_rport_state_enter(rdata, RPORT_ST_RESTART);
		break;
	default:
		FC_RPORT_DBG(rdata, "Login to port\n");
		fc_rport_enter_plogi(rdata);
		break;
	}
	mutex_unlock(&rdata->rp_mutex);
	return 0;
}