/* fc_get_host_port_state() - Return the port state of the given Scsi_Host @shost: The SCSI host whose port state is to be determined  */
void fc_get_host_port_state(struct Scsi_Host *shost)
/* fc_get_host_port_state() - Return the port state of the given Scsi_Host @shost: The SCSI host whose port state is to be determined  */
void fc_get_host_port_state(struct Scsi_Host *shost)
{
	struct fc_lport *lport = shost_priv(shost);
	mutex_lock(&lport->lp_mutex);
	if (!lport->link_up)
		fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
	else
		switch (lport->state) {
		case LPORT_ST_READY:
			fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
			break;
		default:
			fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
		}
	mutex_unlock(&lport->lp_mutex);
}